Download archive-file with Powershell's Invoke-WebRequest


while trying to write a good (brief but thorough) question I found the answer by myself:

$basicAuthValue = "Basic {0}" -f [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes('user:password'))
Invoke-WebRequest -Uri https://my.domain/owner/repo/archive/ -OutFile "$env:USERPROFILE\Downloads\" -Headers @{Authorization = $basicAuthValue}

I’ve found the solution actually on Stackoverflow:

With curl - who would have expected that - it’s of course way easier:

curl -u 'user:password' https://my.domain/owner/repo/archive/ >

Thought I’d share it in case the question occurs to someone else.