Hi,
I monitor a lot with the powershell script monitor components. Some times I have the same powershell script in an application more than 10 times. So if I want to change something in the script I have to go to the template and change the same lines in each of the component.
Therefore I thought I build an wrapper, that would make it possible to just change the lines at the script locally.
At this time my wrapper looks like this:

My first parameter is the path to the script that should be run (called script). All other parameters will be forwarded to the script defined in the first parameter.
For test purposes I wrote this test script

If I run the wrapper script locally I get this output:

But I want to run this in SAM, I get no output. So I added some output in the wrapper script in SAM:

It seems that just the output of the wrapper script is used for statistic and messages.
Do you have any idea to get the output of the called script?
If you have any improvments please tell me
Dominik