我正在尝试关注通过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