Install winget AppID from Mods Template/Functions
parent
086fd00fec
commit
90c1d106e1
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue