Add-ITGlueAPIKey

SYNOPSIS

Sets the API key used to authenticate all API calls

SYNTAX

AsPlainText (Default)

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

AsSecureString

Add-ITGlueAPIKey -ApiKeySecureString <securestring>

ALIASES

This cmdlet has the following aliases,

  • Set-ITGlueAPIKey

DESCRIPTION

The Add-ITGlueAPIKey cmdlet sets the API key which is used to authenticate all API calls made to the ITGlue API

The API key is stored in memory as a SecureString

ITGlue API keys are created in ITGlue Account > Settings > API Keys

The API key is sent in the x-api-key header of every request

Use an API key without password access unless passwords are required

EXAMPLES

EXAMPLE 1

Add-ITGlueAPIKey

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

EXAMPLE 2

Add-ITGlueAPIKey -ApiKey 'your-api-key'

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

EXAMPLE 3

'your-api-key' | Add-ITGlueAPIKey

The API key is passed in from the pipeline

EXAMPLE 4

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

Stores an existing SecureString object as the API key

PARAMETERS

-ApiKey

Defines your API key as plain text

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

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