turn off unapproved verbs warning #27030
Replies: 4 comments 4 replies
-
|
I hate the idea. Developers shoud just use approved verbs. There really is no excuse, other than 'I am special'. Approved verbs are part of the Powershell Promise. I am reluctant to want this. |
Beta Was this translation helpful? Give feedback.
-
|
I don't like verb standardization at all. And I think it would be better to make it a desirable rule rather than a law. |
Beta Was this translation helpful? Give feedback.
-
This should work I'm not sure on this but to know for sure you'd need to start looking a debugging the Module Import process I'm pretty sure there are Performance benefits to using the approved verbs (like not kicking off that warning message) as well as the benefits of others being much more able to discover them
Yeah go for it - the team of original developers very much did think of the issues with discoverability which is why the list of Approved Verbs is a You can get around this completely by not using the Verb-Noun naming convention and then adding whatever verb you may want instead function mycommand {
[CmdletBinding()]
[Alias('NotA-RealCommand')]
param()
123
}& that bypasses the Unapproved Verb warning without the above suggestion even if a bit convoluted doing it this way (& helped me find a bug too) |
Beta Was this translation helpful? Give feedback.
-
|
@kilasuit Trying to import my modules in my $profile caused a delay of about 6 seconds and sometimes twice that in loading a session of PowerShell. I renamed all my functions to use a sanctioned verb with an alias (without importing in the profile) and that works just fine too, without the delay. Also, based on Get-Command, I created a function to list the commands with alias from a module, showing only the latest version. So, using the alias or not, that is helpful to find commands from a module. Example: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like Powershell to have a setting like $UnapprovedVerbPreference or something that I can set to ignore in my profile script.
I wrote a module that has unapproved verbs, and recently, the first time I run a function from that module, I get a long yellow warning message about the module having unapproved verbs. And, the function takes much longer to run than it used to. It seems like those two things are linked. I will name my functions whatever I want. I don't need this smack-down from Powershell just because I decided to do something the Powershell team never thought of. Isn't that the point of writing code?
Beta Was this translation helpful? Give feedback.
All reactions