Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress a warning on unapproved verbs?

Tags:

powershell

When Powershell execute this line:

Add-PSSnapin SqlServerProviderSnapin100

I get this warning message :

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.

How to suppress this warning?

like image 902
Phil Avatar asked Jan 21 '14 16:01

Phil


2 Answers

To truly stop getting the name warnings use -DisableNameChecking:

 import-module MyModule.psm1 -DisableNameChecking

Or as mentioned use -WarningAction SilentlyContinue:

import-module MyModule.psm1 -WarningAction SilentlyContinue

Or if that doesn't work use the warning stream redirection such as

 import-module MyModule.psm1 3>$null

The 3 is not a typo.

like image 89
ΩmegaMan Avatar answered Sep 30 '22 19:09

ΩmegaMan


You could add it using -WarningAction SilentlyContinue like the following:

Add-PSSnapin SqlServerProviderSnapin100 -WarningAction SilentlyContinue
like image 20
Robert Westerlund Avatar answered Sep 30 '22 20:09

Robert Westerlund