1

How can I get a .ps1 script to automatically select the options that I want?

I am trying to automate the installation of a specific software on my docker containers.

This software is installed my running a .ps1 installation script, but when I run it, I get promted for several options. I want to create my own .ps1 script, that automatically runs the installation script, and chooses the options that I want.

When I run the installation script, all the promts looks like this:

Select the Product you wish to install:

Option Product           
------ -------           
[1]    Software 1
[2]    Software 2

Please, select one of the Products available:

Select the Language you wish to install:

Option Language           
------ -------           
[1]    Language 1
[2]    Language 2

Please, select one of the Languages available:

... and so on.

  • No, I'm sorry but the link you sent didn't help me much. – Hanus á Tjaldrafløtti Sep 14 '22 at 19:19
  • The accepted answer to the linked question shows you how to first define a proxy `Read-Host` function that maps prompt strings to the desired selection. Your installation script will then automatically call your proxy function and use the predefined selections. Isn't that the problem you're trying to solve? – mklement0 Sep 14 '22 at 21:27

0 Answers0