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>

Advertisements
This entry was posted in CDXML, CIM, PowerShell V3, PowerShell v4. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s