Skip to content

Information Stream Cleanup - #484

Merged
Peter Ombwa (peombwa) merged 4 commits into
devfrom
bugfixes/InformationLogCleanUp
Dec 10, 2020
Merged

Information Stream Cleanup#484
Peter Ombwa (peombwa) merged 4 commits into
devfrom
bugfixes/InformationLogCleanUp

Conversation

@peombwa

Copy link
Copy Markdown
Member

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 Peter Ombwa (peombwa) self-assigned this Dec 4, 2020
@peombwa
Peter Ombwa (peombwa) merged commit f5ab511 into dev Dec 10, 2020
@peombwa
Peter Ombwa (peombwa) deleted the bugfixes/InformationLogCleanUp branch December 11, 2020 19:52
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