Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@
{
"label": "PesterTest",
"type": "shell",
"command": "Invoke-Pester '${workspaceFolder}/src/Tests/Unit' -Output Detailed",
"command": "Import-Module Pester -RequiredVersion 5.9.1;Invoke-Pester '${workspaceFolder}/src/Tests/Unit' -Output Detailed",
"problemMatcher": "$pester",
"group": "test"
},
{
"label": "Pester-Single-Coverage",
"type": "shell",
"command": "Import-Module -Name '${workspaceFolder}/src/${workspaceFolderBasename}/${workspaceFolderBasename}.psm1';$pesterConfig = New-PesterConfiguration;$pesterConfig.run.Path = '${workspaceFolder}/src/Tests/Unit/*/${input:functionName}.Tests.ps1';$pesterConfig.CodeCoverage.Enabled = $true;$pesterConfig.CodeCoverage.Path = '${workspaceFolder}/src/${workspaceFolderBasename}/*/${input:functionName}.ps1';Invoke-Pester -Configuration $pesterConfig",
"command": "Import-Module Pester -RequiredVersion 5.9.1;Import-Module -Name '${workspaceFolder}/src/${workspaceFolderBasename}/${workspaceFolderBasename}.psm1';$pesterConfig = New-PesterConfiguration;$pesterConfig.run.Path = '${workspaceFolder}/src/Tests/Unit/*/${input:functionName}.Tests.ps1';$pesterConfig.CodeCoverage.Enabled = $true;$pesterConfig.CodeCoverage.Path = '${workspaceFolder}/src/${workspaceFolderBasename}/*/${input:functionName}.ps1';Invoke-Pester -Configuration $pesterConfig",
"problemMatcher": "$pester",
"presentation": {
"echo": false,
Expand All @@ -217,7 +217,7 @@
{
"label": "Pester-Single-Detailed",
"type": "shell",
"command": "Import-Module -Name '${workspaceFolder}/src/${workspaceFolderBasename}/${workspaceFolderBasename}.psm1';Invoke-Pester '${workspaceFolder}/src/Tests/Unit/*/${input:functionName}.Tests.ps1' -Output Detailed",
"command": "Import-Module Pester -RequiredVersion 5.9.1;Import-Module -Name '${workspaceFolder}/src/${workspaceFolderBasename}/${workspaceFolderBasename}.psm1';Invoke-Pester '${workspaceFolder}/src/Tests/Unit/*/${input:functionName}.Tests.ps1' -Output Detailed",
"problemMatcher": "$pester",
"presentation": {
"echo": false,
Expand All @@ -228,7 +228,7 @@
{
"label": "DevCC-Single",
"type": "shell",
"command": "Import-Module -Name '${workspaceFolder}/src/${workspaceFolderBasename}/${workspaceFolderBasename}.psm1';$pesterConfig = New-PesterConfiguration;$pesterConfig.run.Path = '${workspaceFolder}/src/Tests/Unit/*/${input:functionName}.Tests.ps1';$pesterConfig.CodeCoverage.Enabled = $true;$pesterConfig.CodeCoverage.Path = '${workspaceFolder}/src/${workspaceFolderBasename}/*/${input:functionName}.ps1';$pesterConfig.CodeCoverage.OutputPath = '${workspaceFolder}/cov.xml';$pesterConfig.CodeCoverage.OutputFormat = 'CoverageGutters';Invoke-Pester -Configuration $pesterConfig",
"command": "Import-Module Pester -RequiredVersion 5.9.1;Import-Module -Name '${workspaceFolder}/src/${workspaceFolderBasename}/${workspaceFolderBasename}.psm1';$pesterConfig = New-PesterConfiguration;$pesterConfig.run.Path = '${workspaceFolder}/src/Tests/Unit/*/${input:functionName}.Tests.ps1';$pesterConfig.CodeCoverage.Enabled = $true;$pesterConfig.CodeCoverage.Path = '${workspaceFolder}/src/${workspaceFolderBasename}/*/${input:functionName}.ps1';$pesterConfig.CodeCoverage.OutputPath = '${workspaceFolder}/cov.xml';$pesterConfig.CodeCoverage.OutputFormat = 'CoverageGutters';Invoke-Pester -Configuration $pesterConfig",
"problemMatcher": "$pester",
"presentation": {
"echo": false,
Expand All @@ -239,7 +239,7 @@
{
"label": "Integration-Single-Detailed",
"type": "shell",
"command": "Import-Module -Name '${workspaceFolder}/src/${workspaceFolderBasename}/${workspaceFolderBasename}.psm1';Invoke-Pester '${workspaceFolder}/src/Tests/Integration/*/${input:functionName}.Tests.ps1' -Output Detailed",
"command": "Import-Module Pester -RequiredVersion 5.9.1;Import-Module -Name '${workspaceFolder}/src/${workspaceFolderBasename}/${workspaceFolderBasename}.psm1';Invoke-Pester '${workspaceFolder}/src/Tests/Integration/*/${input:functionName}.Tests.ps1' -Output Detailed",
"problemMatcher": "$pester",
"presentation": {
"echo": false,
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@

---

## [2.2.0] - 2026-09-14
Comment thread
SamErde marked this conversation as resolved.
Resolved
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

### Added

- `Update-AllTheThings` - Add support for updating the GitHub CLI and GitHub Copilot CLI.

### Changed

- `Update-AllTheThings` - Refactor update orchestration into focused package-manager, native-command, and PowerShell update helpers.
- `Update-AllTheThings` - Improve cross-platform behavior, progress reporting, command detection, and generated script consistency.
- Expand unit and compatibility test coverage for update orchestration, package managers, CLI updates, and Windows PowerShell 5.1 behavior.

### Fixed

- `Update-AllTheThings` - Preserve later update stages when WinGet is skipped and avoid misleading or duplicate confirmation prompts.

### Security

- `Update-AllTheThings` - Add safeguards around WinGet server detection and server-side CLI updates, including safe fallbacks for legacy hosts.

[*Full Changelog*](https://github.com/SamErde/PSPreworkout/compare/v2.1.1...v2.2.0)

---

## [2.1.1] - 2026-05-11

### Changed
Expand Down Expand Up @@ -491,3 +515,4 @@
[2.0.0]: https://github.com/SamErde/PSPreworkout/tag/v2.0.0
[2.1.0]: https://github.com/SamErde/PSPreworkout/tag/v2.1.0
[2.1.1]: https://github.com/SamErde/PSPreworkout/tag/v2.1.1
[2.2.0]: https://github.com/SamErde/PSPreworkout/tag/v2.2.0
2 changes: 1 addition & 1 deletion docs/MKDOCS-NAVIGATION-AUTOMATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ To change which category a function belongs to:

```powershell
# Run the Pester tests
Import-Module Pester
Import-Module Pester -RequiredVersion 5.9.1
Invoke-Pester -Path ./src/Tests/Unit/Update-MkDocsNavigation.Tests.ps1
```

Expand Down
70 changes: 40 additions & 30 deletions src/PSPreworkout.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,42 @@ Enter-Build {
# Ensure our builds fail until if below a minimum defined code test coverage threshold
$script:coverageThreshold = 30

[version]$script:MinPesterVersion = '5.2.2'
[version]$script:MaxPesterVersion = '5.99.99'
[version]$script:PesterVersion = '5.9.1'
$script:testOutputFormat = 'NUnitXML'
} #Enter-Build

<#
.SYNOPSIS
Imports the exact Pester version required by the build.
.DESCRIPTION
Reuses a matching Pester module already loaded in the current process and
rejects other versions because PowerShell cannot unload Pester assemblies.
.OUTPUTS
System.Management.Automation.PSModuleInfo
#>
function Import-BuildPester {
[CmdletBinding()]
param()

$loadedPester = @(Get-Module -Name Pester)

if ($loadedPester) {
$mismatchedPester = @($loadedPester | Where-Object { $_.Version -ne $script:PesterVersion })
if ($mismatchedPester) {
throw "Loaded Pester version(s) $($mismatchedPester.Version -join ', ') do not match the required version $script:PesterVersion."
}

return $loadedPester |
Sort-Object -Property Version -Descending |
Select-Object -First 1
}

Import-Module -Name Pester -RequiredVersion $script:PesterVersion -ErrorAction Stop
Get-Module -Name Pester |
Sort-Object -Property Version -Descending |
Select-Object -First 1
} #Import-BuildPester

# Define headers as separator, task path, synopsis, and location, e.g. for Ctrl+Click in VSCode.
# Also change the default color to Green. If you need task start times, use `$Task.Started`.
Set-BuildHeader {
Expand Down Expand Up @@ -311,18 +342,8 @@ Add-BuildTask FormattingCheck {
#Synopsis: Invokes all Pester Unit Tests in the Tests\Unit folder (if it exists)
Add-BuildTask Test {

Write-Build White " Importing desired Pester version. Min: $script:MinPesterVersion Max: $script:MaxPesterVersion"
$loadedPester = Get-Module -Name Pester |
Sort-Object -Property Version -Descending |
Select-Object -First 1
if (-not $loadedPester) {
Import-Module -Name Pester -MinimumVersion $script:MinPesterVersion -MaximumVersion $script:MaxPesterVersion -ErrorAction 'Stop'
} elseif (
$loadedPester.Version -lt $script:MinPesterVersion -or
$loadedPester.Version -gt $script:MaxPesterVersion
) {
throw "Loaded Pester version $($loadedPester.Version) is outside the supported range."
}
Write-Build White " Importing required Pester version: $script:PesterVersion"
$null = Import-BuildPester

$codeCovPath = "$script:ArtifactsPath\ccReport\"
$testOutPutPath = "$script:ArtifactsPath\testOutput\"
Expand Down Expand Up @@ -388,18 +409,8 @@ Add-BuildTask Test {
#Synopsis: Used primarily during active development to generate xml file to graphically display code coverage in VSCode using Coverage Gutters
Add-BuildTask DevCC {
Write-Build White ' Generating code coverage report at root...'
Write-Build White " Importing desired Pester version. Min: $script:MinPesterVersion Max: $script:MaxPesterVersion"
$loadedPester = Get-Module -Name Pester |
Sort-Object -Property Version -Descending |
Select-Object -First 1
if (-not $loadedPester) {
Import-Module -Name Pester -MinimumVersion $script:MinPesterVersion -MaximumVersion $script:MaxPesterVersion -ErrorAction 'Stop'
} elseif (
$loadedPester.Version -lt $script:MinPesterVersion -or
$loadedPester.Version -gt $script:MaxPesterVersion
) {
throw "Loaded Pester version $($loadedPester.Version) is outside the supported range."
}
Write-Build White " Importing required Pester version: $script:PesterVersion"
$null = Import-BuildPester
$pesterConfiguration = New-PesterConfiguration
$pesterConfiguration.run.Path = $script:UnitTestsPath
$pesterConfiguration.CodeCoverage.Enabled = $true
Expand Down Expand Up @@ -530,7 +541,7 @@ Add-BuildTask UpdateCBH -After AssetCopy {
#>
"@

$CBHPattern = '(?ms)(\<#.*\.SYNOPSIS.*?#>)'
$CBHPattern = '(?ms)(\<#.*?\.SYNOPSIS.*?#>)'
Get-ChildItem -Path "$script:ArtifactsPath\Public\*.ps1" -File | ForEach-Object {
$FormattedOutFile = $_.FullName
Write-Output " Replacing CBH in file: $($FormattedOutFile)"
Expand Down Expand Up @@ -597,9 +608,8 @@ Add-BuildTask Build {
#Synopsis: Invokes all Pester Integration Tests in the Tests\Integration folder (if it exists)
Add-BuildTask IntegrationTest {
if (Test-Path -Path $script:IntegrationTestsPath) {
Write-Build White " Importing desired Pester version. Min: $script:MinPesterVersion Max: $script:MaxPesterVersion"
Remove-Module -Name Pester -Force -ErrorAction SilentlyContinue # there are instances where some containers have Pester already in the session
Import-Module -Name Pester -MinimumVersion $script:MinPesterVersion -MaximumVersion $script:MaxPesterVersion -ErrorAction 'Stop'
Write-Build White " Importing required Pester version: $script:PesterVersion"
$null = Import-BuildPester

Write-Build White " Performing Pester Integration Tests in $($invokePesterParams.path)"

Expand Down
4 changes: 2 additions & 2 deletions src/PSPreworkout/PSPreworkout.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'PSPreworkout.psm1'

# Version number of this module.
ModuleVersion = '2.1.1'
ModuleVersion = '2.2.0'

# Supported PSEditions = @('Desktop', 'Core')
CompatiblePSEditions = @('Core', 'Desktop')
Expand Down Expand Up @@ -99,7 +99,7 @@
IconUri = 'https://raw.githubusercontent.com/SamErde/PSPreworkout/main/media/PSPreworkout-Animated-Logo-170.png'

# ReleaseNotes of this module
ReleaseNotes = 'See <https://github.com/SamErde/PSPreworkout/CHANGELOG.md> for more information.'
ReleaseNotes = 'See https://github.com/SamErde/PSPreworkout/compare/v2.1.1...v2.2.0 for release notes.'

# Prerelease string of this module
# Prerelease = 'preview'
Expand Down
Loading