Having trouble using the approach provided here:
Deploy build artifacts to Bitbucket Downloads
Running a Windows 10 VM with PowerShell 7.4.2.
This is the script I have tested:
$url = "https://api.bitbucket.org/2.0/repositories/${$BITBUCKET_REPO_OWNER}/${$BITBUCKET_REPO_SLUG}/downloads"
$pair = "{0}:{1}" -f ($BITBUCKET_USERNAME, $BITBUCKET_APP_PASSWORD)
$bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
$token = [System.Convert]::ToBase64String($bytes)
$headers = @{ Authorization = "Basic {0}" -f ($token) Accept = "application/json" }
$bin_file_path = "C:\Users\user\Documents\#21 Build Products.zip"
$form = @{ files = Get-Item -Path $bin_file_path }
$result = Invoke-RestMethod -Uri $url -Method Post -Form $form -Headers $headersThe response says "This endpoint does not support token-based authentication".

I have tried to re-create in PowerShell the example approach shown that uses the curl command, but without success.
I found a similar question raised here and the reply seems to suggest that basic authentication should work:
This endpoint does not support token-based authentication | Default reviewers
I appreciate your help.