Get-OSArchitectureWidth

Get-OSArchitectureWidth

Get-OSArchitectureWidth

Get the operating system architecture address width.

Syntax

Get-OSArchitectureWidth `
  [-Compare <Object>]

Description

This will return the system architecture address width (probably 32 or 64 bit). If you pass a comparison, it will return true or false instead of {32|64}.

Notes

When your installation script has to know what architecture it is run on, this simple function comes in handy.

ARM64 architecture will automatically select 32bit width as there is an emulator for 32 bit and there are no current plans by Microsoft to ship 64 bit x86 emulation for ARM64. For more details, see https://github.com/chocolatey/choco/issues/1800#issuecomment-484293844.

Aliases

Get-OSBitness Get-ProcessorBits

Inputs

None

Outputs

None

Parameters

-Compare [<Object>]

This optional parameter causes the function to return $true or $false, depending on whether or not the bit width matches.

Property Value
Aliases
Required? false
Position? 1
Default Value
Accept Pipeline Input? false

Function Reference

:choco-info: NOTE

This documentation has been automatically generated from Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Get-OSArchitectureWidth -Full.

View the source for Get-OSArchitectureWidth