I have a variable in my psm1 file that's a KVP hash
$subcmdlist = @{
"addhost" = "Add-Host";
"deletehost" = "Remove-Host";
"setparameter" = "Set-Parameter";
}
This psm1 file also has a function called 'newtask' which accepts an argument of $subcommand.
I'm wondering how i can execute the cmdlet Add-Host when
newtask addhost
is issued from the shell.
I tried to just echo it but that didn't do much good at all. Just printed out the value.
Thanks!