From cb3a8d5255d815d1fcbe1c5d4c1a1dfc47d2e812 Mon Sep 17 00:00:00 2001 From: wild-devops <33394863+wild-devops@users.noreply.github.com> Date: Fri, 26 Nov 2021 14:11:12 +0300 Subject: [PATCH] Less warnings on module loading --- pwshake.ps1 | 2 +- pwshake/scripts/Build-Context.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pwshake.ps1 b/pwshake.ps1 index 7a0eca9..072109b 100644 --- a/pwshake.ps1 +++ b/pwshake.ps1 @@ -64,7 +64,7 @@ if (Test-Path $PSScriptRoot\pwshake\pwshake.psd1) { if (-not (Get-Module -Name pwshake -ListAvailable | Where-Object Version -eq $version)) { Install-Module -Name pwshake -Repository PSGallery -RequiredVersion $version -Force -Scope CurrentUser | Out-Null } - Import-Module -Name pwshake -RequiredVersion $version -Force -Global -DisableNameChecking + Import-Module -Name pwshake -RequiredVersion $version -Force -Global -DisableNameChecking -WarningAction Ignore } $params = @{ diff --git a/pwshake/scripts/Build-Context.ps1 b/pwshake/scripts/Build-Context.ps1 index 6cdf3e9..8eac858 100644 --- a/pwshake/scripts/Build-Context.ps1 +++ b/pwshake/scripts/Build-Context.ps1 @@ -35,7 +35,7 @@ function Build-Context { } $context.types | ForEach-Object type | ForEach-Object { - Add-Type -IgnoreWarnings -TypeDefinition $_ -Language CSharp + Add-Type -IgnoreWarnings -TypeDefinition $_ -Language CSharp -WarningAction Ignore } return $context