Summary
In this chapter, you learned about leveraging PowerShell to interact with disk drives. You started the chapter by learning about the get-disk
cmdlet. You continued to leverage the get-wmiobject
with the win32_logicaldrive
class to query disk information. You then created a switch
statement to determine the different disk types. You also learned how to convert bytes to megabytes and gigabytes. You created a function to dynamically convert to different units of measure and round the values to two decimal places. You ended the chapter by creating a disk information script that queries the disks on a system, converts the disk size and freespace, calculates the units of measure, and identifies the drive types.
In the next chapter, you will scan Windows features and the software installed on a system.