2

I am trying to generate AWS API gateway access key through powershell. However, everytime I try to use any cmdlet it throws an error:

For example:

 Get-AWSCredential -ListProfileDetail

will result in an error like this:

Get-AWSCredential : The term 'Get-AWSCredential' 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 + Get-AWSCredential -ListProfileDetail + ~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-AWSCredential:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

When I display the list of commands through Get-Command the AWS cmdlets do not pop up. Any idea what could be the problem?

1
  • I assume you haven't installed the cmdlets. I posted the command in answers with a reference to Amazon docs. Commented Nov 13, 2017 at 20:43

2 Answers 2

15

Long story short, run this: Install-Package -Name AWSPowerShell

You may need to run PS as an Administrator for the Install-Package command to work. Additionally, you may be prompted to install 'nuget', answer yes. If you receive the security warning about PSGallery, answer yes.

Here is Amazon's docs on PS cmdlets: http://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up.html

Sign up to request clarification or add additional context in comments.

2 Comments

It was an access issue. Installed it.
i switched to WSL linux subsystem terminal windows terminal
0

Since November 2019, AWS now provide a modularised, lighter version of AWS Tools for PowerShell called AWS.Tools.*.

I recommend using these modules over AWSPowerShell, which is the single, large-module version and will most likely include way more than you need.

You need the AWS.Tools.IdentityManagement module for IAM-related commands e.g. Get-AWSCredential / Get-IAMUser.

Recommended setup using AWS.Tools.Installer (multiple benefits1):

Install-Module -Name AWS.Tools.Installer
Install-AWSToolsModule AWS.Tools.IdentityManagement

Minimal setup:

Install-Module -Name AWS.Tools.Common
Install-Module -Name AWS.Tools.IdentityManagement

1: as per above docs

The AWS.Tools.Installer module simplifies the installation and update of other AWS.Tools modules. AWS.Tools.Installer requires, automatically downloads and installs, an updated version of PowerShellGet. The AWS.Tools.Installer module also automatically keeps your module versions in sync. When you install or update to a newer version of one module, the cmdlets in the AWS.Tools.Installer automatically update all of your other AWS.Tools modules to the same version.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.