I'm facing an issue in Visual Studio Code where my functions are getting syntax highlighted based on approved verbs, and I'd like to know how to turn that off. When I use an approved verb, my function names show in yellow, but they turn white when I use verbs that aren't in the approved list. It's quite annoying! I'm currently using the PowerShell extension by Microsoft.
2 Answers
Another option is to use the SuppressMessageAttribute. You can add this attribute to your functions: `[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseApprovedVerbs", "", Justification="sue me")]`. This will stop the highlighting for that specific function.
Honestly, if it’s not a cmdlet you're creating for shell binding, I wouldn’t stress about using approved verbs. Just name your functions whatever you like in PascalCase. It’s way more flexible for everyday coding!
Exactly! Sometimes it just feels good to break the rules a bit.