PowerShell Snippet #5 RunPsScriptAnalyzer on VSTS Hosted Build
Hello!
As someone who has some PowerShell modules knocking about, it’s important to get some checks running prior to publishing. As these modules are in source control, it makes sense to launch builds that run PSScriptAnalyzer as soon as a pull request is made on the branch.
But running PSScriptAnalyzer on the hosted build agent is a little difficult as not only does it not come with it installed, the service account running the builds don’t have permissions to install it!
So, here is a little script I knocked together that will download the PSScriptAnalyzer and run it.