我正在嘗試關注通過PowerShell部署服務結構應用的this文章,但運行Connect-ServiceFabricCluster cmdlet時遇到問題。我得到如下:使用PowerShell時找不到Connect-ServiceFabricCluster cmdlet
Connect-ServiceFabricCluster : The term 'Connect-ServiceFabricCluster' 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:2
+ Connect-ServiceFabricCluster
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-ServiceFabricCluster:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
繼互聯網上的其他文章中,我已經試過進口下列事情:
Import-Module "$ENV:ProgramW6432\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1"
Import-Module "C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ServiceFabric"
我也看到某處嘗試和設置導入模塊之前執行的政策,所以我嘗試這樣做:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser
在PowerShell ISE中的模塊部分,我看到ServiceFabricSDK模塊,但我沒有看到此cmdlet。
如何訪問這些cmdlet?
謝謝你的幫助。
當前版本:
運行$ PSVersionTable.PSVersion,我得到
Major Minor Build Revision
----- ----- ----- --------
4 0 -1 -1
服務織物SDK版本爲2.5.216
在做其他事情之前,請確保您運行的是PowerShell x64版本,而不是x86版本。服務結構和相關的cmdlet *僅*可在64位環境中使用。 – yoape