Win32_VideoController

The Win32_VideoController WMI class represents the capabilities and management capacity of the video controller on a computer system running Windows.Hardware that is not compatible with Windows Dis...

The Win32_VideoController WMI class represents the capabilities and management capacity of the video controller on a computer system running Windows. Hardware that is not compatible with Windows Display Driver Model (WDDM) returns inaccurate property values for instances of this class.

Methods

Win32_VideoController has no methods. Inherited methods (Reset and SetPowerState) are not implemented.

Properties

Win32_VideoController returns 59 properties:

'AcceleratorCapabilities','AdapterCompatibility','AdapterDACType','AdapterRAM',
'Availability','CapabilityDescriptions','Caption','ColorTableEntries','ConfigManagerErrorCode',
'ConfigManagerUserConfig','CreationClassName','CurrentBitsPerPixel','CurrentHorizontalResolution',
'CurrentNumberOfColors','CurrentNumberOfColumns','CurrentNumberOfRows','CurrentRefreshRate',
'CurrentScanMode','CurrentVerticalResolution','Description','DeviceID','DeviceSpecificPens',
'DitherType','DriverDate','DriverVersion','ErrorCleared','ErrorDescription','ICMIntent',
'ICMMethod','InfFilename','InfSection','InstallDate','InstalledDisplayDrivers','LastErrorCode',
'MaxMemorySupported','MaxNumberControlled','MaxRefreshRate','MinRefreshRate','Monochrome','Name',
'NumberOfColorPlanes','NumberOfVideoPages','PNPDeviceID','PowerManagementCapabilities',
'PowerManagementSupported','ProtocolSupported','ReservedSystemPaletteEntries','SpecificationVersion','Status',
'StatusInfo','SystemCreationClassName','SystemName','SystemPaletteEntries','TimeOfLastReset',
'VideoArchitecture','VideoMemoryType','VideoMode','VideoModeDescription','VideoProcessor'

Unless explicitly marked as writeable, all properties are read-only. Read all properties for all instances:

Get-CimInstance -ClassName Win32_VideoController -Property *

Most WMI classes return one or more instances.

When Get-CimInstance returns no result, then apparently no instances of class Win32_VideoController 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).

AcceleratorCapabilities

UINT16 ARRAY

Array of graphics and 3-D capabilities of the video controller.

AcceleratorCapabilities returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$AcceleratorCapabilities_map = @{
      0 = 'Unknown'
      1 = 'Other'
      2 = 'Graphics Accelerator'
      3 = '3D Accelerator'
}
Use a switch statement
switch([int]$value)
{
  0          {'Unknown'}
  1          {'Other'}
  2          {'Graphics Accelerator'}
  3          {'3D Accelerator'}
  default    {"$value"}
}
Use Enum structure
Enum EnumAcceleratorCapabilities
{
  Unknown                = 0
  Other                  = 1
  Graphics_Accelerator   = 2
  _3D_Accelerator        = 3
}

Examples

Use $AcceleratorCapabilities_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "AcceleratorCapabilities" to friendly text

  Note: to use other properties than "AcceleratorCapabilities", 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 "AcceleratorCapabilities" 
# to translate other properties, use their translation table instead
$AcceleratorCapabilities_map = @{
      0 = 'Unknown'
      1 = 'Other'
      2 = 'Graphics Accelerator'
      3 = '3D Accelerator'
}

#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 "AcceleratorCapabilities", 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:
#>
 
$AcceleratorCapabilities = @{
  Name = 'AcceleratorCapabilities'
  Expression = {
    # property is an array, so process all values
    $result = foreach($value in $_.AcceleratorCapabilities)
    {
        # important: convert original value to [int] because
        # hashtable keys are type-aware:
        $AcceleratorCapabilities_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 "AcceleratorCapabilities". The latter
# is defined by the hashtable in $AcceleratorCapabilities: 
Get-CimInstance -Class Win32_VideoController | Select-Object -Property Caption, $AcceleratorCapabilities

# ...or dump content of property AcceleratorCapabilities:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    Select-Object -Property $AcceleratorCapabilities |
    Select-Object -ExpandProperty AcceleratorCapabilities

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $AcceleratorCapabilities_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_VideoController" to friendly text. This approach is ideal when there
  is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# to translate other properties, use their translation table instead
$AcceleratorCapabilities_map = @{
      0 = 'Unknown'
      1 = 'Other'
      2 = 'Graphics Accelerator'
      3 = '3D Accelerator'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.AcceleratorCapabilities  

# translate all raw values into friendly names:
$friendlyNames = foreach($rawValue in $rawValues)
{ $AcceleratorCapabilities_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 "AcceleratorCapabilities" 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 "AcceleratorCapabilities", 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 "AcceleratorCapabilities", 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:
#>
 
$AcceleratorCapabilities = @{
  Name = 'AcceleratorCapabilities'
  Expression = {
    # property is an array, so process all values
    $result = foreach($value in $_.AcceleratorCapabilities)
    {
        switch([int]$value)
      {
        0          {'Unknown'}
        1          {'Other'}
        2          {'Graphics Accelerator'}
        3          {'3D Accelerator'}
        default    {"$value"}
      }
      
    }
    $result
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_VideoController | 
  # ...and output properties "Caption" and "AcceleratorCapabilities". The latter is defined
  # by the hashtable in $AcceleratorCapabilities:
  Select-Object -Property Caption, $AcceleratorCapabilities
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_VideoController", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumAcceleratorCapabilities
{
  Unknown                = 0
  Other                  = 1
  Graphics_Accelerator   = 2
  _3D_Accelerator        = 3
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.AcceleratorCapabilities

#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 **AcceleratorCapabilities** 
[EnumAcceleratorCapabilities[]]$rawValue 

# get a comma-separated string:
[EnumAcceleratorCapabilities[]]$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 [EnumAcceleratorCapabilities[]]
#endregion

Enums must cover all possible values. If AcceleratorCapabilities 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.

AdapterCompatibility

STRING

General chipset used for this controller to compare compatibilities with the system.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, AdapterCompatibility

AdapterDACType

STRING

Name or identifier of the digital-to-analog converter (DAC) chip. The character set of this property is alphanumeric.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, AdapterDACType

AdapterRAM

UINT32 “BYTES”

Memory size of the video adapter.

Example: 64000

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, AdapterRAM

Availability

UINT16

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_VideoController | Select-Object -Property Caption, $Availability

# ...or dump content of property Availability:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    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_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# 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_VideoController | 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_VideoController | 
  # ...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_VideoController", 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_VideoController | 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.

CapabilityDescriptions

STRING ARRAY

Free-form strings providing more detailed explanations for any of the video accelerator features indicated in the AcceleratorCapabilities array. Note, each entry of this array is related to the entry in the AcceleratorCapabilities array that is located at the same index.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CapabilityDescriptions

Caption

STRING MAX 64 CHAR

Short description of the object.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, Caption

ColorTableEntries

UINT32

Size of the system’s color table. The device must have a color depth of no more than 8 bits per pixel; otherwise, this property is not set.

Example: 256

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, ColorTableEntries

ConfigManagerErrorCode

UINT32

Win32 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_VideoController | Select-Object -Property Caption, $ConfigManagerErrorCode

# ...or dump content of property ConfigManagerErrorCode:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    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_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# 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_VideoController | 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_VideoController | 
  # ...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_VideoController", 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_VideoController | 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

BOOLEAN

If TRUE, the device is using a user-defined configuration.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, ConfigManagerUserConfig

CreationClassName

STRING

Name of the first concrete class to appear in the inheritance chain used in the creation of an instance. When used with the other key properties of the class, this property allows all instances of this class and its subclasses to be uniquely identified.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CreationClassName

CurrentBitsPerPixel

UINT32 “BITS”

Number of bits used to display each pixel.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CurrentBitsPerPixel

CurrentHorizontalResolution

UINT32 “PIXELS”

Current number of horizontal pixels.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CurrentHorizontalResolution

CurrentNumberOfColors

UINT64

Number of colors supported at the current resolution.

For more information about using uint64 values in scripts, see Scripting in WMI.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CurrentNumberOfColors

CurrentNumberOfColumns

UINT32

Number of columns for this video controller (if in character mode). Otherwise, enter 0 (zero).

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CurrentNumberOfColumns

CurrentNumberOfRows

UINT32

Number of rows for this video controller (if in character mode). Otherwise, enter 0 (zero).

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CurrentNumberOfRows

CurrentRefreshRate

UINT32 “HERTZ”

Frequency at which the video controller refreshes the image for the monitor. A value of 0 (zero) indicates the default rate is being used, while 0xFFFFFFFF indicates the optimal rate is being used.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CurrentRefreshRate

CurrentScanMode

UINT16

Current scan mode.

CurrentScanMode returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$CurrentScanMode_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'Interlaced'
      4 = 'Non Interlaced'
}
Use a switch statement
switch([int]$value)
{
  1          {'Other'}
  2          {'Unknown'}
  3          {'Interlaced'}
  4          {'Non Interlaced'}
  default    {"$value"}
}
Use Enum structure
Enum EnumCurrentScanMode
{
  Other            = 1
  Unknown          = 2
  Interlaced       = 3
  Non_Interlaced   = 4
}

Examples

Use $CurrentScanMode_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "CurrentScanMode" to friendly text

  Note: to use other properties than "CurrentScanMode", 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 "CurrentScanMode" 
# to translate other properties, use their translation table instead
$CurrentScanMode_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'Interlaced'
      4 = 'Non Interlaced'
}

#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 "CurrentScanMode", 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:
#>
 
$CurrentScanMode = @{
  Name = 'CurrentScanMode'
  Expression = {
    # property is an array, so process all values
    $value = $_.CurrentScanMode
    $CurrentScanMode_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "CurrentScanMode". The latter
# is defined by the hashtable in $CurrentScanMode: 
Get-CimInstance -Class Win32_VideoController | Select-Object -Property Caption, $CurrentScanMode

# ...or dump content of property CurrentScanMode:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    Select-Object -Property $CurrentScanMode |
    Select-Object -ExpandProperty CurrentScanMode

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $CurrentScanMode_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# to translate other properties, use their translation table instead
$CurrentScanMode_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'Interlaced'
      4 = 'Non Interlaced'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.CurrentScanMode  

# translate raw value to friendly text:
$friendlyName = $CurrentScanMode_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 "CurrentScanMode" 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 "CurrentScanMode", 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 "CurrentScanMode", 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:
#>
 
$CurrentScanMode = @{
  Name = 'CurrentScanMode'
  Expression = {
    # property is an array, so process all values
    $value = $_.CurrentScanMode
    
    switch([int]$value)
      {
        1          {'Other'}
        2          {'Unknown'}
        3          {'Interlaced'}
        4          {'Non Interlaced'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_VideoController | 
  # ...and output properties "Caption" and "CurrentScanMode". The latter is defined
  # by the hashtable in $CurrentScanMode:
  Select-Object -Property Caption, $CurrentScanMode
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_VideoController", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumCurrentScanMode
{
  Other            = 1
  Unknown          = 2
  Interlaced       = 3
  Non_Interlaced   = 4
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.CurrentScanMode

#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 **CurrentScanMode** 
[EnumCurrentScanMode]$rawValue 

# get a comma-separated string:
[EnumCurrentScanMode]$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 [EnumCurrentScanMode]
#endregion

Enums must cover all possible values. If CurrentScanMode 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.

CurrentVerticalResolution

UINT32 “PIXELS”

Current number of vertical pixels.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, CurrentVerticalResolution

Description

STRING

Description of the object.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, Description

DeviceID

KEY PROPERTY STRING

Identifier (unique to the computer system) for this video controller.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID

DeviceSpecificPens

UINT32

Current number of device-specific pens. A value of 0xffff means that the device does not support pens.

Example: 3

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, DeviceSpecificPens

DitherType

UINT32

Dither type of the video controller. The property can be one of the predefined values, or a driver-defined value greater than or equal to 256. If line art dithering is chosen, the controller uses a dithering method that produces well-defined borders between black, white, and gray scalings. Line art dithering is not suitable for images that include continuous graduations in intensity and hue such as scanned photographs.

DitherType returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$DitherType_map = @{
      1 = 'No dithering'
      2 = 'Dithering with a coarse brush'
      3 = 'Dithering with a fine brush'
      4 = 'Line art dithering'
      5 = 'Device does gray scaling'
}
Use a switch statement
switch([int]$value)
{
  1          {'No dithering'}
  2          {'Dithering with a coarse brush'}
  3          {'Dithering with a fine brush'}
  4          {'Line art dithering'}
  5          {'Device does gray scaling'}
  default    {"$value"}
}
Use Enum structure
Enum EnumDitherType
{
  No_dithering                    = 1
  Dithering_with_a_coarse_brush   = 2
  Dithering_with_a_fine_brush     = 3
  Line_art_dithering              = 4
  Device_does_gray_scaling        = 5
}

Examples

Use $DitherType_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "DitherType" to friendly text

  Note: to use other properties than "DitherType", 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 "DitherType" 
# to translate other properties, use their translation table instead
$DitherType_map = @{
      1 = 'No dithering'
      2 = 'Dithering with a coarse brush'
      3 = 'Dithering with a fine brush'
      4 = 'Line art dithering'
      5 = 'Device does gray scaling'
}

#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 "DitherType", 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:
#>
 
$DitherType = @{
  Name = 'DitherType'
  Expression = {
    # property is an array, so process all values
    $value = $_.DitherType
    $DitherType_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "DitherType". The latter
# is defined by the hashtable in $DitherType: 
Get-CimInstance -Class Win32_VideoController | Select-Object -Property Caption, $DitherType

# ...or dump content of property DitherType:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    Select-Object -Property $DitherType |
    Select-Object -ExpandProperty DitherType

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $DitherType_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# to translate other properties, use their translation table instead
$DitherType_map = @{
      1 = 'No dithering'
      2 = 'Dithering with a coarse brush'
      3 = 'Dithering with a fine brush'
      4 = 'Line art dithering'
      5 = 'Device does gray scaling'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.DitherType  

# translate raw value to friendly text:
$friendlyName = $DitherType_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 "DitherType" 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 "DitherType", 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 "DitherType", 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:
#>
 
$DitherType = @{
  Name = 'DitherType'
  Expression = {
    # property is an array, so process all values
    $value = $_.DitherType
    
    switch([int]$value)
      {
        1          {'No dithering'}
        2          {'Dithering with a coarse brush'}
        3          {'Dithering with a fine brush'}
        4          {'Line art dithering'}
        5          {'Device does gray scaling'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_VideoController | 
  # ...and output properties "Caption" and "DitherType". The latter is defined
  # by the hashtable in $DitherType:
  Select-Object -Property Caption, $DitherType
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_VideoController", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumDitherType
{
  No_dithering                    = 1
  Dithering_with_a_coarse_brush   = 2
  Dithering_with_a_fine_brush     = 3
  Line_art_dithering              = 4
  Device_does_gray_scaling        = 5
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.DitherType

#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 **DitherType** 
[EnumDitherType]$rawValue 

# get a comma-separated string:
[EnumDitherType]$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 [EnumDitherType]
#endregion

Enums must cover all possible values. If DitherType 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.

DriverDate

DATETIME

Last modification date and time of the currently installed video driver.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, DriverDate

DriverVersion

STRING

Version number of the video driver.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, DriverVersion

ErrorCleared

BOOLEAN

If TRUE, the error reported in LastErrorCode property is now cleared.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, ErrorCleared

ErrorDescription

STRING

Free-form string supplying more information about the error recorded in LastErrorCode property, and information on any corrective actions that may be taken.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, ErrorDescription

ICMIntent

UINT32

Specific value of one of the three possible color-matching methods or intents that should be used by default. This property is used primarily for non-ICM applications. ICM applications establish intents by using the ICM functions. This property can be a predefined value or a driver defined value greater than or equal to 256. Color matching based on saturation is the most appropriate choice for business graphs when dithering is not desired. Color matching based on contrast is the most appropriate choice for scanned or photographic images when dithering is desired. Color matching optimized to match the exact color requested is most appropriate for use with business logos or other images when an exact color match is desired.

ICMIntent returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$ICMIntent_map = @{
      1 = 'Saturation'
      2 = 'Contrast'
      3 = 'Exact Color'
}
Use a switch statement
switch([int]$value)
{
  1          {'Saturation'}
  2          {'Contrast'}
  3          {'Exact Color'}
  default    {"$value"}
}
Use Enum structure
Enum EnumICMIntent
{
  Saturation    = 1
  Contrast      = 2
  Exact_Color   = 3
}

Examples

Use $ICMIntent_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "ICMIntent" to friendly text

  Note: to use other properties than "ICMIntent", 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 "ICMIntent" 
# to translate other properties, use their translation table instead
$ICMIntent_map = @{
      1 = 'Saturation'
      2 = 'Contrast'
      3 = 'Exact Color'
}

#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 "ICMIntent", 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:
#>
 
$ICMIntent = @{
  Name = 'ICMIntent'
  Expression = {
    # property is an array, so process all values
    $value = $_.ICMIntent
    $ICMIntent_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "ICMIntent". The latter
# is defined by the hashtable in $ICMIntent: 
Get-CimInstance -Class Win32_VideoController | Select-Object -Property Caption, $ICMIntent

# ...or dump content of property ICMIntent:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    Select-Object -Property $ICMIntent |
    Select-Object -ExpandProperty ICMIntent

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $ICMIntent_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# to translate other properties, use their translation table instead
$ICMIntent_map = @{
      1 = 'Saturation'
      2 = 'Contrast'
      3 = 'Exact Color'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.ICMIntent  

# translate raw value to friendly text:
$friendlyName = $ICMIntent_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 "ICMIntent" 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 "ICMIntent", 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 "ICMIntent", 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:
#>
 
$ICMIntent = @{
  Name = 'ICMIntent'
  Expression = {
    # property is an array, so process all values
    $value = $_.ICMIntent
    
    switch([int]$value)
      {
        1          {'Saturation'}
        2          {'Contrast'}
        3          {'Exact Color'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_VideoController | 
  # ...and output properties "Caption" and "ICMIntent". The latter is defined
  # by the hashtable in $ICMIntent:
  Select-Object -Property Caption, $ICMIntent
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_VideoController", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumICMIntent
{
  Saturation    = 1
  Contrast      = 2
  Exact_Color   = 3
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.ICMIntent

#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 **ICMIntent** 
[EnumICMIntent]$rawValue 

# get a comma-separated string:
[EnumICMIntent]$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 [EnumICMIntent]
#endregion

Enums must cover all possible values. If ICMIntent 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.

ICMMethod

UINT32

Method of handling ICM. For non-ICM applications, this property determines if ICM is enabled. For ICM applications, the system examines this property to determine how to handle ICM support. This property can be a predefined value or a driver-defined value greater than or equal to 256. The value determines which system handles image color matching.

ICMMethod returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$ICMMethod_map = @{
      1 = 'Disabled'
      2 = 'Windows'
      3 = 'Device Driver'
      4 = 'Destination Device'
}
Use a switch statement
switch([int]$value)
{
  1          {'Disabled'}
  2          {'Windows'}
  3          {'Device Driver'}
  4          {'Destination Device'}
  default    {"$value"}
}
Use Enum structure
Enum EnumICMMethod
{
  Disabled             = 1
  Windows              = 2
  Device_Driver        = 3
  Destination_Device   = 4
}

Examples

Use $ICMMethod_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "ICMMethod" to friendly text

  Note: to use other properties than "ICMMethod", 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 "ICMMethod" 
# to translate other properties, use their translation table instead
$ICMMethod_map = @{
      1 = 'Disabled'
      2 = 'Windows'
      3 = 'Device Driver'
      4 = 'Destination 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 "ICMMethod", 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:
#>
 
$ICMMethod = @{
  Name = 'ICMMethod'
  Expression = {
    # property is an array, so process all values
    $value = $_.ICMMethod
    $ICMMethod_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "ICMMethod". The latter
# is defined by the hashtable in $ICMMethod: 
Get-CimInstance -Class Win32_VideoController | Select-Object -Property Caption, $ICMMethod

# ...or dump content of property ICMMethod:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    Select-Object -Property $ICMMethod |
    Select-Object -ExpandProperty ICMMethod

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $ICMMethod_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# to translate other properties, use their translation table instead
$ICMMethod_map = @{
      1 = 'Disabled'
      2 = 'Windows'
      3 = 'Device Driver'
      4 = 'Destination Device'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.ICMMethod  

# translate raw value to friendly text:
$friendlyName = $ICMMethod_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 "ICMMethod" 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 "ICMMethod", 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 "ICMMethod", 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:
#>
 
$ICMMethod = @{
  Name = 'ICMMethod'
  Expression = {
    # property is an array, so process all values
    $value = $_.ICMMethod
    
    switch([int]$value)
      {
        1          {'Disabled'}
        2          {'Windows'}
        3          {'Device Driver'}
        4          {'Destination Device'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_VideoController | 
  # ...and output properties "Caption" and "ICMMethod". The latter is defined
  # by the hashtable in $ICMMethod:
  Select-Object -Property Caption, $ICMMethod
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_VideoController", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumICMMethod
{
  Disabled             = 1
  Windows              = 2
  Device_Driver        = 3
  Destination_Device   = 4
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.ICMMethod

#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 **ICMMethod** 
[EnumICMMethod]$rawValue 

# get a comma-separated string:
[EnumICMMethod]$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 [EnumICMMethod]
#endregion

Enums must cover all possible values. If ICMMethod 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.

InfFilename

STRING

Path to the video adapter’s .inf file.

Example: “C:\Windows\SYSTEM32\DRIVERS”

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, InfFilename

InfSection

STRING

Section of the .inf file where the Windows video information resides.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, InfSection

InstallDate

DATETIME

Date and time the object was installed. This property does not need a value to indicate that the object is installed.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, InstallDate

InstalledDisplayDrivers

STRING

Name of the installed display device driver.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, InstalledDisplayDrivers

LastErrorCode

UINT32

Last error code reported by the logical device.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, LastErrorCode

MaxMemorySupported

UINT32 “BYTES”

Maximum amount of memory supported in bytes.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, MaxMemorySupported

MaxNumberControlled

UINT32

Maximum number of directly addressable entities supportable by this controller. A value of 0 (zero) should be used if the number is unknown.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, MaxNumberControlled

MaxRefreshRate

UINT32 “HERTZ”

Maximum refresh rate of the video controller in hertz.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, MaxRefreshRate

MinRefreshRate

UINT32 “HERTZ”

Minimum refresh rate of the video controller in hertz.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, MinRefreshRate

Monochrome

BOOLEAN

If TRUE, gray scale is used to display images.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, Monochrome

Name

STRING

Label by which the object is known. When subclassed, the property can be overridden to be a key property.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, Name

NumberOfColorPlanes

UINT16

Current number of color planes. If this value is not applicable for the current video configuration, enter 0 (zero).

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, NumberOfColorPlanes

NumberOfVideoPages

UINT32

Number of video pages supported given the current resolutions and available memory.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, NumberOfVideoPages

PNPDeviceID

STRING

Windows Plug and Play device identifier of the logical device.

Example: “*PNP030b”

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, PNPDeviceID

PowerManagementCapabilities

UINT16 ARRAY

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_VideoController | Select-Object -Property Caption, $PowerManagementCapabilities

# ...or dump content of property PowerManagementCapabilities:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    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_VideoController" to friendly text. This approach is ideal when there
  is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# 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_VideoController | 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_VideoController | 
  # ...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_VideoController", 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_VideoController | 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

BOOLEAN

If TRUE, the device can be power-managed (can be put into suspend mode, and so on). The property does not indicate that power management features are currently enabled, only that the logical device is capable of power management.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, PowerManagementSupported

ProtocolSupported

UINT16

Protocol used by the controller to access “controlled” devices.

ProtocolSupported returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$ProtocolSupported_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'EISA'
      4 = 'ISA'
      5 = 'PCI'
      6 = 'ATA/ATAPI'
      7 = 'Flexible Diskette'
      8 = '1496'
      9 = 'SCSI Parallel Interface'
     10 = 'SCSI Fibre Channel Protocol'
     11 = 'SCSI Serial Bus Protocol'
   1394 = 'SCSI Serial Bus Protocol-2'
     13 = 'SCSI Serial Storage Architecture'
     14 = 'VESA'
     15 = 'PCMCIA'
     16 = 'Universal Serial Bus'
     17 = 'Parallel Protocol'
     18 = 'ESCON'
     19 = 'Diagnostic'
     20 = 'I2C'
     21 = 'Power'
     22 = 'HIPPI'
     23 = 'MultiBus'
     24 = 'VME'
     25 = 'IPI'
     26 = 'IEEE-488'
     27 = 'RS232'
     28 = 'IEEE 802.3 10BASE5'
     29 = 'IEEE 802.3 10BASE2'
     30 = 'IEEE 802.3 1BASE5'
     31 = 'IEEE 802.3 10BROAD36'
     32 = 'IEEE 802.3 100BASEVG'
     33 = 'IEEE 802.5 Token-Ring'
     34 = 'ANSI X3T9.5 FDDI'
     35 = 'MCA'
     36 = 'ESDI'
     37 = 'IDE'
     38 = 'CMD'
     39 = 'ST506'
     40 = 'DSSI'
     41 = 'QIC2'
     42 = 'Enhanced ATA/IDE'
     43 = 'AGP'
     44 = 'TWIRP (two-way infrared)'
     45 = 'FIR (fast infrared)'
     46 = 'SIR (serial infrared)'
     47 = 'IrBus'
}
Use a switch statement
switch([int]$value)
{
  1          {'Other'}
  2          {'Unknown'}
  3          {'EISA'}
  4          {'ISA'}
  5          {'PCI'}
  6          {'ATA/ATAPI'}
  7          {'Flexible Diskette'}
  8          {'1496'}
  9          {'SCSI Parallel Interface'}
  10         {'SCSI Fibre Channel Protocol'}
  11         {'SCSI Serial Bus Protocol'}
  1394       {'SCSI Serial Bus Protocol-2'}
  13         {'SCSI Serial Storage Architecture'}
  14         {'VESA'}
  15         {'PCMCIA'}
  16         {'Universal Serial Bus'}
  17         {'Parallel Protocol'}
  18         {'ESCON'}
  19         {'Diagnostic'}
  20         {'I2C'}
  21         {'Power'}
  22         {'HIPPI'}
  23         {'MultiBus'}
  24         {'VME'}
  25         {'IPI'}
  26         {'IEEE-488'}
  27         {'RS232'}
  28         {'IEEE 802.3 10BASE5'}
  29         {'IEEE 802.3 10BASE2'}
  30         {'IEEE 802.3 1BASE5'}
  31         {'IEEE 802.3 10BROAD36'}
  32         {'IEEE 802.3 100BASEVG'}
  33         {'IEEE 802.5 Token-Ring'}
  34         {'ANSI X3T9.5 FDDI'}
  35         {'MCA'}
  36         {'ESDI'}
  37         {'IDE'}
  38         {'CMD'}
  39         {'ST506'}
  40         {'DSSI'}
  41         {'QIC2'}
  42         {'Enhanced ATA/IDE'}
  43         {'AGP'}
  44         {'TWIRP (two-way infrared)'}
  45         {'FIR (fast infrared)'}
  46         {'SIR (serial infrared)'}
  47         {'IrBus'}
  default    {"$value"}
}
Use Enum structure
Enum EnumProtocolSupported
{
  Other                              = 1
  Unknown                            = 2
  EISA                               = 3
  ISA                                = 4
  PCI                                = 5
  ATAATAPI                           = 6
  Flexible_Diskette                  = 7
  _1496                              = 8
  SCSI_Parallel_Interface            = 9
  SCSI_Fibre_Channel_Protocol        = 10
  SCSI_Serial_Bus_Protocol           = 11
  SCSI_Serial_Bus_Protocol_2         = 1394
  SCSI_Serial_Storage_Architecture   = 13
  VESA                               = 14
  PCMCIA                             = 15
  Universal_Serial_Bus               = 16
  Parallel_Protocol                  = 17
  ESCON                              = 18
  Diagnostic                         = 19
  I2C                                = 20
  Power                              = 21
  HIPPI                              = 22
  MultiBus                           = 23
  VME                                = 24
  IPI                                = 25
  IEEE_488                           = 26
  RS232                              = 27
  IEEE_8023_10BASE5                  = 28
  IEEE_8023_10BASE2                  = 29
  IEEE_8023_1BASE5                   = 30
  IEEE_8023_10BROAD36                = 31
  IEEE_8023_100BASEVG                = 32
  IEEE_8025_Token_Ring               = 33
  ANSI_X3T95_FDDI                    = 34
  MCA                                = 35
  ESDI                               = 36
  IDE                                = 37
  CMD                                = 38
  ST506                              = 39
  DSSI                               = 40
  QIC2                               = 41
  Enhanced_ATAIDE                    = 42
  AGP                                = 43
  TWIRP_two_way_infrared             = 44
  FIR_fast_infrared                  = 45
  SIR_serial_infrared                = 46
  IrBus                              = 47
}

Examples

Use $ProtocolSupported_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "ProtocolSupported" to friendly text

  Note: to use other properties than "ProtocolSupported", 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 "ProtocolSupported" 
# to translate other properties, use their translation table instead
$ProtocolSupported_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'EISA'
      4 = 'ISA'
      5 = 'PCI'
      6 = 'ATA/ATAPI'
      7 = 'Flexible Diskette'
      8 = '1496'
      9 = 'SCSI Parallel Interface'
     10 = 'SCSI Fibre Channel Protocol'
     11 = 'SCSI Serial Bus Protocol'
   1394 = 'SCSI Serial Bus Protocol-2'
     13 = 'SCSI Serial Storage Architecture'
     14 = 'VESA'
     15 = 'PCMCIA'
     16 = 'Universal Serial Bus'
     17 = 'Parallel Protocol'
     18 = 'ESCON'
     19 = 'Diagnostic'
     20 = 'I2C'
     21 = 'Power'
     22 = 'HIPPI'
     23 = 'MultiBus'
     24 = 'VME'
     25 = 'IPI'
     26 = 'IEEE-488'
     27 = 'RS232'
     28 = 'IEEE 802.3 10BASE5'
     29 = 'IEEE 802.3 10BASE2'
     30 = 'IEEE 802.3 1BASE5'
     31 = 'IEEE 802.3 10BROAD36'
     32 = 'IEEE 802.3 100BASEVG'
     33 = 'IEEE 802.5 Token-Ring'
     34 = 'ANSI X3T9.5 FDDI'
     35 = 'MCA'
     36 = 'ESDI'
     37 = 'IDE'
     38 = 'CMD'
     39 = 'ST506'
     40 = 'DSSI'
     41 = 'QIC2'
     42 = 'Enhanced ATA/IDE'
     43 = 'AGP'
     44 = 'TWIRP (two-way infrared)'
     45 = 'FIR (fast infrared)'
     46 = 'SIR (serial infrared)'
     47 = 'IrBus'
}

#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 "ProtocolSupported", 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:
#>
 
$ProtocolSupported = @{
  Name = 'ProtocolSupported'
  Expression = {
    # property is an array, so process all values
    $value = $_.ProtocolSupported
    $ProtocolSupported_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "ProtocolSupported". The latter
# is defined by the hashtable in $ProtocolSupported: 
Get-CimInstance -Class Win32_VideoController | Select-Object -Property Caption, $ProtocolSupported

# ...or dump content of property ProtocolSupported:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    Select-Object -Property $ProtocolSupported |
    Select-Object -ExpandProperty ProtocolSupported

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $ProtocolSupported_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# to translate other properties, use their translation table instead
$ProtocolSupported_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'EISA'
      4 = 'ISA'
      5 = 'PCI'
      6 = 'ATA/ATAPI'
      7 = 'Flexible Diskette'
      8 = '1496'
      9 = 'SCSI Parallel Interface'
     10 = 'SCSI Fibre Channel Protocol'
     11 = 'SCSI Serial Bus Protocol'
   1394 = 'SCSI Serial Bus Protocol-2'
     13 = 'SCSI Serial Storage Architecture'
     14 = 'VESA'
     15 = 'PCMCIA'
     16 = 'Universal Serial Bus'
     17 = 'Parallel Protocol'
     18 = 'ESCON'
     19 = 'Diagnostic'
     20 = 'I2C'
     21 = 'Power'
     22 = 'HIPPI'
     23 = 'MultiBus'
     24 = 'VME'
     25 = 'IPI'
     26 = 'IEEE-488'
     27 = 'RS232'
     28 = 'IEEE 802.3 10BASE5'
     29 = 'IEEE 802.3 10BASE2'
     30 = 'IEEE 802.3 1BASE5'
     31 = 'IEEE 802.3 10BROAD36'
     32 = 'IEEE 802.3 100BASEVG'
     33 = 'IEEE 802.5 Token-Ring'
     34 = 'ANSI X3T9.5 FDDI'
     35 = 'MCA'
     36 = 'ESDI'
     37 = 'IDE'
     38 = 'CMD'
     39 = 'ST506'
     40 = 'DSSI'
     41 = 'QIC2'
     42 = 'Enhanced ATA/IDE'
     43 = 'AGP'
     44 = 'TWIRP (two-way infrared)'
     45 = 'FIR (fast infrared)'
     46 = 'SIR (serial infrared)'
     47 = 'IrBus'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.ProtocolSupported  

# translate raw value to friendly text:
$friendlyName = $ProtocolSupported_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 "ProtocolSupported" 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 "ProtocolSupported", 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 "ProtocolSupported", 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:
#>
 
$ProtocolSupported = @{
  Name = 'ProtocolSupported'
  Expression = {
    # property is an array, so process all values
    $value = $_.ProtocolSupported
    
    switch([int]$value)
      {
        1          {'Other'}
        2          {'Unknown'}
        3          {'EISA'}
        4          {'ISA'}
        5          {'PCI'}
        6          {'ATA/ATAPI'}
        7          {'Flexible Diskette'}
        8          {'1496'}
        9          {'SCSI Parallel Interface'}
        10         {'SCSI Fibre Channel Protocol'}
        11         {'SCSI Serial Bus Protocol'}
        1394       {'SCSI Serial Bus Protocol-2'}
        13         {'SCSI Serial Storage Architecture'}
        14         {'VESA'}
        15         {'PCMCIA'}
        16         {'Universal Serial Bus'}
        17         {'Parallel Protocol'}
        18         {'ESCON'}
        19         {'Diagnostic'}
        20         {'I2C'}
        21         {'Power'}
        22         {'HIPPI'}
        23         {'MultiBus'}
        24         {'VME'}
        25         {'IPI'}
        26         {'IEEE-488'}
        27         {'RS232'}
        28         {'IEEE 802.3 10BASE5'}
        29         {'IEEE 802.3 10BASE2'}
        30         {'IEEE 802.3 1BASE5'}
        31         {'IEEE 802.3 10BROAD36'}
        32         {'IEEE 802.3 100BASEVG'}
        33         {'IEEE 802.5 Token-Ring'}
        34         {'ANSI X3T9.5 FDDI'}
        35         {'MCA'}
        36         {'ESDI'}
        37         {'IDE'}
        38         {'CMD'}
        39         {'ST506'}
        40         {'DSSI'}
        41         {'QIC2'}
        42         {'Enhanced ATA/IDE'}
        43         {'AGP'}
        44         {'TWIRP (two-way infrared)'}
        45         {'FIR (fast infrared)'}
        46         {'SIR (serial infrared)'}
        47         {'IrBus'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_VideoController | 
  # ...and output properties "Caption" and "ProtocolSupported". The latter is defined
  # by the hashtable in $ProtocolSupported:
  Select-Object -Property Caption, $ProtocolSupported
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_VideoController", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumProtocolSupported
{
  Other                              = 1
  Unknown                            = 2
  EISA                               = 3
  ISA                                = 4
  PCI                                = 5
  ATAATAPI                           = 6
  Flexible_Diskette                  = 7
  _1496                              = 8
  SCSI_Parallel_Interface            = 9
  SCSI_Fibre_Channel_Protocol        = 10
  SCSI_Serial_Bus_Protocol           = 11
  SCSI_Serial_Bus_Protocol_2         = 1394
  SCSI_Serial_Storage_Architecture   = 13
  VESA                               = 14
  PCMCIA                             = 15
  Universal_Serial_Bus               = 16
  Parallel_Protocol                  = 17
  ESCON                              = 18
  Diagnostic                         = 19
  I2C                                = 20
  Power                              = 21
  HIPPI                              = 22
  MultiBus                           = 23
  VME                                = 24
  IPI                                = 25
  IEEE_488                           = 26
  RS232                              = 27
  IEEE_8023_10BASE5                  = 28
  IEEE_8023_10BASE2                  = 29
  IEEE_8023_1BASE5                   = 30
  IEEE_8023_10BROAD36                = 31
  IEEE_8023_100BASEVG                = 32
  IEEE_8025_Token_Ring               = 33
  ANSI_X3T95_FDDI                    = 34
  MCA                                = 35
  ESDI                               = 36
  IDE                                = 37
  CMD                                = 38
  ST506                              = 39
  DSSI                               = 40
  QIC2                               = 41
  Enhanced_ATAIDE                    = 42
  AGP                                = 43
  TWIRP_two_way_infrared             = 44
  FIR_fast_infrared                  = 45
  SIR_serial_infrared                = 46
  IrBus                              = 47
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.ProtocolSupported

#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 **ProtocolSupported** 
[EnumProtocolSupported]$rawValue 

# get a comma-separated string:
[EnumProtocolSupported]$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 [EnumProtocolSupported]
#endregion

Enums must cover all possible values. If ProtocolSupported 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.

ReservedSystemPaletteEntries

UINT32

Number of reserved entries in the system palette. The operating system may reserve entries to support standard colors for task bars and other desktop display items. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index, and is available only if the driver is compatible with 16-bit Windows. If the system is not using a palette, ReservedSystemPaletteEntries is not set.

Example: 20

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, ReservedSystemPaletteEntries

SpecificationVersion

UINT32

Version number of the initialization data specification (upon which the structure is based).

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, SpecificationVersion

Status

STRING MAX 10 CHAR

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_VideoController | Select-Object -Property DeviceID, Status

StatusInfo

UINT16

State of the logical device. If this property does not apply to the logical device, the value 5 (Not Applicable) should be used.

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_VideoController | Select-Object -Property Caption, $StatusInfo

# ...or dump content of property StatusInfo:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    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_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# 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_VideoController | 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_VideoController | 
  # ...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_VideoController", 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_VideoController | 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.

SystemCreationClassName

STRING

Value of the scoping computer’s CreationClassName property.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, SystemCreationClassName

SystemName

STRING

Name of the scoping system.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, SystemName

SystemPaletteEntries

UINT32

Current number of color index entries in the system palette. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index, and is available only if the driver is compatible with 16-bit Windows. If the system is not using a palette, SystemPaletteEntries is not set.

Example: 20

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, SystemPaletteEntries

TimeOfLastReset

DATETIME

Date and time this controller was last reset. This could mean the controller was powered down or reinitialized.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, TimeOfLastReset

VideoArchitecture

UINT16

Type of video architecture.

VideoArchitecture returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$VideoArchitecture_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'CGA'
      4 = 'EGA'
      5 = 'VGA'
      6 = 'SVGA'
      7 = 'MDA'
      8 = 'HGC'
      9 = 'MCGA'
     10 = '8514A'
     11 = 'XGA'
     12 = 'Linear Frame Buffer'
    160 = 'PC-98'
}
Use a switch statement
switch([int]$value)
{
  1          {'Other'}
  2          {'Unknown'}
  3          {'CGA'}
  4          {'EGA'}
  5          {'VGA'}
  6          {'SVGA'}
  7          {'MDA'}
  8          {'HGC'}
  9          {'MCGA'}
  10         {'8514A'}
  11         {'XGA'}
  12         {'Linear Frame Buffer'}
  160        {'PC-98'}
  default    {"$value"}
}
Use Enum structure
Enum EnumVideoArchitecture
{
  Other                 = 1
  Unknown               = 2
  CGA                   = 3
  EGA                   = 4
  VGA                   = 5
  SVGA                  = 6
  MDA                   = 7
  HGC                   = 8
  MCGA                  = 9
  _8514A                = 10
  XGA                   = 11
  Linear_Frame_Buffer   = 12
  PC_98                 = 160
}

Examples

Use $VideoArchitecture_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "VideoArchitecture" to friendly text

  Note: to use other properties than "VideoArchitecture", 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 "VideoArchitecture" 
# to translate other properties, use their translation table instead
$VideoArchitecture_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'CGA'
      4 = 'EGA'
      5 = 'VGA'
      6 = 'SVGA'
      7 = 'MDA'
      8 = 'HGC'
      9 = 'MCGA'
     10 = '8514A'
     11 = 'XGA'
     12 = 'Linear Frame Buffer'
    160 = 'PC-98'
}

#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 "VideoArchitecture", 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:
#>
 
$VideoArchitecture = @{
  Name = 'VideoArchitecture'
  Expression = {
    # property is an array, so process all values
    $value = $_.VideoArchitecture
    $VideoArchitecture_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "VideoArchitecture". The latter
# is defined by the hashtable in $VideoArchitecture: 
Get-CimInstance -Class Win32_VideoController | Select-Object -Property Caption, $VideoArchitecture

# ...or dump content of property VideoArchitecture:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    Select-Object -Property $VideoArchitecture |
    Select-Object -ExpandProperty VideoArchitecture

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $VideoArchitecture_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# to translate other properties, use their translation table instead
$VideoArchitecture_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'CGA'
      4 = 'EGA'
      5 = 'VGA'
      6 = 'SVGA'
      7 = 'MDA'
      8 = 'HGC'
      9 = 'MCGA'
     10 = '8514A'
     11 = 'XGA'
     12 = 'Linear Frame Buffer'
    160 = 'PC-98'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.VideoArchitecture  

# translate raw value to friendly text:
$friendlyName = $VideoArchitecture_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 "VideoArchitecture" 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 "VideoArchitecture", 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 "VideoArchitecture", 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:
#>
 
$VideoArchitecture = @{
  Name = 'VideoArchitecture'
  Expression = {
    # property is an array, so process all values
    $value = $_.VideoArchitecture
    
    switch([int]$value)
      {
        1          {'Other'}
        2          {'Unknown'}
        3          {'CGA'}
        4          {'EGA'}
        5          {'VGA'}
        6          {'SVGA'}
        7          {'MDA'}
        8          {'HGC'}
        9          {'MCGA'}
        10         {'8514A'}
        11         {'XGA'}
        12         {'Linear Frame Buffer'}
        160        {'PC-98'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_VideoController | 
  # ...and output properties "Caption" and "VideoArchitecture". The latter is defined
  # by the hashtable in $VideoArchitecture:
  Select-Object -Property Caption, $VideoArchitecture
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_VideoController", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumVideoArchitecture
{
  Other                 = 1
  Unknown               = 2
  CGA                   = 3
  EGA                   = 4
  VGA                   = 5
  SVGA                  = 6
  MDA                   = 7
  HGC                   = 8
  MCGA                  = 9
  _8514A                = 10
  XGA                   = 11
  Linear_Frame_Buffer   = 12
  PC_98                 = 160
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.VideoArchitecture

#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 **VideoArchitecture** 
[EnumVideoArchitecture]$rawValue 

# get a comma-separated string:
[EnumVideoArchitecture]$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 [EnumVideoArchitecture]
#endregion

Enums must cover all possible values. If VideoArchitecture 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.

VideoMemoryType

UINT16

Type of video memory.

VideoMemoryType returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$VideoMemoryType_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'VRAM'
      4 = 'DRAM'
      5 = 'SRAM'
      6 = 'WRAM'
      7 = 'EDO RAM'
      8 = 'Burst Synchronous DRAM'
      9 = 'Pipelined Burst SRAM'
     10 = 'CDRAM'
     11 = '3DRAM'
     12 = 'SDRAM'
     13 = 'SGRAM'
}
Use a switch statement
switch([int]$value)
{
  1          {'Other'}
  2          {'Unknown'}
  3          {'VRAM'}
  4          {'DRAM'}
  5          {'SRAM'}
  6          {'WRAM'}
  7          {'EDO RAM'}
  8          {'Burst Synchronous DRAM'}
  9          {'Pipelined Burst SRAM'}
  10         {'CDRAM'}
  11         {'3DRAM'}
  12         {'SDRAM'}
  13         {'SGRAM'}
  default    {"$value"}
}
Use Enum structure
Enum EnumVideoMemoryType
{
  Other                    = 1
  Unknown                  = 2
  VRAM                     = 3
  DRAM                     = 4
  SRAM                     = 5
  WRAM                     = 6
  EDO_RAM                  = 7
  Burst_Synchronous_DRAM   = 8
  Pipelined_Burst_SRAM     = 9
  CDRAM                    = 10
  _3DRAM                   = 11
  SDRAM                    = 12
  SGRAM                    = 13
}

Examples

Use $VideoMemoryType_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "VideoMemoryType" to friendly text

  Note: to use other properties than "VideoMemoryType", 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 "VideoMemoryType" 
# to translate other properties, use their translation table instead
$VideoMemoryType_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'VRAM'
      4 = 'DRAM'
      5 = 'SRAM'
      6 = 'WRAM'
      7 = 'EDO RAM'
      8 = 'Burst Synchronous DRAM'
      9 = 'Pipelined Burst SRAM'
     10 = 'CDRAM'
     11 = '3DRAM'
     12 = 'SDRAM'
     13 = 'SGRAM'
}

#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 "VideoMemoryType", 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:
#>
 
$VideoMemoryType = @{
  Name = 'VideoMemoryType'
  Expression = {
    # property is an array, so process all values
    $value = $_.VideoMemoryType
    $VideoMemoryType_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "VideoMemoryType". The latter
# is defined by the hashtable in $VideoMemoryType: 
Get-CimInstance -Class Win32_VideoController | Select-Object -Property Caption, $VideoMemoryType

# ...or dump content of property VideoMemoryType:
$friendlyValues = Get-CimInstance -Class Win32_VideoController | 
    Select-Object -Property $VideoMemoryType |
    Select-Object -ExpandProperty VideoMemoryType

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $VideoMemoryType_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_VideoController" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_VideoController", 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_VideoController" 
# to translate other properties, use their translation table instead
$VideoMemoryType_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'VRAM'
      4 = 'DRAM'
      5 = 'SRAM'
      6 = 'WRAM'
      7 = 'EDO RAM'
      8 = 'Burst Synchronous DRAM'
      9 = 'Pipelined Burst SRAM'
     10 = 'CDRAM'
     11 = '3DRAM'
     12 = 'SDRAM'
     13 = 'SGRAM'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.VideoMemoryType  

# translate raw value to friendly text:
$friendlyName = $VideoMemoryType_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 "VideoMemoryType" 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 "VideoMemoryType", 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 "VideoMemoryType", 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:
#>
 
$VideoMemoryType = @{
  Name = 'VideoMemoryType'
  Expression = {
    # property is an array, so process all values
    $value = $_.VideoMemoryType
    
    switch([int]$value)
      {
        1          {'Other'}
        2          {'Unknown'}
        3          {'VRAM'}
        4          {'DRAM'}
        5          {'SRAM'}
        6          {'WRAM'}
        7          {'EDO RAM'}
        8          {'Burst Synchronous DRAM'}
        9          {'Pipelined Burst SRAM'}
        10         {'CDRAM'}
        11         {'3DRAM'}
        12         {'SDRAM'}
        13         {'SGRAM'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_VideoController | 
  # ...and output properties "Caption" and "VideoMemoryType". The latter is defined
  # by the hashtable in $VideoMemoryType:
  Select-Object -Property Caption, $VideoMemoryType
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_VideoController", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumVideoMemoryType
{
  Other                    = 1
  Unknown                  = 2
  VRAM                     = 3
  DRAM                     = 4
  SRAM                     = 5
  WRAM                     = 6
  EDO_RAM                  = 7
  Burst_Synchronous_DRAM   = 8
  Pipelined_Burst_SRAM     = 9
  CDRAM                    = 10
  _3DRAM                   = 11
  SDRAM                    = 12
  SGRAM                    = 13
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_VideoController | 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.VideoMemoryType

#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 **VideoMemoryType** 
[EnumVideoMemoryType]$rawValue 

# get a comma-separated string:
[EnumVideoMemoryType]$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 [EnumVideoMemoryType]
#endregion

Enums must cover all possible values. If VideoMemoryType 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.

VideoMode

UINT16

Current video mode.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, VideoMode

VideoModeDescription

STRING

Current resolution, color, and scan mode settings of the video controller.

Example: “1024 x 768 x 256 colors”

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, VideoModeDescription

VideoProcessor

STRING

Free-form string describing the video processor.

Get-CimInstance -ClassName Win32_VideoController | Select-Object -Property DeviceID, VideoProcessor

Examples

List all instances of Win32_VideoController
Get-CimInstance -ClassName Win32_VideoController

Learn more about Get-CimInstance and the deprecated Get-WmiObject.

View all properties
Get-CimInstance -ClassName Win32_VideoController -Property *
View key properties only
Get-CimInstance -ClassName Win32_VideoController -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 = 'AcceleratorCapabilities',
              'AdapterCompatibility',
              'AdapterDACType',
              'AdapterRAM',
              'Availability',
              'CapabilityDescriptions',
              'Caption',
              'ColorTableEntries',
              'ConfigManagerErrorCode',
              'ConfigManagerUserConfig',
              'CreationClassName',
              'CurrentBitsPerPixel',
              'CurrentHorizontalResolution',
              'CurrentNumberOfColors',
              'CurrentNumberOfColumns',
              'CurrentNumberOfRows',
              'CurrentRefreshRate',
              'CurrentScanMode',
              'CurrentVerticalResolution',
              'Description',
              'DeviceID',
              'DeviceSpecificPens',
              'DitherType',
              'DriverDate',
              'DriverVersion',
              'ErrorCleared',
              'ErrorDescription',
              'ICMIntent',
              'ICMMethod',
              'InfFilename',
              'InfSection',
              'InstallDate',
              'InstalledDisplayDrivers',
              'LastErrorCode',
              'MaxMemorySupported',
              'MaxNumberControlled',
              'MaxRefreshRate',
              'MinRefreshRate',
              'Monochrome',
              'Name',
              'NumberOfColorPlanes',
              'NumberOfVideoPages',
              'PNPDeviceID',
              'PowerManagementCapabilities',
              'PowerManagementSupported',
              'ProtocolSupported',
              'ReservedSystemPaletteEntries',
              'SpecificationVersion',
              'Status',
              'StatusInfo',
              'SystemCreationClassName',
              'SystemName',
              'SystemPaletteEntries',
              'TimeOfLastReset',
              'VideoArchitecture',
              'VideoMemoryType',
              'VideoMode',
              'VideoModeDescription',
              'VideoProcessor'
Get-CimInstance -ClassName Win32_VideoController | 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_VideoController -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_VideoController -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 InfFilename, VideoMemoryType, ErrorDescription, VideoMode FROM Win32_VideoController 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 InfFilename, VideoMemoryType, ErrorDescription, VideoMode FROM Win32_VideoController WHERE Caption LIKE 'a%'" | Select-Object -Property InfFilename, VideoMemoryType, ErrorDescription, VideoMode

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_VideoController -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_VideoController -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_VideoController, 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_VideoController was introduced on clients with Windows Vista and on servers with Windows Server 2008.

Namespace

Win32_VideoController 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_VideoController 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