PSScriptAnalyzer icon indicating copy to clipboard operation
PSScriptAnalyzer copied to clipboard

Flag usage of >< etc when -gt, -lt, etc should be used

Open erikread opened this issue 1 year ago • 2 comments

Prerequisites

  • [X] I have written a descriptive issue title.
  • [X] I have searched all issues to ensure it has not already been reported.

Summary

I would like the Visual Studio Code editor to flag usage of >< !=, etc as possibly incorrect if used in a conditional. I go back and forth between languages and I inadvertently use C#/TypeScript syntax in conditionals and then it takes a while to find my error. An error/warning/hint that I am probably using the incorrect syntax would be great.

Proposed Design

No response

erikread avatar Mar 06 '23 19:03 erikread

This should probably be a request of PowerShell Script Analyzer

andyleejordan avatar Mar 06 '23 19:03 andyleejordan

Yes, we already have a similar rule around accidental usage of = instead of -eq

bergmeister avatar Mar 07 '23 17:03 bergmeister