【发布时间】:2020-11-28 04:46:03
【问题描述】:
我正在尝试一个接一个地批量安装一堆 .msi。但是当我运行我的 powershell 脚本时 msiexec /?好像我的论点是错误的。我在这里错过了什么?
$Path = Get-ChildItem -Path *my path goes here* -Recurse -Filter *.MSI
foreach ( $Installer in ( Get-ChildItem -Path $Path.DirectoryName -Filter *.MSI ) ) {
Start-Process -Wait -FilePath C:\windows\system32\msiexec.exe -ArgumentList "/i '$Installer.FullName'"
}
【问题讨论】:
-
把
"/i '$Installer.FullName'"改成"/i '$($Installer.FullName)'"
标签: powershell automation windows-installer