Skip to content

Commit

Permalink
so thtat we dont load the v5 peseter version when we want v4 #897
Browse files Browse the repository at this point in the history
  • Loading branch information
SQLDBAWithABeard committed May 9, 2023
1 parent f916963 commit 30e05cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/functions/Invoke-DbcCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,13 @@ function Invoke-DbcCheck {
process {
if ($legacy) {
try {
Write-PSFMessage 'Running in legacy mode, we need Version 4'
if (Get-Module Pester | Where-Object { $_.Version -gt '5.0.0' }) {
Write-PSFMessage 'Remove Version 5' -Level Verbose
Remove-Module Pester -ErrorAction SilentlyContinue
Write-PSFMessage 'Running in legacy mode, we need to import Version 4' -Level Verbose
Import-Module Pester -RequiredVersion 4.10.1 -Global
}
Write-PSFMessage 'import Version 4' -Level Verbose
Import-Module Pester -RequiredVersion 4.10.1 -Global
} catch {
Write-PSFMessage -Message 'Something Went wrong' -Level Warning -ErrorRecord $_
Return
Expand Down

0 comments on commit 30e05cc

Please sign in to comment.