How to modify the code of a deployed powershell activity ?
Hi,
I've recently started using PSA in a request template. Suppose that sometime in the future I wanted to update the code of the powershell activity without recreating the template or any of the ARO forms that are based on that template ? What would be the recommended steps ?
Stephane
Best Answer
-
Justin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
@Stephane_Bouillon - You don't have to recreate the template, but you do have to edit it. What I typically do is edit the script as needed. Then just re-link the script to the PSA template, then remove the PSA template from the SR and re-add it. This is in fact a bit of work.
One option I've seen in the past is to have an external script repository on the file system and just have a PSA script & template that calls the script from the external location. That way you can test and change the powershell code quickly without all the template shuffling in the console.
Another variation of that method that I have personally tried is a PSA script/template that uses SMLets to actually get other PSA scripts and execute them. That way your script repository stays in SCSM completely, but you still have the flexibility of changing the code outside of the templates themselves.
5
Answers
@Stephane_Bouillon - You don't have to recreate the template, but you do have to edit it. What I typically do is edit the script as needed. Then just re-link the script to the PSA template, then remove the PSA template from the SR and re-add it. This is in fact a bit of work.
One option I've seen in the past is to have an external script repository on the file system and just have a PSA script & template that calls the script from the external location. That way you can test and change the powershell code quickly without all the template shuffling in the console.
Another variation of that method that I have personally tried is a PSA script/template that uses SMLets to actually get other PSA scripts and execute them. That way your script repository stays in SCSM completely, but you still have the flexibility of changing the code outside of the templates themselves.
Thanks, up to now all my scripts are on the SMA server which is on another machine than the Portal.