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

Retrieves and caches an AWS Login access token to exchange for AWS credentials.

Syntax

Invoke-AWSLogin
-Remote <SwitchParameter>
-ExecutionTimeout <Int32>

Description

The Invoke-AWSLogin cmdlet retrieves and caches an AWS Signin access token to exchange for AWS credentials. It will configure the named profile specified by the ProfileName parameter.

Parameters

-ExecutionTimeout <Int32>
Execution timeout value in milliseconds.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Remote <SwitchParameter>
Indicates if CmdLet should use cross-device scenario.
Required?False
Position?Named
Accept pipeline input?False

Common Credential and Region Parameters

-ProfileName <String>
The name of an AWS Login profile that contains login session information. The profile is defined in the shared configuration file '~/.aws/config'.
Required?False
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-Region <String>
AWS Region to be used for login.
Required?False
Position?211
Accept pipeline input?True (ByValue, ByPropertyName)

Outputs

None
This cmdlet does not generate any output.

Examples

Example 1

Invoke-AWSLogin
Logs in using the default profile and region determined by AWS configuration. The cmdlet will launch a browser for authentication.

Example 2

Invoke-AWSLogin -ProfileName "aws-login-test-profile" -Region "us-west-2"
Logs in using a specific profile named "aws-login-test-profile" in the us-west-2 region. The login session will be cached and associated with this profile.

Example 3

Invoke-AWSLogin -ProfileName "aws-login-test-profile" -Region "us-east-1" -Remote
Logs in using cross-device authentication flow without launching a browser. This is useful for headless environments or when a browser cannot be launched. You will receive a URL to visit in a browser and a verification code to enter.

Supported Version

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