Nagendra Ghimire
Nagendra Ghimire

Reputation: 86

Unable to get Service Fabric PowerShell module

I am running on Windows Server 2016 Datacenter and I am not able to get the Service Fabric commandlets like Connect-ServiceFabricCluster.

Documentation says : The Service Fabric PowerShell module is installed with the Service Fabric SDK, runtime, and tools.

What else can I try? It is working in other system where I am using Windows 10. Can I export the module from another system where it is working and import it here?

Upvotes: 4

Views: 5229

Answers (2)

MonteChristo
MonteChristo

Reputation: 597

In my case, I was using PowerShell 7.x as my default version of PowerShell. Apparently, the ServiceFabric PowerShell module is only partly compatible with that version, so it is not loaded automatically. Once I used PowerShell 5.x to administer ServiceFabric, the module loaded upon PowerShell start and was ready to be used.

Upvotes: 3

Kundan
Kundan

Reputation: 1415

Not sure how you have installed the service fabric sdk; I tried it myself and able to find Connect-ServiceFabricCluster in the list. I can suggest two easiest ways to get it installed.

A. with Choco package

choco install MicrosoftAzure-ServiceFabric-CoreSDK --source webpi --confirm

B. With individual installation

Install visual c++ 2012 SP1 redistributable package

Invoke-WebRequest "http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU1/vcredist_x64.exe" -OutFile "C:\vcredist.exe" -UseBasicParsing; \ Start-Process "C:\vcredist.exe" -ArgumentList '/install', '/passive' -NoNewWindow -Wait; \ rm "C:\vcredist.exe"

Install Service Fabric Runtime

Invoke-WebRequest "http://download.microsoft.com/download/3/2/1/3217654F-6882-4CEA-BD51-49287EDECE9B/MicrosoftServiceFabric.6.0.232.9494.exe" -OutFile "C:\ServiceFabricRuntime.exe" -UseBasicParsing; \ Start-Process "C:\ServiceFabricRuntime.exe" -ArgumentList '/AcceptEULA', '/QUIET' -NoNewWindow -Wait; \ rm "C:\ServiceFabricRuntime.exe"

Install Service Fabric SDK

Invoke-WebRequest "http://download.microsoft.com/download/3/2/1/3217654F-6882-4CEA-BD51-49287EDECE9B/MicrosoftServiceFabricSDK.2.8.232.msi" -OutFile "C:\ServiceFabricSDK.msi" -UseBasicParsing; \ Start-Process "msiexec" -ArgumentList '/i', 'C:\ServiceFabricSDK.msi', '/passive', '/quiet', '/norestart', '/qn' -NoNewWindow -Wait; \ rm "C:\ServiceFabricSDK.msi"

Here's the output

$> Get-Command *ServiceFabricCluster* -All

enter image description here

Upvotes: 2

Related Questions