Add-RocketCyberAPIKey

SYNOPSIS

Sets the API key used to authenticate all API calls

SYNTAX

AsPlainText (Default)

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

AsSecureString

Add-RocketCyberAPIKey -ApiKeySecureString <securestring>

ALIASES

This cmdlet has the following aliases,

  • Add-RCApiKey
  • Set-RCApiKey
  • Set-RocketCyberAPIKey

DESCRIPTION

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

The API key is stored in memory as a SecureString

RocketCyber API keys are created in the RocketCyber web interface Provider Settings > RocketCyber API

EXAMPLES

EXAMPLE 1

Add-RocketCyberAPIKey

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

EXAMPLE 2

Add-RocketCyberAPIKey -ApiKey '12345'

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

EXAMPLE 3

'12345' | Add-RocketCyberAPIKey

The API key is passed in from the pipeline

EXAMPLE 4

Add-RocketCyberAPIKey -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