简体   繁体   中英

Error invoking command to install a Msi through Powershell

I am trying to use PowerShell's Invoke-Command but I am encountering an error that I have no idea of what it is!

Would be great to have some help on this. I am sure that it must be something really simple..

invoke-command  -scriptblock{ $executable = "wmic"; & "$executable product call install true","-computername name" ,'path to the msi' } 

Thank you!

You could just try using msiexec:

$scriptblock = {Start-Process msiexec.exe -Argumentlist "/i $PathToMSI","/qn"}
invoke-command  -scriptblock $scriptblock -computername $name 

I´m not sure if you even can install msi´s via wmi, never seen it before. Other than that you mixed up the syntax of your invoke-command a bit ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM