π module version increment #51
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test PowerShell on Windows | |
on: push | |
jobs: | |
tests: | |
name: Pester test and ScriptAnalyzer | |
runs-on: windows-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Perform a Pester test from the Tests.ps1 file | |
shell: pwsh | |
run: | | |
Invoke-Pester .\tests\Unit.Tests.ps1 -Passthru | |
- name: Install PSScriptAnalyzer module | |
if: success() | |
shell: pwsh | |
run: | | |
Set-PSRepository PSGallery -InstallationPolicy Trusted | |
Install-Module PSScriptAnalyzer -ErrorAction Stop | |
- name: Lint with PSScriptAnalyzer | |
if: success() | |
shell: pwsh | |
run: | | |
Invoke-ScriptAnalyzer -Path .\Intune-App-Sandbox\Public\*.ps1 -Recurse -Outvariable issues -ExcludeRule PSAvoidUsingWriteHost,PSUseShouldProcessForStateChangingFunctions | |
$errors = $issues.Where({$_.Severity -eq 'Error'}) | |
$warnings = $issues.Where({$_.Severity -eq 'Warning'}) | |
if ($errors) { | |
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop | |
} else { | |
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total." | |
} |