diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6be9929..61f211b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.22.2] + +- Catesta template module changes + - Added PSScriptAnalyzer suppression rule to `MarkdownRepair.ps1` +- Catesta primary module changes + - Addressed bug in `Catesta.build.ps1` where in certain circumstances PSScriptAnalyzer violations were not being properly detected + - Added PSScriptAnalyzer suppression rule to `MarkdownRepair.ps1` + ## [2.22.0] - Catesta template module changes diff --git a/docs/Catesta.md b/docs/Catesta.md index 2ada752..c84186d 100644 --- a/docs/Catesta.md +++ b/docs/Catesta.md @@ -2,7 +2,7 @@ Module Name: Catesta Module Guid: 6796b193-9013-468a-b022-837749af2d06 Download Help Link: NA -Help Version: 2.22.0 +Help Version: 2.22.2 Locale: en-US --- diff --git a/src/Catesta.build.ps1 b/src/Catesta.build.ps1 index 7c9b9c9..919b0f1 100644 --- a/src/Catesta.build.ps1 +++ b/src/Catesta.build.ps1 @@ -165,22 +165,29 @@ Add-BuildTask Clean { Add-BuildTask Analyze { $scriptAnalyzerParams = @{ - # Path = $script:ModuleSourcePath Setting = 'PSScriptAnalyzerSettings.psd1' - # Recurse = $true - # Verbose = $false } - $filesToAnalyze = Get-ChildItem -Path $script:ModuleSourcePath -Exclude "PSVault.Extension*" -Recurse + $filesToAnalyze = Get-ChildItem -Path $script:ModuleSourcePath -Exclude "PSVault.Extension*" -Recurse -File | Where-Object { $_.FullName -notlike '*\Tests\*' } + $fileCount = $filesToAnalyze.Count + + Write-Build White (' Performing Module ScriptAnalyzer checks for {0} files...' -f $fileCount) + Import-Module -Name PSScriptAnalyzer -ErrorAction Stop + + $scriptAnalyzerResults = New-Object System.Collections.Generic.List[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord] - Write-Build White ' Performing Module ScriptAnalyzer checks...' foreach ($file in $filesToAnalyze) { - $scriptAnalyzerResults = Invoke-ScriptAnalyzer @scriptAnalyzerParams -Path $file.FullName + $results = $null + $results = Invoke-ScriptAnalyzer @scriptAnalyzerParams -Path $file.FullName + if ($results) { + foreach ($result in $results) { + $scriptAnalyzerResults.Add($result) + } + } } - # $scriptAnalyzerResults = Invoke-ScriptAnalyzer @scriptAnalyzerParams if ($scriptAnalyzerResults) { - $scriptAnalyzerResults | Format-Table + $scriptAnalyzerResults | Format-List * throw ' One or more PSScriptAnalyzer errors/warnings where found.' } else { diff --git a/src/Catesta/Catesta.psd1 b/src/Catesta/Catesta.psd1 index e74761a..2e1e5a0 100644 --- a/src/Catesta/Catesta.psd1 +++ b/src/Catesta/Catesta.psd1 @@ -12,7 +12,7 @@ RootModule = 'Catesta.psm1' # Version number of this module. - ModuleVersion = '2.22.0' + ModuleVersion = '2.22.2' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/src/Catesta/Resources/Module/plasterManifest.xml b/src/Catesta/Resources/Module/plasterManifest.xml index 5c506a8..9f298f0 100644 --- a/src/Catesta/Resources/Module/plasterManifest.xml +++ b/src/Catesta/Resources/Module/plasterManifest.xml @@ -19,7 +19,7 @@ Catesta 258a61ba-566b-4c3a-8230-c2b6861a1a8d - 2.22.0 + 2.22.2 Catesta Scaffolds a new PowerShell module project Jake Morrison diff --git a/src/Catesta/Resources/Module/src/MarkdownRepair.ps1 b/src/Catesta/Resources/Module/src/MarkdownRepair.ps1 index aa011ec..c973c64 100644 --- a/src/Catesta/Resources/Module/src/MarkdownRepair.ps1 +++ b/src/Catesta/Resources/Module/src/MarkdownRepair.ps1 @@ -11,6 +11,7 @@ #> function Remove-CommonParameterFromMarkdown { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] <# .SYNOPSIS Remove a PlatyPS generated parameter block. diff --git a/src/Catesta/Resources/Vault/plasterManifest.xml b/src/Catesta/Resources/Vault/plasterManifest.xml index 7f9e7c4..570b0d9 100644 --- a/src/Catesta/Resources/Vault/plasterManifest.xml +++ b/src/Catesta/Resources/Vault/plasterManifest.xml @@ -6,7 +6,7 @@ Catesta d531e058-52b8-4dd2-8162-01c95d1eb8f7 - 2.22.0 + 2.22.2 Catesta Scaffolds a new PowerShell SecretManagement extension vault module project Jake Morrison diff --git a/src/MarkdownRepair.ps1 b/src/MarkdownRepair.ps1 index aa011ec..c973c64 100644 --- a/src/MarkdownRepair.ps1 +++ b/src/MarkdownRepair.ps1 @@ -11,6 +11,7 @@ #> function Remove-CommonParameterFromMarkdown { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] <# .SYNOPSIS Remove a PlatyPS generated parameter block.