PowerShell script to list mount points in Windows

Here is a PowerShell script that will list the mount points in Windows along with Capacity in GB, Free space in GB, Free space in %.

gwmi win32_volume|where-object {$_.filesystem -match “ntfs”}|ft name,@{Name=”Capacity(GB)”;expression={[math]::round(($_.Capacity/ 1073741824),2)}},@{Name=”FreeSpace(GB)”;expression={[math]::round(($_.FreeSpace / 1073741824),2)}},@{Name=”Free(%)”;expression={[math]::round(((($_.FreeSpace / 1073741824)/($_.Capacity / 1073741824)) * 100),0)}}

PowerShell command to list mount points
This entry was posted in Microsoft, Scripting and tagged , , , , . Bookmark the permalink.

One Response to PowerShell script to list mount points in Windows

  1. Ralph Freibeuter says:

    does not work with folders assigned to a drive

Leave a Reply

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