Search code examples
powershellazure-service-fabricpowershell-5.0

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.

  • I am using visual studio 2019
  • I followed instructions from here and I have uninstalled and reinstalled Service Fabric SDK from Web Platform Installer and rebooted my system.

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?


Solution

  • 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