Auth

New-NetstorageAuth

Synopsis

Creates and writes NetStorage credentials to an auth file.

Syntax

New-NetstorageAuth [-UploadAccountID] <String> [[-AuthSection] <String>] [[-OutputDirectory] <String>] [[-EdgeRCFile] <String>] [[-Section] <String>] [[-AccountSwitchKey] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

Description

The New-NetStorageAuth cmdlet creates a new NetStorage auth file or appends an existing auth file with NetStorage Usage API credentials.

Examples


Creates a new `.nsrc` at the root directory with the defaults.

New-NetStorageAuth -UploadAccountID my-upload-account-id


Creates a new `.nsrc` at a given directory.

New-NetStorageAuth -UploadAccountID my-upload-account-id -OutputDirectory "~/another/path"

Parameters

‑UploadAccountID
Required

The ID assigned to the target upload account. You can get this value by running Get-NetstorageUploadAccount and filtering the results.

‑AuthSection

A human-readable name for the new credentials section. Use only lowercase alpha, numbers, or dashes for the value. Defaults to default.

‑OutputDirectory

The path to the directory in which to place the new .nsrc file. Defaults to ~/.nsrc.

‑EdgeRCFile

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

‑Section

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

‑AccountSwitchKey

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.

Related Links