diff --git a/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 b/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 index 8ace279..85b09b7 100644 --- a/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 @@ -10,6 +10,9 @@ $RunWait = $True #Beginning of Process Name to Stop - optional wildcard (*) after, without .exe, multiple: "proc1","proc2" $Proc = @("") +#Beginning of Service Name to Stop - multiple: "service1.exe","service2.exe" +$Svc = @("") + #Beginning of Process Name to Wait for to End - optional wildcard (*) after, without .exe, multiple: "proc1","proc2" $Wait = @("") @@ -89,6 +92,9 @@ if ($RunSystem) { if ($Proc) { Stop-ModsProc $Proc } +if ($Svc) { + Stop-ModsSvc $Svc +} if ($Wait) { Wait-ModsProc $Wait } @@ -129,4 +135,4 @@ if ($RunUser) { Invoke-ModsApp $RunUser "" "" $User } -<# EXTRAS #> +<# EXTRAS #> \ No newline at end of file diff --git a/Sources/WAU/Winget-AutoUpdate/mods/_Mods-Functions.ps1 b/Sources/WAU/Winget-AutoUpdate/mods/_Mods-Functions.ps1 index eab4681..4528848 100644 --- a/Sources/WAU/Winget-AutoUpdate/mods/_Mods-Functions.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/mods/_Mods-Functions.ps1 @@ -25,6 +25,12 @@ function Stop-ModsProc ($Proc) { } Return } +function Stop-ModsSvc ($Svc) { + foreach ($service in $Svc) { + Stop-Service -Name $service -Force -ErrorAction SilentlyContinue | Out-Null + } + Return +} function Wait-ModsProc ($Wait) { foreach ($process in $Wait) {