2015-11-03 82 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 

這應該做的伎倆。