Would you like fries with your script ?

I was asked today by our Virtualization team to write a script to support a project that they are about to take on.   The VMWare infrastructure team was looking to upgrade all vmware servers from hardware version 4 to hardware version 7.  The question they had was would it be possible to query the Device Manager from a script and out put the Name of each device and also the Status of the device.  They wanted to be able to do this query against a list of computers before and after the upgrade to assure that the upgrade went successfully.  So I said no problem…. I can script that.

Here is the horrendously long script!  ( With PS-Remoting 😮 for extra bling   )

PS:> Invoke-Command -ComputerName (Get-Content C:\Temp\HWUpgradeIn.txt) -ScriptBlock { Get-WMIObject Win32_PnpEntity | Select ServerName, Name, Status | Out-File c:\Temp\HWUpgradeOut.txt }

This script took me about 5 minutes to come up with.  While I wrote the script the VM team walked back to their desk and started to compile the list of server that they were going to ask me to test with.  They were about to send the email when I walked up and said the script was done. 😮  Just to show them how cool Powershell is…. I showed off a little bit and had one of the guys recreate the script through dictation on his machine. 

 I was in a meeting later in the day and a VM Team member said that I was able to script the process with McDonalds Drive Thru quickness…. So my new tag line is “Do you want fries with that script?”

God Bless and have fun scripting!

Published by ScriptWarrior

Father, Geek - Automation Evangelist with Windows Powershell

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: