title: Open ports for TCP/UDP in Windows Firewall with Powershell
body: <p>How can I write a powershell script to open windows firewall ports for specified protocol (TCP or UDP)?</p>
  
  <p>Something like this:</p>
  
  <pre><code>$ports = @(843, 943)
  foreach($item in $ports){
      # open the ports, 843 for TCP and 943 for UDP
      ...
  }
  
  "DONE"
  </code></pre>
  
  <p>I did a search, but cannot find way to specify the protocol.</p>