diff --git a/tests/Invoke-DbaQuery.Tests.ps1 b/tests/Invoke-DbaQuery.Tests.ps1 index 9636656cbc..640b561857 100644 --- a/tests/Invoke-DbaQuery.Tests.ps1 +++ b/tests/Invoke-DbaQuery.Tests.ps1 @@ -1,4 +1,4 @@ -#HaveParameter - yeah, I know. +#Requires -Module @{ ModuleName="Pester"; ModuleVersion="5.0"} BeforeAll { $CommandName = (Get-Item $PSCommandPath).Name.Replace(".Tests.ps1", "") diff --git a/tests/appveyor.pester.ps1 b/tests/appveyor.pester.ps1 index 038cd00a01..a505853f14 100644 --- a/tests/appveyor.pester.ps1 +++ b/tests/appveyor.pester.ps1 @@ -162,7 +162,7 @@ function Get-CodecovReport($Results, $ModuleBase) { function Get-PesterTestVersion($testFilePath) { $testFileContent = Get-Content -Path $testFilePath -Raw - if ($testFileContent -match 'HaveParameter') + if ($testFileContent -match '#Requires\s+-Module\s+@\{\s+ModuleName="Pester";\s+ModuleVersion="5\.') { return '5' }