I recently saw a post by Jakub Jares on testing self-contained scripts with
Pester [http://jakubjares.com/2019/06/09/2019-07-testing-whole-scripts/].
He suggests, essentially, hijacking the call to any functions, dot-sourcing the
script, and then removing the hijack (an alias, in this case).
We do something similar at work to