AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Returns an AWSCredentials object initialized with from either credentials currently set as default in the shell or saved and associated with the supplied name from a local credential store. Optionally the cmdlet can list the names, types, and locations of all sets of credentials held in the store.

Syntax

Shell (Default)

Get-AWSCredential

SingleProfile

Get-AWSCredential
-ProfileName <String>
-ProfileLocation <String>

ListName

Get-AWSCredential
-ProfileLocation <String>
-ListProfile <SwitchParameter>

ListDetail

Get-AWSCredential
-ProfileLocation <String>
-ListProfileDetail <SwitchParameter>

Description

Returns an AWSCredentials object initialized with from either credentials currently set as default in the shell or saved and associated with the supplied name from the local credential store. Optionally the cmdlet can list the names, types, and locations of all sets of credentials held in local stores. Note: For scripts written against earlier versions of this module this cmdlet can also be invoked with the alias Get-AWSCredentials.

Note: For scripts written against earlier versions of this module this cmdlet can also be invoked with the alias, Get-AWSCredentials.

Parameters

-ListProfile <SwitchParameter>
Lists the names of all CredentialProfiles saved in local storage
Required?False
Position?Named
Accept pipeline input?False
-ListProfileDetail <SwitchParameter>
List the name, type, and location of all CredentialProfiles saved in local storage
Required?False
Position?Named
Accept pipeline input?False
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?False
-ProfileName <String>
The name associated with the credentials in local storage
Required?False
Position?2
Accept pipeline input?False

Inputs

This cmdlet does not accept pipeline input.

Outputs

Object containing a set of AWS credentials.
String
The set of names associated with saved credentials in local stores.
The set of names, types, and locations associated with saved credentials in local stores.

Supported Version

AWS Tools for PowerShell: 2.x.y.z