We execute several powershell scripts during OSD. Sometimes a powershell script failed with exit Code 1 (Incorrect Function). After we made a second try with the same machine it works. The Error happens rarely. In Case of 100 deployments it happens once.
All deployments use the same Tasksequence.
The Error is not reproducible. I wonder what is the problem.
Run Commandline
cmd.exe /c "powershell.exe "& '.\XXXXXX.ps1'"
(Executionpolicy is set globally before in another Run Commandline-step)
SMSTS.log
Content successfully downloaded at C:\_SMSTaskSequence\Packages\XXX000BC
Resolved source to 'C:\_SMSTaskSequence\Packages\XXX000BC'
Command line for extension .exe is "%1" %*
Set command line: Run command line
Working dir 'C:\_SMSTaskSequence\Packages\XXX000BC'
Executing command line: Run command line
Process completed with exit code 1
Entering ReleaseSource() for C:\_SMSTaskSequence\Packages\XXX000BC
reference count 1 for the source C:\_SMSTaskSequence\Packages\XXX000BC before releasing
Released the resolved source C:\_SMSTaskSequence\Packages\XXX000BC
Process completed with exit code 1
!--------------------------------------------------------------------------------------------!
Failed to run the action: XXXXXXXXXXXX.
Unknown error (Error: 00000001; Source: Unknown)
Any ideas?