Friday 24 April 2015

Finding volume GUIDs from powershell

This peice of PowerShell will find all the volume GUIDs, their name and free space.

Get-WmiObject -class Win32_Volume -computername localhost | where-object {$_.name -like "\\?\*"} | select-object label, name, @{ Label = "Capacity(GB)" ; Expression = { "{0:N2}" -f ($_.capacity/1024/1024/1024) } },@{ Label = "Freespace(GB)" ; Expression = { "{0:N2}" -f ($_.freespace/1024/1024/1024) } } | ft -auto

No comments:

Post a Comment