Open wise-io opened 1 year ago
Use -ne instead of -notlike to avoid issues with certain application DisplayNames.
-ne
-notlike
Example of issue with -notlike:
PS C:\Users\wise-io> $DisplayName = "Test Application [Fail-Me]" PS C:\Users\wise-io> if ($null -notlike $DisplayName) { Write-Output 'Yay' } The specified wildcard character pattern is not valid: Test Application [Fail-Me] At line:1 char:5 + if ($null -notlike $DisplayName) { Write-Output 'No error' } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], WildcardPatternException + FullyQualifiedErrorId : RuntimeException
Use
-ne
instead of-notlike
to avoid issues with certain application DisplayNames.Example of issue with
-notlike
: