how to set AWS default profile for AWS Tools for Powershell

564 Views Asked by At

If I am using AWS CLI commands ("aws"), it works to have it pick up the profile I'm using if I set the environment variable AWS_PROFILE so that I don't have to specify credentials or region for each command. This does not work for the AWS Powershell commands. I have to use -ProfileName to get those to work. Can anyone tell how to make this work so that I don't have to specify profile related stuff in each command line?

1

There are 1 best solutions below

0
ashovlin On

AWS Tools for PowerShell does not support AWS_PROFILE - https://github.com/aws/aws-tools-for-powershell/issues/8

You can specify the profile to use for a PowerShell session via Set-AWSCredential:

Set-AWSCredential -ProfileName MyProfileName

See Specifying Credentials in the AWS Tools for PowerShell user guide for more.