Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Suppress PowerShell Module Import Warning Messages

$
0
0

Summary: Learn how to use the warning redirection operator to suppress Windows PowerShell warning messages when importing a module.

Hey, Scripting Guy! Question How can you hide the warning message from a Windows PowerShell module when you import it if the module contains an unapproved verb?

Hey, Scripting Guy! Answer Use the warning stream redirection operator when importing the module, and redirect the warning message to $null:

Import-Module *sql* 3>$null


Viewing all articles
Browse latest Browse all 3333

Trending Articles