import-module -VERBOSE

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Mike Applebee Mike Applebee 1 year, 1 month ago.

  • Author
  • #34864
    Profile photo of Mike Applebee
    Mike Applebee

    I built a module file (.psm1) I wanted to show a few help/info lines if it was imported with the -verbose switch. Wanted to show more that just the stream of new functions. But the verbose argument escapes me inside the psm1 scope? Can I do this?
    import-module SavePuppy -verbose


    write-verbose "Save a puppy!"
    function get-poo
        [CmdletBinding()]   Param ()
        Process    {
            Write-Verbose "Puppy Saved"
    if ($PSBoundParameters['Verbose'] -eq $True) { 
        write-host "Play Dead"
    write-Host "R.I.P fido"

You must be logged in to reply to this topic.