How to dump firewall rules into file with powershell

Hi everybody,

again a short note for my self to not search again in my offline notes. 😉

How to dump Firewall rules with Powershell 3.0 and newer in a file “oneliner”.

Inbound rules:

 

Outbound rules: