PortValhalla/scripts/Windows/Software/winget/Manage.ps1

31 lines
984 B
PowerShell
Raw Normal View History

2024-08-01 16:58:33 +00:00
param(
2024-08-01 21:34:35 +00:00
$Action,
2024-08-01 16:58:33 +00:00
[hashtable] $Arguments
)
. "$PSScriptRoot/../../Scripts/Software.ps1";
2024-08-01 21:34:35 +00:00
. "$PSScriptRoot/../../Types/InstallerAction.ps1";
function Install-Winget {
param(
[InstallerAction] $Action = [InstallerAction]::Install,
[hashtable] $Arguments
)
Start-SoftwareInstaller -Action $Action -Arguments $Arguments;
}
2024-08-01 16:58:33 +00:00
function Install-Software {
$xamlDownloadLink = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx";
$downloadLink = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle";
$file = New-TemporaryFile;
$file = Rename-Item $file "$file.msixbundle" -PassThru;
Invoke-WebRequest "$xamlDownloadLink" -OutFile "$file";
Add-AppxPackage "$file";
Invoke-WebRequest "$downloadLink" -OutFile "$file";
Add-AppxPackage "$file";
Remove-Item $file;
}
2024-08-01 21:34:35 +00:00
Install-Winget @PSBoundParameters;