We will be running the script from another application which will automatically rotate the password for the AD account, so I would like for the script to be standalone if possible. If not possible, running it within a custom command is fine since we can use the REST API to call the custom command from the other application.
Yes, ideally we would define a list of custom commands (which could be hard coded into the script rather than a parameter) and then the script would update the password for all the Run a program or PowerShell script actions within each command.