Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set AWS credentials in AWS PowerShell

I just downloaded the latest version of AWS Powershell and tried this: Before I don't remember any problem. Now I am getting this error message:

PS C:\Program Files (x86)\AWS Tools\PowerShell\AWSPowerShell> Set-AWSCredentials -AccessKey xxxxxxxx -SecretKey xxxxxxx -StoreAs xxxx
Set-AWSCredentials : The term 'Set-AWSCredentials' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
+ Set-AWSCredentials -AccessKey xxxxxxx -SecretKey xxxxx
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Set-AWSCredentials:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Program Files (x86)\AWS Tools\PowerShell\AWSPowerShell>

Does anyone have any ideas what I might be doing wrong? Has some syntax changed again :-(

Thanks

like image 846
Alan2 Avatar asked Nov 03 '15 13:11

Alan2


People also ask

How do I connect to AWS using PowerShell?

To use AWS programmatically from PowerShell, you need to generate your access keys. To do this, sign into the AWS console, and from the Services tab, select IAM under Security, Identity, & Compliance. From the left-hand side, select Users, and find the username you want to generate access keys for.

How do I set up AWS provider credentials?

To set AWS credentials, you must have the access key ID and your secret access key for the IAM user you want to configure. For information about access key IDs and secret access keys, see Managing Access Keys for IAM Users in the IAM User Guide.

How do I change my AWS credentials in terminal?

You can edit the AWS credentials directly by editing the AWS credentials file on your hard drive. The aws_access_key_id and the aws_secret_access_key are stored in the ~/. aws/credentials file by default. You can use any editor to edit them, such as vim, emacs, or nano, e.g.

Which PowerShell cmdlet can be used to set up authentication to AWS?

Using the Set-AWSCredentials Cmdlet Any accounts that you register through PowerShell will also show up in Visual Studio (including the AWS PS Default account you may have set up with Initialize-AWSDefaults ).


1 Answers

The tools install to a folder structure compliant with the auto-import support in PowerShell version 3 or higher, so Import-Module should not be needed.

It does however require that the PSModulePath update the installer performs takes effect, and we've noticed that on some systems you need to reboot after install.

Looking at PSModulePath you should see something like this (excuse wrapping):

PS C:\> ls env:PSModulePath | fl

Name  : PSModulePath
Value : C:\Users\userid\Documents\WindowsPowerShell\Modules;C:\Program
        Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\;C:\Program Files (x86)\AWS Tools\PowerShell\

If so, try restarting your machine and then open a shell prompt and see if Set-AWSCredentials becomes available. If not, report back and we'll try and repro.

like image 169
Steve Roberts Avatar answered Nov 15 '22 08:11

Steve Roberts