As has been mentioned in the MacAdmins microsoft-office slack channel, there are issues with running this script via Jamf. Jamf automatically passes the first three arguments, causing the ShowUsage function to be called and then exiting the script without doing any work.
Fixing this would involve detecting whether the script is running under Jamf, and if so skipping the first three arguments. The second part is easy with the shift command. I believe there was mention of detecting the working directory or something like that but I think a simpler solution would be to just add a valid argument to signal that it needs to skip the first 3. Working on a Pull Request.
As has been mentioned in the MacAdmins microsoft-office slack channel, there are issues with running this script via Jamf. Jamf automatically passes the first three arguments, causing the ShowUsage function to be called and then exiting the script without doing any work.
Fixing this would involve detecting whether the script is running under Jamf, and if so skipping the first three arguments. The second part is easy with the shift command. I believe there was mention of detecting the working directory or something like that but I think a simpler solution would be to just add a valid argument to signal that it needs to skip the first 3. Working on a Pull Request.