edge_vanisher.ps1

Source: https://code.ravendevteam.org/talon/edge_vanisher.ps1

Overview

This PowerShell script uninstalls Microsoft Edge on Windows 11 systems and prevents it from reinstalling by applying restrictive filesystem permissions to Edge components.

Purpose & Use Cases

Remove Microsoft Edge and its related shortcuts and files from Windows 11 environments.

Lock down Edge installation directories to enforce organizational policies against Microsoft Edge usage.

Dependencies

PowerShell 5.1 or later with Appx module support.

Windows 11 operating system.

Administrator privileges.

Configuration & Parameters

Parameter Type Description Default
None N/A No configurable parameters N/A

Usage Example

powershell -ExecutionPolicy Bypass -File edge_vanisher.ps1

Behavior & Implementation

The script verifies administrator rights, terminates running Microsoft Edge processes, uninstalls the Edge Appx package for the current user, deletes associated shortcuts and installation folders, and then applies deny access control entries to key Edge directories to prevent reinstallation.

Error Handling

Uses Try/Catch blocks around filesystem and ACL operations with -ErrorAction Stop for critical commands, logging error details to the host. Non-critical removals use -ErrorAction SilentlyContinue with post-action checks.

Security Considerations

Must be run with elevated privileges. Improper ACL modifications can affect future updates or other applications. No external inputs are accepted, so input sanitization is not required.

Logging

Employs Write-Host with color-coded output: Yellow for progress, Cyan for operations, Green for success messages, and Red for errors.

Testing & Validation

Test in a non-production or VM environment; verify Edge removal and ACL protection using commands like Get-AppxPackage Microsoft.MicrosoftEdge and attempt reinstall.

Author

Author: Raven Development Team