Categories

Refreshing values

The CIM cmdlets in PowerShell v3 enable you to refresh the data in the object.  Try this:

$p = Get-CimInstance -ClassName Win32_PerfFormattedData_PerfOS_Processor
$p | Get-CimInstance | select percentprocessortime

  $p will remain unchanged.  Another use for this is monitoring processes – you could check on CPU utilisation

Leave a Reply