WPS Scripts

 

WMI_win32_classes.ps1

One of the essential aspects of PowerShell is the access and use of Windows Management Instrumentation classes in the Root\CIMv2 namespace.  The win32_ classes will allow you to access, configure, report on, and manipulate nearly every aspect of the Windows machines across your network.  But what is an easy and convenient way to access the win32_ classes from PowerShell?  Well from powershell you can run this simple script to look at every win32_ class orgainzed by first letter.  Just copy this script, save with a .PS1 extension, run and enjoy!  HINT: open WPS, browse to the folder holding the script and type the first letter then hit tab until the script name appears in your prompt, then hit enter.

# WMI_win32_classes.ps1
# Copywrite 2010 RightDesigns – www.rightdesigns.com
# This script can be freely used and distributed, please retain the Copywrite and Author information.
# Author: Michael Pitcher
# Get any set of WMI WIN32_ class objects grouped by first letter of the name of the class a-z
# Hint if looking for classes around disks for instance – try “d” or “l” 
 
 do
  {$L = read-host -prompt “Enter the first letter of the WMI WIN32_ class group you want…”
  gwmi -List | Where {$_.name -match “win32_”+$L} | Sort
  $C = read-host -Prompt “Would you like to chose another WMI WIN32_ class group by first letter? (Y/N)”}
 until ($C -eq “N”) 
 
 
#—————-
  • Share/Bookmark
Info
Date Posted: 16 Feb 2010 @ 9:58 PM
Last Modified: 16 Feb 2010 @ 10:24 PM
Posted By: Raven
 

Responses to this post » (None)

 
Post a Comment

You must be logged in to post a comment.


 Last 50 Posts
 Back
 Back
Change Theme...
  • Users » 5
  • Posts/Pages » 3
  • Comments » 0
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

WPS Scripts



    No Child Pages.