当 Powershell 执行此行时:
Add-PSSnapin SqlServerProviderSnapin100
我收到此警告消息:
WARNING: Some imported command names include unapproved verbs which might make them less discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of approved verbs.
如何抑制此警告?
最佳答案
要真正停止收到名称警告,请使用 -DisableNameChecking
:
import-module MyModule.psm1 -DisableNameChecking
或者如上所述使用
-WarningAction SilentlyContinue
:import-module MyModule.psm1 -WarningAction SilentlyContinue
或者,如果这不起作用,请使用警告流重定向,例如
import-module MyModule.psm1 3>$null
3
不是错别字。
关于powershell - 如何禁止对未经批准的动词发出警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21263567/