generate file after call url and automatic save to disk

Welcome Forums General PowerShell Q&A generate file after call url and automatic save to disk

Viewing 1 reply thread
  • Author
    Posts
    • #258922
      Participant
      Topics: 5
      Replies: 21
      Points: 90
      Rank: Member

      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

    • #259234
      Senior Moderator
      Topics: 9
      Replies: 1373
      Points: 5,061
      Helping Hand
      Rank: Community MVP

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

Viewing 1 reply thread
  • You must be logged in to reply to this topic.