I would like to use the Verbose preference ($VerbosePreference
) inside my build script. I'm using the Chocolatey version of psake (so calling the batch file) and I cannot get it to work well at all.
The -Verbose
switch works not at all. I ended up adding a property and pass that in. It gets passed in and then I set the $VerbosePreference
to 'Continue' if it is true, otherwise 'SilentlyContinue'. I created a function to do this. In that function, if I call Write-Verbose
, it works. However in a task, it does not. If I set the $VerbosePreference
in the task, it does not work. Basically, I can't use Write-Verbose
in tasks. What concept am I missing here? Completely flumoxed...