This worked for me:
$url = "https://www.hkex.com.hk/eng/stat/dmstat/dayrpt/dqe221206.zip"
$file = "D:\ABC.zip"
[System.Net.SecurityProtocolType]::Tls12
try {
Invoke-WebRequest $url -OutFile $file -ErrorAction Stop
}
catch [System.Exception] {
$httpStatus = $null
$tryError = $_.Exception
$urlIsValid = $false;
Write-Host "There was an error downloading $file"
}