wingetautoupdate/Winget-AutoUpdate/mods/_AppID-template.ps1

55 lines
1.5 KiB
PowerShell
Raw Normal View History

2022-12-20 01:54:14 +00:00
<# ARRAYS/VARIABLES #>
#Beginning of Process Name to Stop - optional wildcard (*) after, without .exe, multiple: "proc1","proc2"
$Proc = @("")
2022-12-20 02:19:46 +00:00
#Beginning of Process Name to Wait for to End - optional wildcard (*) after, without .exe, multiple: "proc1","proc2"
2022-12-20 01:54:14 +00:00
$Wait = @("")
2022-12-21 22:56:59 +00:00
#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"!
2022-12-20 01:54:14 +00:00
$App = ""
#Beginning of Desktop Link Name to Remove - optional wildcard (*) after, without .lnk, multiple: "lnk1","lnk2"
$Lnk = @("")
2023-01-03 04:25:42 +00:00
#Registry _value_ (DWord/String) to add in existing registry Key. Example:
#$AddKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate"
#$AddValue = "WAU_BypassListForUsers"
#$AddTypeValue = "1"
#$AddType = "DWord"
$AddKey = ""
$AddValue = ""
$AddTypeValue = ""
$AddType = ""
2023-01-03 04:25:42 +00:00
#Registry _value_ to delete in existing registry Key. Example:
#$DelKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate"
#$DelValue = "WAU_BypassListForUsers"
$DelKey = ""
$DelValue = ""
2022-12-20 01:54:14 +00:00
<# FUNCTIONS #>
2022-12-20 02:36:44 +00:00
. $PSScriptRoot\_Mods-Functions.ps1
2022-12-20 01:54:14 +00:00
<# MAIN #>
if ($Proc) {
Stop-ModsProc $Proc
}
if ($Wait) {
Wait-ModsProc $Wait
}
if ($App) {
Uninstall-ModsApp $App
}
if ($Lnk) {
Remove-ModsLnk $Lnk
}
if ($AddKey -and $AddValue -and $AddTypeValue -and $AddType) {
Add-ModsReg $AddKey $AddValue $AddTypeValue $AddType
}
if ($DelKey -and $DelValue) {
Remove-ModsReg $DelKey $DelValue
}
2022-12-20 01:54:14 +00:00
<# EXTRAS #>