script-server
script-server copied to clipboard
Powershell issue using multilist
Hi Bugy,
Thanks again for providing a great script server.
I wonder if you can help with Windows server / Powershell setup.
We are using multilist parameter. How can we run a powershell cmd on each returned parameter? How can the powershell script drop down to the third multilist parameter?
Thanks in advance sir.
Hi @billybenson sorry for the late reply.
Do you want to run a script multiple times?
Or just pass the parameters it like my_script.ps1 value1 value2 value3
?
Hi - pass the parameters like you have mentioned above.
However, I would want to run a PS command in my_script.ps1 for value1 and value2 and value3.
Thanks.
Hi @billybenson to pass the values like this, please use this configuration https://github.com/bugy/script-server/wiki/Script-config#multiple_arguments (set to true).
Or if you are using dev build, use multiselect_argument_type
Regarding using those arguments and passing to another command. Unfortunately I don't know powershell at all and cannot be of a huge help here. However, I found this: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Automatic_Variables?view=powershell-7.2#args
I.e. you can run a PS command with PS_command $args
syntax