Hi, I have little question to Richard Siddaway's book, if I may:) .
In "powershell and WMI", in section "best practise" Richard has written like this:
"Use Test-Connection -ComputerName $computer -Count 1 to test the availability of a remote machine before using WMI."
In powershell v5, test-connection or win32_pingstatus are members of the same class
..so ..or I can understand this paragraphe(test-connection and another class like win32_diskdrive or win32_pingstatus are members of System.Management.ManagementObject#root\cimv2\*) or it was difference in previous powershell version (v3,v2)? Why use test-connection before wmi technology sice are members of the same namespaces?
May be it was just suggestion not to reinvent wheel? :)
Get-WMI is an expensive call -- read that as SLOW. It becomes painfully slow when you have to wait to timeout for a machine that's not online when your script is running. So it's considered a best practice to see if the machine (or address) is alive before trying to connect to it for WMI data. Not required, it just makes sense from an efficiency standpoint.