Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Collect  Processor  Information  

 Content of Collect Processor Information.ps1
MD5 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 ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a