##Parameter $NUMBER_OF_SAMPLES = 5; $SAMPLE_INTERVAL_TIME = 1; $counters = @( "\Memory\Available MBytes", "\Processor(_Total)\% Processor Time", "\LogicalDisk(_Total)\% Free Space", "\Network Adapter(NIC TEAM 1)\Bytes Total/sec", "\Objects\Processes" ) ##enter other counter here. ##the values are saved here. $val = @{} $i = 0; foreach($counter in $counters) { Write-Progress -activity "Collecting performance data" -status "Counter data $($i+1) von $($counters.Count): $($counter)" -PercentComplete $(($i+1)/($counters.Count+1)*100) try { $v = Get-Counter -Counter $counter -MaxSamples $NUMBER_OF_SAMPLES -SampleInterval $SAMPLE_ INTERVAL_TIME $val.Add($counter, ($v.CounterSamples.CookedValue | Measure-Object -Average).Average ) } catch { Write-Host "Error: the counter could not be collected. Reason: $($_)" } $i++; } Write-Progress -activity "Collecting performance data" status "Releasing results" -PercentComplete 100 Write-Host "Results: " $val