Skip to content

Commit

Permalink
Update setOperations.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kipjr authored Jul 29, 2024
1 parent e605454 commit ce6172e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions setOperations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ function Get-SetOperationResult
#-----------
if ($OperationType -eq 'Difference-LeftMinusRight')
{
$result = $Left | ?{-not ($Right -contains $_)}
$result = $Left | Where-Object {-not ($Right -contains $_)}
}
if ($OperationType -eq 'Difference-RightMinusLeft')
{
$result = $Right | ?{-not ($Left -contains $_)}
$result = $Right | Where-Object {-not ($Left -contains $_)}
}

#-----------
Expand All @@ -147,12 +147,12 @@ function Get-SetOperationResult
if ($OperationType -eq 'ComplementLeft')
{
$result = Compare-Object $Left $Right -PassThru -IncludeEqual | # union
?{-not ($Left -contains $_)}
Where-Object {-not ($Left -contains $_)}
}
if ($OperationType -eq 'ComplementRight')
{
$result = Compare-Object $Left $Right -PassThru -IncludeEqual | # union
?{-not ($Right -contains $_)}
Where-Object {-not ($Right -contains $_)}
}

Write-Output $result
Expand All @@ -161,4 +161,4 @@ function Get-SetOperationResult
END
{
}
}
}

0 comments on commit ce6172e

Please sign in to comment.