For those of you working with System Center Service Manager (SCSM) and have created or edited forms in the Authoring Tool have probably noticed that Management Pack can easily become a couple of hundred rows! And that’s just the inside the <Forms> node!
This is happening due to the fact that the Authoring Tool is basically writing 3 lines of XML for every change you make. This includes changing values, moving controls etc.
There’s also some rumors that the excess amount of rows causes performance issues when loading the form in SCSM. It sounds reasonable to me, but I haven’t personally done any testing in this matter.
But fear not! The below script will remove the unnecessary XML!
I’ve included functionality for piping several XML-files, ie.
Get-ChildItem *.xml | Invoke-SCSMAuthoringToolCleanup
You can define where to save the processed XML with the parameter -OutputPath. If omitting this parameter the script will overwrite the existing Management Pack.
If you want the XML object as output for further processing, use the parameter -Passthru.
If you’re using fixed position and control sizes (which you shouldn’t!) you can omit processing of these nodes by setting the parameters -ProcessResize and -ProcessMove to $false.
You can download the script from TechNet Gallery at: