From cfdd1b6a930b716e25929d5225bb57e7b33ad0f6 Mon Sep 17 00:00:00 2001 From: techthouhts2 Date: Sat, 23 Sep 2023 23:43:01 -0500 Subject: [PATCH 01/10] updated alias reference in azure pipeline --- docs/CHANGELOG.md | 7 +++++++ docs/Catesta.md | 2 +- src/Catesta/Catesta.psd1 | 2 +- src/Catesta/Resources/Azure/azure-pipelines.yml | 8 ++++---- src/Catesta/Resources/Module/plasterManifest.xml | 2 +- src/Catesta/Resources/Vault/plasterManifest.xml | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e6a1b0c..9d5ab4d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,13 @@ 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.0.1] + +- Catesta template module changes + - CI/CD Changes: + - Azure: + - Updated `testRunner` alias reference to `testResultsFormat` + ## [2.0.0] - *breaking changes introduced* - Catesta template module changes diff --git a/docs/Catesta.md b/docs/Catesta.md index 6a8550c..5b91f7b 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.0.0 +Help Version: 2.0.1 Locale: en-US --- diff --git a/src/Catesta/Catesta.psd1 b/src/Catesta/Catesta.psd1 index b1e1b27..a937b9f 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.0.0' + ModuleVersion = '2.0.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/src/Catesta/Resources/Azure/azure-pipelines.yml b/src/Catesta/Resources/Azure/azure-pipelines.yml index 2c34d2b..03c5a6b 100644 --- a/src/Catesta/Resources/Azure/azure-pipelines.yml +++ b/src/Catesta/Resources/Azure/azure-pipelines.yml @@ -24,7 +24,7 @@ if ($PLASTER_PARAM_AzureOptions -eq 'windows') { displayName: 'Build and Test - Windows PowerShell' - task: PublishTestResults@2 inputs: - testRunner: 'NUnit' + testResultsFormat: 'NUnit' testResultsFiles: '**\Artifacts\testOutput\PesterTests.xml' testRunTitle: 'ps_winLatest' failTaskOnFailedTests: true @@ -60,7 +60,7 @@ if ($PLASTER_PARAM_AzureOptions -eq 'pwshcore') { displayName: 'Build and Test - Windows pwsh' - task: PublishTestResults@2 inputs: - testRunner: 'NUnit' + testResultsFormat: 'NUnit' testResultsFiles: '**\Artifacts\testOutput\PesterTests.xml' testRunTitle: 'pwsh_winLatest' failTaskOnFailedTests: true @@ -96,7 +96,7 @@ if ($PLASTER_PARAM_AzureOptions -eq 'linux') { displayName: 'Build and Test - Linux' - task: PublishTestResults@2 inputs: - testRunner: 'NUnit' + testResultsFormat: 'NUnit' testResultsFiles: '**/Artifacts/testOutput/PesterTests.xml' testRunTitle: 'pwsh_ubuntuLatest' failTaskOnFailedTests: true @@ -132,7 +132,7 @@ if ($PLASTER_PARAM_AzureOptions -eq 'macos') { displayName: 'Build and Test - macOS' - task: PublishTestResults@2 inputs: - testRunner: 'NUnit' + testResultsFormat: 'NUnit' testResultsFiles: '**/Artifacts/testOutput/PesterTests.xml' testRunTitle: 'pwsh_macOSLatest' failTaskOnFailedTests: true diff --git a/src/Catesta/Resources/Module/plasterManifest.xml b/src/Catesta/Resources/Module/plasterManifest.xml index 9bf70d3..dd89e51 100644 --- a/src/Catesta/Resources/Module/plasterManifest.xml +++ b/src/Catesta/Resources/Module/plasterManifest.xml @@ -18,7 +18,7 @@ Catesta 258a61ba-566b-4c3a-8230-c2b6861a1a8d - 2.0.0 + 2.0.1 Catesta Scaffolds a new PowerShell module project Jake Morrison diff --git a/src/Catesta/Resources/Vault/plasterManifest.xml b/src/Catesta/Resources/Vault/plasterManifest.xml index aaa15c5..e613d90 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.0.0 + 2.0.1 Catesta Scaffolds a new PowerShell SecretManagement extension vault module project Jake Morrison From 7ed35032fd06cba8ebb2e40d3128277acdb5d5c0 Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Sun, 24 Sep 2023 00:22:38 -0500 Subject: [PATCH 02/10] module dependencies bump --- actions_bootstrap.ps1 | 6 +++--- docs/CHANGELOG.md | 9 ++++++++- docs/Catesta.md | 2 +- src/Catesta/Catesta.psd1 | 6 +++--- src/Catesta/Resources/AWS/install_modules.ps1 | 4 ++-- src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 | 4 ++-- src/Catesta/Resources/Azure/actions_bootstrap.ps1 | 4 ++-- src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 | 4 ++-- .../Resources/GitHubActions/actions_bootstrap.ps1 | 4 ++-- src/Catesta/Resources/GitLab/actions_bootstrap.ps1 | 4 ++-- src/Catesta/Resources/Module/plasterManifest.xml | 2 +- src/Catesta/Resources/Vault/plasterManifest.xml | 2 +- 12 files changed, 29 insertions(+), 22 deletions(-) diff --git a/actions_bootstrap.ps1 b/actions_bootstrap.ps1 index e32db9f..ea6c095 100644 --- a/actions_bootstrap.ps1 +++ b/actions_bootstrap.ps1 @@ -11,17 +11,17 @@ $modulesToInstall = [System.Collections.ArrayList]::new() # https://github.com/PowerShell/Plaster $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Plaster' - ModuleVersion = '1.1.3' + ModuleVersion = '1.1.4' })) # https://github.com/pester/Pester $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' - ModuleVersion = '5.4.0' + ModuleVersion = '5.5.0' })) # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.2' + ModuleVersion = '5.10.4' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9d5ab4d..7742df4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,12 +5,19 @@ 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.0.1] +## [2.0.2] - Catesta template module changes - CI/CD Changes: - Azure: - Updated `testRunner` alias reference to `testResultsFormat` + - Plaster bumped from `1.1.3` to `1.1.4` + - Pester bumped from `5.4.0` to `5.5.0` + - InvokeBuild bumped from `5.10.2` to `5.10.4` +- Catesta primary module changes + - Plaster bumped from `1.1.3` to `1.1.4` + - Pester bumped from `5.4.0` to `5.5.0` + - InvokeBuild bumped from `5.10.2` to `5.10.4` ## [2.0.0] - *breaking changes introduced* diff --git a/docs/Catesta.md b/docs/Catesta.md index 5b91f7b..3d4a350 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.0.1 +Help Version: 2.0.2 Locale: en-US --- diff --git a/src/Catesta/Catesta.psd1 b/src/Catesta/Catesta.psd1 index a937b9f..e77177b 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.0.1' + ModuleVersion = '2.0.2' # Supported PSEditions # CompatiblePSEditions = @() @@ -54,7 +54,7 @@ RequiredModules = @( @{ ModuleName = 'Plaster' - ModuleVersion = '1.1.3' + ModuleVersion = '1.1.4' }, @{ ModuleName = 'Pester' @@ -190,7 +190,7 @@ Extensions = @( @{ Module = 'Plaster' - MinimumVersion = '1.1.3' + MinimumVersion = '1.1.4' Details = @{ TemplatePaths = @( 'Resources\Module', diff --git a/src/Catesta/Resources/AWS/install_modules.ps1 b/src/Catesta/Resources/AWS/install_modules.ps1 index 7ae0530..bef4658 100644 --- a/src/Catesta/Resources/AWS/install_modules.ps1 +++ b/src/Catesta/Resources/AWS/install_modules.ps1 @@ -59,7 +59,7 @@ elseif ($PLASTER_PARAM_Pester-eq '5') { # https://github.com/pester/Pester $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' - ModuleVersion = '5.4.0' + ModuleVersion = '5.5.0' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' KeyPrefix = '' })) @@ -68,7 +68,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ %> $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.2' + ModuleVersion = '5.10.4' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' KeyPrefix = '' })) diff --git a/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 b/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 index 40efd2c..12564f8 100644 --- a/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 @@ -23,7 +23,7 @@ elseif ($PLASTER_PARAM_Pester-eq '5') { # https://github.com/pester/Pester $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' - ModuleVersion = '5.4.0' + ModuleVersion = '5.5.0' })) '@ } @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.2' + ModuleVersion = '5.10.4' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/Azure/actions_bootstrap.ps1 b/src/Catesta/Resources/Azure/actions_bootstrap.ps1 index 40efd2c..12564f8 100644 --- a/src/Catesta/Resources/Azure/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/Azure/actions_bootstrap.ps1 @@ -23,7 +23,7 @@ elseif ($PLASTER_PARAM_Pester-eq '5') { # https://github.com/pester/Pester $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' - ModuleVersion = '5.4.0' + ModuleVersion = '5.5.0' })) '@ } @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.2' + ModuleVersion = '5.10.4' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 b/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 index 40efd2c..12564f8 100644 --- a/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 @@ -23,7 +23,7 @@ elseif ($PLASTER_PARAM_Pester-eq '5') { # https://github.com/pester/Pester $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' - ModuleVersion = '5.4.0' + ModuleVersion = '5.5.0' })) '@ } @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.2' + ModuleVersion = '5.10.4' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 b/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 index 40efd2c..12564f8 100644 --- a/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 @@ -23,7 +23,7 @@ elseif ($PLASTER_PARAM_Pester-eq '5') { # https://github.com/pester/Pester $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' - ModuleVersion = '5.4.0' + ModuleVersion = '5.5.0' })) '@ } @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.2' + ModuleVersion = '5.10.4' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 b/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 index 40efd2c..12564f8 100644 --- a/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 @@ -23,7 +23,7 @@ elseif ($PLASTER_PARAM_Pester-eq '5') { # https://github.com/pester/Pester $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' - ModuleVersion = '5.4.0' + ModuleVersion = '5.5.0' })) '@ } @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.2' + ModuleVersion = '5.10.4' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/Module/plasterManifest.xml b/src/Catesta/Resources/Module/plasterManifest.xml index dd89e51..c33cd3f 100644 --- a/src/Catesta/Resources/Module/plasterManifest.xml +++ b/src/Catesta/Resources/Module/plasterManifest.xml @@ -18,7 +18,7 @@ Catesta 258a61ba-566b-4c3a-8230-c2b6861a1a8d - 2.0.1 + 2.0.2 Catesta Scaffolds a new PowerShell module project Jake Morrison diff --git a/src/Catesta/Resources/Vault/plasterManifest.xml b/src/Catesta/Resources/Vault/plasterManifest.xml index e613d90..dcce753 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.0.1 + 2.0.2 Catesta Scaffolds a new PowerShell SecretManagement extension vault module project Jake Morrison From fd8995426bbeb25dcf57135ce05ddf2c3319dcfa Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 7 Jan 2024 19:39:49 -0700 Subject: [PATCH 03/10] Update Catesta-FAQ.md --- docs/Catesta-FAQ.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Catesta-FAQ.md b/docs/Catesta-FAQ.md index c4f1d81..96deba0 100644 --- a/docs/Catesta-FAQ.md +++ b/docs/Catesta-FAQ.md @@ -11,11 +11,11 @@ Badge examples: ![AWS CodeBuild Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiL2FvTzZsNGFoL1VTTk1UOGE3WXlwSVFRT3BTWngzc1czdVZLTEpNYWJld2xSbS9Ea3R0b3ZETm96Zk5md2ZXMVUwNXZnSnlaRlpuWUJldzdGMENpemRjPSIsIml2UGFyYW1ldGVyU3BlYyI6Ikl3T3VwdU43UUxya0J1SVciLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master) ``` -- **GitHub Actions**: [![GitHub Actions Build Status Windows pwsh Master](https://github.com/techthoughts2/Catesta/workflows/Catesta-Windows-pwsh/badge.svg?branch=master)](https://github.com/techthoughts2/Catesta/actions) +- **GitHub Actions**: [![GitHub Actions Build Status Windows pwsh Main](https://github.com/techthoughts2/Catesta/workflows/Catesta-Windows-pwsh/badge.svg?branch=main)](https://github.com/techthoughts2/Catesta/actions) - *Just replace the link with your repo* ```plain - [![GitHub Actions Build Status Windows pwsh Master](https://github.com/techthoughts2/Catesta/workflows/Catesta-Windows-pwsh/badge.svg?branch=master)](https://github.com/techthoughts2/Catesta/actions) + [![GitHub Actions Build Status Windows pwsh Main](https://github.com/techthoughts2/Catesta/workflows/Catesta-Windows-pwsh/badge.svg?branch=main)](https://github.com/techthoughts2/Catesta/actions) ``` - **Appveyor**: [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/kech4dkqsrb9xuet/branch/master?svg=true)](https://ci.appveyor.com/project/techthoughts2/appveyortest/branch/master) From e0590ae5ddd2411e95a626af0ec89f46c4a95c3e Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Wed, 17 Jan 2024 22:21:28 -0600 Subject: [PATCH 04/10] update for #71 --- docs/CHANGELOG.md | 5 +- docs/Catesta-ModuleSchema.md | 1 - docs/Catesta-VaultSchema.md | 1 - docs/Catesta.md | 2 +- docs/New-ModuleProject.md | 3 +- docs/New-VaultProject.md | 3 +- src/Catesta.build.ps1 | 11 ++ src/Catesta/Catesta.psd1 | 2 +- .../Resources/Module/plasterManifest.xml | 3 +- .../Resources/Module/src/MarkdownRepair.ps1 | 135 ++++++++++++++++++ .../Resources/Module/src/PSModule.build.ps1 | 11 ++ .../Resources/Vault/plasterManifest.xml | 2 +- src/MarkdownRepair.ps1 | 135 ++++++++++++++++++ src/Tests/Integration/FileChecks.Tests.ps1 | 4 + .../Integration/New-ModuleProject.Tests.ps1 | 26 ++++ 15 files changed, 333 insertions(+), 11 deletions(-) create mode 100644 src/Catesta/Resources/Module/src/MarkdownRepair.ps1 create mode 100644 src/MarkdownRepair.ps1 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7742df4..4a07b68 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,9 +5,11 @@ 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.0.2] +## [2.2.0] - Catesta template module changes + - Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. This is to account for an issue in PowerShell `7.4.0`+ where a new parameter was introduced that platyPS can not handle during help creation. Ref: [platyPS issue]([text](https://github.com/PowerShell/platyPS/issues/595)). + - If a build is run and the build environment is `7.4.0`+ the Markdown repair will run to account for the new parameter and repair markdown for help creation. - CI/CD Changes: - Azure: - Updated `testRunner` alias reference to `testResultsFormat` @@ -15,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Pester bumped from `5.4.0` to `5.5.0` - InvokeBuild bumped from `5.10.2` to `5.10.4` - Catesta primary module changes + - Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. - Plaster bumped from `1.1.3` to `1.1.4` - Pester bumped from `5.4.0` to `5.5.0` - InvokeBuild bumped from `5.10.2` to `5.10.4` diff --git a/docs/Catesta-ModuleSchema.md b/docs/Catesta-ModuleSchema.md index ffbdc9e..7f67cd1 100644 --- a/docs/Catesta-ModuleSchema.md +++ b/docs/Catesta-ModuleSchema.md @@ -260,7 +260,6 @@ Help = 'Yes' Pester = '5' - } New-ModuleProject -ModuleParameters $moduleParameters -DestinationPath . ``` diff --git a/docs/Catesta-VaultSchema.md b/docs/Catesta-VaultSchema.md index c44f844..11609a3 100644 --- a/docs/Catesta-VaultSchema.md +++ b/docs/Catesta-VaultSchema.md @@ -251,7 +251,6 @@ CodingStyle = 'Stroustrup' Pester = '5' - } New-ModuleProject -ModuleParameters $vaultParameters -DestinationPath . ``` diff --git a/docs/Catesta.md b/docs/Catesta.md index 3d4a350..b01bc16 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.0.2 +Help Version: 2.2.0 Locale: en-US --- diff --git a/docs/New-ModuleProject.md b/docs/New-ModuleProject.md index 4a29ad8..ade52b7 100644 --- a/docs/New-ModuleProject.md +++ b/docs/New-ModuleProject.md @@ -357,7 +357,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -382,4 +382,3 @@ Read the manifest schemas to understand how to properly craft a ModuleParameters [https://www.catesta.dev/en/latest/New-ModuleProject/](https://www.catesta.dev/en/latest/New-ModuleProject/) [https://docs.microsoft.com/powershell/scripting/developer/module/writing-a-windows-powershell-module](https://docs.microsoft.com/powershell/scripting/developer/module/writing-a-windows-powershell-module) - diff --git a/docs/New-VaultProject.md b/docs/New-VaultProject.md index 38c3ba4..e2b2d10 100644 --- a/docs/New-VaultProject.md +++ b/docs/New-VaultProject.md @@ -349,7 +349,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -369,4 +369,3 @@ Author: Jake Morrison - @jakemorrison - https://www.techthoughts.info/ [https://www.catesta.dev/en/latest/Catesta-Vault-Extension/](https://www.catesta.dev/en/latest/Catesta-Vault-Extension/) [https://github.com/PowerShell/SecretManagement](https://github.com/PowerShell/SecretManagement) - diff --git a/src/Catesta.build.ps1 b/src/Catesta.build.ps1 index 883e870..b1722e1 100644 --- a/src/Catesta.build.ps1 +++ b/src/Catesta.build.ps1 @@ -396,6 +396,17 @@ Add-BuildTask CreateMarkdownHelp -After CreateHelpStart { throw 'Missing GUID. Please review and rebuild.' } + Write-Build Gray ' Evaluating if running 7.4.0 or higher...' + # https://github.com/PowerShell/platyPS/issues/595 + if ($PSVersionTable.PSVersion -ge [version]'7.4.0') { + Write-Build Gray ' Performing Markdown repair' + # dot source markdown repair + . $BuildRoot\MarkdownRepair.ps1 + $OutputDir | Get-ChildItem -File | ForEach-Object { + Repair-PlatyPSMarkdown -Path $_.FullName + } + } + Write-Build Gray ' Checking for missing documentation in md files...' $MissingDocumentation = Select-String -Path "$script:ArtifactsPath\docs\*.md" -Pattern "({{.*}})" if ($MissingDocumentation.Count -gt 0) { diff --git a/src/Catesta/Catesta.psd1 b/src/Catesta/Catesta.psd1 index e77177b..871d912 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.0.2' + ModuleVersion = '2.2.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/src/Catesta/Resources/Module/plasterManifest.xml b/src/Catesta/Resources/Module/plasterManifest.xml index c33cd3f..6e392ef 100644 --- a/src/Catesta/Resources/Module/plasterManifest.xml +++ b/src/Catesta/Resources/Module/plasterManifest.xml @@ -18,7 +18,7 @@ Catesta 258a61ba-566b-4c3a-8230-c2b6861a1a8d - 2.0.2 + 2.2.0 Catesta Scaffolds a new PowerShell module project Jake Morrison @@ -179,6 +179,7 @@ + diff --git a/src/Catesta/Resources/Module/src/MarkdownRepair.ps1 b/src/Catesta/Resources/Module/src/MarkdownRepair.ps1 new file mode 100644 index 0000000..aa011ec --- /dev/null +++ b/src/Catesta/Resources/Module/src/MarkdownRepair.ps1 @@ -0,0 +1,135 @@ +<# +.SYNOPSIS + Repair PlatyPS generated markdown files. +.NOTES + This file is temporarily required to handle platyPS help generation. + https://github.com/PowerShell/platyPS/issues/595 + This is a result of a breaking change introduced in PowerShell 7.4.0: + https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-74?view=powershell-7.4 + Breaking Changes: Added the ProgressAction parameter to the Common Parameters + modified from source: https://github.com/PowerShell/platyPS/issues/595#issuecomment-1820971702 +#> + +function Remove-CommonParameterFromMarkdown { + <# + .SYNOPSIS + Remove a PlatyPS generated parameter block. + .DESCRIPTION + Removes parameter block for the provided parameter name from the markdown file provided. + #> + param( + [Parameter(Mandatory)] + [string[]] + $Path, + + [Parameter(Mandatory = $false)] + [string[]] + $ParameterName = @('ProgressAction') + ) + $ErrorActionPreference = 'Stop' + foreach ($p in $Path) { + $content = (Get-Content -Path $p -Raw).TrimEnd() + $updateFile = $false + foreach ($param in $ParameterName) { + if (-not ($Param.StartsWith('-'))) { + $param = "-$($param)" + } + # Remove the parameter block + $pattern = "(?m)^### $param\r?\n[\S\s]*?(?=#{2,3}?)" + $newContent = $content -replace $pattern, '' + # Remove the parameter from the syntax block + $pattern = " \[$param\s?.*?]" + $newContent = $newContent -replace $pattern, '' + if ($null -ne (Compare-Object -ReferenceObject $content -DifferenceObject $newContent)) { + Write-Verbose "Added $param to $p" + # Update file content + $content = $newContent + $updateFile = $true + } + } + # Save file if content has changed + if ($updateFile) { + $newContent | Out-File -Encoding utf8 -FilePath $p + Write-Verbose "Updated file: $p" + } + } + return +} + +function Add-MissingCommonParameterToMarkdown { + param( + [Parameter(Mandatory)] + [string[]] + $Path, + + [Parameter(Mandatory = $false)] + [string[]] + $ParameterName = @('ProgressAction') + ) + $ErrorActionPreference = 'Stop' + foreach ($p in $Path) { + $content = (Get-Content -Path $p -Raw).TrimEnd() + $updateFile = $false + foreach ($NewParameter in $ParameterName) { + if (-not ($NewParameter.StartsWith('-'))) { + $NewParameter = "-$($NewParameter)" + } + $pattern = '(?m)^This cmdlet supports the common parameters:(.+?)\.' + $replacement = { + $Params = $_.Groups[1].Captures[0].ToString() -split ' ' + $CommonParameters = @() + foreach ($CommonParameter in $Params) { + if ($CommonParameter.StartsWith('-')) { + if ($CommonParameter.EndsWith(',')) { + $CleanParam = $CommonParameter.Substring(0, $CommonParameter.Length - 1) + } + elseif ($p.EndsWith('.')) { + $CleanParam = $CommonParameter.Substring(0, $CommonParameter.Length - 1) + } + else { + $CleanParam = $CommonParameter + } + $CommonParameters += $CleanParam + } + } + if ($NewParameter -notin $CommonParameters) { + $CommonParameters += $NewParameter + } + $CommonParameters[-1] = "and $($CommonParameters[-1]). " + return "This cmdlet supports the common parameters: " + (($CommonParameters | Sort-Object) -join ', ') + } + $newContent = $content -replace $pattern, $replacement + if ($null -ne (Compare-Object -ReferenceObject $content -DifferenceObject $newContent)) { + Write-Verbose "Added $NewParameter to $p" + $updateFile = $true + $content = $newContent + } + } + # Save file if content has changed + if ($updateFile) { + $newContent | Out-File -Encoding utf8 -FilePath $p + Write-Verbose "Updated file: $p" + } + } + return +} + +function Repair-PlatyPSMarkdown { + param( + [Parameter(Mandatory)] + [string[]] + $Path, + + [Parameter()] + [string[]] + $ParameterName = @('ProgressAction') + ) + $ErrorActionPreference = 'Stop' + $Parameters = @{ + Path = $Path + ParameterName = $ParameterName + } + $null = Remove-CommonParameterFromMarkdown @Parameters + $null = Add-MissingCommonParameterToMarkdown @Parameters + return +} diff --git a/src/Catesta/Resources/Module/src/PSModule.build.ps1 b/src/Catesta/Resources/Module/src/PSModule.build.ps1 index 2ab2de5..337c924 100644 --- a/src/Catesta/Resources/Module/src/PSModule.build.ps1 +++ b/src/Catesta/Resources/Module/src/PSModule.build.ps1 @@ -535,6 +535,17 @@ Add-BuildTask CreateMarkdownHelp -After CreateHelpStart { throw 'Missing GUID. Please review and rebuild.' } + Write-Build Gray ' Evaluating if running 7.4.0 or higher...' + # https://github.com/PowerShell/platyPS/issues/595 + if ($PSVersionTable.PSVersion -ge [version]'7.4.0') { + Write-Build Gray ' Performing Markdown repair' + # dot source markdown repair + . $BuildRoot\MarkdownRepair.ps1 + $OutputDir | Get-ChildItem -File | ForEach-Object { + Repair-PlatyPSMarkdown -Path $_.FullName + } + } + Write-Build Gray ' Checking for missing documentation in md files...' $MissingDocumentation = Select-String -Path "$script:ArtifactsPath\docs\*.md" -Pattern "({{.*}})" if ($MissingDocumentation.Count -gt 0) { diff --git a/src/Catesta/Resources/Vault/plasterManifest.xml b/src/Catesta/Resources/Vault/plasterManifest.xml index dcce753..1529879 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.0.2 + 2.2.0 Catesta Scaffolds a new PowerShell SecretManagement extension vault module project Jake Morrison diff --git a/src/MarkdownRepair.ps1 b/src/MarkdownRepair.ps1 new file mode 100644 index 0000000..aa011ec --- /dev/null +++ b/src/MarkdownRepair.ps1 @@ -0,0 +1,135 @@ +<# +.SYNOPSIS + Repair PlatyPS generated markdown files. +.NOTES + This file is temporarily required to handle platyPS help generation. + https://github.com/PowerShell/platyPS/issues/595 + This is a result of a breaking change introduced in PowerShell 7.4.0: + https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-74?view=powershell-7.4 + Breaking Changes: Added the ProgressAction parameter to the Common Parameters + modified from source: https://github.com/PowerShell/platyPS/issues/595#issuecomment-1820971702 +#> + +function Remove-CommonParameterFromMarkdown { + <# + .SYNOPSIS + Remove a PlatyPS generated parameter block. + .DESCRIPTION + Removes parameter block for the provided parameter name from the markdown file provided. + #> + param( + [Parameter(Mandatory)] + [string[]] + $Path, + + [Parameter(Mandatory = $false)] + [string[]] + $ParameterName = @('ProgressAction') + ) + $ErrorActionPreference = 'Stop' + foreach ($p in $Path) { + $content = (Get-Content -Path $p -Raw).TrimEnd() + $updateFile = $false + foreach ($param in $ParameterName) { + if (-not ($Param.StartsWith('-'))) { + $param = "-$($param)" + } + # Remove the parameter block + $pattern = "(?m)^### $param\r?\n[\S\s]*?(?=#{2,3}?)" + $newContent = $content -replace $pattern, '' + # Remove the parameter from the syntax block + $pattern = " \[$param\s?.*?]" + $newContent = $newContent -replace $pattern, '' + if ($null -ne (Compare-Object -ReferenceObject $content -DifferenceObject $newContent)) { + Write-Verbose "Added $param to $p" + # Update file content + $content = $newContent + $updateFile = $true + } + } + # Save file if content has changed + if ($updateFile) { + $newContent | Out-File -Encoding utf8 -FilePath $p + Write-Verbose "Updated file: $p" + } + } + return +} + +function Add-MissingCommonParameterToMarkdown { + param( + [Parameter(Mandatory)] + [string[]] + $Path, + + [Parameter(Mandatory = $false)] + [string[]] + $ParameterName = @('ProgressAction') + ) + $ErrorActionPreference = 'Stop' + foreach ($p in $Path) { + $content = (Get-Content -Path $p -Raw).TrimEnd() + $updateFile = $false + foreach ($NewParameter in $ParameterName) { + if (-not ($NewParameter.StartsWith('-'))) { + $NewParameter = "-$($NewParameter)" + } + $pattern = '(?m)^This cmdlet supports the common parameters:(.+?)\.' + $replacement = { + $Params = $_.Groups[1].Captures[0].ToString() -split ' ' + $CommonParameters = @() + foreach ($CommonParameter in $Params) { + if ($CommonParameter.StartsWith('-')) { + if ($CommonParameter.EndsWith(',')) { + $CleanParam = $CommonParameter.Substring(0, $CommonParameter.Length - 1) + } + elseif ($p.EndsWith('.')) { + $CleanParam = $CommonParameter.Substring(0, $CommonParameter.Length - 1) + } + else { + $CleanParam = $CommonParameter + } + $CommonParameters += $CleanParam + } + } + if ($NewParameter -notin $CommonParameters) { + $CommonParameters += $NewParameter + } + $CommonParameters[-1] = "and $($CommonParameters[-1]). " + return "This cmdlet supports the common parameters: " + (($CommonParameters | Sort-Object) -join ', ') + } + $newContent = $content -replace $pattern, $replacement + if ($null -ne (Compare-Object -ReferenceObject $content -DifferenceObject $newContent)) { + Write-Verbose "Added $NewParameter to $p" + $updateFile = $true + $content = $newContent + } + } + # Save file if content has changed + if ($updateFile) { + $newContent | Out-File -Encoding utf8 -FilePath $p + Write-Verbose "Updated file: $p" + } + } + return +} + +function Repair-PlatyPSMarkdown { + param( + [Parameter(Mandatory)] + [string[]] + $Path, + + [Parameter()] + [string[]] + $ParameterName = @('ProgressAction') + ) + $ErrorActionPreference = 'Stop' + $Parameters = @{ + Path = $Path + ParameterName = $ParameterName + } + $null = Remove-CommonParameterFromMarkdown @Parameters + $null = Add-MissingCommonParameterToMarkdown @Parameters + return +} diff --git a/src/Tests/Integration/FileChecks.Tests.ps1 b/src/Tests/Integration/FileChecks.Tests.ps1 index f6f8561..e8d4066 100644 --- a/src/Tests/Integration/FileChecks.Tests.ps1 +++ b/src/Tests/Integration/FileChecks.Tests.ps1 @@ -58,6 +58,10 @@ Describe 'File Checks' { $srcFiles.Name.Contains('PSModule.Settings.ps1') | Should -BeExactly $true } #it + It 'should have markdown repair file' { + $srcFiles.Name.Contains('MarkdownRepair.ps1') | Should -BeExactly $true + } #it + It 'should have a PSScriptAnalyzerSettings file' { $srcFiles.Name.Contains('PSScriptAnalyzerSettings.psd1') | Should -BeExactly $true } #it diff --git a/src/Tests/Integration/New-ModuleProject.Tests.ps1 b/src/Tests/Integration/New-ModuleProject.Tests.ps1 index 7d66fd1..4e27e9f 100644 --- a/src/Tests/Integration/New-ModuleProject.Tests.ps1 +++ b/src/Tests/Integration/New-ModuleProject.Tests.ps1 @@ -70,6 +70,7 @@ Describe 'Module Integration Tests' { $moduleOnlyFiles.Name.Contains('Imports.ps1') | Should -BeExactly $true $moduleOnlyFiles.Name.Contains('modulename.build.ps1') | Should -BeExactly $true $moduleOnlyFiles.Name.Contains('modulename.Settings.ps1') | Should -BeExactly $true + $moduleOnlyFiles.Name.Contains('MarkdownRepair.ps1') | Should -BeExactly $true $moduleOnlyFiles.Name.Contains('PSScriptAnalyzerSettings.psd1') | Should -BeExactly $true $moduleOnlyFiles.Name.Contains('Get-HelloWorld.ps1') | Should -BeExactly $true $moduleOnlyFiles.Name.Contains('Get-Day.ps1') | Should -BeExactly $true @@ -139,6 +140,31 @@ Describe 'Module Integration Tests' { } #it + It 'should generate a module only scaffold with base elements with no MarkdownRepair if help is not selected' { + $moduleParameters = @{ + VAULT = 'text' + ModuleName = 'modulename' + Description = 'text' + Version = '0.0.1' + FN = 'user full name' + CICD = 'NONE' + RepoType = 'NONE' + CodingStyle = 'Stroustrup' + Help = 'No' + Pester = '5' + S3Bucket = 'PSGallery' + PassThru = $true + NoLogo = $true + } + $eval = New-ModuleProject -ModuleParameters $moduleParameters -DestinationPath $outPutPath + $eval | Should -Not -BeNullOrEmpty + + $moduleOnlyFiles = Get-ChildItem -Path $outPutPathStar -Recurse -Force + + $moduleOnlyFiles.Name.Contains('MarkdownRepair.ps1') | Should -BeExactly $false + + } #it + } #context_module_only Context 'AWS-CodeBuild' { From e50f1dc21bc8377d7f7d18918d1893620898cd51 Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Wed, 17 Jan 2024 22:29:34 -0600 Subject: [PATCH 05/10] bumped InvokeBuild version --- actions_bootstrap.ps1 | 2 +- docs/CHANGELOG.md | 4 ++-- src/Catesta/Resources/AWS/install_modules.ps1 | 2 +- src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 | 2 +- src/Catesta/Resources/Azure/actions_bootstrap.ps1 | 2 +- src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 | 2 +- src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 | 2 +- src/Catesta/Resources/GitLab/actions_bootstrap.ps1 | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actions_bootstrap.ps1 b/actions_bootstrap.ps1 index ea6c095..2368270 100644 --- a/actions_bootstrap.ps1 +++ b/actions_bootstrap.ps1 @@ -21,7 +21,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.4' + ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4a07b68..73492e6 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -15,12 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated `testRunner` alias reference to `testResultsFormat` - Plaster bumped from `1.1.3` to `1.1.4` - Pester bumped from `5.4.0` to `5.5.0` - - InvokeBuild bumped from `5.10.2` to `5.10.4` + - InvokeBuild bumped from `5.10.2` to `5.10.5` - Catesta primary module changes - Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. - Plaster bumped from `1.1.3` to `1.1.4` - Pester bumped from `5.4.0` to `5.5.0` - - InvokeBuild bumped from `5.10.2` to `5.10.4` + - InvokeBuild bumped from `5.10.2` to `5.10.5` ## [2.0.0] - *breaking changes introduced* diff --git a/src/Catesta/Resources/AWS/install_modules.ps1 b/src/Catesta/Resources/AWS/install_modules.ps1 index bef4658..4edf197 100644 --- a/src/Catesta/Resources/AWS/install_modules.ps1 +++ b/src/Catesta/Resources/AWS/install_modules.ps1 @@ -68,7 +68,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ %> $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.4' + ModuleVersion = '5.10.5' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' KeyPrefix = '' })) diff --git a/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 b/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 index 12564f8..6cae12c 100644 --- a/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.4' + ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/Azure/actions_bootstrap.ps1 b/src/Catesta/Resources/Azure/actions_bootstrap.ps1 index 12564f8..6cae12c 100644 --- a/src/Catesta/Resources/Azure/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/Azure/actions_bootstrap.ps1 @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.4' + ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 b/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 index 12564f8..6cae12c 100644 --- a/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.4' + ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 b/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 index 12564f8..6cae12c 100644 --- a/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.4' + ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ diff --git a/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 b/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 index 12564f8..6cae12c 100644 --- a/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 @@ -31,7 +31,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ # https://github.com/nightroman/Invoke-Build $null = $modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' - ModuleVersion = '5.10.4' + ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer $null = $modulesToInstall.Add(([PSCustomObject]@{ From 205fc4347882a6917d1b9637de08c6bab822570a Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Wed, 17 Jan 2024 22:33:10 -0600 Subject: [PATCH 06/10] updated links in manifest --- docs/CHANGELOG.md | 1 + src/Catesta/Catesta.psd1 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 73492e6..5dd1577 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - InvokeBuild bumped from `5.10.2` to `5.10.5` - Catesta primary module changes - Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. + - Updated `LicenseUri` and `IconUri` link in `psd1` manifest. - Plaster bumped from `1.1.3` to `1.1.4` - Pester bumped from `5.4.0` to `5.5.0` - InvokeBuild bumped from `5.10.2` to `5.10.5` diff --git a/src/Catesta/Catesta.psd1 b/src/Catesta/Catesta.psd1 index 871d912..9235ce2 100644 --- a/src/Catesta/Catesta.psd1 +++ b/src/Catesta/Catesta.psd1 @@ -166,13 +166,13 @@ ) # A URL to the license for this module. - # LicenseUri = 'https://github.com/techthoughts2/Catesta/blob/main/LICENSE' + LicenseUri = 'https://github.com/techthoughts2/Catesta/blob/main/LICENSE' # A URL to the main website for this project. ProjectUri = 'https://github.com/techthoughts2/Catesta' # A URL to an icon representing this module. - IconUri = 'https://github.com/techthoughts2/Catesta/raw/main/media/CatestaIcon.png' + IconUri = 'https://github.com/techthoughts2/Catesta/raw/main/docs/assets/CatestaIcon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/techthoughts2/Catesta/blob/main/docs/CHANGELOG.md' From f08e5dfeaff6b3e3012269384ee8b420c9dd5831 Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Wed, 17 Jan 2024 22:38:11 -0600 Subject: [PATCH 07/10] updated aws to use standard 7 --- docs/CHANGELOG.md | 8 +++++++- .../AWS/CloudFormation/PowerShellCodeBuildCC.yml | 2 +- .../AWS/CloudFormation/PowerShellCodeBuildGit.yml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5dd1577..64760fe 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -13,9 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - CI/CD Changes: - Azure: - Updated `testRunner` alias reference to `testResultsFormat` + - AWS CodeBuild CI/CD changes: + - `PowerShellCodeBuildCC.yml` + - `aws/codebuild/standard:6.0` to `aws/codebuild/standard:7.0` + - `PowerShellCodeBuildGit.yml` + - `aws/codebuild/standard:6.0` to `aws/codebuild/standard:7.0` - Plaster bumped from `1.1.3` to `1.1.4` - Pester bumped from `5.4.0` to `5.5.0` - InvokeBuild bumped from `5.10.2` to `5.10.5` + - Catesta primary module changes - Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. - Updated `LicenseUri` and `IconUri` link in `psd1` manifest. @@ -125,7 +131,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - InvokeBuild bumped from `5.8.8` to `5.9.11` - Microsoft.PowerShell.SecretManagement bumped from `1.1.1` to `1.1.2` - AWS CodeBuild CI/CD changes: - - `PowerShellCodeBuildGit.yml` + - `PowerShellCodeBuildCC.yml` - `aws/codebuild/windows-base:2019-1.0` to `aws/codebuild/windows-base:2019-2.0` - `aws/codebuild/standard:5.0` to `aws/codebuild/standard:6.0` - All Lambdas updated from `Runtime: python3.6` to `Runtime: python3.9` diff --git a/src/Catesta/Resources/AWS/CloudFormation/PowerShellCodeBuildCC.yml b/src/Catesta/Resources/AWS/CloudFormation/PowerShellCodeBuildCC.yml index b695eb8..4e813ef 100644 --- a/src/Catesta/Resources/AWS/CloudFormation/PowerShellCodeBuildCC.yml +++ b/src/Catesta/Resources/AWS/CloudFormation/PowerShellCodeBuildCC.yml @@ -496,7 +496,7 @@ Resources: Description: !Ref CodeCommitRepositoryDescription Environment: ComputeType: BUILD_GENERAL1_SMALL - Image: aws/codebuild/standard:6.0 + Image: aws/codebuild/standard:7.0 Type: LINUX_CONTAINER EnvironmentVariables: - Name: main_bucket diff --git a/src/Catesta/Resources/AWS/CloudFormation/PowerShellCodeBuildGit.yml b/src/Catesta/Resources/AWS/CloudFormation/PowerShellCodeBuildGit.yml index fefdefa..6345dd8 100644 --- a/src/Catesta/Resources/AWS/CloudFormation/PowerShellCodeBuildGit.yml +++ b/src/Catesta/Resources/AWS/CloudFormation/PowerShellCodeBuildGit.yml @@ -364,7 +364,7 @@ Resources: Environment: #ComputeType: !Ref CodeBuildComputeType ComputeType: BUILD_GENERAL1_SMALL - Image: aws/codebuild/standard:6.0 + Image: aws/codebuild/standard:7.0 #Type: !Ref CodeBuildEnvironment Type: LINUX_CONTAINER Name: !Join From 752ef1614a9b4db90cfff58ecb4f6d75959d5868 Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Wed, 17 Jan 2024 22:41:16 -0600 Subject: [PATCH 08/10] Updated inline help link references --- docs/CHANGELOG.md | 1 + docs/New-ModuleProject.md | 4 +--- docs/New-VaultProject.md | 4 +--- src/Catesta/Public/New-ModuleProject.ps1 | 2 -- src/Catesta/Public/New-VaultProject.ps1 | 2 -- 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 64760fe..7227d91 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Catesta primary module changes - Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. - Updated `LicenseUri` and `IconUri` link in `psd1` manifest. + - Updated link references in inline help for both public functions - Plaster bumped from `1.1.3` to `1.1.4` - Pester bumped from `5.4.0` to `5.5.0` - InvokeBuild bumped from `5.10.2` to `5.10.5` diff --git a/docs/New-ModuleProject.md b/docs/New-ModuleProject.md index ade52b7..76fe6b4 100644 --- a/docs/New-ModuleProject.md +++ b/docs/New-ModuleProject.md @@ -1,7 +1,7 @@ --- external help file: Catesta-help.xml Module Name: Catesta -online version: https://www.catesta.dev +online version: https://www.catesta.dev/en/latest/New-ModuleProject/ schema: 2.0.0 --- @@ -377,8 +377,6 @@ Read the manifest schemas to understand how to properly craft a ModuleParameters ## RELATED LINKS -[https://www.catesta.dev](https://www.catesta.dev) - [https://www.catesta.dev/en/latest/New-ModuleProject/](https://www.catesta.dev/en/latest/New-ModuleProject/) [https://docs.microsoft.com/powershell/scripting/developer/module/writing-a-windows-powershell-module](https://docs.microsoft.com/powershell/scripting/developer/module/writing-a-windows-powershell-module) diff --git a/docs/New-VaultProject.md b/docs/New-VaultProject.md index e2b2d10..327f307 100644 --- a/docs/New-VaultProject.md +++ b/docs/New-VaultProject.md @@ -1,7 +1,7 @@ --- external help file: Catesta-help.xml Module Name: Catesta -online version: https://www.catesta.dev +online version: https://www.catesta.dev/en/latest/New-VaultProject/ schema: 2.0.0 --- @@ -362,8 +362,6 @@ Author: Jake Morrison - @jakemorrison - https://www.techthoughts.info/ ## RELATED LINKS -[https://www.catesta.dev](https://www.catesta.dev) - [https://www.catesta.dev/en/latest/New-VaultProject/](https://www.catesta.dev/en/latest/New-VaultProject/) [https://www.catesta.dev/en/latest/Catesta-Vault-Extension/](https://www.catesta.dev/en/latest/Catesta-Vault-Extension/) diff --git a/src/Catesta/Public/New-ModuleProject.ps1 b/src/Catesta/Public/New-ModuleProject.ps1 index d50e236..8625cc2 100644 --- a/src/Catesta/Public/New-ModuleProject.ps1 +++ b/src/Catesta/Public/New-ModuleProject.ps1 @@ -202,8 +202,6 @@ This requires an understanding of the template manifest schema which is provided in the Catesta docs. Due to the nature of the lower level Plaster engagement, this means it is possible to pass hashtable choices in ModuleParameters that are not supported. Read the manifest schemas to understand how to properly craft a ModuleParameters table. -.LINK - https://www.catesta.dev .LINK https://www.catesta.dev/en/latest/New-ModuleProject/ .LINK diff --git a/src/Catesta/Public/New-VaultProject.ps1 b/src/Catesta/Public/New-VaultProject.ps1 index ec106b9..03da15c 100644 --- a/src/Catesta/Public/New-VaultProject.ps1 +++ b/src/Catesta/Public/New-VaultProject.ps1 @@ -189,8 +189,6 @@ System.Management.Automation.PSCustomObject .NOTES Author: Jake Morrison - @jakemorrison - https://www.techthoughts.info/ -.LINK - https://www.catesta.dev .LINK https://www.catesta.dev/en/latest/New-VaultProject/ .LINK From c85914863397155c3de1e3752f5de3ab17c7ca1e Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Wed, 17 Jan 2024 22:52:52 -0600 Subject: [PATCH 09/10] updated to use Collections.Generic.List --- actions_bootstrap.ps1 | 18 +++++++------- docs/CHANGELOG.md | 3 ++- src/Catesta/Resources/AWS/install_modules.ps1 | 24 +++++++++---------- .../Resources/AppVeyor/actions_bootstrap.ps1 | 14 +++++------ .../Resources/Azure/actions_bootstrap.ps1 | 14 +++++------ .../Resources/Bitbucket/actions_bootstrap.ps1 | 14 +++++------ .../GitHubActions/actions_bootstrap.ps1 | 14 +++++------ .../Resources/GitLab/actions_bootstrap.ps1 | 14 +++++------ 8 files changed, 58 insertions(+), 57 deletions(-) diff --git a/actions_bootstrap.ps1 b/actions_bootstrap.ps1 index 2368270..3859669 100644 --- a/actions_bootstrap.ps1 +++ b/actions_bootstrap.ps1 @@ -7,30 +7,30 @@ Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # List of PowerShell Modules required for the build -$modulesToInstall = [System.Collections.ArrayList]::new() +$modulesToInstall = New-Object System.Collections.Generic.List[object] # https://github.com/PowerShell/Plaster -$null = $modulesToInstall.Add(([PSCustomObject]@{ - ModuleName = 'Plaster' - ModuleVersion = '1.1.4' -})) +[void]$modulesToInstall.Add(([PSCustomObject]@{ + ModuleName = 'Plaster' + ModuleVersion = '1.1.4' + })) # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '5.5.0' })) # https://github.com/nightroman/Invoke-Build -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'PSScriptAnalyzer' ModuleVersion = '1.21.0' })) # https://github.com/PowerShell/platyPS # older version used due to: https://github.com/PowerShell/platyPS/issues/457 -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'platyPS' ModuleVersion = '0.12.0' })) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7227d91..5a884f7 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Catesta template module changes - Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. This is to account for an issue in PowerShell `7.4.0`+ where a new parameter was introduced that platyPS can not handle during help creation. Ref: [platyPS issue]([text](https://github.com/PowerShell/platyPS/issues/595)). - If a build is run and the build environment is `7.4.0`+ the Markdown repair will run to account for the new parameter and repair markdown for help creation. + - Replaced uses of `System.Collections.ArrayList` with `System.Collections.Generic.List` throughout. - CI/CD Changes: - Azure: - Updated `testRunner` alias reference to `testResultsFormat` @@ -21,11 +22,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Plaster bumped from `1.1.3` to `1.1.4` - Pester bumped from `5.4.0` to `5.5.0` - InvokeBuild bumped from `5.10.2` to `5.10.5` - - Catesta primary module changes - Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. - Updated `LicenseUri` and `IconUri` link in `psd1` manifest. - Updated link references in inline help for both public functions + - Replaced uses of `System.Collections.ArrayList` with `System.Collections.Generic.List` throughout. - Plaster bumped from `1.1.3` to `1.1.4` - Pester bumped from `5.4.0` to `5.5.0` - InvokeBuild bumped from `5.10.2` to `5.10.5` diff --git a/src/Catesta/Resources/AWS/install_modules.ps1 b/src/Catesta/Resources/AWS/install_modules.ps1 index 4edf197..413ab62 100644 --- a/src/Catesta/Resources/AWS/install_modules.ps1 +++ b/src/Catesta/Resources/AWS/install_modules.ps1 @@ -41,12 +41,12 @@ $VerbosePreference = 'SilentlyContinue' # List of PowerShell Modules required for the build # The AWS PowerShell Modules are added below, based on the $PSEdition -$modulesToInstall = [System.Collections.ArrayList]::new() +$modulesToInstall = New-Object System.Collections.Generic.List[object] <% if ($PLASTER_PARAM_Pester-eq '4') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '4.10.1' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' @@ -57,7 +57,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ elseif ($PLASTER_PARAM_Pester-eq '5') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '5.5.0' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' @@ -66,25 +66,25 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ '@ } %> -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' ModuleVersion = '5.10.5' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' KeyPrefix = '' })) -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'PSScriptAnalyzer' ModuleVersion = '1.21.0' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' KeyPrefix = '' })) -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'platyPS' ModuleVersion = '0.12.0' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' KeyPrefix = '' })) -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'AWS.Tools.Common' ModuleVersion = '4.1.133' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' @@ -94,7 +94,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ <% if ($PLASTER_PARAM_VAULT -eq 'VAULT') { @' -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Microsoft.PowerShell.SecretManagement' ModuleVersion = '1.1.2' BucketName = '<%=$PLASTER_PARAM_S3Bucket%>' @@ -113,7 +113,7 @@ if ($galleryDownload -eq $false) { if ($PSEdition -eq 'Core') { $moduleInstallPath = [System.IO.Path]::Combine($env:ProgramFiles, 'PowerShell', 'Modules') # Add the AWSPowerShell.NetCore Module - # $null = $modulesToInstall.Add(([PSCustomObject]@{ + # [void]$modulesToInstall.Add(([PSCustomObject]@{ # ModuleName = 'AWSPowerShell.NetCore' # ModuleVersion = '3.3.604.0' # BucketName = 'ps-invoke-modules' @@ -123,7 +123,7 @@ if ($galleryDownload -eq $false) { else { $moduleInstallPath = [System.IO.Path]::Combine($env:ProgramFiles, 'WindowsPowerShell', 'Modules') # Add the AWSPowerShell Module - # $null = $modulesToInstall.Add(([PSCustomObject]@{ + # [void]$modulesToInstall.Add(([PSCustomObject]@{ # ModuleName = 'AWSPowerShell' # ModuleVersion = '3.3.604.0' # BucketName = 'ps-invoke-modules' @@ -135,7 +135,7 @@ if ($galleryDownload -eq $false) { $moduleInstallPath = [System.IO.Path]::Combine('/', 'usr', 'local', 'share', 'powershell', 'Modules') # Add the AWSPowerShell.NetCore Module - # $null = $modulesToInstall.Add(([PSCustomObject]@{ + # [void]$modulesToInstall.Add(([PSCustomObject]@{ # ModuleName = 'AWSPowerShell.NetCore' # ModuleVersion = '3.3.604.0' # BucketName = 'ps-invoke-modules' @@ -145,7 +145,7 @@ if ($galleryDownload -eq $false) { elseif ($PSEdition -eq 'Desktop') { $moduleInstallPath = [System.IO.Path]::Combine($env:ProgramFiles, 'WindowsPowerShell', 'Modules') # Add the AWSPowerShell Module - # $null = $modulesToInstall.Add(([PSCustomObject]@{ + # [void]$modulesToInstall.Add(([PSCustomObject]@{ # ModuleName = 'AWSPowerShell' # ModuleVersion = '3.3.604.0' # BucketName = 'ps-invoke-modules' diff --git a/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 b/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 index 6cae12c..ddc0402 100644 --- a/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1 @@ -7,12 +7,12 @@ Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # List of PowerShell Modules required for the build -$modulesToInstall = [System.Collections.ArrayList]::new() +$modulesToInstall = New-Object System.Collections.Generic.List[object] <% if ($PLASTER_PARAM_Pester-eq '4') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '4.10.1' })) @@ -21,7 +21,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ elseif ($PLASTER_PARAM_Pester-eq '5') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '5.5.0' })) @@ -29,18 +29,18 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ } %> # https://github.com/nightroman/Invoke-Build -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'PSScriptAnalyzer' ModuleVersion = '1.21.0' })) # https://github.com/PowerShell/platyPS # older version used due to: https://github.com/PowerShell/platyPS/issues/457 -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'platyPS' ModuleVersion = '0.12.0' })) @@ -48,7 +48,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ <% if ($PLASTER_PARAM_VAULT -eq 'VAULT') { @' -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Microsoft.PowerShell.SecretManagement' ModuleVersion = '1.1.2' })) diff --git a/src/Catesta/Resources/Azure/actions_bootstrap.ps1 b/src/Catesta/Resources/Azure/actions_bootstrap.ps1 index 6cae12c..ddc0402 100644 --- a/src/Catesta/Resources/Azure/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/Azure/actions_bootstrap.ps1 @@ -7,12 +7,12 @@ Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # List of PowerShell Modules required for the build -$modulesToInstall = [System.Collections.ArrayList]::new() +$modulesToInstall = New-Object System.Collections.Generic.List[object] <% if ($PLASTER_PARAM_Pester-eq '4') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '4.10.1' })) @@ -21,7 +21,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ elseif ($PLASTER_PARAM_Pester-eq '5') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '5.5.0' })) @@ -29,18 +29,18 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ } %> # https://github.com/nightroman/Invoke-Build -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'PSScriptAnalyzer' ModuleVersion = '1.21.0' })) # https://github.com/PowerShell/platyPS # older version used due to: https://github.com/PowerShell/platyPS/issues/457 -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'platyPS' ModuleVersion = '0.12.0' })) @@ -48,7 +48,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ <% if ($PLASTER_PARAM_VAULT -eq 'VAULT') { @' -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Microsoft.PowerShell.SecretManagement' ModuleVersion = '1.1.2' })) diff --git a/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 b/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 index 6cae12c..ddc0402 100644 --- a/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1 @@ -7,12 +7,12 @@ Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # List of PowerShell Modules required for the build -$modulesToInstall = [System.Collections.ArrayList]::new() +$modulesToInstall = New-Object System.Collections.Generic.List[object] <% if ($PLASTER_PARAM_Pester-eq '4') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '4.10.1' })) @@ -21,7 +21,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ elseif ($PLASTER_PARAM_Pester-eq '5') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '5.5.0' })) @@ -29,18 +29,18 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ } %> # https://github.com/nightroman/Invoke-Build -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'PSScriptAnalyzer' ModuleVersion = '1.21.0' })) # https://github.com/PowerShell/platyPS # older version used due to: https://github.com/PowerShell/platyPS/issues/457 -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'platyPS' ModuleVersion = '0.12.0' })) @@ -48,7 +48,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ <% if ($PLASTER_PARAM_VAULT -eq 'VAULT') { @' -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Microsoft.PowerShell.SecretManagement' ModuleVersion = '1.1.2' })) diff --git a/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 b/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 index 6cae12c..ddc0402 100644 --- a/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1 @@ -7,12 +7,12 @@ Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # List of PowerShell Modules required for the build -$modulesToInstall = [System.Collections.ArrayList]::new() +$modulesToInstall = New-Object System.Collections.Generic.List[object] <% if ($PLASTER_PARAM_Pester-eq '4') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '4.10.1' })) @@ -21,7 +21,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ elseif ($PLASTER_PARAM_Pester-eq '5') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '5.5.0' })) @@ -29,18 +29,18 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ } %> # https://github.com/nightroman/Invoke-Build -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'PSScriptAnalyzer' ModuleVersion = '1.21.0' })) # https://github.com/PowerShell/platyPS # older version used due to: https://github.com/PowerShell/platyPS/issues/457 -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'platyPS' ModuleVersion = '0.12.0' })) @@ -48,7 +48,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ <% if ($PLASTER_PARAM_VAULT -eq 'VAULT') { @' -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Microsoft.PowerShell.SecretManagement' ModuleVersion = '1.1.2' })) diff --git a/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 b/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 index 6cae12c..ddc0402 100644 --- a/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 +++ b/src/Catesta/Resources/GitLab/actions_bootstrap.ps1 @@ -7,12 +7,12 @@ Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # List of PowerShell Modules required for the build -$modulesToInstall = [System.Collections.ArrayList]::new() +$modulesToInstall = New-Object System.Collections.Generic.List[object] <% if ($PLASTER_PARAM_Pester-eq '4') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '4.10.1' })) @@ -21,7 +21,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ elseif ($PLASTER_PARAM_Pester-eq '5') { @' # https://github.com/pester/Pester -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Pester' ModuleVersion = '5.5.0' })) @@ -29,18 +29,18 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ } %> # https://github.com/nightroman/Invoke-Build -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'InvokeBuild' ModuleVersion = '5.10.5' })) # https://github.com/PowerShell/PSScriptAnalyzer -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'PSScriptAnalyzer' ModuleVersion = '1.21.0' })) # https://github.com/PowerShell/platyPS # older version used due to: https://github.com/PowerShell/platyPS/issues/457 -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'platyPS' ModuleVersion = '0.12.0' })) @@ -48,7 +48,7 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{ <% if ($PLASTER_PARAM_VAULT -eq 'VAULT') { @' -$null = $modulesToInstall.Add(([PSCustomObject]@{ +[void]$modulesToInstall.Add(([PSCustomObject]@{ ModuleName = 'Microsoft.PowerShell.SecretManagement' ModuleVersion = '1.1.2' })) From cc64817482abdd9c8460fcfdcabffd58b483be33 Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Thu, 18 Jan 2024 22:15:22 -0600 Subject: [PATCH 10/10] added faq for createmarkdownhelp issue --- docs/Catesta-FAQ.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/Catesta-FAQ.md b/docs/Catesta-FAQ.md index 96deba0..56a66eb 100644 --- a/docs/Catesta-FAQ.md +++ b/docs/Catesta-FAQ.md @@ -121,6 +121,22 @@ By default a freshly created vault extension module already violates several PSS This is normal, and the build / test validation process is doing it's job. You'll need to correct your manifest to not use wildcards. You will also need to add content to your extension psm1 to actually engage the variables. +## ProgressAction Error During Build Issue When Creating Help + +### Issue Overview + +In Catesta versions prior to `v2.2.0`, you might encounter an issue during the `CreateMarkDownHelp` step if you're running PowerShell `7.4.0` or higher. This is due to a new parameter, `ProgressAction`, [introduced in PowerShell 7.4.0(https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-74?view=powershell-7.4), which platyPS cannot handle during help creation. The error typically displays missing sections in the generated Markdown, prompting you to fill out information in your comment-based help. + +platyPS GitHub Issue: [PlatyPS needs to support the new ProgressAction common parameter #595](https://github.com/PowerShell/platyPS/issues/595) + +### Resolution + +This issue has been addressed in [Catesta v2.2.0](https://github.com/techthoughts2/Catesta/issues/71). To resolve the error, upgrade your Catesta to version `v2.2.0` or later. The fix includes the addition of `MarkdownRepair.ps1` and an update to the `InvokeBuild` script to include markdown repair logic. This repair step accounts for the new parameter and corrects the markdown for help creation. + +#### For Existing Projects + +If you have an existing module built with an older version of Catesta and are experiencing this issue, you can manually apply the fix. You can either create a new module with Catesta `v2.2.0` or later and copy the generated `MarkdownRepair.ps1` and updated `InvokeBuild` logic, or directly incorporate these changes from the Catesta GitHub repository. + ## Why is it called Catesta It's a unique and meaningful name, combining two Latin words - "catasta" meaning scaffold, and "testa" meaning shell. This combination perfectly represents the purpose of Catesta, which is to provide a scaffold for PowerShell projects.