Saving .msu help menu to variable

I’m trying to save the menu of .\filename.msu /? to a variable. Currently if you enter:

$this = .\filename.msu /? it just displays the microsoft help menu with all the switches available for that .msu file.

Is it possible to save that menu to a varible in text form?

Hey there Aaron!

There’s not a lot of switches to the Windows Update Standalone installer. You could just create your own hash table with this link as a reference:

Might I inquire as to what you’re attempting?

Sure, so I have a auto install script, with hard coded values for the quiet, passive, no restart switches for msu, but it also installs .exe files and I’ve found that some of the switches vary on those installers.

So I wanted to query the /? of the file and then find the switches it does have and that are applicable and run those per that .exe installer

Hey there Aaron. After conferring with some of my colleagues (thanks Stephen!) and doing a little reading, it appears that what you’re looking to do isn’t really possible. While you can pass returns from the command line into PowerShell, it doesn’t work the other way. Even if you were able to pass arguments into the command line, your problem would be compounded with the lack of uniformity when it comes to exe installers. Depending on the tool used to package it, and the switches that the packager decided to allow, you often run into a different set of switches for just about every exe out there.

A possible solution might be OneGet, but it’s not yet “in production”. Your best bet at this point is to either continue with batch files, or use some sort of application deployment tool like SCCM.

Sorry. :\

Thanks a lot for looking into it Will, I should have stated this is just for microsoft installers (the .exe installs) and was hoping to parse and find certain switches from the menu’s but ohhh well ;/ I may just have to have it sort by error 87 invalid parameters to try the next best ‘guess’ on the switch.

Thanks again for looking into it so diligently!