Hi,
Refer this script to add external IP address to the existing firewall rule.
Editing Parameters:
Profile_name='Network Discovery (LLMNR-UDP-Out)' #Provide the Existing Firewall Rule Name which you need to modify.
myip='8.8.8.8' #Provide the IP which you need to add on the firewall.
Note:
Run as System User