Block an App From Accessing the Internet (Firewall Rule)
Create an outbound Windows Firewall rule that cuts a program off from the network.
Run New-NetFirewallRule -DisplayName "Block App" -Direction Outbound -Program "C:\path\app.exe" -Action Block in an admin PowerShell.
01Command
Command
$ New-NetFirewallRule -DisplayName "Block TelemetryApp" -Direction Outbound -Program "C:\Program Files\TelemetryApp\app.exe" -Action Block02What it does
Windows Firewall passes outbound traffic by default, so most apps call home freely. An outbound rule with Action Block and the program's full .exe path stops that app from opening any internet connection. Delete the rule with Remove-NetFirewallRule when you want to allow it again.
03Risk
!Warning: If the app is updated or moved, its path changes and the block stops working — verify the exact .exe path, and don't block system services like svchost.exe.
04Undo
Undo
$ Remove-NetFirewallRule -DisplayName "Block TelemetryApp"05Sources
- New-NetFirewallRuleEvidence: Documents creating a firewall rule with Direction, Program and Action parameters, including outbound blocking.
Last verified: 2026-09-18 · Category: Security & Privacy
06Related solutions
Verify Code Signatures with Get-AuthenticodeSignature
Read the Authenticode signature status and signer of any executable or script in PowerShell.
Fix 'scripts is disabled on this system' with Set-ExecutionPolicy
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.
Grep on Windows: Select-String
Search inside text files and logs with regex, returning file, line number and match.