SQL queries for SCOM and PowerShell script for monitor performance counters

Here are the two scripts: