PowerTip: Use PowerShell to Query Cluster Shared Volumes' Free Space

Doctor Scripto

Summary: Learn how to use Windows PowerShell to query for free space in Cluster Shared Volumes.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the free space in all my Cluster Shared Volumes for Hyper-V in
           Windows Server 2012 R2 or Windows Server 2012?

Hey, Scripting Guy! Answer Use the Get-ClusterSharedVolume cmdlet with the –Cluster parameter and your Hyper-V cluster name.
           Loop through each cluster shared volume and output a Windows PowerShell custom object to the pipeline.
           The following example is a single-line command broken to display on the webpage:

Get-ClusterSharedVolume -Cluster HV-CLUSTER1 |

ForEach-Object {

[PSCustomObject]@{VolumeName = $_.Name; FreeSpace =$_.SharedVolumeInfo.Partition.FreeSpace}}

Note  Today’s PowerTip is provided by Microsoft premier field engineer, Brian Wilhite


Discussion is closed.

Feedback usabilla icon