From 0b3a37dca61bff29149390634e01e1d8fc3420ea Mon Sep 17 00:00:00 2001 From: jayrodksmith <51105538+jayrodksmith@users.noreply.github.com> Date: Thu, 21 Mar 2024 13:44:40 +0800 Subject: [PATCH] Minor fixes to Verbose messages --- Private/Helpers/Get-RunAsUserModule.ps1 | 8 ++++---- Private/Helpers/Get-SeleniumModule.ps1 | 8 ++++---- Private/Helpers/Start-SeleniumModule.ps1 | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Private/Helpers/Get-RunAsUserModule.ps1 b/Private/Helpers/Get-RunAsUserModule.ps1 index 94e75e3..e66c4d3 100644 --- a/Private/Helpers/Get-RunAsUserModule.ps1 +++ b/Private/Helpers/Get-RunAsUserModule.ps1 @@ -15,11 +15,11 @@ function Get-RunAsUserModule { } catch { } - Import-Module PowerShellGet -Verbose:$false + Import-Module PowerShellGet -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null $RunAsUser = Get-Module -Name RunAsUser -ListAvailable | Where-Object { $_.Version -eq '2.4.0' } if (-not $RunAsUser) { - Get-PackageProvider -Name "nuGet" -ForceBootstrap -Verbose:$false | Out-Null - Install-Module RunAsUser -Force -RequiredVersion '2.4.0' -Verbose:$false + Get-PackageProvider -Name "nuGet" -ForceBootstrap -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null + Install-Module RunAsUser -Force -RequiredVersion '2.4.0' -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null } - Import-Module RunAsUser -Force -Version '2.4.0' -Verbose:$false + Import-Module RunAsUser -Force -Version '2.4.0' -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null } diff --git a/Private/Helpers/Get-SeleniumModule.ps1 b/Private/Helpers/Get-SeleniumModule.ps1 index b8735a0..ae8d10c 100644 --- a/Private/Helpers/Get-SeleniumModule.ps1 +++ b/Private/Helpers/Get-SeleniumModule.ps1 @@ -15,11 +15,11 @@ function Get-SeleniumModule { }catch{ } - Import-Module PowerShellGet -Verbose:$false + Import-Module PowerShellGet -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null $seleniumModule = Get-Module -Name Selenium -ListAvailable | Where-Object { $_.Version -eq '3.0.1' } if (-not $seleniumModule) { - Get-PackageProvider -Name "nuGet" -ForceBootstrap -Verbose:$false | Out-Null - Install-Module Selenium -Force -RequiredVersion '3.0.1' -Verbose:$false + Get-PackageProvider -Name "nuGet" -ForceBootstrap -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null + Install-Module Selenium -Force -RequiredVersion '3.0.1' -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null } - Import-Module Selenium -Force -Version '3.0.1' -Verbose:$false + Import-Module Selenium -Force -Version '3.0.1' -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null } \ No newline at end of file diff --git a/Private/Helpers/Start-SeleniumModule.ps1 b/Private/Helpers/Start-SeleniumModule.ps1 index 2dc3989..adab611 100644 --- a/Private/Helpers/Start-SeleniumModule.ps1 +++ b/Private/Helpers/Start-SeleniumModule.ps1 @@ -24,7 +24,7 @@ function Start-SeleniumModule { ) if($WebDriver -eq "Edge"){ Get-RunAsUserModule - Import-Module -Name RunAsUser -Verbose:$false + Import-Module -Name RunAsUser -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -verbose:$false | Out-Null $scriptblock = { Import-Module Selenium $WebDriverPath = "C:\temp\EasyWarrantyCheck\WebDrivers"