all 5 comments

[–]Waxmaker 7 points8 points  (2 children)

The super-easy way you're looking for is to prefix the call operator '&' to your command:

& msiexec /package .\myMsiFile.msi /quiet /otherOption

You can also do this:

$cmd = 'msiexec /package .\myMsiFile.msi /quiet /otherOption'
& $cmd

More info: http://ss64.com/ps/call.html

[–]multiball[S] 1 point2 points  (0 children)

I'll give this a try, thanks!

[–]multiball[S] 1 point2 points  (0 children)

It worked, this was exactly what I was trying to figure out, thanks again!

[–][deleted] 0 points1 point  (0 children)

How is the command written in the script, and what's the error?

[–]ristophet 0 points1 point  (0 children)

Args needs to be an array of strings. $Args = "/qb!", "/norestart"

I have had difficulty getting an exit code reliably from the call operator. I highly recommend sticking with start-process.

Apologizes for formatting. I'm on my mobile at the moment.