Skip to content

Commit 3065365

Browse files
Merge pull request #91 from techthoughts2/Enhancements
Enhancements
2 parents 4919667 + 75da12f commit 3065365

34 files changed

+419
-257
lines changed

.vscode/tasks.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@
158158
"echo": false,
159159
"showReuseMessage": false
160160
},
161-
"group": "test"
161+
"group": {
162+
"kind": "test",
163+
"isDefault": true
164+
}
162165
},
163166
{
164167
"label": "DevCC",

actions_bootstrap.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ $modulesToInstall = New-Object System.Collections.Generic.List[object]
1616
# https://github.com/pester/Pester
1717
[void]$modulesToInstall.Add(([PSCustomObject]@{
1818
ModuleName = 'Pester'
19-
ModuleVersion = '5.5.0'
19+
ModuleVersion = '5.6.1'
2020
}))
2121
# https://github.com/nightroman/Invoke-Build
2222
[void]$modulesToInstall.Add(([PSCustomObject]@{
2323
ModuleName = 'InvokeBuild'
24-
ModuleVersion = '5.11.1'
24+
ModuleVersion = '5.11.3'
2525
}))
2626
# https://github.com/PowerShell/PSScriptAnalyzer
2727
[void]$modulesToInstall.Add(([PSCustomObject]@{
@@ -46,7 +46,14 @@ foreach ($module in $modulesToInstall) {
4646
ErrorAction = 'Stop'
4747
}
4848
try {
49-
Install-Module @installSplat
49+
if ($module.ModuleName -eq 'Pester' -and $IsWindows) {
50+
# special case for Pester certificate mismatch with older Pester versions - https://github.com/pester/Pester/issues/2389
51+
# this only affects windows builds
52+
Install-Module @installSplat -SkipPublisherCheck
53+
}
54+
else {
55+
Install-Module @installSplat
56+
}
5057
Import-Module -Name $module.ModuleName -ErrorAction Stop
5158
' - Successfully installed {0}' -f $module.ModuleName
5259
}

docs/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.20.0]
9+
10+
- Catesta template module changes
11+
- CI/CD Changes:
12+
- Adjusted all action bootstrap for module installs to include a `SkipPublisherCheck` when installing Pester module on Windows builds. (https://github.com/pester/Pester/issues/2389)
13+
- Pester bumped from `5.5.0` to `5.6.1`
14+
- InvokeBuild bumped from `5.11.1` to `5.11.3`
15+
- **New template question**: Catesta now asks if PowerShell Classes will be used in the module project. If `Yes` is specified a Classes structure will be scaffold.
16+
- Sample pester tests for Pester v5 refactored to follow Pester 5 rules
17+
- Refactored `ExportedFunctions.Tests.ps1` for better efficiency in loops
18+
- Minor spelling correction in sample Pester tests
19+
- `tasks.json`
20+
- `Test` task is now explicitly set as default test task
21+
- Catesta primary module changes
22+
- `tasks.json`
23+
- `Test` task is now explicitly set as default test task
24+
- Pester bumped from `5.5.0` to `5.6.1`
25+
- InvokeBuild bumped from `5.11.1` to `5.11.3`
26+
- Adjusted action bootstrap for module installs to include a `SkipPublisherCheck` when installing Pester module on Windows builds. (https://github.com/pester/Pester/issues/2389)
27+
- Refactored all unit and infra tests to adhere to Pester 5 rules
28+
- Refactored `ExportedFunctions.Tests.ps1` for better efficiency in loops
29+
830
## [2.12.0]
931

1032
- Catesta template module changes

docs/Catesta-Basics.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ New-VaultProject -DestinationPath $outPutPath
3333
* **Enter a description for the module:** *Description of what your module does*
3434
* **Enter the version number of the module (0.0.1)**: *Starting version #*
3535
* **Enter your full name**: *Module author name*
36+
* **Will you use classes in your module?**
37+
* [N] No
38+
* [Y] Yes
3639
* **Which CICD tool will you use to build and deploy your project?**: *Choose CI/CD tool for automated project build and deployment.*
3740
* [M] Module Only
3841
* [G] GitHub Actions

docs/Catesta-ModuleSchema.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ name : FN
3131
type : user-fullname
3232
default :
3333
34+
name : psClasses
35+
type : choice
36+
choices:
37+
value : No
38+
help : Classes will not be used in this PowerShell module.
39+
value : Yes
40+
help : Classes will be used in this PowerShell module.
41+
3442
name : CICD
3543
type : choice
3644
choices:
@@ -254,6 +262,7 @@ ModuleName = 'text'
254262
Description = 'text'
255263
Version = '0.0.1'
256264
FN = 'user full name'
265+
psClasses = 'No'
257266
CICD = 'GITHUB'
258267
GitHubAOptions = 'windows','pwshcore','linux','macos'
259268
AWSOptions = 'ps','pwshcore','pwsh'

docs/Catesta.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Module Name: Catesta
33
Module Guid: 6796b193-9013-468a-b022-837749af2d06
44
Download Help Link: NA
5-
Help Version: 2.12.0
5+
Help Version: 2.20.0
66
Locale: en-US
77
---
88

src/Catesta.build.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ Add-BuildTask Test {
268268
if ($env:CI -and $IsMacOS) {
269269
# the MacOS github action does not properly detect the relative path.
270270
Write-Build White " CI: $env:CI and MacOS action detected. Hard coding path."
271-
$pesterConfiguration.CodeCoverage.Path = "/Users/runner/work/Catesta/Catesta/src/Catesta/*/*.ps1"
271+
$pesterConfiguration.CodeCoverage.Path = "/Users/runner/work/$ModuleName/$ModuleName/src/$ModuleName/*/*.ps1"
272272
}
273273
else {
274-
$pesterConfiguration.CodeCoverage.Path = "..\..\..\$ModuleName\*\*.ps1"
274+
$pesterConfiguration.CodeCoverage.Path = "..\..\..\src\$ModuleName\*\*.ps1"
275275
}
276276
$pesterConfiguration.TestResult.Enabled = $true
277277
$pesterConfiguration.TestResult.OutputPath = "$testOutPutPath\PesterTests.xml"
@@ -472,6 +472,7 @@ Add-BuildTask AssetCopy -Before Build {
472472
Copy-Item -Path "$script:ModuleSourcePath\*" -Destination $script:ArtifactsPath -Exclude *.psd1, *.psm1 -Recurse -ErrorAction Stop
473473
Copy-Item -Path "$script:ModuleSourcePath\Resources\Module\src\PSScriptAnalyzerSettings.psd1" -Destination "$script:ArtifactsPath\Resources\Module\src\PSScriptAnalyzerSettings.psd1" -ErrorAction Stop
474474
Copy-Item -Path "$script:ModuleSourcePath\Resources\Module\src\Module\Module.psm1" -Destination "$script:ArtifactsPath\Resources\Module\src\Module\Module.psm1" -ErrorAction Stop
475+
Copy-Item -Path "$script:ModuleSourcePath\Resources\Module\src\Module\Module_Classes.psm1" -Destination "$script:ArtifactsPath\Resources\Module\src\Module\Module_Classes.psm1" -ErrorAction Stop
475476
# Copy-Item -Path "$script:ModuleSourcePath\Resources\Vault\src\PSVault\PSVault.psd1" -Destination "$script:ArtifactsPath\Resources\Vault\src\PSVault\PSVault.psd1" -ErrorAction Stop
476477
Copy-Item -Path "$script:ModuleSourcePath\Resources\Vault\src\PSVault\PSVault.psm1" -Destination "$script:ArtifactsPath\Resources\Vault\src\PSVault\PSVault.psm1" -ErrorAction Stop
477478
Copy-Item -Path "$script:ModuleSourcePath\Resources\Vault\src\PSVault\PSVault.Extension\PSVault.Extension.psd1" -Destination "$script:ArtifactsPath\Resources\Vault\src\PSVault\PSVault.Extension\PSVault.Extension.psd1" -ErrorAction Stop
@@ -526,8 +527,6 @@ Add-BuildTask Build {
526527
Write-Build Green ' ...Build Complete!'
527528
} #Build
528529

529-
# TODO: schema generator step
530-
531530
#Synopsis: Invokes all Pester Integration Tests in the Tests\Integration folder (if it exists)
532531
Add-BuildTask IntegrationTest {
533532
if (Test-Path -Path $script:IntegrationTestsPath) {

src/Catesta/Catesta.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'Catesta.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.12.0'
15+
ModuleVersion = '2.20.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

src/Catesta/Resources/AWS/install_modules.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ elseif ($PLASTER_PARAM_Pester-eq '5') {
5959
# https://github.com/pester/Pester
6060
[void]$modulesToInstall.Add(([PSCustomObject]@{
6161
ModuleName = 'Pester'
62-
ModuleVersion = '5.5.0'
62+
ModuleVersion = '5.6.1'
6363
BucketName = '<%=$PLASTER_PARAM_S3Bucket%>'
6464
KeyPrefix = ''
6565
}))
@@ -68,7 +68,7 @@ elseif ($PLASTER_PARAM_Pester-eq '5') {
6868
%>
6969
[void]$modulesToInstall.Add(([PSCustomObject]@{
7070
ModuleName = 'InvokeBuild'
71-
ModuleVersion = '5.11.1'
71+
ModuleVersion = '5.11.3'
7272
BucketName = '<%=$PLASTER_PARAM_S3Bucket%>'
7373
KeyPrefix = ''
7474
}))
@@ -204,7 +204,14 @@ else {
204204
ErrorAction = 'Stop'
205205
}
206206
try {
207-
Install-Module @installSplat
207+
if ($module.ModuleName -eq 'Pester' -and $IsWindows) {
208+
# special case for Pester certificate mismatch with older Pester versions - https://github.com/pester/Pester/issues/2389
209+
# this only affects windows builds
210+
Install-Module @installSplat -SkipPublisherCheck
211+
}
212+
else {
213+
Install-Module @installSplat
214+
}
208215
Import-Module -Name $module.ModuleName -ErrorAction Stop
209216
' - Successfully installed {0}' -f $module.ModuleName
210217
}

src/Catesta/Resources/AppVeyor/actions_bootstrap.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ elseif ($PLASTER_PARAM_Pester-eq '5') {
2323
# https://github.com/pester/Pester
2424
[void]$modulesToInstall.Add(([PSCustomObject]@{
2525
ModuleName = 'Pester'
26-
ModuleVersion = '5.5.0'
26+
ModuleVersion = '5.6.1'
2727
}))
2828
'@
2929
}
3030
%>
3131
# https://github.com/nightroman/Invoke-Build
3232
[void]$modulesToInstall.Add(([PSCustomObject]@{
3333
ModuleName = 'InvokeBuild'
34-
ModuleVersion = '5.11.1'
34+
ModuleVersion = '5.11.3'
3535
}))
3636
# https://github.com/PowerShell/PSScriptAnalyzer
3737
[void]$modulesToInstall.Add(([PSCustomObject]@{

0 commit comments

Comments
 (0)