@@ -33,12 +33,13 @@ function Install-Firewall-Rules
3333 Set-NetFirewallRule - Name FRC_Driver_Station_FMS_Comms_TCP_out - Direction Outbound - Protocol TCP - RemoteAddress 10.0 .0.0 / 8 - RemotePort 80 , 443 , 554 , 1110 , 1115 , 1120 , 1121 , 1122 , 1130 , 1140 , 1145 , 1150 , 1160 , 1164 , 1166 , 1180 - 1190 , 1250 , 1735 , 1740 , 1741 , 1742 , 1750 , 5353 , 5800 - 5810 , 6666 , 8080 , 8888 - Action Allow - Enabled True - Profile Any
3434 Set-NetFirewallRule - Name FRC_Driver_Station_FMS_Comms_UDP_out - Direction Outbound - Protocol UDP - RemoteAddress 10.0 .0.0 / 8 - RemotePort 80 , 443 , 554 , 1110 , 1115 , 1120 , 1121 , 1122 , 1130 , 1140 , 1145 , 1150 , 1160 , 1164 , 1166 , 1180 - 1190 , 1250 , 1735 , 1740 , 1741 , 1742 , 1750 , 5353 , 5800 - 5810 , 6666 , 8080 , 8888 - Action Allow - Enabled True - Profile Any
3535 Set-NetFirewallRule - Name FRC_Driver_Station_FMS_Comms_mDNS_out - Direction Outbound - RemoteAddress 10.0 .0.0 / 8 - Program " C:\Program Files\National Instruments\Shared\mDNS Responder\nimdnsResponder.exe" - Action Allow - Enabled True - Profile Any
36- if (Get-NetFirewallRule " FRC_Driver_Station_FMS_Comms_DS_in" 2> $null )
36+ # check if DS software rules exists, enable-update rules if they exist
37+ if (Get-NetFirewallRule " FRC_Driver_Station_FMS_Comms_DS_in" 2> $null )
3738 {
3839 Set-NetFirewallRule - Name FRC_Driver_Station_FMS_Comms_DS_in - Direction Inbound - RemoteAddress 10.0 .0.0 / 8 - Program " C:\Program Files (x86)\FRC Driver Station\DriverStation.exe" - Action Allow - Enabled True - Profile Any
3940 Set-NetFirewallRule - Name FRC_Driver_Station_FMS_Comms_DS_out - Direction Outbound - RemoteAddress 10.0 .0.0 / 8 - Program " C:\Program Files (x86)\FRC Driver Station\DriverStation.exe" - Action Allow - Enabled True - Profile Any
4041 }
41-
42+ # create DS software rules if they don't exist
4243 else {
4344 New-NetFirewallRule - Name FRC_Driver_Station_FMS_Comms_DS_in - Group " Allow FRC Driver Station FMS Comms" - DisplayName " FRC Driver Station FMS Comms NI Driver Stationr" - Direction Inbound - RemoteAddress 10.0 .0.0 / 8 - Program " C:\Program Files (x86)\FRC Driver Station\DriverStation.exe" - Action Allow - Profile Any
4445 New-NetFirewallRule - Name FRC_Driver_Station_FMS_Comms_DS_out - Group " Allow FRC Driver Station FMS Comms" - DisplayName " FRC Driver Station FMS Comms NI Driver Station" - Direction Outbound - RemoteAddress 10.0 .0.0 / 8 - Program " C:\Program Files (x86)\FRC Driver Station\DriverStation.exe" - Action Allow - Profile Any
@@ -118,7 +119,7 @@ foreach ($adapter in $physicalAdapters)
118119# Get All IPv4 Address
119120$IPAddresses = Get-NetIPAddress - AddressFamily IPv4
120121
121- # Remove Satic IPv4 address on Physical Adapters
122+ # Remove Static IPv4 addresses on Physical Adapters
122123foreach ($IPAddress in $IPAddresses )
123124{
124125 if (($IPAddress.SuffixOrigin -like " *Manual" ) -and ($IPAddress.InterfaceAlias -eq $adapter.Name ))
@@ -127,7 +128,7 @@ foreach ($IPAddress in $IPAddresses)
127128 }
128129
129130}
130-
131+ echo " Ethernet Adapters set to use DHCP "
131132# Flush DNS
132133Clear-DnsClientCache
133134echo " DNS Cache Flushed"
@@ -152,7 +153,7 @@ while($confirmation -ne "n")
152153 $confirmation = Read-Host " Open Network Adapters Control Panel to set Static IP? Must Answer [Y or N]"
153154}
154155
155- echo " Geting IP Address with DHCP"
156+ echo " Getting IP Address with DHCP"
156157
157158# Renew DHCP for Physical 802.3 Adapters
158159foreach ($adapter in $physicalAdapters )
0 commit comments