PAL collector script – PalCollector.ps1

One of the top questions I get with the PAL tool is what data to collect. As many of you know, the PAL tool only analyze existing counter logs. It is up to you to create the counter log. To help with this problem, I created a PowerShell script called PalCollector.ps1. This script will query your local computer’s performance counters and will find a PAL threshold file that best matches your computer, then it creates a data collector set called, “PalCollector” using the counter paths from the best matching threshold file. It creates the data collector as a 200 MB binary circular log which means that it will continuously collect data every 15 seconds and will never get over 200 MB in size – roughly 24 hours of data. Once you are done collecting data, analyze the counter log (*.blg) using the PAL tool as you normally would.

Instructions

  1. Download PalCollector.zip from http://sdrv.ms/10dZBNb.
  2. Extract the zip file to a folder such as your Desktop or somewhere under your “My Documents” folder.
  3. In Windows Explorer, find PalCollector.ps1, go to Properties of the file and click the Unblock button. This will allow the script to run on your system.
  4. With administrator rights (required) open an elevated PowerShell session.
  5. If your execution policy is not set to RemoteSigned or Unrestricted, then do so now by running:
    Get-ExecutionPolicy
    Set-ExecutionPolicy RemoteSigned
  6. Change directory to the location where you extracted the zip file.
  7. Run “.\PalCollector.ps1”

Please let me know your thoughts on how it is working for you and any recommendations on improvement.