Skip to content

Instantly share code, notes, and snippets.

@markcowl
Created October 13, 2015 22:13
Show Gist options
  • Save markcowl/4d389e673044c987149b to your computer and use it in GitHub Desktop.
Save markcowl/4d389e673044c987149b to your computer and use it in GitHub Desktop.
Enable ADAL.Net tracing in PowerShell
Add-Type -Path '<path-to-powershell>\ResourceManager\AzureResourceManager\Resources\Microsoft.IdentityModel.Clients.ActiveDirectory.dll'
[Microsoft.IdentityModel.Clients.ActiveDirectory.AdalTrace]::TraceSource.Switch.Level = [System.Diagnostics.SourceLevels]::All
$listener = New-Object -TypeName System.Diagnostics.TextWriterTraceListener -ArgumentList "<full-path-to-trace-file>"
$listener.Writer.AutoFlush = $true
[Microsoft.IdentityModel.Clients.ActiveDirectory.AdalTrace]::TraceSource.Listeners.Add($listener)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment