Skip to content

Commit

Permalink
updated to use Collections.Generic.List
Browse files Browse the repository at this point in the history
  • Loading branch information
techthoughts2 committed Jan 18, 2024
1 parent 752ef16 commit c859148
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 57 deletions.
18 changes: 9 additions & 9 deletions actions_bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}))
Expand Down
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`
Expand Down
24 changes: 12 additions & 12 deletions src/Catesta/Resources/AWS/install_modules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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%>'
Expand All @@ -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%>'
Expand All @@ -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%>'
Expand All @@ -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%>'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand Down
14 changes: 7 additions & 7 deletions src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}))
Expand All @@ -21,34 +21,34 @@ $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'
}))
'@
}
%>
# 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'
}))

<%
if ($PLASTER_PARAM_VAULT -eq 'VAULT') {
@'
$null = $modulesToInstall.Add(([PSCustomObject]@{
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Microsoft.PowerShell.SecretManagement'
ModuleVersion = '1.1.2'
}))
Expand Down
14 changes: 7 additions & 7 deletions src/Catesta/Resources/Azure/actions_bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}))
Expand All @@ -21,34 +21,34 @@ $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'
}))
'@
}
%>
# 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'
}))

<%
if ($PLASTER_PARAM_VAULT -eq 'VAULT') {
@'
$null = $modulesToInstall.Add(([PSCustomObject]@{
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Microsoft.PowerShell.SecretManagement'
ModuleVersion = '1.1.2'
}))
Expand Down
14 changes: 7 additions & 7 deletions src/Catesta/Resources/Bitbucket/actions_bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}))
Expand All @@ -21,34 +21,34 @@ $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'
}))
'@
}
%>
# 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'
}))

<%
if ($PLASTER_PARAM_VAULT -eq 'VAULT') {
@'
$null = $modulesToInstall.Add(([PSCustomObject]@{
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Microsoft.PowerShell.SecretManagement'
ModuleVersion = '1.1.2'
}))
Expand Down
14 changes: 7 additions & 7 deletions src/Catesta/Resources/GitHubActions/actions_bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}))
Expand All @@ -21,34 +21,34 @@ $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'
}))
'@
}
%>
# 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'
}))

<%
if ($PLASTER_PARAM_VAULT -eq 'VAULT') {
@'
$null = $modulesToInstall.Add(([PSCustomObject]@{
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Microsoft.PowerShell.SecretManagement'
ModuleVersion = '1.1.2'
}))
Expand Down
Loading

0 comments on commit c859148

Please sign in to comment.