Can’t find the Connect-ServiceFabricCluster cmdlet when using Powershell

Question:

I’m trying to follow this article about deploying a service fabric app through powershell, but I have an issue with running the Connect-ServiceFabricCluster cmdlet. I get the following:

Following other articles on the internet, I’ve tried importing the following things:

Import-Module "$ENV:ProgramW6432\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1"

Import-Module "C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ServiceFabric"

I also saw somewhere to try and set execution policy before importing modules, so I tried this:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser

In the Modules section of the Powershell ISE I see the ServiceFabricSDK module, but I don’t see this cmdlet.

How do I get access to these cmdlets?

Thank you for any help.

Current versions:

Running $PSVersionTable.PSVersion, I get

Service Fabric SDK is version 2.5.216

Answer:

You should make sure you are running the Windows Powershell as opposed to just Powershell. This made a difference for me.

Source:

Can’t find the Connect-ServiceFabricCluster cmdlet when using Powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply