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?
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.
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.
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.
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.
Import-Module Carbon -Verbose:$false | Out-Null
Try Import-Module Carbon -Verbose:$false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With