$message = "Do you want to set some basic firewall settings?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
  "Sets some basic firewall settings."
$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 {
    netsh advfirewall set allprofiles state on
    netsh advfirewall firewall delete rule name=all
    netsh advfirewall set allprofiles firewallpolicy "blockinbound,blockoutbound"
    netsh advfirewall firewall add rule name="DNS-TCP" dir=out action=allow protocol=TCP remoteport=53
    netsh advfirewall firewall add rule name="DNS-UDP" dir=out action=allow protocol=UDP remoteport=53
    netsh advfirewall firewall add rule name="HTTP" dir=out action=allow protocol=TCP remoteport=80
    netsh advfirewall firewall add rule name="HTTPS" dir=out action=allow protocol=TCP remoteport=443
    netsh advfirewall firewall add rule name="Samba_01" dir=out action=allow protocol=TCP remoteport=139
    netsh advfirewall firewall add rule name="Samba_02" dir=out action=allow protocol=TCP remoteport=445
    netsh advfirewall set allprofiles logging maxfilesize 32767
  }
}
