$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 {
    Set-NetFirewallProfile -All -Enabled True
    Remove-NetFirewallRule -All
    Set-NetFirewallProfile -All -DefaultInboundAction Block -DefaultOutboundAction Block

    New-NetFirewallRule -DisplayName "DNS-TCP" -Direction Outbound -RemotePort 53 -Protocol TCP -Action Allow

    New-NetFirewallRule -DisplayName "DNS-UDP" -Direction Outbound -RemotePort 53 -Protocol UDP -Action Allow

    New-NetFirewallRule -DisplayName "HTTP/HTTPS" -Direction Outbound -RemotePort 80, 443 -Protocol TCP -Action Allow

    New-NetFirewallRule -DisplayName "Samba" -Direction Outbound -RemotePort 139, 445 -Protocol TCP -Action Allow


    Set-NetFirewallProfile -All -LogMaxSizeKilobytes 32767
  }
}
