February 2019
Intermediate to advanced
626 pages
15h 51m
English
CIM-based commands that accept pipeline input, such as Set-NetAdapter, require a CIM instance with a specific PSTypeName. The PSTypeName is a string property normally hidden from Get-Member.
Exploring the InputObject parameter of Set-NetAdapter shows that it accepts a CIM instance type. Expanding the PSTypeName attribute shows that it also requires an object that includes the type name Microsoft.Management.Infrastructure.CimInstance#MSFT_NetAdapter:
PS> (Get-Command Set-NetAdapter).Parameters['InputObject'].ParameterType.NameCimInstance[]PS> (Get-Command Set-NetAdapter).Parameters['InputObject'].Attributes.>> Where{ $_.TypeId -match 'PSType' }.PSTypeNameMicrosoft.Management.Infrastructure.CimInstance#MSFT_NetAdapter
Read now
Unlock full access