It's likely that the PowerShell script output is not formatted correctly for SAM. You may want to ask for assistance modifying your scripts output in the Script Lab
Scripts Must Report Status Through Exit Codes
Scripts must report their status by exiting with the appropriate exit code:
Wscript.quit(0)
Scripts report additional details by sending text to the script’s standard output.
In APM 4.0.2 and earlier, each line of output contained a single detail in the following format:
Message: The directory contains too many files.
While this is still true, SAM now supports multiple values returned by a script using the following format.
Statistic.Name1: x
Message.Name1: abc
Statistic.Name2: y
Message.Name2: abc
Statistic.Name1: 123 Statistic.Name2: 456 | ||
An error or information message to be displayed in the monitor status details. Note: Multi-line messages are supported. To use this functionality print each line using a separate command. For example: Message.Name2: def |
There is a limit of ten Statistic and Message pairs for the script. These can be placed anywhere in the script output. The Statistic and Message names you give must contain valid letters and/or numbers.
Sample output:
# Script comment: This shows two pairs. Ten pairs are possible.
Statistic.CPU: 31.08
Message.CPU: svchost.exe cpu usage
Statistic.RAM: 1234.56
Message.RAM: svchost.exe ram usage