{"id":418,"date":"2014-11-02T11:59:00","date_gmt":"2014-11-02T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/11\/02\/powertip-use-powershell-to-query-cluster-shared-volumes-free-space\/"},"modified":"2014-11-02T11:59:00","modified_gmt":"2014-11-02T11:59:00","slug":"powertip-use-powershell-to-query-cluster-shared-volumes-free-space","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-use-powershell-to-query-cluster-shared-volumes-free-space\/","title":{"rendered":"PowerTip: Use PowerShell to Query Cluster Shared Volumes&#039; Free Space"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: Learn how to use Windows PowerShell to query for <span>free space in C<\/span>luster Shared Volumes.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\">&nbsp;How can I use Windows PowerShell to find the free space in all my Cluster Shared Volumes for Hyper-V in <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Windows Server 2012&nbsp;R2 or Windows Server 2012?<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\">&nbsp;Use the&nbsp;<b>Get-ClusterSharedVolume<\/b>&nbsp;cmdlet with the&nbsp;<b>&ndash;Cluster<\/b>&nbsp;parameter and your Hyper-V cluster name. <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Loop through each cluster shared volume and output a Windows PowerShell custom object to the pipeline. <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The following example is a single-line command broken to display on the webpage:<\/p>\n<p style=\"margin-left:90px\">Get-ClusterSharedVolume -Cluster HV-CLUSTER1 |<\/p>\n<p style=\"margin-left:90px\">ForEach-Object {<\/p>\n<p style=\"margin-left:90px\">[PSCustomObject]@{VolumeName = $_.Name; FreeSpace =$_.SharedVolumeInfo.Partition.FreeSpace}}<\/p>\n<p style=\"margin-left:60px\"><b>Note<\/b>&nbsp; Today&rsquo;s PowerTip is provided by Microsoft premier field engineer, Brian Wilhite<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to use Windows PowerShell to query for free space in Cluster Shared Volumes. &nbsp;How can I use Windows PowerShell to find the free space in all my Cluster Shared Volumes for Hyper-V in &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Windows Server 2012&nbsp;R2 or Windows Server 2012? &nbsp;Use the&nbsp;Get-ClusterSharedVolume&nbsp;cmdlet with the&nbsp;&ndash;Cluster&nbsp;parameter and your Hyper-V [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[327,56,356,3,45],"class_list":["post-418","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-brian-wilhite","tag-guest-blogger","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to use Windows PowerShell to query for free space in Cluster Shared Volumes. &nbsp;How can I use Windows PowerShell to find the free space in all my Cluster Shared Volumes for Hyper-V in &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Windows Server 2012&nbsp;R2 or Windows Server 2012? &nbsp;Use the&nbsp;Get-ClusterSharedVolume&nbsp;cmdlet with the&nbsp;&ndash;Cluster&nbsp;parameter and your Hyper-V [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=418"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/418\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}