Dynamically load script based on test file name

This commit is contained in:
Corbin 2026-01-27 08:48:04 -05:00
parent a93bf5d923
commit 0d4eb555bd
2 changed files with 2 additions and 2 deletions

View File

@ -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' {

View File

@ -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' {