How do I save curl output to a file in Windows? or What's the best way to redirect curl output to a f

12 Replies, 736 Views

Yo! Had the same issue. Turns out, Windows CMD messes with curl’s stdout. Use this in PowerShell:

```
(Invoke-WebRequest -Uri https://example.com).Content | Out-File output.txt
```

It’s not *pure* curl, but it’s way more consistent for saving files in Windows.

For appending, just add `-Append` to the `Out-File` part.

Messages In This Thread



Users browsing this thread: 1 Guest(s)