【问题标题】:How can i install ARR on azure VM via PowerShell?如何通过 PowerShell 在 azure VM 上安装 ARR?
【发布时间】:2013-04-27 16:47:12
【问题描述】:

我已将我的项目部署到 Azure 云服务,但另外我必须安装应用程序请求路由 (ARR)。

.ps1 PowerShell 命令和平:

if( Get-Service was ) {
        Write-Host "Stopping IIS and WAS..."
        Stop-Service was -Force
    }


    $filepath="%temp%\arr.msi"
    $process = (Start-Process -FilePath msiexec -ArgumentList /i, $filepath, /qn -Wait).ExitCode

    Write-Host $process
    if( Get-Service was ) {
        Start-Service was,w3svc -Verbose
    }

输出:

正在下载 MSI 软件包... 下载 MSI 包:D:\Users\BUTTER~1\AppData\Local\Temp\2\arr.msi 已下载... 完毕。正在执行安装... 停止 IIS 和 WAS... 1619 完毕 详细:在目标“万维网发布服务 (w3svc)”上执行“启动服务”操作。 详细:在目标“Windows Process Activation Service (was)”上执行操作“Start-Service”。

没有错误,但它没有安装 ARR。谁能帮忙?

【问题讨论】:

标签: iis powershell azure


【解决方案1】:

我找不到直接通过 PowerShell 执行此操作的好方法。如果您不介意使用 Chocolatey,您可以通过 Web 平台安装程序命令行 (WebPICMD) 完成所有操作,例如:

#Download and install Chocolatey and through Chocolatey install WebPICMD
iex ((new-object net.webclient).DownloadString("https://chocolatey.org/install.ps1"))
cinst webpicommandline

#Install Url Rewrite and ARR
$webPiProducts = @('UrlRewrite2', 'ARRv3_0') 
WebPICMD /Install /Products:"$($webPiProducts -join ',')" /AcceptEULA

更多关于 WebPICMD 的信息在这里:http://www.iis.net/learn/install/web-platform-installer/web-platform-installer-v4-command-line-webpicmdexe-rtw-release

Chocolatey 的灵感来自这篇博文:http://www.tugberkugurlu.com/archive/script-out-everything-initialize-your-windows-azure-vm-for-your-web-server-with-iis-web-deploy-and-other-stuff

【讨论】:

  • 如果安装了chocolatey,也可以使用choco install webpicmd
  • cinstchoco install 的别名
  • 这突然停止工作,并说有签名验证失败。对此有什么想法吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-02-18
  • 2019-05-31
  • 1970-01-01
  • 1970-01-01
  • 2013-09-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多