PowerShell for Windows Admins

Jun 28 2013   11:39AM GMT

Refreshing values

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

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

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: