Closed michruch closed 6 years ago
Of course param() is not commented, opposite to my example above
It's possible, you just have to receive all parameters as a string value named Arguments
due to limitations of the templates. The templates should already have param([string]$Arguments)
specified, so just change it back to that.
If you need to pass multiple args, just add a delimiter between each and use the string.split method in your script to extract them.
It's also worth noting that you can add dynamic property references directly into the script, and SCOM will inject them prior to running the script on each target, so the below also works perfectly fine:
$computerName = '$Target/Property[Type="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer"]/PrincipalName$'
Hi Shadeon,
This works fine. Thank you for your help
Hi,
I am unable to pass argument to my PowerShell Script Two State Monitor. The saved event shows empty value. Here is my monitor fragment:
In general does not matter which parameter I try to use, nothing gets passed.
Is passing arguments to script even possible in this MP?
thanks in advance for any suggestion