From 2643954982ce0ffa6aa30d8577cf2371eb360042 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Mon, 19 Aug 2024 21:06:07 +0200 Subject: [PATCH] Fix ScriptAnalyzer rules --- source/Public/Assert-BlockString.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/Public/Assert-BlockString.ps1 b/source/Public/Assert-BlockString.ps1 index 8fbc998..0d94218 100644 --- a/source/Public/Assert-BlockString.ps1 +++ b/source/Public/Assert-BlockString.ps1 @@ -50,6 +50,7 @@ function Assert-BlockString # Should-BeBlockString { [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseProcessBlockForPipelineCommand', '')] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('AvoidThrowOutsideOfTry', '')] param ( [Parameter(Position = 1, ValueFromPipeline = $true)] $Actual, @@ -79,7 +80,8 @@ function Assert-BlockString # Should-BeBlockString $stringsAreEqual = $isStringType -and (-join $Actual) -eq (-join $Expected) - if (-not $stringsAreEqual) { + if (-not $stringsAreEqual) + { if (-not $isStringType) { $message = "Expected to actual value to be of type string or string[], but it was not."