Skip to content

Commit

Permalink
Update summarize-VMNetUsage.ps1
Browse files Browse the repository at this point in the history
Added -instance to get-stat to further reduce the amount of data being pulled from vCenter.
  • Loading branch information
NamedJason committed Sep 24, 2018
1 parent fed18e3 commit 23ae10c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PowerShell/summarize-VMNetUsage.ps1
Expand Up @@ -13,7 +13,7 @@ function get-VMNetUseSummary {
#Gets the highest average network usage for all VMs in the environment
foreach ($vm in $allVMs){
write-progress -id 1 -activity "Getting VM Network Usage" -status "Checking $($vm.name)..." -percentComplete ($i++ / $allVMs.count * 100)
$networkUsage += (get-stat -Entity $vm -stat "net.usage.average" -realtime).value | sort -Descending | select -first 1
$networkUsage += (get-stat -Entity $vm -stat "net.usage.average" -realtime -instance vmnic*).value | sort -Descending | select -first 1
}
#Creates a summary with Sum, Average, Maximum and Date for the network usage of the whole environment
$summary = $networkUsage | Measure-Object -sum -average -maximum -minimum
Expand Down

0 comments on commit 23ae10c

Please sign in to comment.