Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppressing VERBOSE for Import-Module

I'm importing Carbon into my PowerShell script; however when running my script with -Verbose, Carbon also outputs a lot of VERBOSE statements.

Is it possible to Import-Module silently such that I can ignore the verbose statements in the imported module and leave just my own?

like image 235
Brett Postin Avatar asked Mar 20 '14 15:03

Brett Postin


People also ask

What is verbose in PowerShell?

Typically, the verbose message stream is used to deliver more in depth information about command processing. By default, the verbose message stream is not displayed, but you can display it by changing the value of the $VerbosePreference variable or using the Verbose common parameter in any command.

How do I Unimport a PowerShell module?

The Remove-Module cmdlet removes the members of a module, such as cmdlets and functions, from the current session. If the module includes an assembly (. dll), all members that are implemented by the assembly are removed, but the assembly is not unloaded.

How do I enable the import-module in PowerShell?

To import the module into all sessions, add an Import-Module command to your PowerShell profile. To manage remote Windows computers that have PowerShell and PowerShell remoting enabled, create a PSSession on the remote computer and then use Get-Module -PSSession to get the PowerShell modules in the PSSession.

What does import-module do?

The Import-Module cmdlet adds one or more modules to the current session. Starting in PowerShell 3.0, installed modules are automatically imported to the session when you use any commands or providers in the module.


2 Answers

Import-Module Carbon -Verbose:$false | Out-Null

like image 190
Arluin Avatar answered Nov 15 '22 18:11

Arluin


Try Import-Module Carbon -Verbose:$false

like image 42
jbsmith Avatar answered Nov 15 '22 18:11

jbsmith