Created
February 10, 2011 03:45
-
-
Save jstangroome/819902 to your computer and use it in GitHub Desktop.
Detect 32-bit PowerShell inside a script and switch to 64-bit PowerShell via PS Remoting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Test-Path Env:PROCESSOR_ARCHITEW6432) { | |
Write-Host "Switching to 64-bit PowerShell" | |
Invoke-Command -ComputerName localhost -ScriptBlock { | |
param ($Path, $Parameters) | |
& $Path @Parameters | |
} -ArgumentList $MyInvocation.MyCommand.Path, $PSBoundParameters | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment