Skip to content

Commit

Permalink
feat: terminate edge processes/services
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyueta committed Oct 21, 2023
1 parent 8a81a71 commit bbd8969
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/playbook/Executables/AtlasDesktop/1. Software/Remove Edge.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ $ProgressPreference = "SilentlyContinue"
$user = $env:USERNAME
$SID = (New-Object System.Security.Principal.NTAccount($user)).Translate([Security.Principal.SecurityIdentifier]).Value

$services = @(
'edgeupdate',
'edgeupdatem',
'MicrosoftEdgeElevationService'
)

if ($Exit -and ((-not $UninstallAll) -and (-not $UninstallEdge))) {
$Exit = $false
}
Expand Down Expand Up @@ -84,13 +78,12 @@ function DeleteEdgeUpdate {

function RemoveEdgeChromium {
$baseKey = "HKLM:\SOFTWARE\WOW6432Node\Microsoft"
$ErrorActionPreference = 'SilentlyContinue')

# kill Edge
$ErrorActionPreference = 'SilentlyContinue'

Get-Process -Name MicrosoftEdgeUpdate | Stop-Process -Force
Get-Process -Name msedge | Stop-Process -Force
foreach ($service in $services) {Stop-Service -Name $service -Force}
# Terminate Edge processes
Get-Process | Where-Object {$_.Path -like "$env:SystemDrive\Program Files (x86)\Microsoft\*"} | ForEach-Object {Stop-Process -Id $_.Id -Force}
Get-Process -Name "*edge*" | Stop-Process -Force
Get-Service -Name "*edge*" | Stop-Service -Force

$ErrorActionPreference = 'Continue'

Expand Down

0 comments on commit bbd8969

Please sign in to comment.