Powershell: $env:PROCESSOR_ARCHITECTURE incorrectly displaying x86 on AMD64 platform?

Created on 6 Mar 2020  路  3Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

$env:PROCESSOR_ARCHITECTURE

Expected behavior

AMD64

Actual behavior

[screenshot of both 5.1 and 7.0]
image

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue-Question Resolution-Answered

Most helpful comment

@sgaglione PROCESSOR_ARCHITECTURE reflects the architecture of the process you are in. Looking at the screenshot, you have installed the 32 bit version of PowerShell 7.

If you're looking for whether the operating system is 64 bit you can use [Environment]::Is64BitOperatingSystem.

All 3 comments

@sgaglione PROCESSOR_ARCHITECTURE reflects the architecture of the process you are in. Looking at the screenshot, you have installed the 32 bit version of PowerShell 7.

If you're looking for whether the operating system is 64 bit you can use [Environment]::Is64BitOperatingSystem.

good lord; i didn't even know there was such a thing...this day and age. my bad and i've since installed the x64 version. so sad on my part.

@sgaglione No worries, happens to us all 馃檪

Was this page helpful?
0 / 5 - 0 ratings