Search code examples
powershellcmdautomationdownload

Powershell automate input


Need to automate user input for software installation. In ps it self i can easily run just the setup command for starting the download of my application. But using scripts it won't? This is a part of my code first i tried to unzip the folder(works). after that i need to "write" setup to start the installation. after that i need a bunch of y and n inputs. i want to make this fully automatic that we only need to run the ps. Can someone help me with how to run this "commands" ?

> Expand-Archive -LiteralPath somepath -DestinationPath somepath 
> cd c:\skyspark\bin\ 
> cmd setup  y  y  n y  8080  y  n

Solution

  • Using cmd will start cmd.exe which is probably not what you want. If setup is actually setup.exe, then simply run it as-is.

    Expand-Archive -LiteralPath somepath -DestinationPath somepath 
    Set-Location -Path c:\skyspark\bin\ 
    & setup.exe  y  y  n y  8080  y  n