Resource Monitor and Listening Ports

Does anyone know how to get the firewall status of an application like in Resource Monitor under Network?

To see visually what I’m talking about you can open up Resource Monitor > Network tab > Expand Listening Ports. The column I’m looking to get information from is the Firewall Status.

I can get the application, port, state, but not the firewall status:

$PortInformation=Get-NetTCPConnection -LocalPort 5040 | Select-Object *,App
Get-Process -Id ($PortInformation.OwningProcess) | Where-Object -FilterScript {
$PortInformation | Select-Object -Property App,LocalPort,State


Can anyone help?

Get-NetFirewallProfile | Select-Object Name,Enabled