Outfile Question

Welcome Forums General PowerShell Q&A Outfile Question

This topic contains 4 replies, has 3 voices, and was last updated by

6 months, 3 weeks ago.

  • Author
  • #105731

    Points: 12
    Rank: Member


    I'm currently downloading and installing the vlc player silently:

    When i run the following, all is fine.

    Invoke-WebRequest -Uri "https://www.vlcwebsite.." -OutFile "c:\support\vlc-3.0.3-win64.exe"
    & "c:\support\vlc*.exe" /L=1031 /S

    I want to change the outfile to read c:\support\vlc.exe or something similar because the version of the vlc player will change.

    If I run the following, the file gets downloaded but nothing happens with the install.

    Invoke-WebRequest -Uri "https://www.vlcwebsite.." -OutFile "c:\support\vlc.exe"
    & "c:\support\vlc.exe" /L=1031 /S

    Does anyone know what would be the best way to approach this, is the problem the outfile?


  • #105733

    Points: 551
    Helping Hand
    Rank: Major Contributor

    This doesn't work?

    c:\support\vlc.exe /L=1031 /S
    • #105734

      Points: 12
      Rank: Member

      Unfortunately not. If I run the c:\support\vlc.exe /L=1031 without the /S switch, it pops up the installer. If I run this, c:\support\vlc.exe /L=1031 /S, nothing seems to happen.

      Is there a way to be non-specific about the outfile, could I use a -like switch?
      I just don't know how to deal with the change in the vlc.exe name from the website.

      Thanks for the support.

  • #105743

    Points: 403
    Helping Hand
    Rank: Contributor

    Try using Start-Process instead and pass your switches as part of the ArgumentList:

    Start-Process -FilePath "C:\Support\vlc.exe" -ArgumentList '/L=1031','/S' -NoNewWindow
    • #105778

      Points: 12
      Rank: Member

      Hi Joel,

      Thanks for that, that helped me a lot.

The topic ‘Outfile Question’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort