Multiple App uninstall in Mod Template/Functions
parent
53113310c0
commit
91e788ebb5
|
@ -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 = @("")
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue