Deprecate the -DisableNameChecking parameter, and remove the warnings that are produced if that parameter is not used
See original GitHub issueI am logging this as a bug and not as an enhancement request because in the eyes of a tool builder, this appears to be a bug (or at the very least, a design flaw). The warning that is produced upon import of a module that contains a command with an unapproved verb is for nobody other than the author of that module, yet scripters are the ones who are presented with that message. This poses several problems:
- It confuses scripters who don’t realize that message is not meant for them unless they also created the module.
- It pushes work on toolbuilders to silence this warning if they happen to be using PowerShell behind the scenes and modules they use (that often are beyond their control) happen to cause this warning.
The message that is being conveyed is of good intent, but it is directed at the wrong audience entirely, and it should never have been written as a warning for all to see (warnings are meant to convey useful information to the scripter that they may be doing something wrong). For that reason, the message should be removed entirely from Import-Module and Import-PSSession. The -DisableNameChecking parameter can be kept around for compatibility reasons, but it should simply be ignored. PSScriptAnalyzer is a much more appropriate technology to be used to convey this information to the author of a command.
Steps to reproduce
nmo -name Example {
function Create-Something {[CmdletBinding()]param(); Write-Verbose 'This could create something big!'}
} | ipmo
Expected behavior
The module would import, without any messages sent to the console.
Actual behavior
The module imports, sending the following output to the console:
WARNING: The names of some imported commands from the module 'Example' include unapproved verbs that might make them
less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose
parameter. For a list of approved verbs, type Get-Verb.
Environment data
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:14 (7 by maintainers)

Top Related StackOverflow Question
I could see adding this sort of a check to
Publish-Modulebut having it inImport-Moduleis a real drag.Any self respecting developer would fix this before they let their code out into the world. So the first think you think is “They didn’t test this, what dreadful shoddy code have I got here ?” Run an anti-malware scan and delete it.