How do I enable Verbose mode for the cmdlets within the function?
I added [CmdletBinding()] but that will only print write-verbose to screen but not enabling Verbose for New-ADUser or whatever Cmdlet I called within the script.
Not sure I completely understand your question.
Write-Verbose "Text of debug"
when the shell's $VerbosePreference variable isn't set to "SilentlyContinue" ("Continue" will enable the output), you'll see your verbose output.
Alternatively you can write your own verbose output for your script and use Write-Verbose for whichever line you require.
You must be logged in to reply to this topic.