November 2018
Intermediate to advanced
566 pages
17h 15m
English
This script is simple. We create a function and define its parameters. Next, we clear the contents of the $Error variable, say, for a clean slate. (This is not always recommended. Clear the error variable only if you know for sure that you do not want the previous errors from the current session.) We then proceed to write some verbose content for every step the function takes by using the Write-Verbose cmdlet. This content is suppressed by default ($VerbosePreference is set to SilentlyContinue by default). We use the -Verbose common parameter to make the function generate the verbose output.
As we saw in the Sending output to a file recipe, the PowerShell has six streams:
Read now
Unlock full access