Identical commands can return different results between 32-bit and 64-bit PowerShell sessions because Windows uses different views of system resources for 32-bit and 64-bit processes.
In a 32-bit PowerShell session on a 64-bit Windows computer, WOW64 redirection can change what the command actually accesses:
- File system access to
$Env:windir\System32is automatically redirected to$Env:windir\SysWOW64. - Tools that exist in
System32but not inSysWOW64may appear missing, which can cause errors such as a command not being recognized. - Registry access can also differ, because 32-bit and 64-bit applications use separate logical registry views. On 64-bit Windows, redirected 32-bit registry data is typically under
Wow6432Node.
Because of that, the same command may:
- find a different executable,
- read different registry keys or values,
- or fail in one session but succeed in the other.
To confirm whether a remote PowerShell session is running as 32-bit or 64-bit, check the PROCESSOR_ARCHITECTURE environment variable:
$s = New-PSSession -ComputerName Server01 -ConfigurationName CustomShell
Invoke-Command -Session $s {$Env:PROCESSOR_ARCHITECTURE}
If the output is x86, the session is using a 32-bit process.
References: