AndrewRathbun / KAPE-EZToolsAncillaryUpdater

A script that updates KAPE (using Get-KAPEUpdate.ps1) as well as EZ Tools (within .\KAPE\Modules\bin) and the ancillary files that enhance the output of those tools
MIT License
53 stars 5 forks source link

Just a semantic change - $null should be on left #17

Closed Donovoi closed 1 year ago

Donovoi commented 1 year ago

https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/rules/possibleincorrectcomparisonwithnull?view=ps-modules

cheeky copy/paste

"To ensure that PowerShell performs comparisons correctly, the $null element should be on the left side of the operator.

There are multiple reasons why this occurs:

$null is a scalar value. When the value on the left side of an operator is a scalar, comparison operators return a Boolean value. When the value is a collection, the comparison operators return any matching values or an empty array if there are no matches in the collection. PowerShell performs type casting left to right, resulting in incorrect comparisons when $null is cast to other scalar types. The only way to reliably check if a value is $null is to place $null on the left side of the operator so that a scalar comparison is performed."

Donovoi commented 1 year ago

Hey mate love what you've done!

only one change at the moment as I got to head to work.

I'm loving the new color!

Feel free to deny this pull request if you are happy with the way it is.

AndrewRathbun commented 1 year ago

I'll need to re-sign and push back to the repo, but thanks for the PR!