Invoke-WebRequest

Performs a HTTP/HTTPS request to the Web. Note: This command can only be used through PowerShell. More information: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest.

Invoke-WebRequest {{http://example.com}} -OutFile {{path\to\file}}

Invoke-WebRequest -Method Post -Body @{ name='bob' } {{http://example.com/form}}

Invoke-WebRequest -Headers {{@{ X-My-Header = '123' }}} -Method {{PUT}} {{http://example.com}}

Invoke-WebRequest -Body {{'{"name":"bob"}'}} -ContentType 'application/json' {{http://example.com/users/1234}}

Invoke-WebRequest -Headers @{ Authorization = "Basic "+ [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("myusername:mypassword")) } {{http://example.com}}