I'm sorry guys but looks like that in some cases it's better to we have less knowledge...
Personally I'm a total noob in coding, but I really wanted to block some UWP apps in my PC.
This webpage, is the "END" of road for everyone who google this thing: "How to block UWP apps in Firewall"
With a lot of respects, you guys really make this issue harder than it needs to be...
NO CODING IS NEEDED AT ALL
You can simply block an UWP app in Firewall just like any other traditional Desktop software.
Your problem is that you don't look for the easiest way, you just look for the most advanced solution...
However, as I mentioned above, blocking internet connection for an UWP app is just like a traditional Desktop software.
EASY SOLUTION:
Type "advanced security" in Windows 8/10 search then select "Windows Defender Firewall with Advanced Security".
In the newly opened window and in the left panel, go to "Inbound Rules" then in the right panel, select "New Rule..." then tap "Next" when "Program" is selected. Then click on "Browse..." and go to this address:
*C:\Program Files\WindowsApps*
Now find your app's name and enter its folder then select the file with "Application" type.
I do agree with anyone who say that finding the right file, is not that easy.
But not that hard too...
You'll be able to find the right "Application" type file just in a few seconds.
As an example, the folder name for the "Google" app is this:
GoogleInc.GoogleSearch_2.1.19.0_x64__yfg5n0ztvskxp
And the name of its app "Application" file type is this:
GoogleSearchUniversal
However, after choosing the correct "Application" file type click on "Open" for it.
Then tap "Next" and then choose "Block the connection" then "Next" then marking all types of connections then "Next" then call it and "Finish" and boom! lol...
Just like a traditional Desktop software.
You see?
Not a big deal...
As a conclusion, let's don't make it harder than it needs to be.
Leave your coding knowledge behind and look for an EASY method instead...