Keys

New-APIKey

Synopsis

Generate keys.

Syntax

New-APIKey -CollectionID <Int32> -Count <Int32> [-KeyDescription <String>] [-IncrementLabel] [-Label <String>] [-Tags <String>] [-EdgeRCFile <String>] [-Section <String>] [-AccountSwitchKey <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-APIKey -CollectionID <Int32> -KeyValues <String> [-KeyDescription <String>] [-IncrementLabel] [-Label <String>] [-Tags <String>] [-EdgeRCFile <String>] [-Section <String>] [-AccountSwitchKey <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-APIKey -Body <Object> [-EdgeRCFile <String>] [-Section <String>] [-AccountSwitchKey <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

Description

Creates a collection of keys, either with the provided values (KeyValues) or with auto-generated values (Count).

Parameters

‑AccountSwitchKey

An account credential key that lets you move between accounts when using an API client enabled for multiple accounts. To find account switch keys, use Get-AccountSwitchKey.

‑Body
Conditionally required

A request body, either as a PSCustomObject or a string. This parameter supports pipelining.

‑CollectionID
Conditionally required

Your collection's ID. Run Get-APIKeyCollection to retrieve collections available to you.

‑Count
Conditionally required

The number of keys to generate.

‑EdgeRCFile

Your EdgeGrid resource file to authenticate your command. Defaults to ~/.edgerc.

‑IncrementLabel

When enabled, appends an automatic increment to each key's label. A label's increment starts with an underscore character followed by an integer value based on the number of keys that you create.

For example, if you create eight keys, the increments range from 1 to 8. If you create 125 keys, the increments range from 001 to 125.

‑KeyDescription

A human-readable description for the key you want to create.

‑KeyValues
Conditionally required

A comma-separated string containing values of the keys.

‑Label

The label assigned to the key.

‑Section

The section name in your EdgeGrid resource file to retrieve authentication credentials from. Defaults to default.

‑Tags

A comma-separated string containing additional categories assigned to the key that you can use as filters.

Related Links