From 0d4eb555bdbc2fd713c4ff5354d5cf89d5534d8f Mon Sep 17 00:00:00 2001 From: Corbin Date: Tue, 27 Jan 2026 08:48:04 -0500 Subject: [PATCH] Dynamically load script based on test file name --- windows/Install-WinAcme.Tests.ps1 | 2 +- windows/Install-iPerf3.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/Install-WinAcme.Tests.ps1 b/windows/Install-WinAcme.Tests.ps1 index c095b8f..5c1844b 100644 --- a/windows/Install-WinAcme.Tests.ps1 +++ b/windows/Install-WinAcme.Tests.ps1 @@ -19,7 +19,7 @@ Describe 'Install-WinAcme' { Uninstall-WinAcme -DestinationPath 'C:\Program Files\win-acme' # Load the Install-WinAcme function - Set-Item function:Install-WinAcme ([ScriptBlock]::Create((Get-Content -Raw 'windows\Install-WinAcme.ps1'))) + Set-Item function:Install-WinAcme ([ScriptBlock]::Create((Get-Content -Raw $PSCommandPath.Replace('.Tests.ps1', '.ps1')))) } It 'Has the correct parameters' { diff --git a/windows/Install-iPerf3.Tests.ps1 b/windows/Install-iPerf3.Tests.ps1 index 9ea3b49..369713c 100644 --- a/windows/Install-iPerf3.Tests.ps1 +++ b/windows/Install-iPerf3.Tests.ps1 @@ -30,7 +30,7 @@ Describe 'Install-IPerf3' { Uninstall-IPerf3 -DestinationPath 'C:\Program Files\iPerf3' # Load the Install-iPerf3 function - Set-Item function:Install-IPerf3 ([ScriptBlock]::Create((Get-Content -Raw 'windows\Install-iPerf3.ps1'))) + Set-Item function:Install-IPerf3 ([ScriptBlock]::Create((Get-Content -Raw $PSCommandPath.Replace('.Tests.ps1', '.ps1')))) } It 'Has the correct parameters' {