Multiple App uninstall in Mod Template/Functions
parent
53113310c0
commit
91e788ebb5
|
@ -6,8 +6,8 @@ $Proc = @("")
|
||||||
$Wait = @("")
|
$Wait = @("")
|
||||||
|
|
||||||
#Beginning of App Name string to Silently Uninstall (MSI/NSIS/INNO/EXE with defined silent uninstall in registry)
|
#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"!
|
#Multiple: "app1*","app2*", required wildcard (*) after; search is done with "-like"!
|
||||||
$App = ""
|
$App = @("")
|
||||||
|
|
||||||
#Beginning of Desktop Link Name to Remove - optional wildcard (*) after, without .lnk, multiple: "lnk1","lnk2"
|
#Beginning of Desktop Link Name to Remove - optional wildcard (*) after, without .lnk, multiple: "lnk1","lnk2"
|
||||||
$Lnk = @("")
|
$Lnk = @("")
|
||||||
|
|
|
@ -15,6 +15,8 @@ function Wait-ModsProc ($Wait) {
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
function Uninstall-ModsApp ($App) {
|
function Uninstall-ModsApp ($App) {
|
||||||
|
foreach ($process in $Proc)
|
||||||
|
{
|
||||||
$InstalledSoftware = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall"
|
$InstalledSoftware = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall"
|
||||||
foreach ($obj in $InstalledSoftware){
|
foreach ($obj in $InstalledSoftware){
|
||||||
if ($obj.GetValue('DisplayName') -like $App) {
|
if ($obj.GetValue('DisplayName') -like $App) {
|
||||||
|
@ -126,6 +128,7 @@ function Uninstall-ModsApp ($App) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
function Remove-ModsLnk ($Lnk) {
|
function Remove-ModsLnk ($Lnk) {
|
||||||
|
|
Loading…
Reference in New Issue