How do I execute a Powershell script

ltb76

New Member
Hi,

I'm new to NTLite.
I have been looking to the forum for executing a powershell script as part of "Post-Setup"

I have created a "Setup" folder in the root of the image, and added a test .ps1 file.
In Post-Setup I have added:
"powershell.exe" with the parameters "-ExecutionPolicy Bypass -File C:\Setup\testPS.ps1"

The testPS.ps1 file just contains "New-Item C:\tmp\file01"
(should create an empty file "file01" in the folder "tmp"
However it does not work.

Any insigt as to what I'm doing wrong?

Thank you in advance.
 
@ltb76, seems like you're calling some "C:\Setup\testPS.ps1", but is that location existing during install.
Assuming your script works when ran manually, you can just add the script (testPS.ps1) into the Post setup page directly as a file or drag and drop it.
No need to type the command.
Tool will then copy it to the image and execute after install.

Let me know if there are still problems, thanks.
 
Back
Top