Advertisement
tankcr

yesno

Mar 5th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $message = $site_collection_url + " " + "Is this URL is correct, and do you wish to continue"
  2.  
  3. $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
  4.     "Builds and Permissions the new site collection $site_collection_url"
  5. $no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
  6.     "Ends the script and does not build the new site collection."
  7. $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
  8. $result = $host.ui.PromptForChoice($title, $message, $options, 0)
  9. switch ($result)
  10.     {
  11.         0 {"You selected Yes."}
  12.         1 {"You selected No."}
  13.     }
  14. if ($result = 0)
  15.     {
  16.          {break}
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement