From e801b6063f8df829616f42c9fdd56e805b9d8412 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Jun 2026 18:24:43 +0000 Subject: [PATCH 1/7] Initial plan From 2d4ec78449bb331f340a9efa3205b3bc41143ddb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:52:54 +0000 Subject: [PATCH 2/7] fix: include prerelease lookup for TestingHelper --- test.ps1 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test.ps1 b/test.ps1 index 93c0d44..a29b8a1 100644 --- a/test.ps1 +++ b/test.ps1 @@ -60,8 +60,26 @@ function Import-TestingHelper{ $module = Import-Module TestingHelper -PassThru -ErrorAction SilentlyContinue -RequiredVersion:$semVer if ($null -eq $module) { - $installed = Install-Module -Name TestingHelper -Force -AllowPrerelease:$AllowPrerelease -passThru -RequiredVersion:$Version - $module = Import-Module -Name $installed.Name -RequiredVersion ($installed.Version.Split('-')[0]) -Force -PassThru + $findParams = @{ + Name = "TestingHelper" + ErrorAction = "SilentlyContinue" + AllowPrerelease = $AllowPrerelease + } + + if ($Version) { + $findParams.RequiredVersion = $Version + } + + $found = Find-Module @findParams + if ($found) { + $installed = Install-Module -Name $found.Name -Force -AllowPrerelease:$AllowPrerelease -passThru -RequiredVersion:$found.Version + } else { + $installed = Install-Module -Name TestingHelper -Force -AllowPrerelease:$AllowPrerelease -passThru -RequiredVersion:$Version + } + + if($null -ne $installed){ + $module = Import-Module -Name $installed.Name -RequiredVersion ($installed.Version.Split('-')[0]) -Force -PassThru + } } if ($PassThru) { From c9a17de1c5df2d860f5df360d893ab9ed2788f85 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:53:43 +0000 Subject: [PATCH 3/7] chore: improve TestingHelper install error handling --- test.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test.ps1 b/test.ps1 index a29b8a1..a596eac 100644 --- a/test.ps1 +++ b/test.ps1 @@ -72,13 +72,15 @@ function Import-TestingHelper{ $found = Find-Module @findParams if ($found) { - $installed = Install-Module -Name $found.Name -Force -AllowPrerelease:$AllowPrerelease -passThru -RequiredVersion:$found.Version + $installed = Install-Module -Name $found.Name -Force -AllowPrerelease:$AllowPrerelease -PassThru -RequiredVersion:$found.Version -ErrorAction SilentlyContinue } else { - $installed = Install-Module -Name TestingHelper -Force -AllowPrerelease:$AllowPrerelease -passThru -RequiredVersion:$Version + $installed = Install-Module -Name TestingHelper -Force -AllowPrerelease:$AllowPrerelease -PassThru -RequiredVersion:$Version -ErrorAction SilentlyContinue } - if($null -ne $installed){ + if ($null -ne $installed) { $module = Import-Module -Name $installed.Name -RequiredVersion ($installed.Version.Split('-')[0]) -Force -PassThru + } else { + throw "Unable to install module 'TestingHelper'. Ensure module repositories are registered and reachable." } } @@ -93,7 +95,7 @@ Import-TestingHelper -AllowPrerelease -Version "3.0.9-preview" # Test-ModulelocalPSD1 -ShowTestErrors:$ShowTestErrors # Test-ModulelocalPSD1 -ShowTestErrors:$ShowTestErrors -TestName StagingModuleTest_* -if($TestName){ +if ($TestName) { Invoke-TestingHelper -TestName $TestName -ShowTestErrors:$ShowTestErrors } else { Invoke-TestingHelper -ShowTestErrors:$ShowTestErrors From 26299de2514242de17e103b681fd09f40b1d316f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:54:22 +0000 Subject: [PATCH 4/7] refactor: simplify prerelease module install path --- test.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test.ps1 b/test.ps1 index a596eac..2d06b27 100644 --- a/test.ps1 +++ b/test.ps1 @@ -72,9 +72,7 @@ function Import-TestingHelper{ $found = Find-Module @findParams if ($found) { - $installed = Install-Module -Name $found.Name -Force -AllowPrerelease:$AllowPrerelease -PassThru -RequiredVersion:$found.Version -ErrorAction SilentlyContinue - } else { - $installed = Install-Module -Name TestingHelper -Force -AllowPrerelease:$AllowPrerelease -PassThru -RequiredVersion:$Version -ErrorAction SilentlyContinue + $installed = Install-Module -Name $found.Name -Force -AllowPrerelease:$AllowPrerelease -PassThru -RequiredVersion:$($found.Version.ToString()) -ErrorAction SilentlyContinue } if ($null -ne $installed) { From 4d97a31d6c9b5f24ba3ab9a9fd8cdae46e6171a7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:55:03 +0000 Subject: [PATCH 5/7] fix: harden TestingHelper install and import version handling --- test.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test.ps1 b/test.ps1 index 2d06b27..2a36aa4 100644 --- a/test.ps1 +++ b/test.ps1 @@ -72,11 +72,15 @@ function Import-TestingHelper{ $found = Find-Module @findParams if ($found) { - $installed = Install-Module -Name $found.Name -Force -AllowPrerelease:$AllowPrerelease -PassThru -RequiredVersion:$($found.Version.ToString()) -ErrorAction SilentlyContinue + try { + $installed = Install-Module -Name $found.Name -Force -AllowPrerelease:$AllowPrerelease -PassThru -RequiredVersion:$($found.Version.ToString()) -ErrorAction Stop + } catch { + throw "Unable to install module 'TestingHelper'. Error: $($_.Exception.Message)" + } } if ($null -ne $installed) { - $module = Import-Module -Name $installed.Name -RequiredVersion ($installed.Version.Split('-')[0]) -Force -PassThru + $module = Import-Module -Name $installed.Name -RequiredVersion ($installed.Version.ToString().Split('-')[0]) -Force -PassThru } else { throw "Unable to install module 'TestingHelper'. Ensure module repositories are registered and reachable." } From d69e2ef46e4165ca0455c8dfc1890b67c703c71a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:55:39 +0000 Subject: [PATCH 6/7] chore: clean prerelease install flow variables --- test.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.ps1 b/test.ps1 index 2a36aa4..d48bce8 100644 --- a/test.ps1 +++ b/test.ps1 @@ -70,10 +70,11 @@ function Import-TestingHelper{ $findParams.RequiredVersion = $Version } + $installed = $null $found = Find-Module @findParams if ($found) { try { - $installed = Install-Module -Name $found.Name -Force -AllowPrerelease:$AllowPrerelease -PassThru -RequiredVersion:$($found.Version.ToString()) -ErrorAction Stop + $installed = Install-Module -Name $found.Name -Force -PassThru -RequiredVersion:$($found.Version.ToString()) -ErrorAction Stop } catch { throw "Unable to install module 'TestingHelper'. Error: $($_.Exception.Message)" } From 91fea728e5a54b63abd46edf66e1d284297c8e6f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:56:13 +0000 Subject: [PATCH 7/7] style: simplify required version argument --- test.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.ps1 b/test.ps1 index d48bce8..d325541 100644 --- a/test.ps1 +++ b/test.ps1 @@ -74,7 +74,7 @@ function Import-TestingHelper{ $found = Find-Module @findParams if ($found) { try { - $installed = Install-Module -Name $found.Name -Force -PassThru -RequiredVersion:$($found.Version.ToString()) -ErrorAction Stop + $installed = Install-Module -Name $found.Name -Force -PassThru -RequiredVersion $found.Version -ErrorAction Stop } catch { throw "Unable to install module 'TestingHelper'. Error: $($_.Exception.Message)" }