24 lines
608 B
PowerShell
24 lines
608 B
PowerShell
task . InstallDependencies, Analyze
|
|
|
|
task InstallDependencies {
|
|
Install-Module Pester -Force
|
|
Install-Module PSScriptAnalyzer -Force
|
|
}
|
|
|
|
task Analyze {
|
|
$scriptAnalyzerParams = @{
|
|
Path = "$BuildRoot\ZertoApiWrapper\"
|
|
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"
|
|
}
|
|
}
|
|
|