Skip to content

Commit

Permalink
Fix ScriptAnalyzer rules
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Aug 19, 2024
1 parent 6bfcae4 commit 2643954
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/Public/Assert-BlockString.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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."
Expand Down

0 comments on commit 2643954

Please sign in to comment.