2016-09-07 73 views
3

我想通过Windows PowerShell在我的本地机器上设置我的AWS,它给了我下面的错误信息;亚马逊网络服务PowerShell凭据安装错误

PS C:\> Set-AWSCredentials -AccessKey {AAAAAAAAAAAAAAA} -SecretKey {AAAAAAAAAAAAA} -Stor 
eAs {default} 
Set-AWSCredentials : Cannot evaluate parameter 'AccessKey' because its argument is specified as a script block and 
there is no input. A script block cannot be evaluated without input. 
At line:1 char:31 
+ Set-AWSCredentials -AccessKey {AAAAAAAAAAAAAAA} -SecretKey {AAAAAAAAAAAA ... 
+        ~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : MetadataError: (:) [Set-AWSCredentials], ParameterBindingException 
    + FullyQualifiedErrorId : ScriptBlockArgumentNoInput,Amazon.PowerShell.Common.SetCredentialsCmdlet 

我的Powershell版本如下;

Major Minor Build Revision 
----- ----- ----- -------- 
3  0  -1  -1 

任何人都知道问题是什么?

感谢

回答

6

看起来你需要从你的代码删除括号,从亚马逊的文档,首先出现在谷歌包括他们出于某种原因,但如果你看看http://docs.aws.amazon.com/powershell/latest/reference/items/Set-AWSCredentials.html,靠近底部的例子,你将会看到该函数真的像其他powershell cmdlet一样以字符串的形式期待它们。

Set-AWSCredentials -AccessKey AAAAAAAAAAAAAAA -SecretKey AAAAAAAAAAAAA -StoreAs default 

应该做的伎俩你(如果有任何东西的空间确保用引号括字符串)

+0

谢谢!它现在有效。 –