Hello,
I'm trying to create a script which has parameters that can pass through multiple arguments.
For example, I have;
param ( [string]$variable
)
I want to be able to use $variable as an argument for multiple commands, if possible by running this command through the script;
Examples:
Script.ps1 -variable command start server Script.ps1 -variable command stop server Script.ps1 -variable command restart server
The 'command' part can also change, so could this be another argument as well?
I've delt with parameters before but always used them on a more basic approach, for example;
Script.ps1 -variable true -servername name
But the issue is that I have a variable which I want the user to be able to supply with multiple arguments depending on what they want to do.
Hope this makes sense!
Thanks in advance!
- Edited by OnlyJonathan 22 hours 33 minutes ago