My home media server lost a hard drive earlier this year. I had no idea how long it had been in service, or that it was about to go, despite this data being available from WMI. Test-DiskStatus.ps1 will give you the following information for each drive on the system queried: drive letter, size in GB, free space in GB, percent free, model, total read errors, read errors corrected, power on hours, power on hours as years, device ID, firmware, serial number, SMART support and whether SMART is predicting failure. You must run the script as an administrator. To get data for your own computer, use “localhost” as the computer name when prompted. The code shows you how to get a physical drive from the logical disk using “Get-CimAssociatedInstance”. It also demonstrates collecting data using and ordered hashtable which is later converted into a PSCustomObject.