The Win32_Processor WMI class represents a device that can interpret a sequence of instructions on a computer running on a Windows operating system.
Methods
Win32_Processor has no methods. Inherited methods (Reset and SetPowerState) are not implemented.
Properties
Win32_Processor returns 57 properties:
'AddressWidth','Architecture','AssetTag','Availability','Caption','Characteristics',
'ConfigManagerErrorCode','ConfigManagerUserConfig','CpuStatus','CreationClassName','CurrentClockSpeed',
'CurrentVoltage','DataWidth','Description','DeviceID','ErrorCleared','ErrorDescription','ExtClock',
'Family','InstallDate','L2CacheSize','L2CacheSpeed','L3CacheSize','L3CacheSpeed',
'LastErrorCode','Level','LoadPercentage','Manufacturer','MaxClockSpeed','Name','NumberOfCores',
'NumberOfEnabledCore','NumberOfLogicalProcessors','OtherFamilyDescription','PartNumber','PNPDeviceID',
'PowerManagementCapabilities','PowerManagementSupported','ProcessorId','ProcessorType','Revision','Role',
'SecondLevelAddressTranslationExtensions','SerialNumber','SocketDesignation','Status','StatusInfo','Stepping',
'SystemCreationClassName','SystemName','ThreadCount','UniqueId','UpgradeMethod','Version',
'VirtualizationFirmwareEnabled','VMMonitorModeExtensions','VoltageCaps'
Unless explicitly marked as writeable, all properties are read-only. Read all properties for all instances:
Get-CimInstance -ClassName Win32_Processor -Property *
Most WMI classes return one or more instances.
When
Get-CimInstance
returns no result, then apparently no instances of class Win32_Processor exist. This is normal behavior.Either the class is not implemented on your system (may be deprecated or due to missing drivers, i.e. CIM_VideoControllerResolution), or there are simply no physical representations of this class currently available (i.e. Win32_TapeDrive).
AddressWidth
On a 32-bit operating system, the value is 32 and on a 64-bit operating system it is 64.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, AddressWidth
Architecture
Processor architecture used by the platform.
Architecture returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$Architecture_map = @{
0 = 'x86'
1 = 'MIPS'
2 = 'Alpha'
3 = 'PowerPC'
6 = 'ia64'
9 = 'x64'
}
Use a switch statement
switch([int]$value)
{
0 {'x86'}
1 {'MIPS'}
2 {'Alpha'}
3 {'PowerPC'}
6 {'ia64'}
9 {'x64'}
default {"$value"}
}
Use Enum structure
Enum EnumArchitecture
{
x86 = 0
MIPS = 1
Alpha = 2
PowerPC = 3
ia64 = 6
x64 = 9
}
Examples
Use $Architecture_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "Architecture" to friendly text
Note: to use other properties than "Architecture", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Architecture"
# to translate other properties, use their translation table instead
$Architecture_map = @{
0 = 'x86'
1 = 'MIPS'
2 = 'Alpha'
3 = 'PowerPC'
6 = 'ia64'
9 = 'x64'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "Architecture", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$Architecture = @{
Name = 'Architecture'
Expression = {
# property is an array, so process all values
$value = $_.Architecture
$Architecture_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "Architecture". The latter
# is defined by the hashtable in $Architecture:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $Architecture
# ...or dump content of property Architecture:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $Architecture |
Select-Object -ExpandProperty Architecture
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $Architecture_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$Architecture_map = @{
0 = 'x86'
1 = 'MIPS'
2 = 'Alpha'
3 = 'PowerPC'
6 = 'ia64'
9 = 'x64'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.Architecture
# translate raw value to friendly text:
$friendlyName = $Architecture_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "Architecture" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "Architecture", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "Architecture", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$Architecture = @{
Name = 'Architecture'
Expression = {
# property is an array, so process all values
$value = $_.Architecture
switch([int]$value)
{
0 {'x86'}
1 {'MIPS'}
2 {'Alpha'}
3 {'PowerPC'}
6 {'ia64'}
9 {'x64'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "Architecture". The latter is defined
# by the hashtable in $Architecture:
Select-Object -Property Caption, $Architecture
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumArchitecture
{
x86 = 0
MIPS = 1
Alpha = 2
PowerPC = 3
ia64 = 6
x64 = 9
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.Architecture
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **Architecture**
[EnumArchitecture]$rawValue
# get a comma-separated string:
[EnumArchitecture]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumArchitecture]
#endregion
Enums must cover all possible values. If Architecture returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
AssetTag
Represents the asset tag of this processor.
This value comes from the Asset Tag member of the Processor Information structure in the SMBIOS information.
Windows Server® 2012® R2, Windows® 8.1, Windows Server® 2012, Windows® 8, Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows Server® 2016 and Windows® 10.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, AssetTag
Availability
Availability and status of the device.
Availability returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$Availability_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Running/Full Power'
4 = 'Warning'
5 = 'In Test'
6 = 'Not Applicable'
7 = 'Power Off'
8 = 'Off Line'
9 = 'Off Duty'
10 = 'Degraded'
11 = 'Not Installed'
12 = 'Install Error'
13 = 'Power Save - Unknown'
14 = 'Power Save - Low Power Mode'
15 = 'Power Save - Standby'
16 = 'Power Cycle'
17 = 'Power Save - Warning'
18 = 'Paused'
19 = 'Not Ready'
20 = 'Not Configured'
21 = 'Quiesced'
}
Use a switch statement
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Running/Full Power'}
4 {'Warning'}
5 {'In Test'}
6 {'Not Applicable'}
7 {'Power Off'}
8 {'Off Line'}
9 {'Off Duty'}
10 {'Degraded'}
11 {'Not Installed'}
12 {'Install Error'}
13 {'Power Save - Unknown'}
14 {'Power Save - Low Power Mode'}
15 {'Power Save - Standby'}
16 {'Power Cycle'}
17 {'Power Save - Warning'}
18 {'Paused'}
19 {'Not Ready'}
20 {'Not Configured'}
21 {'Quiesced'}
default {"$value"}
}
Use Enum structure
Enum EnumAvailability
{
Other = 1
Unknown = 2
RunningFull_Power = 3
Warning = 4
In_Test = 5
Not_Applicable = 6
Power_Off = 7
Off_Line = 8
Off_Duty = 9
Degraded = 10
Not_Installed = 11
Install_Error = 12
Power_Save_Unknown = 13
Power_Save_Low_Power_Mode = 14
Power_Save_Standby = 15
Power_Cycle = 16
Power_Save_Warning = 17
Paused = 18
Not_Ready = 19
Not_Configured = 20
Quiesced = 21
}
Examples
Use $Availability_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "Availability" to friendly text
Note: to use other properties than "Availability", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Availability"
# to translate other properties, use their translation table instead
$Availability_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Running/Full Power'
4 = 'Warning'
5 = 'In Test'
6 = 'Not Applicable'
7 = 'Power Off'
8 = 'Off Line'
9 = 'Off Duty'
10 = 'Degraded'
11 = 'Not Installed'
12 = 'Install Error'
13 = 'Power Save - Unknown'
14 = 'Power Save - Low Power Mode'
15 = 'Power Save - Standby'
16 = 'Power Cycle'
17 = 'Power Save - Warning'
18 = 'Paused'
19 = 'Not Ready'
20 = 'Not Configured'
21 = 'Quiesced'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "Availability", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$Availability = @{
Name = 'Availability'
Expression = {
# property is an array, so process all values
$value = $_.Availability
$Availability_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "Availability". The latter
# is defined by the hashtable in $Availability:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $Availability
# ...or dump content of property Availability:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $Availability |
Select-Object -ExpandProperty Availability
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $Availability_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$Availability_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Running/Full Power'
4 = 'Warning'
5 = 'In Test'
6 = 'Not Applicable'
7 = 'Power Off'
8 = 'Off Line'
9 = 'Off Duty'
10 = 'Degraded'
11 = 'Not Installed'
12 = 'Install Error'
13 = 'Power Save - Unknown'
14 = 'Power Save - Low Power Mode'
15 = 'Power Save - Standby'
16 = 'Power Cycle'
17 = 'Power Save - Warning'
18 = 'Paused'
19 = 'Not Ready'
20 = 'Not Configured'
21 = 'Quiesced'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.Availability
# translate raw value to friendly text:
$friendlyName = $Availability_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "Availability" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "Availability", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "Availability", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$Availability = @{
Name = 'Availability'
Expression = {
# property is an array, so process all values
$value = $_.Availability
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Running/Full Power'}
4 {'Warning'}
5 {'In Test'}
6 {'Not Applicable'}
7 {'Power Off'}
8 {'Off Line'}
9 {'Off Duty'}
10 {'Degraded'}
11 {'Not Installed'}
12 {'Install Error'}
13 {'Power Save - Unknown'}
14 {'Power Save - Low Power Mode'}
15 {'Power Save - Standby'}
16 {'Power Cycle'}
17 {'Power Save - Warning'}
18 {'Paused'}
19 {'Not Ready'}
20 {'Not Configured'}
21 {'Quiesced'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "Availability". The latter is defined
# by the hashtable in $Availability:
Select-Object -Property Caption, $Availability
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumAvailability
{
Other = 1
Unknown = 2
RunningFull_Power = 3
Warning = 4
In_Test = 5
Not_Applicable = 6
Power_Off = 7
Off_Line = 8
Off_Duty = 9
Degraded = 10
Not_Installed = 11
Install_Error = 12
Power_Save_Unknown = 13
Power_Save_Low_Power_Mode = 14
Power_Save_Standby = 15
Power_Cycle = 16
Power_Save_Warning = 17
Paused = 18
Not_Ready = 19
Not_Configured = 20
Quiesced = 21
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.Availability
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **Availability**
[EnumAvailability]$rawValue
# get a comma-separated string:
[EnumAvailability]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumAvailability]
#endregion
Enums must cover all possible values. If Availability returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
Caption
Short description of an object (a one-line string).
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Caption
Characteristics
Defines which functions the processor supports.
This value comes from the Processor Characteristics member of the Processor Information structure in the SMBIOS information.
Windows Server® 2012® R2, Windows® 8.1, Windows Server® 2012, Windows® 8, Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows Server® 2016 and Windows® 10.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Characteristics
ConfigManagerErrorCode
Windows API Configuration Manager error code.
ConfigManagerErrorCode returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$ConfigManagerErrorCode_map = @{
0 = 'This device is working properly.'
1 = 'This device is not configured correctly.'
2 = 'Windows cannot load the driver for this device.'
3 = 'The driver for this device might be corrupted, or your system may be running low on memory or other resources.'
4 = 'This device is not working properly. One of its drivers or your registry might be corrupted.'
5 = 'The driver for this device needs a resource that Windows cannot manage.'
6 = 'The boot configuration for this device conflicts with other devices.'
7 = 'Cannot filter.'
8 = 'The driver loader for the device is missing.'
9 = 'This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly.'
10 = 'This device cannot start.'
11 = 'This device failed.'
12 = 'This device cannot find enough free resources that it can use.'
13 = 'Windows cannot verify this device''s resources.'
14 = 'This device cannot work properly until you restart your computer.'
15 = 'This device is not working properly because there is probably a re-enumeration problem.'
16 = 'Windows cannot identify all the resources this device uses.'
17 = 'This device is asking for an unknown resource type.'
18 = 'Reinstall the drivers for this device.'
19 = 'Failure using the VxD loader.'
20 = 'Your registry might be corrupted.'
21 = 'System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device.'
22 = 'This device is disabled.'
23 = 'System failure: Try changing the driver for this device. If that doesn''t work, see your hardware documentation.'
24 = 'This device is not present, is not working properly, or does not have all its drivers installed.'
25 = 'Windows is still setting up this device.'
26 = 'Windows is still setting up this device.'
27 = 'This device does not have valid log configuration.'
28 = 'The drivers for this device are not installed.'
29 = 'This device is disabled because the firmware of the device did not give it the required resources.'
30 = 'This device is using an Interrupt Request (IRQ) resource that another device is using.'
31 = 'This device is not working properly because Windows cannot load the drivers required for this device.'
}
Use a switch statement
switch([int]$value)
{
0 {'This device is working properly.'}
1 {'This device is not configured correctly.'}
2 {'Windows cannot load the driver for this device.'}
3 {'The driver for this device might be corrupted, or your system may be running low on memory or other resources.'}
4 {'This device is not working properly. One of its drivers or your registry might be corrupted.'}
5 {'The driver for this device needs a resource that Windows cannot manage.'}
6 {'The boot configuration for this device conflicts with other devices.'}
7 {'Cannot filter.'}
8 {'The driver loader for the device is missing.'}
9 {'This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly.'}
10 {'This device cannot start.'}
11 {'This device failed.'}
12 {'This device cannot find enough free resources that it can use.'}
13 {'Windows cannot verify this device''s resources.'}
14 {'This device cannot work properly until you restart your computer.'}
15 {'This device is not working properly because there is probably a re-enumeration problem.'}
16 {'Windows cannot identify all the resources this device uses.'}
17 {'This device is asking for an unknown resource type.'}
18 {'Reinstall the drivers for this device.'}
19 {'Failure using the VxD loader.'}
20 {'Your registry might be corrupted.'}
21 {'System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device.'}
22 {'This device is disabled.'}
23 {'System failure: Try changing the driver for this device. If that doesn''t work, see your hardware documentation.'}
24 {'This device is not present, is not working properly, or does not have all its drivers installed.'}
25 {'Windows is still setting up this device.'}
26 {'Windows is still setting up this device.'}
27 {'This device does not have valid log configuration.'}
28 {'The drivers for this device are not installed.'}
29 {'This device is disabled because the firmware of the device did not give it the required resources.'}
30 {'This device is using an Interrupt Request (IRQ) resource that another device is using.'}
31 {'This device is not working properly because Windows cannot load the drivers required for this device.'}
default {"$value"}
}
Use Enum structure
Enum EnumConfigManagerErrorCode
{
This_device_is_working_properly = 0
This_device_is_not_configured_correctly = 1
Windows_cannot_load_the_driver_for_this_device = 2
The_driver_for_this_device_might_be_corrupted_or_your_system_may_be_running_low_on_memory_or_other_resources = 3
This_device_is_not_working_properly_One_of_its_drivers_or_your_registry_might_be_corrupted = 4
The_driver_for_this_device_needs_a_resource_that_Windows_cannot_manage = 5
The_boot_configuration_for_this_device_conflicts_with_other_devices = 6
Cannot_filter = 7
The_driver_loader_for_the_device_is_missing = 8
This_device_is_not_working_properly_because_the_controlling_firmware_is_reporting_the_resources_for_the_device_incorrectly = 9
This_device_cannot_start = 10
This_device_failed = 11
This_device_cannot_find_enough_free_resources_that_it_can_use = 12
Windows_cannot_verify_this_devices_resources = 13
This_device_cannot_work_properly_until_you_restart_your_computer = 14
This_device_is_not_working_properly_because_there_is_probably_a_re_enumeration_problem = 15
Windows_cannot_identify_all_the_resources_this_device_uses = 16
This_device_is_asking_for_an_unknown_resource_type = 17
Reinstall_the_drivers_for_this_device = 18
Failure_using_the_VxD_loader = 19
Your_registry_might_be_corrupted = 20
System_failure_Try_changing_the_driver_for_this_device_If_that_does_not_work_see_your_hardware_documentation_Windows_is_removing_this_device = 21
This_device_is_disabled = 22
System_failure_Try_changing_the_driver_for_this_device_If_that_doesnt_work_see_your_hardware_documentation = 23
This_device_is_not_present_is_not_working_properly_or_does_not_have_all_its_drivers_installed = 24
Windows_is_still_setting_up_this_device1 = 25
Windows_is_still_setting_up_this_device2 = 26
This_device_does_not_have_valid_log_configuration = 27
The_drivers_for_this_device_are_not_installed = 28
This_device_is_disabled_because_the_firmware_of_the_device_did_not_give_it_the_required_resources = 29
This_device_is_using_an_Interrupt_Request_IRQ_resource_that_another_device_is_using = 30
This_device_is_not_working_properly_because_Windows_cannot_load_the_drivers_required_for_this_device = 31
}
Examples
Use $ConfigManagerErrorCode_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "ConfigManagerErrorCode" to friendly text
Note: to use other properties than "ConfigManagerErrorCode", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "ConfigManagerErrorCode"
# to translate other properties, use their translation table instead
$ConfigManagerErrorCode_map = @{
0 = 'This device is working properly.'
1 = 'This device is not configured correctly.'
2 = 'Windows cannot load the driver for this device.'
3 = 'The driver for this device might be corrupted, or your system may be running low on memory or other resources.'
4 = 'This device is not working properly. One of its drivers or your registry might be corrupted.'
5 = 'The driver for this device needs a resource that Windows cannot manage.'
6 = 'The boot configuration for this device conflicts with other devices.'
7 = 'Cannot filter.'
8 = 'The driver loader for the device is missing.'
9 = 'This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly.'
10 = 'This device cannot start.'
11 = 'This device failed.'
12 = 'This device cannot find enough free resources that it can use.'
13 = 'Windows cannot verify this device''s resources.'
14 = 'This device cannot work properly until you restart your computer.'
15 = 'This device is not working properly because there is probably a re-enumeration problem.'
16 = 'Windows cannot identify all the resources this device uses.'
17 = 'This device is asking for an unknown resource type.'
18 = 'Reinstall the drivers for this device.'
19 = 'Failure using the VxD loader.'
20 = 'Your registry might be corrupted.'
21 = 'System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device.'
22 = 'This device is disabled.'
23 = 'System failure: Try changing the driver for this device. If that doesn''t work, see your hardware documentation.'
24 = 'This device is not present, is not working properly, or does not have all its drivers installed.'
25 = 'Windows is still setting up this device.'
26 = 'Windows is still setting up this device.'
27 = 'This device does not have valid log configuration.'
28 = 'The drivers for this device are not installed.'
29 = 'This device is disabled because the firmware of the device did not give it the required resources.'
30 = 'This device is using an Interrupt Request (IRQ) resource that another device is using.'
31 = 'This device is not working properly because Windows cannot load the drivers required for this device.'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "ConfigManagerErrorCode", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$ConfigManagerErrorCode = @{
Name = 'ConfigManagerErrorCode'
Expression = {
# property is an array, so process all values
$value = $_.ConfigManagerErrorCode
$ConfigManagerErrorCode_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "ConfigManagerErrorCode". The latter
# is defined by the hashtable in $ConfigManagerErrorCode:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $ConfigManagerErrorCode
# ...or dump content of property ConfigManagerErrorCode:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $ConfigManagerErrorCode |
Select-Object -ExpandProperty ConfigManagerErrorCode
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $ConfigManagerErrorCode_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$ConfigManagerErrorCode_map = @{
0 = 'This device is working properly.'
1 = 'This device is not configured correctly.'
2 = 'Windows cannot load the driver for this device.'
3 = 'The driver for this device might be corrupted, or your system may be running low on memory or other resources.'
4 = 'This device is not working properly. One of its drivers or your registry might be corrupted.'
5 = 'The driver for this device needs a resource that Windows cannot manage.'
6 = 'The boot configuration for this device conflicts with other devices.'
7 = 'Cannot filter.'
8 = 'The driver loader for the device is missing.'
9 = 'This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly.'
10 = 'This device cannot start.'
11 = 'This device failed.'
12 = 'This device cannot find enough free resources that it can use.'
13 = 'Windows cannot verify this device''s resources.'
14 = 'This device cannot work properly until you restart your computer.'
15 = 'This device is not working properly because there is probably a re-enumeration problem.'
16 = 'Windows cannot identify all the resources this device uses.'
17 = 'This device is asking for an unknown resource type.'
18 = 'Reinstall the drivers for this device.'
19 = 'Failure using the VxD loader.'
20 = 'Your registry might be corrupted.'
21 = 'System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device.'
22 = 'This device is disabled.'
23 = 'System failure: Try changing the driver for this device. If that doesn''t work, see your hardware documentation.'
24 = 'This device is not present, is not working properly, or does not have all its drivers installed.'
25 = 'Windows is still setting up this device.'
26 = 'Windows is still setting up this device.'
27 = 'This device does not have valid log configuration.'
28 = 'The drivers for this device are not installed.'
29 = 'This device is disabled because the firmware of the device did not give it the required resources.'
30 = 'This device is using an Interrupt Request (IRQ) resource that another device is using.'
31 = 'This device is not working properly because Windows cannot load the drivers required for this device.'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.ConfigManagerErrorCode
# translate raw value to friendly text:
$friendlyName = $ConfigManagerErrorCode_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "ConfigManagerErrorCode" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "ConfigManagerErrorCode", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "ConfigManagerErrorCode", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$ConfigManagerErrorCode = @{
Name = 'ConfigManagerErrorCode'
Expression = {
# property is an array, so process all values
$value = $_.ConfigManagerErrorCode
switch([int]$value)
{
0 {'This device is working properly.'}
1 {'This device is not configured correctly.'}
2 {'Windows cannot load the driver for this device.'}
3 {'The driver for this device might be corrupted, or your system may be running low on memory or other resources.'}
4 {'This device is not working properly. One of its drivers or your registry might be corrupted.'}
5 {'The driver for this device needs a resource that Windows cannot manage.'}
6 {'The boot configuration for this device conflicts with other devices.'}
7 {'Cannot filter.'}
8 {'The driver loader for the device is missing.'}
9 {'This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly.'}
10 {'This device cannot start.'}
11 {'This device failed.'}
12 {'This device cannot find enough free resources that it can use.'}
13 {'Windows cannot verify this device''s resources.'}
14 {'This device cannot work properly until you restart your computer.'}
15 {'This device is not working properly because there is probably a re-enumeration problem.'}
16 {'Windows cannot identify all the resources this device uses.'}
17 {'This device is asking for an unknown resource type.'}
18 {'Reinstall the drivers for this device.'}
19 {'Failure using the VxD loader.'}
20 {'Your registry might be corrupted.'}
21 {'System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device.'}
22 {'This device is disabled.'}
23 {'System failure: Try changing the driver for this device. If that doesn''t work, see your hardware documentation.'}
24 {'This device is not present, is not working properly, or does not have all its drivers installed.'}
25 {'Windows is still setting up this device.'}
26 {'Windows is still setting up this device.'}
27 {'This device does not have valid log configuration.'}
28 {'The drivers for this device are not installed.'}
29 {'This device is disabled because the firmware of the device did not give it the required resources.'}
30 {'This device is using an Interrupt Request (IRQ) resource that another device is using.'}
31 {'This device is not working properly because Windows cannot load the drivers required for this device.'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "ConfigManagerErrorCode". The latter is defined
# by the hashtable in $ConfigManagerErrorCode:
Select-Object -Property Caption, $ConfigManagerErrorCode
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumConfigManagerErrorCode
{
This_device_is_working_properly = 0
This_device_is_not_configured_correctly = 1
Windows_cannot_load_the_driver_for_this_device = 2
The_driver_for_this_device_might_be_corrupted_or_your_system_may_be_running_low_on_memory_or_other_resources = 3
This_device_is_not_working_properly_One_of_its_drivers_or_your_registry_might_be_corrupted = 4
The_driver_for_this_device_needs_a_resource_that_Windows_cannot_manage = 5
The_boot_configuration_for_this_device_conflicts_with_other_devices = 6
Cannot_filter = 7
The_driver_loader_for_the_device_is_missing = 8
This_device_is_not_working_properly_because_the_controlling_firmware_is_reporting_the_resources_for_the_device_incorrectly = 9
This_device_cannot_start = 10
This_device_failed = 11
This_device_cannot_find_enough_free_resources_that_it_can_use = 12
Windows_cannot_verify_this_devices_resources = 13
This_device_cannot_work_properly_until_you_restart_your_computer = 14
This_device_is_not_working_properly_because_there_is_probably_a_re_enumeration_problem = 15
Windows_cannot_identify_all_the_resources_this_device_uses = 16
This_device_is_asking_for_an_unknown_resource_type = 17
Reinstall_the_drivers_for_this_device = 18
Failure_using_the_VxD_loader = 19
Your_registry_might_be_corrupted = 20
System_failure_Try_changing_the_driver_for_this_device_If_that_does_not_work_see_your_hardware_documentation_Windows_is_removing_this_device = 21
This_device_is_disabled = 22
System_failure_Try_changing_the_driver_for_this_device_If_that_doesnt_work_see_your_hardware_documentation = 23
This_device_is_not_present_is_not_working_properly_or_does_not_have_all_its_drivers_installed = 24
Windows_is_still_setting_up_this_device1 = 25
Windows_is_still_setting_up_this_device2 = 26
This_device_does_not_have_valid_log_configuration = 27
The_drivers_for_this_device_are_not_installed = 28
This_device_is_disabled_because_the_firmware_of_the_device_did_not_give_it_the_required_resources = 29
This_device_is_using_an_Interrupt_Request_IRQ_resource_that_another_device_is_using = 30
This_device_is_not_working_properly_because_Windows_cannot_load_the_drivers_required_for_this_device = 31
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.ConfigManagerErrorCode
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **ConfigManagerErrorCode**
[EnumConfigManagerErrorCode]$rawValue
# get a comma-separated string:
[EnumConfigManagerErrorCode]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumConfigManagerErrorCode]
#endregion
Enums must cover all possible values. If ConfigManagerErrorCode returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
ConfigManagerUserConfig
If TRUE, the device is using a configuration that the user defines.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, ConfigManagerUserConfig
CpuStatus
Current status of the processor. Status changes indicate processor usage, but not the physical condition of the processor.
This value comes from the Status member of the Processor Information structure in the SMBIOS information.
CpuStatus returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$CpuStatus_map = @{
0 = 'Unknown'
1 = 'CPU Enabled'
2 = 'CPU Disabled by User via BIOS Setup'
3 = 'CPU Disabled By BIOS (POST Error)'
4 = 'CPU is Idle'
5 = 'Reserved'
6 = 'Reserved'
7 = 'Other'
}
Use a switch statement
switch([int]$value)
{
0 {'Unknown'}
1 {'CPU Enabled'}
2 {'CPU Disabled by User via BIOS Setup'}
3 {'CPU Disabled By BIOS (POST Error)'}
4 {'CPU is Idle'}
5 {'Reserved'}
6 {'Reserved'}
7 {'Other'}
default {"$value"}
}
Use Enum structure
Enum EnumCpuStatus
{
Unknown = 0
CPU_Enabled = 1
CPU_Disabled_by_User_via_BIOS_Setup = 2
CPU_Disabled_By_BIOS_POST_Error = 3
CPU_is_Idle = 4
Reserved1 = 5
Reserved2 = 6
Other = 7
}
Examples
Use $CpuStatus_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "CpuStatus" to friendly text
Note: to use other properties than "CpuStatus", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "CpuStatus"
# to translate other properties, use their translation table instead
$CpuStatus_map = @{
0 = 'Unknown'
1 = 'CPU Enabled'
2 = 'CPU Disabled by User via BIOS Setup'
3 = 'CPU Disabled By BIOS (POST Error)'
4 = 'CPU is Idle'
5 = 'Reserved'
6 = 'Reserved'
7 = 'Other'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "CpuStatus", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$CpuStatus = @{
Name = 'CpuStatus'
Expression = {
# property is an array, so process all values
$value = $_.CpuStatus
$CpuStatus_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "CpuStatus". The latter
# is defined by the hashtable in $CpuStatus:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $CpuStatus
# ...or dump content of property CpuStatus:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $CpuStatus |
Select-Object -ExpandProperty CpuStatus
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $CpuStatus_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$CpuStatus_map = @{
0 = 'Unknown'
1 = 'CPU Enabled'
2 = 'CPU Disabled by User via BIOS Setup'
3 = 'CPU Disabled By BIOS (POST Error)'
4 = 'CPU is Idle'
5 = 'Reserved'
6 = 'Reserved'
7 = 'Other'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.CpuStatus
# translate raw value to friendly text:
$friendlyName = $CpuStatus_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "CpuStatus" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "CpuStatus", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "CpuStatus", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$CpuStatus = @{
Name = 'CpuStatus'
Expression = {
# property is an array, so process all values
$value = $_.CpuStatus
switch([int]$value)
{
0 {'Unknown'}
1 {'CPU Enabled'}
2 {'CPU Disabled by User via BIOS Setup'}
3 {'CPU Disabled By BIOS (POST Error)'}
4 {'CPU is Idle'}
5 {'Reserved'}
6 {'Reserved'}
7 {'Other'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "CpuStatus". The latter is defined
# by the hashtable in $CpuStatus:
Select-Object -Property Caption, $CpuStatus
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumCpuStatus
{
Unknown = 0
CPU_Enabled = 1
CPU_Disabled_by_User_via_BIOS_Setup = 2
CPU_Disabled_By_BIOS_POST_Error = 3
CPU_is_Idle = 4
Reserved1 = 5
Reserved2 = 6
Other = 7
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.CpuStatus
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **CpuStatus**
[EnumCpuStatus]$rawValue
# get a comma-separated string:
[EnumCpuStatus]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumCpuStatus]
#endregion
Enums must cover all possible values. If CpuStatus returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
CreationClassName
Name of the first concrete class that appears in the inheritance chain used to create an instance. When used with the other key properties of the class, the property allows all instances of this class and its subclasses to be identified uniquely.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, CreationClassName
CurrentClockSpeed
Current speed of the processor, in MHz.
This value comes from the Current Speed member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, CurrentClockSpeed
CurrentVoltage
Voltage of the processor. If the eighth bit is set, bits 0-6 contain the voltage multiplied by 10. If the eighth bit is not set, then the bit setting in VoltageCaps represents the voltage value. CurrentVoltage is only set when SMBIOS designates a voltage value.
Example: Value for a processor voltage of 1.8 volts is 0x12 (1.8 x 10).
This value comes from the Voltage member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, CurrentVoltage
DataWidth
On a 32-bit processor, the value is 32 and on a 64-bit processor it is 64.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, DataWidth
Description
Description of the object.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Description
DeviceID
Unique identifier of a processor on the system.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID
ErrorCleared
If TRUE, the error reported in LastErrorCode is clear.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, ErrorCleared
ErrorDescription
More information about the error recorded in LastErrorCode, and information about corrective actions that can be taken.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, ErrorDescription
ExtClock
External clock frequency, in MHz. If the frequency is unknown, this property is set to NULL.
This value comes from the External Clock member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, ExtClock
Family
Processor family type.
This value comes from the Processor Information structure in the SMBIOS version information. For SMBIOS versions 2.0 thru 2.5 the value comes from the Processor Family member. For SMBIOS version 2.6+ the value comes from the Processor Family 2 member.
Family returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$Family_map = @{
1 = 'Other'
2 = 'Unknown'
3 = '8086'
4 = '80286'
5 = '80386'
6 = '80486'
7 = '8087'
8 = '80287'
9 = '80387'
10 = '80487'
11 = 'Pentium(R) brand'
12 = 'Pentium(R) Pro'
13 = 'Pentium(R) II'
14 = 'Pentium(R) processor with MMX(TM) technology'
15 = 'Celeron(TM)'
16 = 'Pentium(R) II Xeon(TM)'
17 = 'Pentium(R) III'
18 = 'M1 Family'
19 = 'M2 Family'
24 = 'K5 Family'
25 = 'K6 Family'
26 = 'K6-2'
27 = 'K6-3'
28 = 'AMD Athlon(TM) Processor Family'
29 = 'AMD(R) Duron(TM) Processor'
30 = 'AMD29000 Family'
31 = 'K6-2+'
32 = 'Power PC Family'
33 = 'Power PC 601'
34 = 'Power PC 603'
35 = 'Power PC 603+'
36 = 'Power PC 604'
37 = 'Power PC 620'
38 = 'Power PC X704'
39 = 'Power PC 750'
48 = 'Alpha Family'
49 = 'Alpha 21064'
50 = 'Alpha 21066'
51 = 'Alpha 21164'
52 = 'Alpha 21164PC'
53 = 'Alpha 21164a'
54 = 'Alpha 21264'
55 = 'Alpha 21364'
64 = 'MIPS Family'
65 = 'MIPS R4000'
66 = 'MIPS R4200'
67 = 'MIPS R4400'
68 = 'MIPS R4600'
69 = 'MIPS R10000'
80 = 'SPARC Family'
81 = 'SuperSPARC'
82 = 'microSPARC II'
83 = 'microSPARC IIep'
84 = 'UltraSPARC'
85 = 'UltraSPARC II'
86 = 'UltraSPARC IIi'
87 = 'UltraSPARC III'
88 = 'UltraSPARC IIIi'
96 = '68040'
97 = '68xxx Family'
98 = '68000'
99 = '68010'
100 = '68020'
101 = '68030'
112 = 'Hobbit Family'
120 = 'Crusoe(TM) TM5000 Family'
121 = 'Crusoe(TM) TM3000 Family'
122 = 'Efficeon(TM) TM8000 Family'
128 = 'Weitek'
130 = 'Itanium(TM) Processor'
131 = 'AMD Athlon(TM) 64 Processor Family'
132 = 'AMD Opteron(TM) Family'
144 = 'PA-RISC Family'
145 = 'PA-RISC 8500'
146 = 'PA-RISC 8000'
147 = 'PA-RISC 7300LC'
148 = 'PA-RISC 7200'
149 = 'PA-RISC 7100LC'
150 = 'PA-RISC 7100'
160 = 'V30 Family'
176 = 'Pentium(R) III Xeon(TM)'
177 = 'Pentium(R) III Processor with Intel(R) SpeedStep(TM) Technology'
178 = 'Pentium(R) 4'
179 = 'Intel(R) Xeon(TM)'
180 = 'AS400 Family'
181 = 'Intel(R) Xeon(TM) processor MP'
182 = 'AMD AthlonXP(TM) Family'
183 = 'AMD AthlonMP(TM) Family'
184 = 'Intel(R) Itanium(R) 2'
185 = 'Intel Pentium M Processor'
190 = 'K7'
200 = 'IBM390 Family'
201 = 'G4'
202 = 'G5'
203 = 'G6'
204 = 'z/Architecture base'
250 = 'i860'
251 = 'i960'
260 = 'SH-3'
261 = 'SH-4'
280 = 'ARM'
281 = 'StrongARM'
300 = '6x86'
301 = 'MediaGX'
302 = 'MII'
320 = 'WinChip'
350 = 'DSP'
500 = 'Video Processor'
}
Use a switch statement
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'8086'}
4 {'80286'}
5 {'80386'}
6 {'80486'}
7 {'8087'}
8 {'80287'}
9 {'80387'}
10 {'80487'}
11 {'Pentium(R) brand'}
12 {'Pentium(R) Pro'}
13 {'Pentium(R) II'}
14 {'Pentium(R) processor with MMX(TM) technology'}
15 {'Celeron(TM)'}
16 {'Pentium(R) II Xeon(TM)'}
17 {'Pentium(R) III'}
18 {'M1 Family'}
19 {'M2 Family'}
24 {'K5 Family'}
25 {'K6 Family'}
26 {'K6-2'}
27 {'K6-3'}
28 {'AMD Athlon(TM) Processor Family'}
29 {'AMD(R) Duron(TM) Processor'}
30 {'AMD29000 Family'}
31 {'K6-2+'}
32 {'Power PC Family'}
33 {'Power PC 601'}
34 {'Power PC 603'}
35 {'Power PC 603+'}
36 {'Power PC 604'}
37 {'Power PC 620'}
38 {'Power PC X704'}
39 {'Power PC 750'}
48 {'Alpha Family'}
49 {'Alpha 21064'}
50 {'Alpha 21066'}
51 {'Alpha 21164'}
52 {'Alpha 21164PC'}
53 {'Alpha 21164a'}
54 {'Alpha 21264'}
55 {'Alpha 21364'}
64 {'MIPS Family'}
65 {'MIPS R4000'}
66 {'MIPS R4200'}
67 {'MIPS R4400'}
68 {'MIPS R4600'}
69 {'MIPS R10000'}
80 {'SPARC Family'}
81 {'SuperSPARC'}
82 {'microSPARC II'}
83 {'microSPARC IIep'}
84 {'UltraSPARC'}
85 {'UltraSPARC II'}
86 {'UltraSPARC IIi'}
87 {'UltraSPARC III'}
88 {'UltraSPARC IIIi'}
96 {'68040'}
97 {'68xxx Family'}
98 {'68000'}
99 {'68010'}
100 {'68020'}
101 {'68030'}
112 {'Hobbit Family'}
120 {'Crusoe(TM) TM5000 Family'}
121 {'Crusoe(TM) TM3000 Family'}
122 {'Efficeon(TM) TM8000 Family'}
128 {'Weitek'}
130 {'Itanium(TM) Processor'}
131 {'AMD Athlon(TM) 64 Processor Family'}
132 {'AMD Opteron(TM) Family'}
144 {'PA-RISC Family'}
145 {'PA-RISC 8500'}
146 {'PA-RISC 8000'}
147 {'PA-RISC 7300LC'}
148 {'PA-RISC 7200'}
149 {'PA-RISC 7100LC'}
150 {'PA-RISC 7100'}
160 {'V30 Family'}
176 {'Pentium(R) III Xeon(TM)'}
177 {'Pentium(R) III Processor with Intel(R) SpeedStep(TM) Technology'}
178 {'Pentium(R) 4'}
179 {'Intel(R) Xeon(TM)'}
180 {'AS400 Family'}
181 {'Intel(R) Xeon(TM) processor MP'}
182 {'AMD AthlonXP(TM) Family'}
183 {'AMD AthlonMP(TM) Family'}
184 {'Intel(R) Itanium(R) 2'}
185 {'Intel Pentium M Processor'}
190 {'K7'}
200 {'IBM390 Family'}
201 {'G4'}
202 {'G5'}
203 {'G6'}
204 {'z/Architecture base'}
250 {'i860'}
251 {'i960'}
260 {'SH-3'}
261 {'SH-4'}
280 {'ARM'}
281 {'StrongARM'}
300 {'6x86'}
301 {'MediaGX'}
302 {'MII'}
320 {'WinChip'}
350 {'DSP'}
500 {'Video Processor'}
default {"$value"}
}
Use Enum structure
Enum EnumFamily
{
Other = 1
Unknown = 2
_8086 = 3
_80286 = 4
_80386 = 5
_80486 = 6
_8087 = 7
_80287 = 8
_80387 = 9
_80487 = 10
PentiumR_brand = 11
PentiumR_Pro = 12
PentiumR_II = 13
PentiumR_processor_with_MMXTM_technology = 14
CeleronTM = 15
PentiumR_II_XeonTM = 16
PentiumR_III = 17
M1_Family = 18
M2_Family = 19
K5_Family = 24
K6_Family = 25
K6_21 = 26
K6_3 = 27
AMD_AthlonTM_Processor_Family = 28
AMDR_DuronTM_Processor = 29
AMD29000_Family = 30
K6_22 = 31
Power_PC_Family = 32
Power_PC_601 = 33
Power_PC_6031 = 34
Power_PC_6032 = 35
Power_PC_604 = 36
Power_PC_620 = 37
Power_PC_X704 = 38
Power_PC_750 = 39
Alpha_Family = 48
Alpha_21064 = 49
Alpha_21066 = 50
Alpha_21164 = 51
Alpha_21164PC = 52
Alpha_21164a = 53
Alpha_21264 = 54
Alpha_21364 = 55
MIPS_Family = 64
MIPS_R4000 = 65
MIPS_R4200 = 66
MIPS_R4400 = 67
MIPS_R4600 = 68
MIPS_R10000 = 69
SPARC_Family = 80
SuperSPARC = 81
microSPARC_II = 82
microSPARC_IIep = 83
UltraSPARC = 84
UltraSPARC_II = 85
UltraSPARC_IIi1 = 86
UltraSPARC_III2 = 87
UltraSPARC_IIIi = 88
_68040 = 96
_68xxx_Family = 97
_68000 = 98
_68010 = 99
_68020 = 100
_68030 = 101
Hobbit_Family = 112
CrusoeTM_TM5000_Family = 120
CrusoeTM_TM3000_Family = 121
EfficeonTM_TM8000_Family = 122
Weitek = 128
ItaniumTM_Processor = 130
AMD_AthlonTM_64_Processor_Family = 131
AMD_OpteronTM_Family = 132
PA_RISC_Family = 144
PA_RISC_8500 = 145
PA_RISC_8000 = 146
PA_RISC_7300LC = 147
PA_RISC_7200 = 148
PA_RISC_7100LC = 149
PA_RISC_7100 = 150
V30_Family = 160
PentiumR_III_XeonTM = 176
PentiumR_III_Processor_with_IntelR_SpeedStepTM_Technology = 177
PentiumR_4 = 178
IntelR_XeonTM = 179
AS400_Family = 180
IntelR_XeonTM_processor_MP = 181
AMD_AthlonXPTM_Family = 182
AMD_AthlonMPTM_Family = 183
IntelR_ItaniumR_2 = 184
Intel_Pentium_M_Processor = 185
K7 = 190
IBM390_Family = 200
G4 = 201
G5 = 202
G6 = 203
zArchitecture_base = 204
i860 = 250
i960 = 251
SH_3 = 260
SH_4 = 261
ARM = 280
StrongARM = 281
_6x86 = 300
MediaGX = 301
MII = 302
WinChip = 320
DSP = 350
Video_Processor = 500
}
Examples
Use $Family_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "Family" to friendly text
Note: to use other properties than "Family", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Family"
# to translate other properties, use their translation table instead
$Family_map = @{
1 = 'Other'
2 = 'Unknown'
3 = '8086'
4 = '80286'
5 = '80386'
6 = '80486'
7 = '8087'
8 = '80287'
9 = '80387'
10 = '80487'
11 = 'Pentium(R) brand'
12 = 'Pentium(R) Pro'
13 = 'Pentium(R) II'
14 = 'Pentium(R) processor with MMX(TM) technology'
15 = 'Celeron(TM)'
16 = 'Pentium(R) II Xeon(TM)'
17 = 'Pentium(R) III'
18 = 'M1 Family'
19 = 'M2 Family'
24 = 'K5 Family'
25 = 'K6 Family'
26 = 'K6-2'
27 = 'K6-3'
28 = 'AMD Athlon(TM) Processor Family'
29 = 'AMD(R) Duron(TM) Processor'
30 = 'AMD29000 Family'
31 = 'K6-2+'
32 = 'Power PC Family'
33 = 'Power PC 601'
34 = 'Power PC 603'
35 = 'Power PC 603+'
36 = 'Power PC 604'
37 = 'Power PC 620'
38 = 'Power PC X704'
39 = 'Power PC 750'
48 = 'Alpha Family'
49 = 'Alpha 21064'
50 = 'Alpha 21066'
51 = 'Alpha 21164'
52 = 'Alpha 21164PC'
53 = 'Alpha 21164a'
54 = 'Alpha 21264'
55 = 'Alpha 21364'
64 = 'MIPS Family'
65 = 'MIPS R4000'
66 = 'MIPS R4200'
67 = 'MIPS R4400'
68 = 'MIPS R4600'
69 = 'MIPS R10000'
80 = 'SPARC Family'
81 = 'SuperSPARC'
82 = 'microSPARC II'
83 = 'microSPARC IIep'
84 = 'UltraSPARC'
85 = 'UltraSPARC II'
86 = 'UltraSPARC IIi'
87 = 'UltraSPARC III'
88 = 'UltraSPARC IIIi'
96 = '68040'
97 = '68xxx Family'
98 = '68000'
99 = '68010'
100 = '68020'
101 = '68030'
112 = 'Hobbit Family'
120 = 'Crusoe(TM) TM5000 Family'
121 = 'Crusoe(TM) TM3000 Family'
122 = 'Efficeon(TM) TM8000 Family'
128 = 'Weitek'
130 = 'Itanium(TM) Processor'
131 = 'AMD Athlon(TM) 64 Processor Family'
132 = 'AMD Opteron(TM) Family'
144 = 'PA-RISC Family'
145 = 'PA-RISC 8500'
146 = 'PA-RISC 8000'
147 = 'PA-RISC 7300LC'
148 = 'PA-RISC 7200'
149 = 'PA-RISC 7100LC'
150 = 'PA-RISC 7100'
160 = 'V30 Family'
176 = 'Pentium(R) III Xeon(TM)'
177 = 'Pentium(R) III Processor with Intel(R) SpeedStep(TM) Technology'
178 = 'Pentium(R) 4'
179 = 'Intel(R) Xeon(TM)'
180 = 'AS400 Family'
181 = 'Intel(R) Xeon(TM) processor MP'
182 = 'AMD AthlonXP(TM) Family'
183 = 'AMD AthlonMP(TM) Family'
184 = 'Intel(R) Itanium(R) 2'
185 = 'Intel Pentium M Processor'
190 = 'K7'
200 = 'IBM390 Family'
201 = 'G4'
202 = 'G5'
203 = 'G6'
204 = 'z/Architecture base'
250 = 'i860'
251 = 'i960'
260 = 'SH-3'
261 = 'SH-4'
280 = 'ARM'
281 = 'StrongARM'
300 = '6x86'
301 = 'MediaGX'
302 = 'MII'
320 = 'WinChip'
350 = 'DSP'
500 = 'Video Processor'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "Family", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$Family = @{
Name = 'Family'
Expression = {
# property is an array, so process all values
$value = $_.Family
$Family_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "Family". The latter
# is defined by the hashtable in $Family:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $Family
# ...or dump content of property Family:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $Family |
Select-Object -ExpandProperty Family
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $Family_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$Family_map = @{
1 = 'Other'
2 = 'Unknown'
3 = '8086'
4 = '80286'
5 = '80386'
6 = '80486'
7 = '8087'
8 = '80287'
9 = '80387'
10 = '80487'
11 = 'Pentium(R) brand'
12 = 'Pentium(R) Pro'
13 = 'Pentium(R) II'
14 = 'Pentium(R) processor with MMX(TM) technology'
15 = 'Celeron(TM)'
16 = 'Pentium(R) II Xeon(TM)'
17 = 'Pentium(R) III'
18 = 'M1 Family'
19 = 'M2 Family'
24 = 'K5 Family'
25 = 'K6 Family'
26 = 'K6-2'
27 = 'K6-3'
28 = 'AMD Athlon(TM) Processor Family'
29 = 'AMD(R) Duron(TM) Processor'
30 = 'AMD29000 Family'
31 = 'K6-2+'
32 = 'Power PC Family'
33 = 'Power PC 601'
34 = 'Power PC 603'
35 = 'Power PC 603+'
36 = 'Power PC 604'
37 = 'Power PC 620'
38 = 'Power PC X704'
39 = 'Power PC 750'
48 = 'Alpha Family'
49 = 'Alpha 21064'
50 = 'Alpha 21066'
51 = 'Alpha 21164'
52 = 'Alpha 21164PC'
53 = 'Alpha 21164a'
54 = 'Alpha 21264'
55 = 'Alpha 21364'
64 = 'MIPS Family'
65 = 'MIPS R4000'
66 = 'MIPS R4200'
67 = 'MIPS R4400'
68 = 'MIPS R4600'
69 = 'MIPS R10000'
80 = 'SPARC Family'
81 = 'SuperSPARC'
82 = 'microSPARC II'
83 = 'microSPARC IIep'
84 = 'UltraSPARC'
85 = 'UltraSPARC II'
86 = 'UltraSPARC IIi'
87 = 'UltraSPARC III'
88 = 'UltraSPARC IIIi'
96 = '68040'
97 = '68xxx Family'
98 = '68000'
99 = '68010'
100 = '68020'
101 = '68030'
112 = 'Hobbit Family'
120 = 'Crusoe(TM) TM5000 Family'
121 = 'Crusoe(TM) TM3000 Family'
122 = 'Efficeon(TM) TM8000 Family'
128 = 'Weitek'
130 = 'Itanium(TM) Processor'
131 = 'AMD Athlon(TM) 64 Processor Family'
132 = 'AMD Opteron(TM) Family'
144 = 'PA-RISC Family'
145 = 'PA-RISC 8500'
146 = 'PA-RISC 8000'
147 = 'PA-RISC 7300LC'
148 = 'PA-RISC 7200'
149 = 'PA-RISC 7100LC'
150 = 'PA-RISC 7100'
160 = 'V30 Family'
176 = 'Pentium(R) III Xeon(TM)'
177 = 'Pentium(R) III Processor with Intel(R) SpeedStep(TM) Technology'
178 = 'Pentium(R) 4'
179 = 'Intel(R) Xeon(TM)'
180 = 'AS400 Family'
181 = 'Intel(R) Xeon(TM) processor MP'
182 = 'AMD AthlonXP(TM) Family'
183 = 'AMD AthlonMP(TM) Family'
184 = 'Intel(R) Itanium(R) 2'
185 = 'Intel Pentium M Processor'
190 = 'K7'
200 = 'IBM390 Family'
201 = 'G4'
202 = 'G5'
203 = 'G6'
204 = 'z/Architecture base'
250 = 'i860'
251 = 'i960'
260 = 'SH-3'
261 = 'SH-4'
280 = 'ARM'
281 = 'StrongARM'
300 = '6x86'
301 = 'MediaGX'
302 = 'MII'
320 = 'WinChip'
350 = 'DSP'
500 = 'Video Processor'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.Family
# translate raw value to friendly text:
$friendlyName = $Family_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "Family" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "Family", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "Family", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$Family = @{
Name = 'Family'
Expression = {
# property is an array, so process all values
$value = $_.Family
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'8086'}
4 {'80286'}
5 {'80386'}
6 {'80486'}
7 {'8087'}
8 {'80287'}
9 {'80387'}
10 {'80487'}
11 {'Pentium(R) brand'}
12 {'Pentium(R) Pro'}
13 {'Pentium(R) II'}
14 {'Pentium(R) processor with MMX(TM) technology'}
15 {'Celeron(TM)'}
16 {'Pentium(R) II Xeon(TM)'}
17 {'Pentium(R) III'}
18 {'M1 Family'}
19 {'M2 Family'}
24 {'K5 Family'}
25 {'K6 Family'}
26 {'K6-2'}
27 {'K6-3'}
28 {'AMD Athlon(TM) Processor Family'}
29 {'AMD(R) Duron(TM) Processor'}
30 {'AMD29000 Family'}
31 {'K6-2+'}
32 {'Power PC Family'}
33 {'Power PC 601'}
34 {'Power PC 603'}
35 {'Power PC 603+'}
36 {'Power PC 604'}
37 {'Power PC 620'}
38 {'Power PC X704'}
39 {'Power PC 750'}
48 {'Alpha Family'}
49 {'Alpha 21064'}
50 {'Alpha 21066'}
51 {'Alpha 21164'}
52 {'Alpha 21164PC'}
53 {'Alpha 21164a'}
54 {'Alpha 21264'}
55 {'Alpha 21364'}
64 {'MIPS Family'}
65 {'MIPS R4000'}
66 {'MIPS R4200'}
67 {'MIPS R4400'}
68 {'MIPS R4600'}
69 {'MIPS R10000'}
80 {'SPARC Family'}
81 {'SuperSPARC'}
82 {'microSPARC II'}
83 {'microSPARC IIep'}
84 {'UltraSPARC'}
85 {'UltraSPARC II'}
86 {'UltraSPARC IIi'}
87 {'UltraSPARC III'}
88 {'UltraSPARC IIIi'}
96 {'68040'}
97 {'68xxx Family'}
98 {'68000'}
99 {'68010'}
100 {'68020'}
101 {'68030'}
112 {'Hobbit Family'}
120 {'Crusoe(TM) TM5000 Family'}
121 {'Crusoe(TM) TM3000 Family'}
122 {'Efficeon(TM) TM8000 Family'}
128 {'Weitek'}
130 {'Itanium(TM) Processor'}
131 {'AMD Athlon(TM) 64 Processor Family'}
132 {'AMD Opteron(TM) Family'}
144 {'PA-RISC Family'}
145 {'PA-RISC 8500'}
146 {'PA-RISC 8000'}
147 {'PA-RISC 7300LC'}
148 {'PA-RISC 7200'}
149 {'PA-RISC 7100LC'}
150 {'PA-RISC 7100'}
160 {'V30 Family'}
176 {'Pentium(R) III Xeon(TM)'}
177 {'Pentium(R) III Processor with Intel(R) SpeedStep(TM) Technology'}
178 {'Pentium(R) 4'}
179 {'Intel(R) Xeon(TM)'}
180 {'AS400 Family'}
181 {'Intel(R) Xeon(TM) processor MP'}
182 {'AMD AthlonXP(TM) Family'}
183 {'AMD AthlonMP(TM) Family'}
184 {'Intel(R) Itanium(R) 2'}
185 {'Intel Pentium M Processor'}
190 {'K7'}
200 {'IBM390 Family'}
201 {'G4'}
202 {'G5'}
203 {'G6'}
204 {'z/Architecture base'}
250 {'i860'}
251 {'i960'}
260 {'SH-3'}
261 {'SH-4'}
280 {'ARM'}
281 {'StrongARM'}
300 {'6x86'}
301 {'MediaGX'}
302 {'MII'}
320 {'WinChip'}
350 {'DSP'}
500 {'Video Processor'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "Family". The latter is defined
# by the hashtable in $Family:
Select-Object -Property Caption, $Family
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumFamily
{
Other = 1
Unknown = 2
_8086 = 3
_80286 = 4
_80386 = 5
_80486 = 6
_8087 = 7
_80287 = 8
_80387 = 9
_80487 = 10
PentiumR_brand = 11
PentiumR_Pro = 12
PentiumR_II = 13
PentiumR_processor_with_MMXTM_technology = 14
CeleronTM = 15
PentiumR_II_XeonTM = 16
PentiumR_III = 17
M1_Family = 18
M2_Family = 19
K5_Family = 24
K6_Family = 25
K6_21 = 26
K6_3 = 27
AMD_AthlonTM_Processor_Family = 28
AMDR_DuronTM_Processor = 29
AMD29000_Family = 30
K6_22 = 31
Power_PC_Family = 32
Power_PC_601 = 33
Power_PC_6031 = 34
Power_PC_6032 = 35
Power_PC_604 = 36
Power_PC_620 = 37
Power_PC_X704 = 38
Power_PC_750 = 39
Alpha_Family = 48
Alpha_21064 = 49
Alpha_21066 = 50
Alpha_21164 = 51
Alpha_21164PC = 52
Alpha_21164a = 53
Alpha_21264 = 54
Alpha_21364 = 55
MIPS_Family = 64
MIPS_R4000 = 65
MIPS_R4200 = 66
MIPS_R4400 = 67
MIPS_R4600 = 68
MIPS_R10000 = 69
SPARC_Family = 80
SuperSPARC = 81
microSPARC_II = 82
microSPARC_IIep = 83
UltraSPARC = 84
UltraSPARC_II = 85
UltraSPARC_IIi1 = 86
UltraSPARC_III2 = 87
UltraSPARC_IIIi = 88
_68040 = 96
_68xxx_Family = 97
_68000 = 98
_68010 = 99
_68020 = 100
_68030 = 101
Hobbit_Family = 112
CrusoeTM_TM5000_Family = 120
CrusoeTM_TM3000_Family = 121
EfficeonTM_TM8000_Family = 122
Weitek = 128
ItaniumTM_Processor = 130
AMD_AthlonTM_64_Processor_Family = 131
AMD_OpteronTM_Family = 132
PA_RISC_Family = 144
PA_RISC_8500 = 145
PA_RISC_8000 = 146
PA_RISC_7300LC = 147
PA_RISC_7200 = 148
PA_RISC_7100LC = 149
PA_RISC_7100 = 150
V30_Family = 160
PentiumR_III_XeonTM = 176
PentiumR_III_Processor_with_IntelR_SpeedStepTM_Technology = 177
PentiumR_4 = 178
IntelR_XeonTM = 179
AS400_Family = 180
IntelR_XeonTM_processor_MP = 181
AMD_AthlonXPTM_Family = 182
AMD_AthlonMPTM_Family = 183
IntelR_ItaniumR_2 = 184
Intel_Pentium_M_Processor = 185
K7 = 190
IBM390_Family = 200
G4 = 201
G5 = 202
G6 = 203
zArchitecture_base = 204
i860 = 250
i960 = 251
SH_3 = 260
SH_4 = 261
ARM = 280
StrongARM = 281
_6x86 = 300
MediaGX = 301
MII = 302
WinChip = 320
DSP = 350
Video_Processor = 500
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.Family
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **Family**
[EnumFamily]$rawValue
# get a comma-separated string:
[EnumFamily]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumFamily]
#endregion
Enums must cover all possible values. If Family returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
InstallDate
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, InstallDate
L2CacheSize
Size of the Level 2 processor cache. A Level 2 cache is an external memory area that has a faster access time than the main RAM memory.
This value comes from the L2 Cache Handle member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, L2CacheSize
L2CacheSpeed
Clock speed of the Level 2 processor cache. A Level 2 cache is an external memory area that has a faster access time than the main RAM memory.
This value comes from the L2 Cache Handle member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, L2CacheSpeed
L3CacheSize
Size of the Level 3 processor cache. A Level 3 cache is an external memory area that has a faster access time than the main RAM memory.
This value comes from the L3 Cache Handle member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, L3CacheSize
L3CacheSpeed
Clockspeed of the Level 3 property cache. A Level 3 cache is an external memory area that has a faster access time than the main RAM memory.
This value comes from the L3 Cache Handle member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, L3CacheSpeed
LastErrorCode
Last error code reported by the logical device.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, LastErrorCode
Level
Definition of the processor type. The value depends on the architecture of the processor.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Level
LoadPercentage
Load capacity of each processor, averaged to the last second. Processor loading refers to the total computing burden for each processor at one time.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, LoadPercentage
Manufacturer
Name of the processor manufacturer.
Example: A. Datum Corporation
This value comes from the Processor Manufacturer member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Manufacturer
MaxClockSpeed
Maximum speed of the processor, in MHz.
This value comes from the Max Speed member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, MaxClockSpeed
Name
Label by which the object is known. When this property is a subclass, it can be overridden to be a key property.
This value comes from the Processor Version member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Name
NumberOfCores
Number of cores for the current instance of the processor. A core is a physical processor on the integrated circuit. For example, in a dual-core processor this property has a value of 2. For more information, see Remarks.
This value comes from the Processor Information structure in the SMBIOS version information. For SMBIOS versions 2.5 thru 2.9 the value comes from the Core Count member. For SMBIOS version 3.0+ the value comes from the Core Count 2 member.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, NumberOfCores
NumberOfEnabledCore
The number of enabled cores per processor socket.
This value comes from the Processor Information structure in the SMBIOS version information. For SMBIOS versions 2.5 thru 2.9 the value comes from the Core Enabled member. For SMBIOS version 3.0+ the value comes from the Core Enabled 2 member.
Windows Server® 2012® R2, Windows® 8.1, Windows Server® 2012, Windows® 8, Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows Server® 2016 and Windows® 10.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, NumberOfEnabledCore
NumberOfLogicalProcessors
Number of logical processors for the current instance of the processor. For processors capable of hyperthreading, this value includes only the processors which have hyperthreading enabled. For more information, see Remarks.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, NumberOfLogicalProcessors
OtherFamilyDescription
Processor family type. Used when the Family property is set to 1, which means Other. This string should be set to NULL when the Family property is a value that is not 1.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, OtherFamilyDescription
PartNumber
The part number of this processor as set by the manufacturer.
This value comes from the Part Number member of the Processor Information structure in the SMBIOS information.
Windows Server® 2012® R2, Windows® 8.1, Windows Server® 2012, Windows® 8, Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows Server® 2016 and Windows® 10.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, PartNumber
PNPDeviceID
Windows Plug and Play device identifier of the logical device.
Example: *PNP030b
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, PNPDeviceID
PowerManagementCapabilities
Array of the specific power-related capabilities of a logical device.
PowerManagementCapabilities returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$PowerManagementCapabilities_map = @{
0 = 'Unknown'
1 = 'Not Supported'
2 = 'Disabled'
3 = 'Enabled'
4 = 'Power Saving Modes Entered Automatically'
5 = 'Power State Settable'
6 = 'Power Cycling Supported'
7 = 'Timed Power On Supported'
}
Use a switch statement
switch([int]$value)
{
0 {'Unknown'}
1 {'Not Supported'}
2 {'Disabled'}
3 {'Enabled'}
4 {'Power Saving Modes Entered Automatically'}
5 {'Power State Settable'}
6 {'Power Cycling Supported'}
7 {'Timed Power On Supported'}
default {"$value"}
}
Use Enum structure
Enum EnumPowerManagementCapabilities
{
Unknown = 0
Not_Supported = 1
Disabled = 2
Enabled = 3
Power_Saving_Modes_Entered_Automatically = 4
Power_State_Settable = 5
Power_Cycling_Supported = 6
Timed_Power_On_Supported = 7
}
Examples
Use $PowerManagementCapabilities_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "PowerManagementCapabilities" to friendly text
Note: to use other properties than "PowerManagementCapabilities", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "PowerManagementCapabilities"
# to translate other properties, use their translation table instead
$PowerManagementCapabilities_map = @{
0 = 'Unknown'
1 = 'Not Supported'
2 = 'Disabled'
3 = 'Enabled'
4 = 'Power Saving Modes Entered Automatically'
5 = 'Power State Settable'
6 = 'Power Cycling Supported'
7 = 'Timed Power On Supported'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "PowerManagementCapabilities", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$PowerManagementCapabilities = @{
Name = 'PowerManagementCapabilities'
Expression = {
# property is an array, so process all values
$result = foreach($value in $_.PowerManagementCapabilities)
{
# important: convert original value to [int] because
# hashtable keys are type-aware:
$PowerManagementCapabilities_map[[int]$value]
}
# uncomment to get a comma-separated string instead
# of a string array:
$result <#-join ', '#>
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "PowerManagementCapabilities". The latter
# is defined by the hashtable in $PowerManagementCapabilities:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $PowerManagementCapabilities
# ...or dump content of property PowerManagementCapabilities:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $PowerManagementCapabilities |
Select-Object -ExpandProperty PowerManagementCapabilities
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $PowerManagementCapabilities_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when there
is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$PowerManagementCapabilities_map = @{
0 = 'Unknown'
1 = 'Not Supported'
2 = 'Disabled'
3 = 'Enabled'
4 = 'Power Saving Modes Entered Automatically'
5 = 'Power State Settable'
6 = 'Power Cycling Supported'
7 = 'Timed Power On Supported'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property (hint: the property is an array!)
$rawValues = $instance.PowerManagementCapabilities
# translate all raw values into friendly names:
$friendlyNames = foreach($rawValue in $rawValues)
{ $PowerManagementCapabilities_map[[int]$rawValue] }
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "PowerManagementCapabilities" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "PowerManagementCapabilities", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "PowerManagementCapabilities", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$PowerManagementCapabilities = @{
Name = 'PowerManagementCapabilities'
Expression = {
# property is an array, so process all values
$result = foreach($value in $_.PowerManagementCapabilities)
{
switch([int]$value)
{
0 {'Unknown'}
1 {'Not Supported'}
2 {'Disabled'}
3 {'Enabled'}
4 {'Power Saving Modes Entered Automatically'}
5 {'Power State Settable'}
6 {'Power Cycling Supported'}
7 {'Timed Power On Supported'}
default {"$value"}
}
}
$result
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "PowerManagementCapabilities". The latter is defined
# by the hashtable in $PowerManagementCapabilities:
Select-Object -Property Caption, $PowerManagementCapabilities
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumPowerManagementCapabilities
{
Unknown = 0
Not_Supported = 1
Disabled = 2
Enabled = 3
Power_Saving_Modes_Entered_Automatically = 4
Power_State_Settable = 5
Power_Cycling_Supported = 6
Timed_Power_On_Supported = 7
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.PowerManagementCapabilities
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **PowerManagementCapabilities**
[EnumPowerManagementCapabilities[]]$rawValue
# get a comma-separated string:
[EnumPowerManagementCapabilities[]]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumPowerManagementCapabilities[]]
#endregion
Enums must cover all possible values. If PowerManagementCapabilities returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
PowerManagementSupported
If TRUE, the power of the device can be managed, which means that it can be put into suspend mode, and so on. The property does not indicate that power management features are enabled, but it does indicate that the logical device power can be managed.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, PowerManagementSupported
ProcessorId
Processor information that describes the processor features. For an x86 class CPU, the field format depends on the processor support of the CPUID instruction. If the instruction is supported, the property contains 2 (two) DWORD formatted values. The first is an offset of 08h-0Bh, which is the EAX value that a CPUID instruction returns with input EAX set to 1. The second is an offset of 0Ch-0Fh, which is the EDX value that the instruction returns. Only the first two bytes of the property are significant and contain the contents of the DX register at CPU resetâall others are set to 0 (zero), and the contents are in DWORD format.
This value comes from the Processor ID member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, ProcessorId
ProcessorType
Primary function of the processor.
This value comes from the Processor Type member of the Processor Information structure in the SMBIOS information.
ProcessorType returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$ProcessorType_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Central Processor'
4 = 'Math Processor'
5 = 'DSP Processor'
6 = 'Video Processor'
}
Use a switch statement
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Central Processor'}
4 {'Math Processor'}
5 {'DSP Processor'}
6 {'Video Processor'}
default {"$value"}
}
Use Enum structure
Enum EnumProcessorType
{
Other = 1
Unknown = 2
Central_Processor = 3
Math_Processor = 4
DSP_Processor = 5
Video_Processor = 6
}
Examples
Use $ProcessorType_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "ProcessorType" to friendly text
Note: to use other properties than "ProcessorType", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "ProcessorType"
# to translate other properties, use their translation table instead
$ProcessorType_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Central Processor'
4 = 'Math Processor'
5 = 'DSP Processor'
6 = 'Video Processor'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "ProcessorType", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$ProcessorType = @{
Name = 'ProcessorType'
Expression = {
# property is an array, so process all values
$value = $_.ProcessorType
$ProcessorType_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "ProcessorType". The latter
# is defined by the hashtable in $ProcessorType:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $ProcessorType
# ...or dump content of property ProcessorType:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $ProcessorType |
Select-Object -ExpandProperty ProcessorType
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $ProcessorType_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$ProcessorType_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Central Processor'
4 = 'Math Processor'
5 = 'DSP Processor'
6 = 'Video Processor'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.ProcessorType
# translate raw value to friendly text:
$friendlyName = $ProcessorType_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "ProcessorType" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "ProcessorType", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "ProcessorType", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$ProcessorType = @{
Name = 'ProcessorType'
Expression = {
# property is an array, so process all values
$value = $_.ProcessorType
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Central Processor'}
4 {'Math Processor'}
5 {'DSP Processor'}
6 {'Video Processor'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "ProcessorType". The latter is defined
# by the hashtable in $ProcessorType:
Select-Object -Property Caption, $ProcessorType
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumProcessorType
{
Other = 1
Unknown = 2
Central_Processor = 3
Math_Processor = 4
DSP_Processor = 5
Video_Processor = 6
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.ProcessorType
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **ProcessorType**
[EnumProcessorType]$rawValue
# get a comma-separated string:
[EnumProcessorType]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumProcessorType]
#endregion
Enums must cover all possible values. If ProcessorType returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
Revision
System revision level that depends on the architecture. The system revision level contains the same values as the Version property, but in a numerical format.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Revision
Role
Role of the processor.
Examples: Central Processor or Math Processor
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Role
SecondLevelAddressTranslationExtensions
If True, the processor supports address translation extensions used for virtualization.
Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows® 8 and Windows Server® 2012.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, SecondLevelAddressTranslationExtensions
SerialNumber
The serial number of this processor This value is set by the manufacturer and normally not changeable.
This value comes from the Serial Number member of the Processor Information structure in the SMBIOS information.
Windows Server® 2012® R2, Windows® 8.1, Windows Server® 2012, Windows® 8, Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows Server® 2016 and Windows® 10.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, SerialNumber
SocketDesignation
Type of chip socket used on the circuit.
Example: J202
This value comes from the Socket Designation member of the Processor Information structure in the SMBIOS information.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, SocketDesignation
Status
Current status of an object. Various operational and nonoperational statuses can be defined. Available values:
$values = 'Degraded','Error','Lost Comm','No Contact','NonRecover','OK','Pred Fail','Service','Starting','Stopping','Stressed','Unknown'
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Status
StatusInfo
State of the logical device. If this property does not apply to the logical device, use the value 5, which means Not Applicable.
StatusInfo returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$StatusInfo_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Enabled'
4 = 'Disabled'
5 = 'Not Applicable'
}
Use a switch statement
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Enabled'}
4 {'Disabled'}
5 {'Not Applicable'}
default {"$value"}
}
Use Enum structure
Enum EnumStatusInfo
{
Other = 1
Unknown = 2
Enabled = 3
Disabled = 4
Not_Applicable = 5
}
Examples
Use $StatusInfo_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "StatusInfo" to friendly text
Note: to use other properties than "StatusInfo", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "StatusInfo"
# to translate other properties, use their translation table instead
$StatusInfo_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Enabled'
4 = 'Disabled'
5 = 'Not Applicable'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "StatusInfo", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$StatusInfo = @{
Name = 'StatusInfo'
Expression = {
# property is an array, so process all values
$value = $_.StatusInfo
$StatusInfo_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "StatusInfo". The latter
# is defined by the hashtable in $StatusInfo:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $StatusInfo
# ...or dump content of property StatusInfo:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $StatusInfo |
Select-Object -ExpandProperty StatusInfo
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $StatusInfo_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$StatusInfo_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Enabled'
4 = 'Disabled'
5 = 'Not Applicable'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.StatusInfo
# translate raw value to friendly text:
$friendlyName = $StatusInfo_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "StatusInfo" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "StatusInfo", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "StatusInfo", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$StatusInfo = @{
Name = 'StatusInfo'
Expression = {
# property is an array, so process all values
$value = $_.StatusInfo
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Enabled'}
4 {'Disabled'}
5 {'Not Applicable'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "StatusInfo". The latter is defined
# by the hashtable in $StatusInfo:
Select-Object -Property Caption, $StatusInfo
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumStatusInfo
{
Other = 1
Unknown = 2
Enabled = 3
Disabled = 4
Not_Applicable = 5
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.StatusInfo
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **StatusInfo**
[EnumStatusInfo]$rawValue
# get a comma-separated string:
[EnumStatusInfo]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumStatusInfo]
#endregion
Enums must cover all possible values. If StatusInfo returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
Stepping
Revision level of the processor in the processor family.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Stepping
SystemCreationClassName
Value of the CreationClassName property for the scoping computer.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, SystemCreationClassName
SystemName
Name of the scoping system.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, SystemName
ThreadCount
The number of threads per processor socket.
This value comes from the Processor Information structure in the SMBIOS version information. For SMBIOS versions 2.5 thru 2.9 the value comes from the Thread Count member. For SMBIOS version 3.0+ the value comes from the Thread Count 2 member.
Windows Server® 2012® R2, Windows® 8.1, Windows Server® 2012, Windows® 8, Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows Server® 2016 and Windows® 10.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, ThreadCount
UniqueId
Globally unique identifier for the processor. This identifier may only be unique within a processor family.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, UniqueId
UpgradeMethod
CPU socket information, including the method by which this processor can be upgraded, if upgrades are supported. This property is an integer enumeration.
This value comes from the Processor Upgrade member of the Processor Information structure in the SMBIOS information.
UpgradeMethod returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$UpgradeMethod_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Daughter Board'
4 = 'ZIF Socket'
5 = 'Replacement/Piggy Back'
6 = 'None'
7 = 'LIF Socket'
8 = 'Slot 1'
9 = 'Slot 2'
10 = '370 Pin Socket'
11 = 'Slot A'
12 = 'Slot M'
13 = 'Socket 423'
14 = 'Socket A (Socket 462)'
15 = 'Socket 478'
16 = 'Socket 754'
17 = 'Socket 940'
18 = 'Socket 939'
}
Use a switch statement
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Daughter Board'}
4 {'ZIF Socket'}
5 {'Replacement/Piggy Back'}
6 {'None'}
7 {'LIF Socket'}
8 {'Slot 1'}
9 {'Slot 2'}
10 {'370 Pin Socket'}
11 {'Slot A'}
12 {'Slot M'}
13 {'Socket 423'}
14 {'Socket A (Socket 462)'}
15 {'Socket 478'}
16 {'Socket 754'}
17 {'Socket 940'}
18 {'Socket 939'}
default {"$value"}
}
Use Enum structure
Enum EnumUpgradeMethod
{
Other = 1
Unknown = 2
Daughter_Board = 3
ZIF_Socket = 4
ReplacementPiggy_Back = 5
None = 6
LIF_Socket = 7
Slot_1 = 8
Slot_2 = 9
_370_Pin_Socket = 10
Slot_A = 11
Slot_M = 12
Socket_423 = 13
Socket_A_Socket_462 = 14
Socket_478 = 15
Socket_754 = 16
Socket_940 = 17
Socket_939 = 18
}
Examples
Use $UpgradeMethod_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "UpgradeMethod" to friendly text
Note: to use other properties than "UpgradeMethod", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "UpgradeMethod"
# to translate other properties, use their translation table instead
$UpgradeMethod_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Daughter Board'
4 = 'ZIF Socket'
5 = 'Replacement/Piggy Back'
6 = 'None'
7 = 'LIF Socket'
8 = 'Slot 1'
9 = 'Slot 2'
10 = '370 Pin Socket'
11 = 'Slot A'
12 = 'Slot M'
13 = 'Socket 423'
14 = 'Socket A (Socket 462)'
15 = 'Socket 478'
16 = 'Socket 754'
17 = 'Socket 940'
18 = 'Socket 939'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "UpgradeMethod", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$UpgradeMethod = @{
Name = 'UpgradeMethod'
Expression = {
# property is an array, so process all values
$value = $_.UpgradeMethod
$UpgradeMethod_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "UpgradeMethod". The latter
# is defined by the hashtable in $UpgradeMethod:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $UpgradeMethod
# ...or dump content of property UpgradeMethod:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $UpgradeMethod |
Select-Object -ExpandProperty UpgradeMethod
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $UpgradeMethod_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$UpgradeMethod_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Daughter Board'
4 = 'ZIF Socket'
5 = 'Replacement/Piggy Back'
6 = 'None'
7 = 'LIF Socket'
8 = 'Slot 1'
9 = 'Slot 2'
10 = '370 Pin Socket'
11 = 'Slot A'
12 = 'Slot M'
13 = 'Socket 423'
14 = 'Socket A (Socket 462)'
15 = 'Socket 478'
16 = 'Socket 754'
17 = 'Socket 940'
18 = 'Socket 939'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.UpgradeMethod
# translate raw value to friendly text:
$friendlyName = $UpgradeMethod_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "UpgradeMethod" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "UpgradeMethod", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "UpgradeMethod", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$UpgradeMethod = @{
Name = 'UpgradeMethod'
Expression = {
# property is an array, so process all values
$value = $_.UpgradeMethod
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Daughter Board'}
4 {'ZIF Socket'}
5 {'Replacement/Piggy Back'}
6 {'None'}
7 {'LIF Socket'}
8 {'Slot 1'}
9 {'Slot 2'}
10 {'370 Pin Socket'}
11 {'Slot A'}
12 {'Slot M'}
13 {'Socket 423'}
14 {'Socket A (Socket 462)'}
15 {'Socket 478'}
16 {'Socket 754'}
17 {'Socket 940'}
18 {'Socket 939'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "UpgradeMethod". The latter is defined
# by the hashtable in $UpgradeMethod:
Select-Object -Property Caption, $UpgradeMethod
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumUpgradeMethod
{
Other = 1
Unknown = 2
Daughter_Board = 3
ZIF_Socket = 4
ReplacementPiggy_Back = 5
None = 6
LIF_Socket = 7
Slot_1 = 8
Slot_2 = 9
_370_Pin_Socket = 10
Slot_A = 11
Slot_M = 12
Socket_423 = 13
Socket_A_Socket_462 = 14
Socket_478 = 15
Socket_754 = 16
Socket_940 = 17
Socket_939 = 18
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.UpgradeMethod
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **UpgradeMethod**
[EnumUpgradeMethod]$rawValue
# get a comma-separated string:
[EnumUpgradeMethod]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumUpgradeMethod]
#endregion
Enums must cover all possible values. If UpgradeMethod returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
Version
Processor revision number that depends on the architecture.
Example: Model 2, Stepping 12
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, Version
VirtualizationFirmwareEnabled
If True, the Firmware has enabled virtualization extensions.
Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows® 8 and Windows Server® 2012.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, VirtualizationFirmwareEnabled
VMMonitorModeExtensions
If True, the processor supports Intel or AMD Virtual Machine Monitor extensions.
Windows Server® 2008® R2, Windows® 7, Windows Server® 2008 and Windows® Vista: This property is not supported before Windows® 8 and Windows Server® 2012.
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property DeviceID, VMMonitorModeExtensions
VoltageCaps
Voltage capabilities of the processor. Bits 0-3 of the field represent specific voltages that the processor socket can accept. All other bits should be set to 0 (zero). The socket is configurable if multiple bits are set. For more information about the actual voltage at which the processor is running, see CurrentVoltage. If the property is NULL, then the voltage capabilities are unknown.
VoltageCaps returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$VoltageCaps_map = @{
1 = '5'
2 = '3.3'
4 = '2.9'
}
Use a switch statement
switch([int]$value)
{
1 {'5'}
2 {'3.3'}
4 {'2.9'}
default {"$value"}
}
Use Enum structure
Enum EnumVoltageCaps
{
_5 = 1
_33 = 2
_29 = 4
}
Examples
Use $VoltageCaps_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "VoltageCaps" to friendly text
Note: to use other properties than "VoltageCaps", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "VoltageCaps"
# to translate other properties, use their translation table instead
$VoltageCaps_map = @{
1 = '5'
2 = '3.3'
4 = '2.9'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "VoltageCaps", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$VoltageCaps = @{
Name = 'VoltageCaps'
Expression = {
# property is an array, so process all values
$value = $_.VoltageCaps
$VoltageCaps_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "VoltageCaps". The latter
# is defined by the hashtable in $VoltageCaps:
Get-CimInstance -Class Win32_Processor | Select-Object -Property Caption, $VoltageCaps
# ...or dump content of property VoltageCaps:
$friendlyValues = Get-CimInstance -Class Win32_Processor |
Select-Object -Property $VoltageCaps |
Select-Object -ExpandProperty VoltageCaps
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $VoltageCaps_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_Processor" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_Processor", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_Processor"
# to translate other properties, use their translation table instead
$VoltageCaps_map = @{
1 = '5'
2 = '3.3'
4 = '2.9'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.VoltageCaps
# translate raw value to friendly text:
$friendlyName = $VoltageCaps_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "VoltageCaps" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "VoltageCaps", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "VoltageCaps", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$VoltageCaps = @{
Name = 'VoltageCaps'
Expression = {
# property is an array, so process all values
$value = $_.VoltageCaps
switch([int]$value)
{
1 {'5'}
2 {'3.3'}
4 {'2.9'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_Processor |
# ...and output properties "Caption" and "VoltageCaps". The latter is defined
# by the hashtable in $VoltageCaps:
Select-Object -Property Caption, $VoltageCaps
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_Processor", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumVoltageCaps
{
_5 = 1
_33 = 2
_29 = 4
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_Processor | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.VoltageCaps
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **VoltageCaps**
[EnumVoltageCaps]$rawValue
# get a comma-separated string:
[EnumVoltageCaps]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumVoltageCaps]
#endregion
Enums must cover all possible values. If VoltageCaps returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
Examples
List all instances of Win32_Processor
Get-CimInstance -ClassName Win32_Processor
Learn more about Get-CimInstance
and the deprecated Get-WmiObject
.
View all properties
Get-CimInstance -ClassName Win32_Processor -Property *
View key properties only
Get-CimInstance -ClassName Win32_Processor -KeyOnly
Selecting Properties
To select only some properties, pipe the results to Select-Object -Property a,b,c
with a comma-separated list of the properties you require. Wildcards are permitted.
Get-CimInstance
always returns all properties but only retrieves the ones that you specify. All other properties are empty but still present. That’s why you need to pipe the results into Select-Object
if you want to limit the visible properties, i.e. for reporting.
Selecting Properties
The code below lists all available properties. Remove the ones you do not need:
$properties = 'AddressWidth',
'Architecture',
'AssetTag',
'Availability',
'Caption',
'Characteristics',
'ConfigManagerErrorCode',
'ConfigManagerUserConfig',
'CpuStatus',
'CreationClassName',
'CurrentClockSpeed',
'CurrentVoltage',
'DataWidth',
'Description',
'DeviceID',
'ErrorCleared',
'ErrorDescription',
'ExtClock',
'Family',
'InstallDate',
'L2CacheSize',
'L2CacheSpeed',
'L3CacheSize',
'L3CacheSpeed',
'LastErrorCode',
'Level',
'LoadPercentage',
'Manufacturer',
'MaxClockSpeed',
'Name',
'NumberOfCores',
'NumberOfEnabledCore',
'NumberOfLogicalProcessors',
'OtherFamilyDescription',
'PartNumber',
'PNPDeviceID',
'PowerManagementCapabilities',
'PowerManagementSupported',
'ProcessorId',
'ProcessorType',
'Revision',
'Role',
'SecondLevelAddressTranslationExtensions',
'SerialNumber',
'SocketDesignation',
'Status',
'StatusInfo',
'Stepping',
'SystemCreationClassName',
'SystemName',
'ThreadCount',
'UniqueId',
'UpgradeMethod',
'Version',
'VirtualizationFirmwareEnabled',
'VMMonitorModeExtensions',
'VoltageCaps'
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property $properties
Limiting Network Bandwidth
If you work remotely, it makes sense to limit network bandwidth by filtering the properties on the server side, too:
Get-CimInstance -Class Win32_Processor -Property $property |
Select-Object -Property $property
Selecting Instances
To select some instances, use Get-CimInstance and a WMI Query. The wildcard character in WMI Queries is % (and not “*”).
The parameter -Filter runs a simple query.
Listing all instances where the property Caption starts with “A”
Get-CimInstance -Class Win32_Processor -Filter 'Caption LIKE "a%"'
Using a WQL Query
The parameter -Query uses a query similar to SQL and combines the parameters -Filter and -Property. This returns all instances where the property Caption starts with “A”, and returns the properties specified:
Get-CimInstance -Query "SELECT ExtClock, ErrorCleared, Characteristics, CreationClassName FROM Win32_Processor WHERE Caption LIKE 'a%'"
Any property you did not specify is still present but empty. You might need to use
Select-Object
to remove all unwanted properties:Get-CimInstance -Query "SELECT ExtClock, ErrorCleared, Characteristics, CreationClassName FROM Win32_Processor WHERE Caption LIKE 'a%'" | Select-Object -Property ExtClock, ErrorCleared, Characteristics, CreationClassName
Accessing Remote Computers
To access remote systems, you need to have proper permissions. User the parameter -ComputerName to access one or more remote systems.
Authenticating as Current User
# one or more computer names or IP addresses:
$list = 'server1', 'server2'
# authenticate with your current identity:
$result = Get-CimInstance -ClassName Win32_Processor -ComputerName $list
$result
Authenticating as Different User
Use a CIMSession object to authenticate with a new identity:
# one or more computer names or IP addresses:
$list = 'server1', 'server2'
# authenticate with a different identity:
$cred = Get-Credential -Message 'Authenticate to retrieve WMI information:'
$session = New-CimSession -ComputerName $list -Credential $cred
$result = Get-CimInstance Win32_Processor -CimSession $session
# remove the session after use (if you do not plan to re-use it later)
Remove-CimSession -CimSession $session
$result
Learn more about accessing remote computers.
Requirements
To use Win32_Processor, the following requirements apply:
PowerShell
Get-CimInstance
was introduced with PowerShell Version 3.0, which in turn was introduced on clients with Windows 8 and on servers with Windows Server 2012.
If necessary, update Windows PowerShell to Windows PowerShell 5.1, or install PowerShell 7 side-by-side.
Operating System
Win32_Processor was introduced on clients with Windows Vista and on servers with Windows Server 2008.
Namespace
Win32_Processor lives in the Namespace Root/CIMV2. This is the default namespace. There is no need to use the -Namespace parameter in Get-CimInstance
.
Implementation
Win32_Processor is implemented in CIMWin32.dll and defined in CIMWin32.mof. Both files are located in the folder C:\Windows\system32\wbem
:
explorer $env:windir\system32\wbem
notepad $env:windir\system32\wbem\CIMWin32.mof