Lets stick with WMI and jump forward to chapter 10 where we will concentrate on disks and the file system
Starting point is physical disks. The WMI class the logically named Win32_DiskDrive. If you want to see all properties use
Get-WmiObject Win32_DiskDrive | select *
This display is a little odd as the information is put out in an apparently random order with the __ properties in the middle. However, if you want to reproduce the script in the book then we need to be a little more selective.
Get-WmiObject Win32_DiskDrive | select caption, deviceid,index, interfacetype, manufacturer, medialoaded, mediatype, model, name, partitions, pnpdeviceid, scsibus, scsilogicalunit, scsiport, scsitargetid, sectorspertrack, size, status, totalcylinders, totalheads, totalsectors, totaltracks, trackspercylinder
This follows the usual pattern of choosing the class in get-wmiobject and then selecting the properties we are interested in.
I will be posting these scripts for download soon.