通过网络部署和安装 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 (将#修改为@)