Skip to content

Instantly share code, notes, and snippets.

Working from home

Nick Shores nshores

Working from home
Block or report user

Report or block nshores

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Get Storage Total.ps1
#Create a CSV file with a Column called name containing all your VM names, 1 per line.
$vmlist = import-csv "c:\your\csv\here.csv"
$totaldiskgb = @()
foreach ($vm in $vmlist) {
$disksum = get-vm $ | get-harddisk | Select-Object CapacityGB | Measure-Object CapacityGB -Sum
$totaldiskgb += $disksum.sum
$gb = ($totaldiskgb | measure-object -sum).sum
Write-host " Total Size $t GB"
You can’t perform that action at this time.