CIM objects

Commands that require instances of CIM objects can be provided with empty instances:

$cimInstance = New-Object Microsoft.Management.Infrastructure.CimInstance('Null') 

The string value used by the constructor is not validated against existing WMI classes. Commands that accept CIM instances as parameters typically validate using the PSTypeNames attribute. Additional type names can be added to the list for any object as follows:

$cimInstance = New-Object Microsoft.Management.Infrastructure.CimInstance('Null') 
$cimInstance | Add-Member -TypeName 'Microsoft.Management.Infrastructure.CimInstance#MSFT_Something'

TypeNames are held as an array in a hidden property of the object instance:

PS> $cimInstance.PSObject.TypeNames
Microsoft.Management.Infrastructure.CimInstance#MSFT_Something
Microsoft.Management.Infrastructure.CimInstance#Null
Microsoft.Management.Infrastructure.CimInstance
System.Object
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.235.62