Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Update vulmap-windows.ps1 #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

wise-io
Copy link

@wise-io wise-io commented Mar 18, 2023

Use -ne instead of -notlike to avoid issues with certain application DisplayNames.

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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant