Referencing the help file for `Invoke-RestMethod:
PS /home/nicholas>
PS /home/nicholas> $response = Invoke-RestMethod -Uri https://blogs.msdn.microsoft.com/powershell/feed/
PS /home/nicholas>
PS /home/nicholas> $json = $response | ConvertTo-Json
WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2.
PS /home/nicholas>
PS /home/nicholas> $xml = $response | ConvertTo-Xml
PS /home/nicholas>
PS /home/nicholas> $xml.OuterXml
How can I convert the response
to xml
and output it, as above, in a single line?