This script is just an update of a previous one that was tested on standalone and stacked Cisco Catalyst 9300 and 9500s running IOS-XE software releases in INSTALL mode.
In theory, this should still work for any IOS-XE switch that supports the 'install' commands.
The script TFTPs the IOS-XE image from your Solarwinds File Repository to the switch, verifies its hash (remember to update this with the hash from software.cisco.com), runs 'install add, activate, and commit' with no prompt, and verifies successful upgrade after waiting for the switch to reboot.
With the limitations of the template maker, I could not add 'install inactive remove' to the upgrade verification because it does not wait for the switch to compile the list of files to remove before having to input 'yes/no'. After the upgrades are complete, you can run a job in NCM or manually enter install inactive remove to clean up the old image files.