2015-11-03 83 views
2

我刚刚下载了最新版本的AWS Powershell,并尝试了这一点:在我不记得任何问题之前。现在我收到此错误消息:如何在AWS PowerShell中设置AWS凭证

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> 

有没有人有任何想法我可能会做错什么?有一些语法:-(

感谢

+0

您可能需要使用'Import-Module'来导入aws模块 –

+0

我以前从未导入过任何模块。你能给我更多的细节吗?请注意,我刚刚下载并安装了AWS powershell,并且正在使用AWS powershell。谢谢 – Alan2

+1

如果您刚刚安装了AWS工具包,您可以尝试关闭当前的PowerShell窗口并重新打开它(假设它在安装之前已经打开) –

回答

2

这些工具安装到一个文件夹结构符合自动导入支持PowerShell中的3或更高版本,所以不应该需要导入模块又变了。但是,它会要求该PSModulePath更新安装程序执行生效,我们已经注意到,在某些系统需要重新启动后安装

看着PSModulePath你应该看到这样的事情(借口包装):

PS C :> ls env:PSModulePath | fl

名称: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是否可用。如果没有,请回报,我们会尝试重新制作。

0

要启用脚本执行,请在PowerShell中通过以管理员身份登录运行以下命令。

Set-ExecutionPolicy RemoteSigned 

这应该做的伎俩。