How do I use invoke-webrequest with basic authentication header in PowerShell? or What's the correct

14 Replies, 1149 Views

Wild guess: Is your password super long? Base64 has limits, and some servers truncate it. Try a shorter test password.

Also, `Invoke-RestMethod` might behave better than invoke-webrequest with basic authentication header. Worth a shot!

If all else fails, curl in PowerShell (yes, it’s a thing now):
```powershell
curl -u user:pass https://example.com
```
Way less fuss.

Messages In This Thread



Users browsing this thread: 1 Guest(s)