Outfile Question

Welcome Forums General PowerShell Q&A Outfile Question

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

 
Participant
3 months, 2 weeks ago.

  • Author
    Posts
  • #105731

    Participant
    Points: 1
    Rank: Member

    Hi,

    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?

    Thanks

  • #105733
    js

    Participant
    Points: 217
    Helping Hand
    Rank: Participant

    This doesn't work?

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

      Participant
      Points: 1
      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

    Participant
    Points: 166
    Helping Hand
    Rank: Participant

    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

      Participant
      Points: 1
      Rank: Member

      Hi Joel,

      Thanks for that, that helped me a lot.

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