-
Notifications
You must be signed in to change notification settings - Fork 215
Fix exception thrown when Debug is called for Service modules. #601
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
Conversation
Show full request body and response when Debug is called.
|
We should also honor $DebugPreference that is set by a customer. |
|
It would be nice to add Pester tests for some of these edge cases. e.g. $ps = [powershell]::Create()
$ps.AddScript(@'
$DebugPreference = 'Continue'
Import-Module .\src\Authentication\Authentication\artifacts\Microsoft.Graph.Authentication.psd1
Import-Module .\src\DirectoryObjects\DirectoryObjects\Microsoft.Graph.DirectoryObjects.psd1
Connect-MgGraph
Test-MgDirectoryObjectProperty -DisplayName "New Name" -EntityType "Group"
'@).Invoke()
# Assert that debug stream contains the expected debug log and no exception.
if ($ps.Streams.Debug -notLike "*Exception*") { pass test ... }
if ($ps.Streams.Debug -like "*HTTP/1.1 200 OK*) { pass test ...}
.... |
Is there a way for us to honor |
|
@peombwa This seems to be part of a known issue, especially since there is nothing special we are doing that would disregard the customer preference. Also from the code, however, removing this check:-
resolves the issue, ensuring the cmdlets respect all the preferences.
|




Show full request body and response when Debug is called.