- $program = "D:\program files\mobaxterm\root\slash\bin\xwin_mobax.exe"
- New-NetFirewallRule -DisplayName "bbb" -Profile Private,Public -Direction Outbound -Program $program -Action block
- $count = 0
- do
- {
- $count += 1
- write-host "count:" $count
- Enable-NetFirewallRule -DisplayName "bbb"
- start-sleep 5
- disable-NetFirewallRule -DisplayName "bbb"
- start-sleep 8
- }
- while {$true}
复制代码
|