【发布时间】:2022-08-05 05:01:40
【问题描述】:
我正在尝试使用 PowerShell 在 Windows 服务器上安装 Web 部署。所以我有这个脚本。
$temp_path = \"c:\\azuredata\\\"
$wd_installer_url = \"https://download.microsoft.com/download/0/1/D/01DC28EA-638C-4A22-A57B-4CEF97755C6C/WebDeploy_amd64_en-US.msi\"
$wd_installer_file = $temp_path + [System.IO.Path]::GetFileName( $wd_installer_url )
$DataStamp = get-date -Format yyyyMMddTHHmmss
$logFile = \'{0}-{1}.log\' -f $wd_installer_file,$DataStamp
$MSIArguments = @(
\"/i\"
(\'\"{0}\"\' -f $wd_installer_file)
\"/qn\"
\"/norestart\"
\"/L*v\"
$logFile
)
Start-Process \"msiexec.exe\" -ArgumentList $MSIArguments -Wait -NoNewWindow
已安装 webdeploy 工具。但是当我查看它时,所有功能都没有安装。
修改网络部署工具。
点击更改
选择特征。
如您所见,未安装所有功能。现在无论我如何操作 powershell 命令的参数列表,它都没有完全安装它。我后来不得不手动执行此操作。尝试将 /i 替换为 /a。但这并没有帮助。
$MSIArguments = @(
\"/i\"
(\'\"{0}\"\' -f $wd_installer_file)
\"/qn\"
\"/norestart\"
\"/L*v\"
$logFile
)
我相信一定有办法做到这一点。因此,我的自动化工作流程被卡住了。有什么想法可以做什么?看了into this document,但不知道。