diff --git a/scripts/Remove-BuildVM.ps1 b/scripts/Remove-BuildVM.ps1 index 7f7655f..483d7f0 100644 --- a/scripts/Remove-BuildVM.ps1 +++ b/scripts/Remove-BuildVM.ps1 @@ -32,7 +32,7 @@ param( [string] $VmrunPath = 'C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe', - [ValidateRange(5, 60)] + [ValidateRange(1, 60)] [int] $GracefulTimeoutSeconds = 15 ) diff --git a/scripts/Test-E2E-Section3.3.ps1 b/scripts/Test-E2E-Section3.3.ps1 index dd9fa66..539aaff 100644 --- a/scripts/Test-E2E-Section3.3.ps1 +++ b/scripts/Test-E2E-Section3.3.ps1 @@ -157,7 +157,7 @@ function Run-Test { Write-Host "" Write-Host "╔════════════════════════════════════════════════════════╗" -ForegroundColor Yellow -Write-Host "║ §3.3 E2E Test: In-VM Git Clone vs Host-side Zip ║" -ForegroundColor Yellow +Write-Host "║ §3.3 E2E Test: In-VM Git Clone vs Host-side Zip ║" -ForegroundColor Yellow Write-Host "╚════════════════════════════════════════════════════════╝" -ForegroundColor Yellow $baselineResult = $null diff --git a/scripts/Wait-VMReady.ps1 b/scripts/Wait-VMReady.ps1 index 3a3f6e2..f71be8c 100644 --- a/scripts/Wait-VMReady.ps1 +++ b/scripts/Wait-VMReady.ps1 @@ -43,10 +43,10 @@ param( [ValidatePattern('^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$')] [string] $IPAddress, - [ValidateRange(30, 600)] + [ValidateRange(3, 600)] [int] $TimeoutSeconds = 300, - [ValidateRange(3, 30)] + [ValidateRange(1, 30)] [int] $PollIntervalSeconds = 5, [string] $VmrunPath = 'C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe', diff --git a/tests/New-BuildVM.Tests.ps1 b/tests/New-BuildVM.Tests.ps1 index 2055f59..19ba063 100644 --- a/tests/New-BuildVM.Tests.ps1 +++ b/tests/New-BuildVM.Tests.ps1 @@ -9,18 +9,22 @@ BeforeAll { $script:CloneBaseDir = Join-Path $env:TEMP "CI-Tests-CloneBase-$PID" New-Item -ItemType Directory -Path $script:CloneBaseDir -Force | Out-Null - # Fake vmrun.cmd — exits with %FAKE_VMRUN_EXIT% (default 0) + # Fake vmrun.ps1 — exits with $env:FAKE_VMRUN_EXIT (default 0) # On success it also creates the destination VMX so the post-clone Test-Path passes. - $script:FakeVmrun = Join-Path $env:TEMP "fake-vmrun-$PID.cmd" + # Using .ps1 instead of .cmd avoids Windows cmd redirect limitations inside if blocks. + $script:FakeVmrun = Join-Path $env:TEMP "fake-vmrun-$PID.ps1" Set-Content $script:FakeVmrun -Value @' -@echo off -if "%FAKE_VMRUN_EXIT%"=="" ( set _exit=0 ) else ( set _exit=%FAKE_VMRUN_EXIT% ) -if "%_exit%"=="0" ( - REM Create the destination VMX file so the caller's Test-Path check passes. - REM The destination path is the 4th positional arg (after -T ws clone