The first two recipes in this chapter used different techniques (Get-Counter and WMI) to retrieve specific counters and counter sets. As you seen, getting a large number of counter values for detailed analysis can be very slow with these mechanisms. These techniques are ideal for retrieving one or two bits of information (CPU utilization for example, or pages/second). If you want to get a larger number of statistics (for example, all of the networking statistics including TCP, UDP, IP, and ICMP) the techniques do not scale well.
A better approach to gathering large number of counters is to use the Data Collector Sets and have Windows do the work for you. To do this, you first create and configure a collector set. When you start the set, Windows starts collecting the data you have configured the collector set to return. Finally, when the...