Categories

CDXML–NetworkAdapterConfiguration–IP Enabled

Last time we added a search parameter enabling this:

Get-NetworkAdapterConfiguration -DHCPEnabled $true

I also want to be able to search based on if the adapter if IP Enabled using:

Get-NetworkAdapterConfiguration -IPEnabled $true

This can be achieved by specifying another search parameter:

<Property PropertyName="IPEnabled">
<Type PSType = "System.Boolean"/>
<RegularQuery >
   <CmdletParameterMetadata PSName="IPEnabled" />
</RegularQuery>
</Property>

This the same as was done for DHCPEnabled except that the IPEnabled property is used.

The full XML now looks like this:

<?xml version='1.0' encoding='utf-8'?>
<PowerShellMetadata xmlns='http://schemas.microsoft.com/cmdlets-over-objects/2009/11'>
  <Class ClassName='ROOT\cimv2\Win32_NetworkAdapterConfiguration'>
    <Version>1.0</Version>
    <DefaultNoun>NetworkAdapterConfiguration</DefaultNoun>

    <InstanceCmdlets>
      <GetCmdletParameters DefaultCmdletParameterSet='DefaultSet'>
       
        <QueryableProperties>
           <Property PropertyName="DHCPEnabled">
            <Type PSType = "System.Boolean"/>
            <RegularQuery >
              <CmdletParameterMetadata PSName="DHCPEnabled" />
            </RegularQuery>
           </Property>
          
           <Property PropertyName="IPEnabled">
            <Type PSType = "System.Boolean"/>
            <RegularQuery >
              <CmdletParameterMetadata PSName="IPEnabled" />
            </RegularQuery>
           </Property>
       
        </QueryableProperties>
             
      </GetCmdletParameters>
    </InstanceCmdlets> 
  </Class>
</PowerShellMetadata>

Leave a Reply