4 ms·
Powershell introduces more complications, with functions like Invoke-WebRequest being given the alias "curl". At a minimum, you would get a type validation erro
by stephengillie 10y ago
Powershell introduces more complications, with functions like Invoke-WebRequest being given the alias "curl". At a minimum, you would get a type validation error, as Invoke-WebRequest by default gives back headers and other data as objects inside a larger object, not just the content string that curl.exe defaults to returning.
This should work in both bash and PS, with different results:
> curl HTTP://example.com > file.html
- Hondor 10y agoIsn't that just what a compiled language would sort out for you? On Bash it'd compile to curl HTTP://example.com > file.html and on PowerShell it'd become (curl HTTP://example.com).Content > file.html