Amazon Web Service PowerShell 凭据设置错误

Amazon Web Service PowerShell Credentials setup Errors

我正在尝试通过 windows PowerShell 在我的本地计算机上设置我的 AWS,它给我以下错误消息;

    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

有人知道问题出在哪里吗?

谢谢

看起来您需要从代码中删除括号,google 中最先出现的来自亚马逊的文档出于某种原因包含它们,但如果您查看 http://docs.aws.amazon.com/powershell/latest/reference/items/Set-AWSCredentials.html 和示例在底部附近,您会看到该函数确实在字符串中期待它们,就像任何其他 powershell cmdlet 一样。

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

应该可以解决问题(如果任何内容中有空格,请确保将字符串用引号引起来)