Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Work Item] Debug Logging in Multi Thread and Remote Server #2245

Open
dpaulson45 opened this issue Dec 5, 2024 · 1 comment
Open

[Work Item] Debug Logging in Multi Thread and Remote Server #2245

dpaulson45 opened this issue Dec 5, 2024 · 1 comment
Assignees
Labels
Enhancement New feature or request Health Checker Work Item Work Item for project work

Comments

@dpaulson45
Copy link
Member

Describe the work
In order to have proper debug logging occurring, we still need to have our Write-Verbose, Write-Host, and other various default cmdlets that we override to still do a logging functionality, even when we are doing a multi-threaded or remote execution.

Need to come up with a way to pull out this information and properly display it as we would normally do in a single session.

Additional Context
This was partly done within Exchange Log Collector, but there should be a better way to handle this.

@dpaulson45 dpaulson45 added Enhancement New feature or request Work Item Work Item for project work labels Dec 5, 2024
@dpaulson45
Copy link
Member Author

https://devblogs.microsoft.com/scripting/weekend-scripter-welcome-to-the-powershell-information-stream/

https://devblogs.microsoft.com/scripting/understanding-streams-redirection-and-write-host-in-powershell/

After digging into this, now understand why Exchange Log Collector was done the way it is handled. The best option for when we are using Write-Host and Write-Verbose to log out that information.

Currently don't see a better option than to use the method of Add-ScriptBlockInjection to our script block that we want to have and then possibly create a better option for the PipelineFunctions.ps1 to handle us putting Write-Verbose and Write-Host on the pipeline to be returned.

When putting this in the Shared, need to make sure that we have a good Pester test for this action as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Health Checker Work Item Work Item for project work
Projects
None yet
Development

No branches or pull requests

1 participant