PowerShell Great Debate: “Fixing” Output

When should a script (or more likely, function) output raw data, and when should it “massage” its output? The classic example is something like disk space. You’re querying WMI, and it’s giving you disk space in bytes. Nobody cares about bytes. Should your function output bytes anyway, or output megabytes or gigabytes? If you output raw data, how would you expect a user to get a more-useful version? Would you expect someone running your command to use Select-Object on their own to do the math, or would you perhaps provide a default formatting view (a la what Get-Process does) that […]


Philadelphia Meeting – September 5th, 2013

Please join us Thursday, September 5th when Mike F. Robbins will be joining us via Lync to present on Using CIM Cmdlets and CIM Sessions. Years ago, needing something as simple as the serial number from a remote server often meant that administrators had to resort to making a trip to the remote location. Even back in those days, some administrators were savvy enough to query WMI with third party programs or scripting languages such as VBScript to retrieve this information. Although, querying WMI was kind of like black magic back in those days and it was often simply easier to […]


Some Event 3 Notes

I didn’t see anyone (although I’ll admit I haven’t checked every entry) using my EnhancedHTML module from Creating HTML Reports in PowerShell. I am ensaddened. But man, Event 3 shows that you can really do well by learning a wee bit of HTML. Knowing an H2 and HR tag makes for much pretty results. Take it as career advice. As a nitpick, don’t use Convert as a function verb unless all the function is going to do is convert something. It shouldn’t “Get” as well. That said, because this event wants a single function that both gets and converts… which […]


CIM vs WMI cmdlets-remote execution speed

Following on from my previous post we’ll look at how the two types of cmdlets compare for accessing remote machines. I used a similar format to the previous tests but was accessing a remote machine. First off was the WMI … Continue reading



Use PowerShell to Modify WMI Data Such as Drive Labels

Summary: The Scripting Wife learns how to use the CIM cmdlets and Windows PowerShell to assign a new drive label by modifying WMI data.
Weekend Scripter: Changing WMI information
Microsoft Scripting Guy, Ed Wilson, is here. Well yesterday, after we got…


Advanced Practice Event

I want to direct your attention to this forums post, which I think is worth anyone’s time to look through. I’ve left a pretty long reply with some comments on the entry that would also be worth a read. I find that a LOT of folks – like the gentleman who posted his script – have a really good approach to PowerShell scripts. They want to use parameters. They want verbose output. They want to proactively check for errors. Where I think folks get lost is in the fine points of how PowerShell enables these features. I see folks working […]


Weekend Scripter: Use PowerShell to Find the Version of Windows

Summary: The Scripting Wife learns about using Windows PowerShell to find computer hardware information in prep for the 2013 Scripting Games.
Microsoft Scripting Guy, Ed Wilson, is here. This morning did not start with a nice leisurely cup of tea on th…


Get CIMInstance from PowerShell 2.0

I love the new CIM cmdlets in PowerShell 3.0. Querying WMI is a little faster because the CIM cmdlets query WMI using the WSMAN protocol instead of DCOM. The catch is that remote computers must be running PowerShell 3 which includes the latest version of the WSMAN protocol and the WinRM service. But if your […]




Shutting down a remote computer

PowerShell provides the Stop-Computer cmdlet for closing down a remote machine. I find this especially useful in my virtual test environment. I’ll have several machines running but won’t necessarily have logged onto them. Using Stop-Computer means that I can shut … Continue reading


CIM cmdlets

The CIM cmdlets are found in the CIMcmdlets module. Get-Command -Module CimCmdlets  produces this list of names.  I’ve added some information on the tasks they perform Get-CimAssociatedInstance  is for working with WMI associated classes Get-CimClass  is for discovering the properties … Continue reading


WMI vs CIM

An email debate yesterday regarding the use of the CIM cmdlets (new in PowerShell 3) vs the WMI cmdlets made me realise that other people are probably wondering the same thing, The question is really part of a the semi-philosophical … Continue reading


WMI Explorer from The PowerShell Guy

Several years ago, The PowerShell Guy, aka MoW, wrote a fantastic graphical PowerShell script that was a WMI Explorer. With this script you could connect to a computer and namespace, browse classes and view instances. A great way for discovering things about WMI. However Marc has moved on to other things I think and his […]