Summary: Use Windows PowerShell to find the key of a WMI class.
How can I use Windows PowerShell to discover the property that has the key qualifier for a WMI class?
Use Get-CimClass and iterate through the properties:
$class = Get-CimClass -ClassName Win32_Process
foreach ($property in $class.CimClassProperties) {
$property | select -ExpandProperty Qualifiers |
foreach {
if ($_.Name -eq ‘key’){
$property
}
}
}
0 comments