I have been writing about this before:
http://larslohmann.blogspot.dk/2013/05/cscript-error-can-find-script-engine.html
Apparently not only vbscript is affected by this but also PowerShell.
Get-WmiObject : Retrieving the COM class factory for component with CLSID {xxx} failed due to the following error: 80070005.
The script works outside the task sequence also with alternate credentials and task sequence is not in WinPE phase.
When trying to connect to the SCCM server (WMI) from a task sequence step with alternate credentials the problem shows up again.
Since last time I have also seen the problem with dotNet 1.1 is installed.
The workaround is the same as in the original post, and with the workaround implemented the script works as expected, Powershell code shown here with workaround marked.