Hariharan
Hariharan

Reputation: 11

PowerShell Invoke RestMethod response as file to PDF

I am using invoke-restmethod GET in Powershell which produces a PDF file as a response.
I can see that file as an encoded format in the PowerShell window.

I need to create a PDF file from the response.

How to achieve?

Upvotes: 0

Views: 1731

Answers (1)

Mathias R. Jessen
Mathias R. Jessen

Reputation: 174575

Use the -OutFile parameter:

Invoke-RestMethod $uri -Method Get -OutFile output.pdf

Upvotes: 2

Related Questions