Due to the fact that there still are people using either 64 or 32bit processor architectures. I think it won't hurt to provide this information in the $PSVersionTable.
It could be nice to include the *$env:PROCESSOR_ARCHITECTURE in the $PSVersion variable.
_*Note: While posting this feedback, I notice the $env:PROCESSOR_ARCHITECTURE doesn't exit in Linux or MacOS PSCore6._
Currently, this information is only available in the $env:PROCESSOR_ARCHITECTURE variable.
PROCESSOR_ARCHITECTURE AMD64
It could look like the following results:
PS C:\Program Files\PowerShell\6-preview> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.2
PSEdition Core
GitCommitId v6.1.0-preview.2
OS Microsoft Windows 10.0.17661
Platform Win32NT
Processor_Architecture AMD64
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
It doesn't exist
PS C:\Program Files\PowerShell\6-preview> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.2
PSEdition Core
GitCommitId v6.1.0-preview.2
OS Microsoft Windows 10.0.17661
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Windows OS: Microsoft Windows 10.0.17661
PS C:\Program Files\PowerShell\6-preview> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.2
PSEdition Core
GitCommitId v6.1.0-preview.2
OS Microsoft Windows 10.0.17661
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
The solution to this might lie in resolving https://github.com/PowerShell/PowerShell/issues/4474.
I agree that adding the bit-ness to $PSVersionTable can't hurt, given that there's quite a bit of OS information there already.
In the meantime, [Environment]::Is64BitOperatingSystem gives you that information.
It doesn't reflect the CPU's ISA, however.
people using either 64 or 32bit processor architectures
How PowerShell scripts depends on this? Could you give business scenarios?
May be better to resolve this via https://github.com/PowerShell/PowerShell/issues/2693
Thanks everyone!!
:)
We can get this from .Net:
c#
Most helpful comment
We can get this from .Net:
c#