Page 1 of 1

Run simple powershell script

Posted: Tue Mar 28, 2023 12:28 pm
by leeboozer
Can someone provide an example of running a simple powershell script from the app installation folder?

I can add the script to the installer, and the script gets installed fine.
But what to put in System --> Commands to execute the script from the app installation folder so far eludes me.

Re: Run simple powershell script

Posted: Wed Mar 29, 2023 4:09 am
by Leo
Try this:

Code: Select all

File: <SystemDir>\cmd.exe
Parameters: /C powershell.exe "<InstallDir>\script.ps1"

Re: Run simple powershell script

Posted: Wed Mar 29, 2023 1:43 pm
by leeboozer
Thanks Leo. That almost worked. Windows had a fuss about the (x86) in the path.

It worked once I added apostrophes just inside the quotation marks:

Parameters: /C powershell.exe "'<InstallDir>\PostInstall.ps1'"

Re: Run simple powershell script

Posted: Fri Mar 31, 2023 5:17 am
by Leo
Thank you for this information.