EdgeGrid credentials

Synopsis

Load EdgeGrid credentials to environment variables.

Syntax

Import-EdgegridCredentials [-EdgeRCFile <String>] [-Section <String>] [-AccountSwitchKey <String>] [-EnvironmentPrefix <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Import-EdgegridCredentials -HostName <String> -ClientToken <String> -AccessToken <String> -ClientSecret <String> [-AccountSwitchKey <String>] [-EnvironmentPrefix <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

Description

This function takes in either a set of EdgeGrid credentials or an .edgerc file and section and sets the appropriate environment variables for subsequent requests. This allows you to set the credentials your requests will use for a given session in your shell, and avoid having to provide these for every command. To clear your credentials use Clear-EdgeGridCredentials.

Alongside your credentials you can also specify an EnvironmentPrefix. This will be added as a prefix to your environment variables, e.g. -EnvironmentPrefix MyCreds will result in AKAMAI_MYCREDS_HOST, and so on. These credentials will be loaded by any command which specifies -Section of MyCreds.

Parameters

‑AccessToken
Alias: ‑access_token
Conditionally required

Access token.

‑AccountSwitchKey
Alias: ‑AccountKey, account_key

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.

‑ClientSecret
Alias: ‑client_secret
Conditionally required

The API credential's client secret.

‑ClientToken
Alias: ‑client_token
Conditionally required

The API credential's client token.

‑EdgeRCFile

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

‑EnvironmentPrefix

String to prepend environment variables, e.g. with a value of MyCreds the function will create environment variables AKAMAI_MYCREDS_HOST and so on.

‑HostName
Alias: ‑host
Conditionally required

The API credential's hostname.

‑Section

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

Related Links

User Guide: Overview