We recommend reviewing what is submitted before posting, in case your idea has already been submitted by another community member. If it has been submitted, vote for that existing feature request (by clicking the up arrow) to increase its opportunity of being added to Cireson solutions.
For more information around feature requests in the Cireson Community click here.
PowerShell Activity - allow user-defined strings to be mapped to script parameters
With this feature, I could make my PowerShell scripts more dynamic, and use a constant in my SR templates to define which action the script should take.
For example, I have a script to add a user as a reviewer to a specified RA.
Parameters include:
- ActivityGUID (Required)
- ApproverType [Manager/ServiceOwner/FreeText/RelatedCI] (Required)
- FreeTextUserName (If ApproverType is FreeText)
- FreeTextDomain (If ApproverType is FreeText)
Instead, I have to create four separate scripts in SCSM, one for each ApproverType, because I cannot tell the template which one to use.
Comments
Workaround I have used is to extend the PowerShell Activity class with String 1 etc or a JSON blob property and then grab that once inside the PowerShell.
So you would just pass in Activity ID using the current params functionality and then in the code grab the ID, grab the object with Get-SCSMObject -Id and then grab the properties and go from there.
It works well but is long winded.
Geoff