You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The switch statement condition syntax seems obscure from time to time. See PowerShell issues 21299 and 10911.
Hence, I suggest do add a few checks to test switch statement conditions for invalid syntax. (I.e., syntax that will never be evaluated, or that will always evaluate to $false etc.)
The text was updated successfully, but these errors were encountered:
Thanks @SetTrend would love to see more commentary on how someone would think about constructing this rule/what conditions they would consider before moving to up for grabs
Happy to add a rule but we need something concrete that we can alert on based on just static analysis without false positives. But I fear if the parser cannot do that due to PowerShell's dynamic nature, I am not sure PSSA can do better.
The
switch
statement condition syntax seems obscure from time to time. See PowerShell issues 21299 and 10911.Hence, I suggest do add a few checks to test
switch
statement conditions for invalid syntax. (I.e., syntax that will never be evaluated, or that will always evaluate to$false
etc.)The text was updated successfully, but these errors were encountered: