November 2nd, 2014

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

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.