Reading performance counters
Often the best method of identifying how a system is performing is by viewing the performance counters. Microsoft has included PerfMon in Server 2012 for collecting and viewing performance information graphically; however this has been problematic to automate across multiple systems. Several system management tools have been created to enable enterprise-wide monitoring, however they are normally very expensive, difficult to maintain, and are designed to do more than most people need.
In this recipe, we will review various methods of gathering performance data using PowerShell.
Getting ready
For this recipe, we will be using a basic Windows Server 2012 system. Additionally, we will export the performance statistics for viewing in Microsoft Excel.
How to do it...
Carry out the following steps to read the performance data using PowerShell:
Read the basic performance counters.
Get-Counter
When executed, performance metrics will be displayed, as shown in the following screenshot...