I am attempting to create a PowerShell script that I will ultimately plug into our application monitoring system;
Specifically, I am looking to create a script that will identify a specific IIS application pool, and then return the amount of memory used by that pool's worker process. I pretty much have it getting what I need, but in order to integrate this with our monitoring solution I need to format the output of the script a bit...
Here is what I have:
$memUsed = Get-WmiObject Win32_process -ComputerName $serverName | where CommandLine -Match $applicationPoolName | fl VM
So, I call this script from a PowerShell prompt:
CheckAppPool.ps1 servername appPoolName
The results are returned as:
VM : 123456789
I need to figure out a way to have the results returned to me so they look like this:
Any assistance is greatly appreciated!!