PowerShell to Get OS Type and Count

My manager asked for the count of Windows Server 2012 virtual servers. So I did a fast and dirty script to get just the count of Server 2012

$server2012 = ((get-vm).extensiondata.guest | Where GuestFullName -eq "Microsoft Windows Server 2012 (64-bit)").count

After I provided the results from this, I worked to make it a better, more robust script.… Continue reading