I'm trying to access a public file using a URL from Australian Bureau Of Statistics.
And can do so without an error using Firefox but when I try using powershell I get
"Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (403) Forbidden."
The code I'm using:
(New-Object System.Net.WebClient).DownloadFile('https://stat.data.abs.gov.au/sdmx-json/data/ABS_BLDG_APPROVALS_LGA2020/1.1.1.110.LGA2020.20660+20740+20830+20910+21110+21180+21450+21610+21890+22170+22310+22490+22670+22750+23110+23270+23430+23670+24130+24210+24330+24410+24600+24650+24850+24970+25060+25150+25250+25340+25710+25900+26080+26170+26350+26490+26980+27070+27260+27350+27450.M/all?detail=Full&dimensionAtObservation=AllDimensions&startPeriod=2020-07&endPeriod=2021-09','C:\temp\test')
powershell version 5.1
Edit: I should have mentioned that I have successfully run the powershell script on other websites, without error