$message = "Do you want to turn UAC (User Account Control) on and set it to the highest value?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
  "Turns UAC on and sets it to the highest value."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
  "Does nothing."
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
$result = $host.ui.PromptForChoice($title, $message, $options, 1)
switch ($result) {
  0 {
    $dir = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System'
    Set-ItemProperty $dir -Name ConsentPromptBehaviorAdmin -Type DWORD -Value 2
    Set-ItemProperty $dir -Name ConsentPromptBehaviorUser -Type DWORD -Value 1
    Set-ItemProperty $dir -Name EnableLUA -Type DWORD -Value 1
    Set-ItemProperty $dir -Name PromptOnSecureDesktop -Type DWORD -Value 1
  }
} 
