Add-vPenTestAPIKey

SYNOPSIS

Sets your API token used to authenticate all API calls

SYNTAX

AsPlainText (Default)

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

AsSecureString

Add-vPenTestAPIKey -ApiKeySecureString <securestring>

ALIASES

This cmdlet has the following aliases,

  • Set-vPenTestAPIKey

DESCRIPTION

The Add-vPenTestAPIKey cmdlet sets your API token which is used to authenticate all API calls made to vPenTest

The token is stored in memory as a SecureString

vPenTest API keys are generated in the vPenTest web interface My Account > My Settings > API Key > Generate API Key

An API key has the same access as the user that generated it, treat it like a password

EXAMPLES

EXAMPLE 1

Add-vPenTestAPIKey

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

EXAMPLE 2

Add-vPenTestAPIKey -ApiKey '12345'

Converts the string to a SecureString and stores it in the global variable

EXAMPLE 3

'12345' | Add-vPenTestAPIKey

The API token is passed in from the pipeline

EXAMPLE 4

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

Stores an existing SecureString object

PARAMETERS

-ApiKey

Plain text API token

If not defined the cmdlet will prompt you to enter the API token 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 token

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