PowerShell WMI Module v1.0 Released!

The PowerShell WMI Module was developed to make it easier to create custom WMI Namespaces and Classes.

This module was inspired by Jason Sandys
System Center Universe presentation on WMI Manipulations and Manifestations

The module has been uploaded to TechNet Script Gallery. Get it here!

Module Functions

Get-WMINamespace

This function returns an object containing the Namespace requested.

Example: Get-WMINamespace –Namespace ‘Namespace1′

Get-WMIClass

This function returns an object containing the WMI Class requested.

Example: Get-WMIClass –Namespace ‘Namespace1′ –ClassName ‘Class1′

New-WMINamespace

This function creates a new WMI Namespace and returns the WMI Namespace object using Get-WMINamespace.

Example: New-WMINamespace –Root ‘Root’ –Name ‘Namespace1′

New-WMIClass

This function creates a new WMI Class and returns the WMI Class object using Get-WMIClass.

Example: New-WMIClass –Name ‘Class1′ –Namespace ‘Root\Namespace1′

Add-WMIClassProperty

This function adds a single WMI Class Property to your custom WMI Class. Use this function multiple times to add multiple properties.

Examples:

Add-WMIClassProperty -Namespace $namespace
-ClassName $className
-PropertyName “Default”
-PropertyType ‘String’
–IsKey

 

Add-WMIClassProperty -Namespace $namespace
-ClassName $className
-PropertyName “IsEnabled”
-PropertyType ‘String’

email

Written by , Posted .