$a = Test-Path 'C:\Program Files\Mozilla Firefox\firefox.exe'
$b = Test-Path 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'
if ($a -or $b) {
  $message = "Do you want to add NoScript to your Mozilla Firefox browser?"
  $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
    "Gives som instructions about adding NoScript and then opens Mozilla Firefox browser on Firefox Add-ons page."
  $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 {
      if ($a) {
        $dir = 'C:\Program Files\Mozilla Firefox\firefox.exe'
      } else {
        $dir = 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'
      }
      "In a few seconds will be Mozilla opened on Firefox Add-ons page with NoScript. Click on '+ Add to Firefox' in section 'NoScript Security Suite' and then confirm it. If it is not possible, install latest version of this browser and then run this script again."
      Start-Sleep -Seconds 10
      & $dir https://addons.mozilla.org/en-US/firefox/addon/noscript
    }
  }  
}
