微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

通过网络部署和安装 MSI

如何解决通过网络部署和安装 MSI

下午好, 我写了下面的内容将 msi 从网络位置复制到临时目录,然后静安装。 MSI 文件为 1.5GB。已经 30 分钟了,它仍在复制到单个主机名,甚至还没有开始安装部分。 有没有更有效的方式来部署这个 MSI?理想情况下,我想将它部署到网络上的许多主机名,但如果它对一个主机名这么慢 - 它将无法使用。 谢谢

$computername = Get-Content "\\server\List.txt"
$sourcefile = "\\server\package.msi"

#This section will install the software 

foreach ($computer in $computername) 

{

$destinationFolder = "\\$computer\C$\temp"

#This section will copy the $sourcefile to the $destinationfolder. If the Folder does not exist it will create it.

if (!(Test-Path -path $destinationFolder))

{

New-Item $destinationFolder -Type Directory

}

copy-Item -Path $sourcefile -Destination $destinationFolder

Invoke-Command -ComputerName $computer -ScriptBlock { & cmd /c "msiexec.exe /i c:\temp\package.msi" TRANSFORMS=Package.mst /q LICENSEKEY="xxx" LICENSEKEYCAPENSYS="xxx" LICENSeto="Company Name" DEFAULTPDFAPP=1 CENTRALCONfig="C:\Installer\temp 4" CENTRALCONfigAUTOUPDATE=1 ADDLOCAL=Core,DMContextMenu,OfficeAddins,OutlookAddin,PD3App,ShellIntegration,OCRDESKTOP,Capensys,IEPreview,ShellPreview
 }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。