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"
|
#Grant "Modify" for directory/file to "Authenticated Users" - multiple: "dir1","dir2"
|
||||||
$GrantPath = @("")
|
$GrantPath = @("")
|
||||||
|
|
||||||
|
#Install App from Winget Repo, multiple: "appID1","appID2". Example:
|
||||||
|
#$AppID = @("Microsoft.PowerToys")
|
||||||
|
$AppID = @("")
|
||||||
|
|
||||||
#App to Run (as current logged-on user)
|
#App to Run (as current logged-on user)
|
||||||
$RunUser = ""
|
$RunUser = ""
|
||||||
$User = $True
|
$User = $True
|
||||||
|
@ -100,6 +104,9 @@ if ($File -and $FindText -and $ReplaceText) {
|
||||||
if ($GrantPath) {
|
if ($GrantPath) {
|
||||||
Grant-ModsPath $GrantPath
|
Grant-ModsPath $GrantPath
|
||||||
}
|
}
|
||||||
|
if ($AppID) {
|
||||||
|
Install-ModsApp $AppID
|
||||||
|
}
|
||||||
if ($RunUser) {
|
if ($RunUser) {
|
||||||
Invoke-ModsApp $RunUser "" "" $User
|
Invoke-ModsApp $RunUser "" "" $User
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,6 @@ function Uninstall-ModsApp ($App) {
|
||||||
}
|
}
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
function Remove-ModsLnk ($Lnk) {
|
function Remove-ModsLnk ($Lnk) {
|
||||||
foreach ($link in $Lnk)
|
foreach ($link in $Lnk)
|
||||||
{
|
{
|
||||||
|
@ -230,3 +229,11 @@ function Grant-ModsPath ($GrantPath) {
|
||||||
}
|
}
|
||||||
Return
|
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