From 43808971613dd0e1ce25337e3162bca3acb1c7ab Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Sat, 2 Nov 2024 18:58:47 +0100 Subject: [PATCH] Update Invoke-ManualPester.ps1 --- private/testing/Invoke-ManualPester.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/private/testing/Invoke-ManualPester.ps1 b/private/testing/Invoke-ManualPester.ps1 index 0190d1cf74..5b4e79b2ca 100644 --- a/private/testing/Invoke-ManualPester.ps1 +++ b/private/testing/Invoke-ManualPester.ps1 @@ -98,7 +98,7 @@ function Invoke-ManualPester { [switch]$ScriptAnalyzer ) begin { - Remove-Module -Name Pester + Remove-Module -Name Pester -ErrorAction SilentlyContinue $stopProcess = $false function Get-CoverageIndications($Path, $ModuleBase) { # takes a test file path and figures out what to analyze for coverage (i.e. dependencies) @@ -231,11 +231,11 @@ function Invoke-ManualPester { # No need the force will do it #Remove-Module dbatools -ErrorAction Ignore #imports the module making sure DLL is loaded ok - Write-DetailedMessage "Importing dbatools psd1" - Import-Module "$ModuleBase\dbatools.psd1" -DisableNameChecking -Force -NoClobber + #Write-DetailedMessage "Importing dbatools psd1" + #Import-Module "$ModuleBase\dbatools.psd1" -DisableNameChecking -Force -NoClobber -ErrorAction SilentlyContinue #imports the psm1 to be able to use internal functions in tests Write-DetailedMessage "Importing dbatools psm1" - Import-Module "$ModuleBase\dbatools.psm1" -DisableNameChecking -Force -NoClobber + Import-Module "$ModuleBase\dbatools.psm1" -DisableNameChecking -Force -NoClobber -ErrorAction SilentlyContinue $ScriptAnalyzerRulesExclude = @('PSUseOutputTypeCorrectly', 'PSAvoidUsingPlainTextForPassword', 'PSUseBOMForUnicodeEncodedFile')