用于静默安装 Azure Service Fabric SDK、运行时和工具的 Powershell 脚本

Emi*_*uez 5 powershell azure azure-service-fabric

我正在尝试编写一个脚本来将安装的 Azure Service Fabric SDK、运行时和工具下载到一些服务器中。

我的问题是,此处提供的安装程序是 Web 安装程序,并且不支持静默模式。

我在这里找到了解决这个问题的人。他的代码:

# 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"
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,他正在使用 .msi 安装程序的直接链接(以及其他人在其他线程中所做的事情,如 两个答案)。

所以我的问题是,如何获得带有这些安装程序最新版本的 msi 的直接链接?

后续问题是,是否有一个通用链接可以自动下载这些工具的最新版本?

提前致谢。

Ste*_*zor 5

我知道这并不完全是您所要求的,但您可以用来静默Web Platform Installer Command Line安装WebPI产品。这个想法是从命令行下载WebPICMD并运行安装。Service Fabric SDKpowershell 脚本可能如下所示:

Invoke-WebRequest "https://download.microsoft.com/download/C/F/F/CFF3A0B8-99D4-41A2-AE1A-496C08BEB904/WebPlatformInstaller_amd64_en-US.msi" -OutFile "C:\WebPlatformInstaller.msi" -UseBasicParsing;
Start-Process "msiexec" -ArgumentList '/i', 'C:\WebPlatformInstaller.msi', '/passive', '/quiet', '/norestart', '/qn' -NoNewWindow -Wait; 
rm "C:\WebPlatformInstaller.msi"

WebPICMD.exe /Install /Products:MicrosoftAzure-ServiceFabric-CoreSDK /AcceptEULA
Run Code Online (Sandbox Code Playgroud)

产品MicrosoftAzure-ServiceFabric-CoreSDK将静默安装最新版本的Service Fabric SDKService Fabric Runtime

如果你想安装与运行不同的东西WebPI

WebPICMD.exe /List /ListOption:All

此命令将列出所有可用的产品,只需获取产品的 ID 并运行安装命令即可。

更多关于WebPICMD 这里