Hello,
Initially, those scripts where no app exe is specified corresponds to rules that affect only the port. For example, do not allow communication on port, or allow communication.
For more complex rules, such as specific Exe files you can use the New-NetFirewallRule cmdlet, like explained in the next article, in specific the Example 7, to associate rule with specific app.
https://learn.microsoft.com/en-us/powershell/module/netsecurity/new-netfirewallrule?view=windowsserver2022-ps
------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--