generate file after call url and automatic save to disk

Hello,

Hi, when I call the web address, a csv file is generated for me. After generation, a dialog box will pop up with the option to open or save. Can you please advise me how to create a script in the powershell that calls the url address and then automatically downloads the generated file to disk?

I Try this

Invoke-WebRequest -Uri “url” -OutFile “C:\path\file”, but i get return only webpage

Thank you

what is the url here you have used ? if you have the url pointing to the csv, above code will work.