Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Powershell drop down list for parameter values.

$
0
0
Hello,I am looking to right a function that will add a sql login to a role. Thing is, when the parameter is entered, I don't want anyone typing anything is because typos are a pain. I have done some research, but they are all form-based.At this stage I'm just wondering if this can be done outside forms?I did write some code, and although it did not raise any errors, I have no idea how to use it, that's if it actually works!![Array]$AddToDBRole = "db_datareader","db_datawriter", "db_owner"Function Return-DropDown {$Script:Choice = $DropDown.SelectedItem.ToString()$Form.Close()}I don't think I'm calling it correctly to get it to actually do anything, or the code is just rubbish. I'd appreciate any pointers. Thank you.Regards,D.

Viewing all articles
Browse latest Browse all 467

Trending Articles