Create WMI class and add static property or default value
问题 I'm trying to create a WMI class and add a static property, or set the default value of the property $WMI_Class = New-Object System.Management.ManagementClass("root\default", $null, $null) $WMI_Class.Qualifiers.Add("Static", $true) $WMI_Class.Properties.Add("ver", [System.Management.CimType]::String, "myDefaultValue") $WMI_Class.name = "MyCoreClass" $WMI_Class.Put() $obj = ([WmiClass] 'root\default:MyCoreClass') $ver = $obj.Properties['ver'].Value $ver The class is created but the $ver is