Every time I see this I can't help but smile, knowing that in Zsh the equivalent code is:
#!/usr/bin/env zsh
setopt err_exit no_unset
DIR=${0:h} #!/usr/bin/env zsh
setopt err_exit no_unset
DIR=${0:h}[1] https://weblogs.asp.net/soever/returning-an-exit-code-from-a...
[2] https://octopus.com/blog/powershell-exit-codes
[3] https://community.idera.com/database-tools/powershell/powert...