diff --git a/Winget-AutoUpdate/mods/_AppID-template.ps1 b/Winget-AutoUpdate/mods/_AppID-template.ps1 index 4bbd952..b1344cf 100644 --- a/Winget-AutoUpdate/mods/_AppID-template.ps1 +++ b/Winget-AutoUpdate/mods/_AppID-template.ps1 @@ -59,6 +59,10 @@ $ReplaceText = '' #Grant "Modify" for directory/file to "Authenticated Users" - multiple: "dir1","dir2" $GrantPath = @("") +#Install App from Winget Repo, multiple: "appID1","appID2". Example: +#$AppID = @("Microsoft.PowerToys") +$AppID = @("") + #App to Run (as current logged-on user) $RunUser = "" $User = $True @@ -100,6 +104,9 @@ if ($File -and $FindText -and $ReplaceText) { if ($GrantPath) { Grant-ModsPath $GrantPath } +if ($AppID) { + Install-ModsApp $AppID +} if ($RunUser) { Invoke-ModsApp $RunUser "" "" $User } diff --git a/Winget-AutoUpdate/mods/_Mods-Functions.ps1 b/Winget-AutoUpdate/mods/_Mods-Functions.ps1 index 607d3d0..054e331 100644 --- a/Winget-AutoUpdate/mods/_Mods-Functions.ps1 +++ b/Winget-AutoUpdate/mods/_Mods-Functions.ps1 @@ -152,7 +152,6 @@ function Uninstall-ModsApp ($App) { } Return } - function Remove-ModsLnk ($Lnk) { foreach ($link in $Lnk) { @@ -230,3 +229,11 @@ function Grant-ModsPath ($GrantPath) { } Return } + +function Install-ModsApp ($AppID) { + foreach ($app in $AppID) + { + & $Winget install --id $app --accept-package-agreements --accept-source-agreements -h + } + Return +}