I have decided to jump to the WMI section. The VBScript dictionary object is equivalent (ish) to the PowerShell hash table which has been covered in many places. Chapter 5 is on ADSI and having just finished writing a big chapter on that for my book I wanted to look at something else.
Chapter 6 in the scripting guide covers WMI. PowerShell has great WMI support so if we look at
Listing 6.1 shows us how to get the Total Physical Memory on a machine (10 lines of VBScript)
The listing uses the Win32_LogicalMemoryConfiguration class so we turn the script into
Get-WmiObject -Class Win32_LogicalMemoryConfiguration | Select TotalPhysicalMemory
However, XP and later don’t support this so we use
Get-WmiObject -Class Win32_OperatingSystem | Select TotalVisibleMemorySize
This is one area where research pays off as WMI is evolving and changing with each version of Windows