From d8a0bf4e694ebc3991bc6257ca4d810a7f8bcd8b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 19 Feb 2019 17:28:13 -0500 Subject: [PATCH] First Pass and a Invoke-Build script --- ZertoApiWrapper.build.ps1 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ZertoApiWrapper.build.ps1 diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 new file mode 100644 index 0000000..ae5b3ec --- /dev/null +++ b/ZertoApiWrapper.build.ps1 @@ -0,0 +1,21 @@ +task InstallDependencies { + Install-Module Pester -Force + Install-Module PSScriptAnalyzer -Force +} + +task Analyze { + $scriptAnalyzerParams = @{ + Path = "$BuildRoot\Functions\" + Severity = @('Error', 'Warning') + Recurse = $true + Verbose = $false + ExcludeRule = 'PSUseDeclaredVarsMoreThanAssignments' + } + $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams + + if ($saResults) { + $saResults | Format-Table + throw "One or more PSScriptAnalyzer errors/warnings were found" + } +} +