Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Invoke-Command does not apply VerbosePreference to ScriptBlock #4040
Steps to reproduce
PowerShell 6Beta2 still has the same gotcha as Windows PowerShell that one needs to manually pass and set the VerbosePreference into scriptblocks, even when using advanced functions. It would be nice if the VerbosePreference of the Invoke-Command Cmdlet would be set automatically in the executed scriptblock.
I would expect in both cases that the VerbosePreference gets applied automatically
No verbose output.
@pcgeek86 My impression was that with the general usage of
I too ran into the same problem with not understanding why my verbose statements within an
If you think about it, the expectation with
As for the conflict with
I think having verbose output for both the