task sequence error 1460 when attempting to run powershell script using 'Run command line' step
Literally banging my head against the wall here!
I want to run a powershell script in a task sequence (OSD). I am recieving error 1460, which from what I have read, leads me to believe that this is a working directory issue. The setup is as follows (problematic command line in bold);
SCCM 2007 R2
Deploying Windows XP SP3
Installed Windows Management Framework 2.0 (WinRM + Powershell as windows update item)
Quick configured WinRM (cmd.exe /c winrm.cmd QC /q)
Configured Powershell execution policy (powershell.exe -command {set-executionpolicy unrestricted})
Run command line (powershell.exe -file ".\script_1.ps1" -noprofile) Using SCCM package in command line task as working directory.(well it should be according to the manual!)
I have tried this command with the .\ and without it. The operating system reported error 1460.
I have looked at many posts now and it seems to be a grey area I believe. Can powershell scripts run in TS (OSD)? If so, I would welcome anybody's valuable input on this.
Oh, I have also read the Michael Niehaus blog and this did not work.
May 31st, 2012 9:49am
Ok, so I got it working. I copied the PS1 script into the MDT scripts dir as I have integrated MDT tools into SCCM OSD for ZTI reasons. I used %SCRIPTROOT%\script_1.ps1 and this has worked.
So the question is, why does powershell not run scripts over the network to the local DP? It seems it only works when scripts are local to the computers i.e. in the C: partition. If somebody can clarify this one, I would be gratefull. I
want to use SCCM packages as a script repositories called by TS run command line, not MDT.
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2012 10:09am