Finding the PS version and process architecture and change 64bit to 32 bit vice versa

Powershell environement


to get the version




Below script will force the shell to 32 bit process

if ($env:Processor_Architecture -ne "x86")
write-warning "Running x86 PowerShell..." 
&"$env:WINDIR\syswow64\windowspowershell\v1.0\powershell.exe" -NonInteractive -NoProfile $myInvocation.Line

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s