Closed
Description
Invoke-MgGraphRequest
should throw an error requiring -OutputFilePath
when it can't process non-JSON responses and the OutputType is not HttpResponseMessage.
Repro steps
➜ Connect-MgGraph
Welcome To Microsoft Graph!
➜ Invoke-MgGraphRequest -Uri "v1.0/users/$userId/messages/$messageId/`$value" # Should throw an error requiring -OutputFilePath.`
➜ Invoke-MgGraphRequest -Uri "v1.0/users/$userId/messages/$messageId/`$value" -OutputFilePath MessageContent.txt # works
Invoke-MgGraphRequest
should also honor -OutputType HttpResponseMessage
.
➜ Invoke-MgGraphRequest -Uri "v1.0/users/$userId/messages/$messageId/`$value" -OutputType HttpResponseMessage