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

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

Comments (1)

  1. gnani says:

    Hai this is gnani software engg’r. please visit this blogger and help to other and your friends. what and all i wrote the code using jquery in .net i put in my blogger, if you don’t mind please share it to all our young stur’s. please

Skip to main content