Skip to content

Commit c33edbb

Browse files
fix(gate): use parameterized script block for Pester subprocess invocation (v1.0.11)
Eliminates string escaping and modulo operator parsing error in Windows PowerShell 5.1 when executing Test-MasterGate.ps1.
1 parent 83fffe5 commit c33edbb

5 files changed

Lines changed: 42 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
---
1313

14+
## [1.0.11] - 2026-09-08
15+
16+
### Fixed
17+
- **Local Master Gate (`Test-MasterGate.ps1`)**: Refactored Pester 5 subprocess invocation to execute via parameterized script block instead of an escaped command string. Eliminates Windows PowerShell 5.1 command-line expression parsing error (`At line:1 char:890`) during automated CI execution.
18+
19+
---
20+
1421
## [1.0.10] - 2026-09-08
1522

1623
### Fixed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[![Windows 11](https://img.shields.io/badge/Windows%2011-23H2%20%7C%2024H2%20%7C%2025H2-0078D6?style=for-the-badge&logo=windows11&logoColor=white)](https://github.com/PyPie-Studio/unslop-windows)
1313
[![License](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](LICENSE)
1414

15-
[⚡ Quick Download](https://github.com/PyPie-Studio/unslop-windows/releases/latest/download/unslop-windows-v1.0.10.zip)[📋 Changelog](CHANGELOG.md)[🗺️ Roadmap](ROADMAP.md)[🚀 Real-World Impact](#-measured-real-world-impact)[📊 Comparison](#-comparison-matrix)[🛡️ Safe-Tier Principles](#-safe-tier-design-principles)[⚙️ All 18 Modules](#-what-gets-hardened-18-modules)[🔒 Untouchable Whitelist](#-untouchable-safety-whitelist)
15+
[⚡ Quick Download](https://github.com/PyPie-Studio/unslop-windows/releases/latest/download/unslop-windows-v1.0.11.zip)[📋 Changelog](CHANGELOG.md)[🗺️ Roadmap](ROADMAP.md)[🚀 Real-World Impact](#-measured-real-world-impact)[📊 Comparison](#-comparison-matrix)[🛡️ Safe-Tier Principles](#-safe-tier-design-principles)[⚙️ All 18 Modules](#-what-gets-hardened-18-modules)[🔒 Untouchable Whitelist](#-untouchable-safety-whitelist)
1616

1717
</div>
1818

@@ -26,7 +26,7 @@
2626

2727
```text
2828
============================================================
29-
unslop-windows (v1.0.10) - PyPie Studio
29+
unslop-windows (v1.0.11) - PyPie Studio
3030
Universal Windows 11 24H2 / 25H2 Debloat & Privacy Hardener
3131
============================================================
3232
@@ -57,7 +57,7 @@ Select an option [0-8]:
5757
### Method 1: Direct Download (1-Click / Non-Technical)
5858
No Git, terminal commands, or PowerShell knowledge needed:
5959

60-
1. Download **[`unslop-windows-v1.0.10.zip`](https://github.com/PyPie-Studio/unslop-windows/releases/latest/download/unslop-windows-v1.0.10.zip)** from the [Latest Release](https://github.com/PyPie-Studio/unslop-windows/releases/latest).
60+
1. Download **[`unslop-windows-v1.0.11.zip`](https://github.com/PyPie-Studio/unslop-windows/releases/latest/download/unslop-windows-v1.0.11.zip)** from the [Latest Release](https://github.com/PyPie-Studio/unslop-windows/releases/latest).
6161
2. Extract the `.zip` archive to any folder.
6262
3. Right-click **`unslop.bat`** and select **Run as administrator** (or double-click and accept the UAC prompt).
6363
4. In the console menu, type `1` (or your preferred option) and press Enter.

scripts/Test-MasterGate.ps1

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ if (-not $Fast) {
190190
if ($pesterModule -and $pesterModule.Version.Major -ge 5) {
191191
Push-Location $root
192192
try {
193-
$xmlConfig = ""
193+
$targetXml = ""
194194
if ($TestResultsPath) {
195195
$targetXml = if ([System.IO.Path]::IsPathRooted($TestResultsPath)) {
196196
$TestResultsPath
@@ -201,9 +201,9 @@ if (-not $Fast) {
201201
if ($xmlDir -and -not (Test-Path $xmlDir)) {
202202
New-Item -ItemType Directory -Path $xmlDir -Force | Out-Null
203203
}
204-
$xmlConfig = "`$cfg.TestResult.Enabled = `$true; `$cfg.TestResult.OutputFormat = 'NUnitXml'; `$cfg.TestResult.OutputPath = '$targetXml';"
205204
}
206-
$covConfig = ""
205+
$targetCovXml = ""
206+
$covFile = ""
207207
if ($CodeCoveragePath) {
208208
$targetCovXml = if ([System.IO.Path]::IsPathRooted($CodeCoveragePath)) {
209209
$CodeCoveragePath
@@ -215,10 +215,33 @@ if (-not $Fast) {
215215
New-Item -ItemType Directory -Path $covDir -Force | Out-Null
216216
}
217217
$covFile = Join-Path $root "unslop.ps1"
218-
$covConfig = "`$cfg.CodeCoverage.Enabled = `$true; `$cfg.CodeCoverage.Path = '$covFile'; `$cfg.CodeCoverage.OutputFormat = 'JaCoCo'; `$cfg.CodeCoverage.OutputPath = '$targetCovXml';"
219218
}
220-
$pesterCmd = "Import-Module Pester -MinimumVersion 5.0.0; `$cfg = New-PesterConfiguration; `$cfg.Run.Path = '$testScript'; `$cfg.Output.Verbosity = 'Detailed'; $xmlConfig $covConfig `$cfg.Run.PassThru = `$true; `$res = Invoke-Pester -Configuration `$cfg; if (`$res.CodeCoverage) { Write-Host `" Code Coverage: `$([math]::Round(`$res.CodeCoverage.CoveragePercent, 1))% (`$(`$res.CodeCoverage.CommandsExecutedCount)/`$(`$res.CodeCoverage.CommandsAnalyzedCount) commands)`" -ForegroundColor Cyan }; if (`$res.FailedCount -gt 0) { exit 1 }"
221-
$pesterOut = & $psExec -NoProfile -ExecutionPolicy Bypass -Command $pesterCmd 2>&1
219+
$pesterBlock = {
220+
param($testPath, $xmlOut, $covOut, $covTarget)
221+
Import-Module Pester -MinimumVersion 5.0.0
222+
$cfg = New-PesterConfiguration
223+
$cfg.Run.Path = $testPath
224+
$cfg.Output.Verbosity = 'Detailed'
225+
$cfg.Run.PassThru = $true
226+
if ($xmlOut) {
227+
$cfg.TestResult.Enabled = $true
228+
$cfg.TestResult.OutputFormat = 'NUnitXml'
229+
$cfg.TestResult.OutputPath = $xmlOut
230+
}
231+
if ($covOut -and $covTarget) {
232+
$cfg.CodeCoverage.Enabled = $true
233+
$cfg.CodeCoverage.Path = $covTarget
234+
$cfg.CodeCoverage.OutputFormat = 'JaCoCo'
235+
$cfg.CodeCoverage.OutputPath = $covOut
236+
}
237+
$res = Invoke-Pester -Configuration $cfg
238+
if ($res.CodeCoverage) {
239+
$pct = [math]::Round($res.CodeCoverage.CoveragePercent, 1)
240+
Write-Host " Code Coverage: $pct% ($($res.CodeCoverage.CommandsExecutedCount)/$($res.CodeCoverage.CommandsAnalyzedCount) commands)" -ForegroundColor Cyan
241+
}
242+
if ($res.FailedCount -gt 0) { exit 1 }
243+
}
244+
$pesterOut = & $psExec -NoProfile -ExecutionPolicy Bypass -Command $pesterBlock -args $testScript, $targetXml, $targetCovXml, $covFile 2>&1
222245
$pesterExit = $LASTEXITCODE
223246
if ($pesterExit -ne 0) {
224247
$fail = $true

unslop.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if not "%~1"=="" (
5656
:menu
5757
cls
5858
echo ============================================================
59-
echo unslop-windows (v1.0.10) - PyPie Studio
59+
echo unslop-windows (v1.0.11) - PyPie Studio
6060
echo Universal Windows 11 24H2 / 25H2 Debloat ^& Privacy Hardener
6161
echo ============================================================
6262
echo.

unslop.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# unslop-windows: Universal Windows 11 Debloat & Privacy Hardener (v1.0.10)
1+
# unslop-windows: Universal Windows 11 Debloat & Privacy Hardener (v1.0.11)
22
# Targets Windows 11 23H2, 24H2, and 25H2 (Build 26100 - 26200+)
33
# Safe tier — no core system files touched, all changes reversible
44
# Run as Administrator after fresh install or every major Windows feature update
@@ -189,7 +189,7 @@ if (-not $isAdmin) {
189189
$modeStr = if ($IsUndo) { "RESTORE / UNDO" } else { "UNIVERSAL 25H2 DEBLOAT & PRIVACY HARDEN" }
190190
if ($IsDryRun) { $modeStr += " (DRY-RUN / AUDIT ONLY)" }
191191

192-
Log "=== unslop-windows v1.0.10: Windows 11 $modeStr ==="
192+
Log "=== unslop-windows v1.0.11: Windows 11 $modeStr ==="
193193
Log ""
194194

195195
# ============================================================

0 commit comments

Comments
 (0)