In a PowerShell script I am trying to get the number of page faults per second with this command:
(Get-WmiObject Win32_PerfFormattedData_PerfOS_memory).PageFaultsPersec
Unfortunately, it reads always the same value because I don't Refresh() the performance counter.
How can I send a Refresh() method to Pervormance Data via PowerShell?