$message = "Do you want to disable WPAD (Web Proxy Auto-Discovery)?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
  "Turns WPAD (Web Proxy Auto-Discovery) off."
$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 = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Wpad'
    Set-ItemProperty $dir -Name WpadOverride -Type DWORD -Value 1
    $dir = 'HKLM:\SYSTEM\CurrentControlSet\Services\WinHttpAutoProxySvc'
    Set-ItemProperty $dir -Name Start -Type DWORD -Value 4
  }
}
