如何在 AWS PowerShell 中设置 AWS 凭证

Ala*_*an2 5 powershell amazon-s3 amazon-web-services aws-powershell

我刚刚下载了最新版本的 AWS Powershell 并尝试了这个:之前我不记得有任何问题。现在我收到此错误消息:

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>
Run Code Online (Sandbox Code Playgroud)

有谁知道我可能做错了什么?有一些语法再次改变:-(

谢谢

小智 2

这些工具安装到符合 PowerShell 版本 3 或更高版本中的自动导入支持的文件夹结构,因此Import-Module不需要。

但是,它确实要求PSModulePath安装程序执行的更新生效,并且我们注意到在某些系统上您需要在安装后重新启动。

看看PSModulePath你应该会看到类似这样的东西(请原谅换行):

PS C:\> ls env:PSModulePath | 佛罗里达州

名称 : PSModulePath
值: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\

如果是这样,请尝试重新启动计算机,然后打开 shell 提示符并查看是否Set-AWSCredentials可用。如果没有,请报告,我们将尝试重现。