PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.8k stars 365 forks source link

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

Open erikread opened 1 year ago

erikread commented 1 year ago

Prerequisites

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

andyleejordan commented 1 year ago

This should probably be a request of PowerShell Script Analyzer

bergmeister commented 1 year ago

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