View Full Version : How to pass parameters to a powershell custom action?

09-26-2012, 05:48 PM
I would like to utilize the new custom action type of powershell. However, most powershell scripts that I write need to have some sort of parameters passed to them. I do not see anywhere in the InstallShield documentation how to do this. Does anybody know how?

Thanks in advance!

09-26-2012, 08:57 PM

I have not used the powershell custom action yet... when did it come out? What versions of MSI support it?

A couple of things... I use powershell exclusively in my custom actions, and I do plenty of parameter passing. I just use the executable CA type. It seems to work fine. Here's a sample invocation that I use:

cmd /C powershell -Command .\utilities\powershell\install\patch_install.ps1 -installCmd uninstall -productVersion [ProductVersion] 2>&1 > PatchUninstall[CLIENTPROCESSID]_log.txt

I also know from using PowerShell with TeamCity, which has a PowerShell plug-in which forces you to use the "-Command -" idiom to take the script from standard in, that you can pass in values via environment variables as well. Is there a way to set some env vars?

Good Luck,


09-27-2012, 10:28 AM
Hi Jesse, this capability was introduced in InstallShield 2012 spring. I assume it is only supported in that version and up of InstallShield. It would be a very handy and cool feature to use if they only explained how to pass parameters! :) Without that information, it is pretty much useless in my humble opinion.

Take care,