Get complete disk allocated for computer RRS feed

  • Question

  • Hi.

    I sometimes run this script to get size and free space for the disks on computers:

    $computers = ("srv1,"srv2")
    foreach  ($computer in $computers) {
    Get-WmiObject win32_volume -computer $computer |
    select $computer,name, label, @{Name="Capacity (GB)";Expression={$_.Capacity/1GB}},
    @{Name="FreeSpace (GB)";Expression={$_.FreeSpace/1GB}},
    @{Name="FreeSpace (PCT)";Expression={$_.FreeSpace/$_.Capacity*100}} |
    sort "name" |

    But I also need some way to combine the capacity of all the disks on every computer.  Is there any way to change this script so I can get that sum?


    • Moved by Bill_Stewart Wednesday, July 26, 2017 7:39 PM This is not "scripts on demand"
    Tuesday, June 20, 2017 10:45 AM

All replies

  • Sorry but we do not modify scripts on request. 

    I recommend starting by learning basic PowerShell.


    Tuesday, June 20, 2017 1:33 PM