使用 cmdlet 访问 AWS IAM 时出现 ObjectNotFound 错误

ObjectNotFound Error while using cmdlet to access AWS IAM

我正在尝试通过 powershell 生成 AWS API 网关访问密钥。但是,每次我尝试使用任何 cmdlet 时都会抛出错误:

例如:

 Get-AWSCredential -ListProfileDetail

将导致如下错误:

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

当我通过 Get-Command 显示命令列表时,AWS cmdlet 没有弹出。 知道可能是什么问题吗?

长话短说,运行 这个:Install-Package -Name AWSPowerShell

您可能需要 运行 PS 作为管理员才能使用 Install-Package 命令。此外,系统可能会提示您安装 'nuget',请回答是。如果您收到有关 PS图库的安全警告,请回答是。

这是亚马逊关于 PS cmdlet 的文档:http://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up.html