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

Information Stream Cleanup #484

Merged
merged 4 commits into from
Dec 10, 2020
Merged

Information Stream Cleanup #484

merged 4 commits into from
Dec 10, 2020

Conversation

peombwa
Copy link
Member

@peombwa peombwa commented Dec 4, 2020

This PR closes #373 by replacing all instances of Write-Information in a module (.psm1) with Write-Debug. This frees up the information stream since everything will be logged in the debug stream when $DebugPreference is set to inquire or Continue.

Testing Instructions

Both information and debug streams should be empty

$ps = [powershell]::Create()
$ps.AddScript(@'
Connect-MgGraph -CertificateThumbprint $certificateThumbprint -ClientId $appId -TenantId $tenantNameOrId
$Users = Get-MgUser -Top 5
'@).Invoke()
$ps.Streams.Information
$ps.Streams.Debug

Information stream should be empty and debug stream should contain the logs

$ps = [powershell]::Create()
$ps.AddScript(@'
$DebugPreference = "Inquire"
Connect-MgGraph -CertificateThumbprint $certificateThumbprint -ClientId $appId -TenantId $tenantNameOrId
$Users = Get-MgUser -Top 5
'@).Invoke()
$ps.Streams.Information
$ps.Streams.Debug

@peombwa peombwa self-assigned this Dec 4, 2020
@peombwa peombwa marked this pull request as ready for review December 10, 2020 01:15
@peombwa peombwa merged commit f5ab511 into dev Dec 10, 2020
@peombwa peombwa deleted the bugfixes/InformationLogCleanUp branch December 11, 2020 19:52
@peombwa peombwa mentioned this pull request Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Binary cmdlets spam the information stream inappropriately and logs sensitive information to that stream
2 participants