From 18a65df58858fe2775063660dda077dbfd482fa3 Mon Sep 17 00:00:00 2001 From: Lester W <30345058+lesterw1@users.noreply.github.com> Date: Sun, 21 Apr 2019 09:40:38 +0100 Subject: [PATCH] Add example to illustrate behavior Add an additional "Try it Yourself" example to illustrate the behavior. --- RuleDocumentation/PossibleIncorrectComparisonWithNull.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/RuleDocumentation/PossibleIncorrectComparisonWithNull.md b/RuleDocumentation/PossibleIncorrectComparisonWithNull.md index 15a11b1fd..d12f77a96 100644 --- a/RuleDocumentation/PossibleIncorrectComparisonWithNull.md +++ b/RuleDocumentation/PossibleIncorrectComparisonWithNull.md @@ -37,3 +37,10 @@ function Test-CompareWithNull } } ``` + +## Try it Yourself + +``` PowerShell +if (@() -eq $null) { 'true' } else { 'false' } # Returns false +if ($null -ne @()) { 'true' } else { 'false' } # Returns true +```