HedleyPhillips
Contributor
Contributor

Install Builder hangs when running a Powershell script

Hi,

I've got an issue where the set up process hangs when trying to run a Powershell script. The script runs but the setup doesn't finish and I have to cancel the setup.

"Creating Shortcut for Uninstall INSTALLERNAME"

I'm placing two files. A batch file that runs the powershell script. The powershell script just create a new text file and nothing else.

<runProgram>
<program>${installdir}/batchfile.bat</program>
<programArguments></programArguments>
<show>0</show>
</runProgram>

Batchfile contents:
Powershell.exe -ExecutionPolicy Unrestricted -NonInteractive -WindowStyle Hidden -File ./create-file.ps1

PowerShell contents
New-Item -Path . -ItemType "file" -Name "test file.txt"

In my installdir I have the following:

rollbackBackupDirectory
batchfile.bat
create-file.ps1
test file.txt
Uninstall GPO Headless Installer (shortcut)

What am I doing wrong? Is the setup waiting for a response from the powershell script?

 

Thanks.

0 Kudos
1 Reply
HedleyPhillips
Contributor
Contributor

This was resolved with the assistance of support by adding a < nul to the end of the batch file line to stop the installer waiting for input

eg:

Powershell.exe -ExecutionPolicy Unrestricted -NonInteractive -WindowStyle Hidden -File ./Headless-Installer-v20.ps1 < nul

0 Kudos