Multiple App uninstall in Mod Template/Functions

pull/257/head
GAJ-san 2023-01-05 15:37:30 +01:00
parent 53113310c0
commit 91e788ebb5
2 changed files with 68 additions and 65 deletions

View File

@ -6,8 +6,8 @@ $Proc = @("")
$Wait = @("")
#Beginning of App Name string to Silently Uninstall (MSI/NSIS/INNO/EXE with defined silent uninstall in registry)
#Required wildcard (*) after, search is done with "-like"!
$App = ""
#Multiple: "app1*","app2*", required wildcard (*) after; search is done with "-like"!
$App = @("")
#Beginning of Desktop Link Name to Remove - optional wildcard (*) after, without .lnk, multiple: "lnk1","lnk2"
$Lnk = @("")

View File

@ -15,6 +15,8 @@ function Wait-ModsProc ($Wait) {
Return
}
function Uninstall-ModsApp ($App) {
foreach ($process in $Proc)
{
$InstalledSoftware = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall"
foreach ($obj in $InstalledSoftware){
if ($obj.GetValue('DisplayName') -like $App) {
@ -126,6 +128,7 @@ function Uninstall-ModsApp ($App) {
}
}
}
}
Return
}
function Remove-ModsLnk ($Lnk) {