Running 32-Bit-Code on 64-Bit Machines

by Nov 9, 2010

Some code may not work right on 64-Bit machines. Use this approach to make PowerShell execute code in an isolated 32-Bit PowerShell session and hand over its results to your 64-Bit PowerShell:

$32bitcode = {
# run on 64bit machine directly
& $32bitcode
# run in isolated 32bit session
$job = Start-Job $32bitcode -runAs32
$job| Wait-Job |Receive-Job
Remove-Job $job

Twitter This Tip!
ReTweet this Tip!