Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Collect Processor InformationContent of Collect Processor Information.ps1MD5 Hash: 66153241EB55E0A02C0F6F94BD51052E |
||
Function CreateEmptyArray($ubound)
{ [int[]]$script:aryProp = [array]::CreateInstance("int",$ubound) } #end CreateEmptyArray Function GetWmiPerformanceData() { For($i = 0 ; $i -le $reps -1 ; $i++) { $aryProp[$i] +=([wmi]"\\$computer\root\cimv2:$class.$key='$instance'").$Property Write-Progress -Activity "Obtaining Processor info" -Status "% complete: " ` -PercentComplete $i Start-Sleep -Seconds $delay } #end for }#end GetWmiPerformanceData Function EvaluateObject() { $aryProp | Measure-Object -Average -Maximum -Minimum | Format-Table -Property ` @{ Label = "Data Points" ; Expression = {$_.count} }, average, Maximum, Minimum -autosize } #End EvaluateObject # *** Entry Point *** $computer = "." $delay = 1 $reps = 10 $class = "Win32_PerfFormattedData_PerfOS_Processor" $key = "name" $instance = "_Total" $property = "PercentProcessorTime" CreateEmptyArray($reps) GetWmiPerformanceData EvaluateObject | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |