How To Display Mount Points and Drives Using PowerShell


To continue on with more useful PowerShell we cover getting details on drives including drives that are using mount points.

The Code

For the most part we will be making a call to WMI using win32_volumes class and using auto format to output to a table. In the output we want to display Disk free space, total space, disk percentage as well as name and  drive letter. The name output includes the full path to the mount point.



So what does it look like?



Another task handled by PowerShell, happy coding.

2 Responses to “How To Display Mount Points and Drives Using PowerShell”

  1. Chuck King says:

    I am new to PowerShell and like your code. How would you output the results to a csv file?

    • newlife007 says:

      I appreciate the comments, I try to keep the scripts easy to read and use. PowerShell makes it easy with cmdlet Export-CSV, just replace the Format-table with Export-CSV -path c:\Support\myfile.csv -append

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.