pencilCake
pencilCake

Reputation: 53233

Why my Write-Verbose messages do not appear?

I have replaced some of th ecomments with:

Write-Verbose "Doing somthing..."

and I run my script via PS ISE like:

.\FooScript.ps1 -verbose

But in the output window I do not see any of those messages.

How can I make the write-Verbose messages displayed?

Upvotes: 14

Views: 12366

Answers (1)

CB.
CB.

Reputation: 60910

You need to add

[CmdletBinding()]

at the start of your script and use the

-verbose

parameter to see verbose messages.

Read more typing:

help about_functions_advanced

Upvotes: 27

Related Questions