2016-02-26

PowerShell: Total all hdd space script

On local computer:

Get-WMIObject Win32_LogicalDisk | ForEach-Object {[math]::round($_.size / 1GB)}|Measure-Object -sum | select sum

On remote computer:

Get-WMIObject Win32_LogicalDisk -ComputerName RemoteComputerName | ForEach-Object {[math]::round($_.size / 1GB)}|Measure-Object -sum | select sum

/Geecoholic

No comments:

Post a Comment