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 = {
[IntPtr]::Size
}
# run on 64bit machine directly
& $32bitcode
# run in isolated 32bit session
$job = Start-Job $32bitcode -runAs32
$job| Wait-Job |Receive-Job
Remove-Job $job
"Done"
[IntPtr]::Size
}
# run on 64bit machine directly
& $32bitcode
# run in isolated 32bit session
$job = Start-Job $32bitcode -runAs32
$job| Wait-Job |Receive-Job
Remove-Job $job
"Done"