netsh advfirewall firewall add rule ?- $RULENAME1 = 'Domain Controllers'
- $Rule = netsh advfirewall firewall show rule name="$RULENAME1" $nul
-
- if ($?) {
-
- echo "Rule "$RULENAME1" already exist."
- echo "Hey, you already got a out rule by that name, you cannot put another one in!"
-
- } else {
- echo Rule "$RULENAME1" not exist. Creating...
- netsh advfirewall firewall add rule name="$RULENAME1" dir=out action=block program="C:\Program Files\Mozilla Firefox\firefox.exe"
- }
复制代码
|