Add-APITCGAPIKey

SYNOPSIS

Sets the API key used to authenticate all API calls

SYNTAX

AsPlainText (Default)

Add-APITCGAPIKey [[-ApiKey] <string>]

AsSecureString

Add-APITCGAPIKey -ApiKeySecureString <securestring>

ALIASES

This cmdlet has the following aliases,

  • Set-APITCGAPIKey

DESCRIPTION

The Add-APITCGAPIKey cmdlet sets the API key which is sent in the x-api-key header of every API call made to the APITCG API

The API key is stored in memory as a SecureString and is only decrypted when a request is sent

An APITCG API key is created for free in the Developer Platform https://apitcg.com/platform/api-key

If neither ApiKey nor ApiKeySecureString is defined the cmdlet prompts you to enter the API key which is stored as a SecureString

EXAMPLES

EXAMPLE 1

Add-APITCGAPIKey

Prompts to enter in the API key which will be stored as a SecureString

EXAMPLE 2

Add-APITCGAPIKey -ApiKey '1234567890'

Converts the API key to a SecureString and stores it in a global variable

EXAMPLE 3

'1234567890' | Add-APITCGAPIKey

The API key is passed in from the pipeline

EXAMPLE 4

Add-APITCGAPIKey -ApiKeySecureString (Read-Host -AsSecureString)

Stores an existing SecureString object as the API key

PARAMETERS

-ApiKey

Defines your API key as plain text

The API key can also be passed in from the pipeline

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: AsPlainText
  Position: 0
  IsRequired: false
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ApiKeySecureString

Input a SecureString object containing the API key

Type: System.Security.SecureString
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: AsSecureString
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String

OUTPUTS

NOTES

N/A