powershell - 无法获取 Service Fabric PowerShell 模块

标签 powershell azure-service-fabric powershell-5.0

我在 Windows Server 2016 Datacenter 上运行,但无法获取 Service Fabric commandlet,例如 Connect-ServiceFabricCluster。

Documentation说:Service Fabric PowerShell 模块随 Service Fabric SDK、运行时和工具一起安装。

  • 我正在使用 visual studio 2019
  • 我按照 here 的说明进行操作我已经从 Web 平台安装程序中卸载并重新安装了 Service Fabric SDK,并重新启动了我的系统。

我还能尝试什么?它在我使用 Windows 10 的其他系统中工作。我可以从它正在工作的另一个系统导出模块并在此处导入它吗?

最佳答案

不确定您是如何安装 service fabric sdk 的;我自己尝试过并能够在列表中找到 Connect-ServiceFabricCluster。我可以推荐两种最简单的安装方法。

A.附巧克力包

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

B.单独安装

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"

这是输出

$> Get-Command *ServiceFabricCluster* -All

enter image description here

关于powershell - 无法获取 Service Fabric PowerShell 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62241504/

相关文章:

azure - Powershell AzureADPreview cmdlet Set-AzureADApplication "PreAuthorizedApplications"参数的正确语法是什么?

excel - PowerShell 6 找不到 Excel Interop。 PowerShell 5.1 可以

Azure Service Fabric 使用情况

c# - 带有服务结构的 SOAP - Https 和 Http 绑定(bind)

powershell - 使用 -PathType 参数如何影响 Test-Path 的效率?

powershell - 参数的变量类型问题? - 电源外壳

powershell - PowerShell 模块(尤其是 PSReadline)如何在 V5 中自动加载?

visual-studio - 通过 powershell 将调试器附加到多个进程

c# - 在 C# 中,我们如何确定调用者是否使用 Windows PowerShell 5.1 或更高版本?

azure-service-fabric - 修复 ServiceFabricPartition 命令