powershell | -NoProfile -ExecutionPolicy ByPass -f C:\path\to\Script.ps1 argument1 argument2 |
That is not correct. After Powershell script gets injected into Windows ISO file the path to script would not be a C: drive any more during Windows installation.Normally, you add the .ps1 file under Post-Setup (User). No Parameters are required, unless your script expects arguments to be passed.
If you need pass arguments, then add the Command:
powershell -NoProfile -ExecutionPolicy ByPass -f C:\path\to\Script.ps1 argument1 argument2
That is not correct. After Powershell script gets injected into Windows ISO file the path to script would not be a C: drive any more during Windows installation.
The correct relative path to the script should be this, but it does not work:
powershell -NoProfile -ExecutionPolicy ByPass -File "%SystemDrive%\sources\$OEM$\$$\Setup\FilesU\script.ps1"