-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove.ps1
34 lines (26 loc) · 2.38 KB
/
remove.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$Storage = "$env:LocalAppData\WindowsTerminalContextMenu"
if (Test-Path $Storage) {
$Layout = Get-Content "$Storage\layout"
if ($Layout -eq "Flat") {
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminalContextMenu-*"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\WindowsTerminalContextMenu-*"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Drive\shell\WindowsTerminalContextMenu-*"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\LibraryFolder\Background\shell\WindowsTerminalContextMenu-*"
} else {
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\WindowsTerminalContextMenu"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminalContextMenu"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\WindowsTerminalContextMenu"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Drive\shell\WindowsTerminalContextMenu"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\LibraryFolder\Background\shell\WindowsTerminalContextMenu"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\WindowsTerminalContextMenu-Elevated"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\WindowsTerminalContextMenu-Elevated"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\WindowsTerminalContextMenu-Elevated"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\Drive\shell\WindowsTerminalContextMenu-Elevated"
Remove-Item -Force -Recurse -ErrorAction Ignore "Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\LibraryFolder\Background\shell\WindowsTerminalContextMenu-Elevated"
}
Remove-Item -Force -Recurse $Storage
Write-Host "Done"
} else {
Write-Host "Nothing to remove"
}
exit 0