vulmon / Vulmap

Vulmap Online Local Vulnerability Scanners Project
https://vulmon.com
GNU General Public License v3.0
950 stars 196 forks source link

Update vulmap-windows.ps1 #27

Open wise-io opened 1 year ago

wise-io commented 1 year ago

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