title: Command console output -- to file . Get { Windows Filtering Platform / Windows Firewall } rules
body: <p>Output of this doesn't fit into the window</p>
  <pre><code>get-netFirewallRule | where { $_.Action -eq 'Block' -and $_.Enabled -eq 'True' }
  
  read-host -prompt &quot;Press Enter to continue...&quot;
  </code></pre>
  <p>When i try</p>
  <pre><code>Remove-Item -Path ($env:userprofile + &quot;\Desktop\enabledBlockRules_WindowsFilteringPlatform.txt&quot;)
  
  get-netFirewallRule | where { $_.Action -eq 'Block' -and $_.Enabled -eq 'True' } | forEach {
      $_ | Add-Content -Path ($env:userprofile + &quot;\Desktop\enabledBlockRules_WindowsFilteringPlatform.txt&quot;) -Encoding &quot;utf8&quot;
  }
  
  read-host -prompt &quot;Exported to desktop .&quot;
  </code></pre>
  <p>I get nonsense results . How could i do this ?</p>