Last active
February 27, 2024 08:57
Revisions
-
szero revised this gist
Feb 27, 2024 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,19 +17,21 @@ try { $licensedl = $rel.assets.Where({$_.name -match ".*License1.xml$"}).browser_download_url $wingetdl = $rel.assets.Where({$_.name -match ".*msixbundle$"}).browser_download_url $vclibsdl = "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx" $uixamldl = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx" $winget = ($wingetdl -split "\/")[-1] $license = ($licensedl -split "\/")[-1] $vclibs = ($vclibsdl -split "\/")[-1] $uixaml = ($uixamldl -split "\/")[-1] Write-Output "Downloading WinGet and its dependencies..." if (!(Test-Path $winget)) {Invoke-WebRequest -Uri $wingetdl -OutFile $winget} if (!(Test-Path $license)) {Invoke-WebRequest -Uri $licensedl -OutFile $license} if (!(Test-Path $vclibs)) {Invoke-WebRequest -Uri $vclibsdl -OutFile $vclibs} if (!(Test-Path $uixaml)) {Invoke-WebRequest -Uri $uixamldl -OutFile $uixaml} Add-AppxPackage $vclibs Add-AppxPackage $uixaml -
szero revised this gist
Feb 10, 2024 . No changes.There are no files selected for viewing
-
szero revised this gist
Feb 10, 2024 . No changes.There are no files selected for viewing
-
szero created this gist
Feb 10, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ #Requires -RunAsAdministrator Write-Output "Removing previous instances of winget..." Get-AppxPackage -allUsers *desktopappinstaller* | Remove-AppxPackage Get-AppxPackage -allUsers *winget* | Remove-AppxPackage Write-Output "Getting information on latest winget release..." try { $rel = (Invoke-WebRequest -Uri https://api.github.com/repos/microsoft/winget-cli/releases/latest).Content | Out-String | ConvertFrom-Json } catch { Write-Error $_ Exit } $licensedl = $rel.assets.Where({$_.name -match ".*License1.xml$"}).browser_download_url $wingetdl = $rel.assets.Where({$_.name -match ".*msixbundle$"}).browser_download_url $winget = ($wingetdl -split "\/")[-1] $license = ($licensedl -split "\/")[-1] $vclibs = "Microsoft.VCLibs.x64.14.00.Desktop.appx" $uixaml = "Microsoft.UI.Xaml.2.7.x64.appx" Write-Output "Downloading WinGet and its dependencies..." if (!(Test-Path $winget)) {Invoke-WebRequest -Uri $wingetdl -OutFile $winget} if (!(Test-Path $license)) {Invoke-WebRequest -Uri $licensedl -OutFile $license} if (!(Test-Path $vclibs)) {Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile $vclibs} if (!(Test-Path $uixaml)) {Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx -OutFile $uixaml} Add-AppxPackage $vclibs Add-AppxPackage $uixaml Add-AppxPackage $winget Add-AppxProvisionedPackage -Online -PackagePath $winget -LicensePath $license -Verbose Add-AppxPackage -RegisterByFamilyName -MainPackage ([io.fileinfo]$winget).basename Write-Output "Cleaning up downloaded files..." foreach ($file in $winget, $license, $vclibs, $uixaml) { Remove-Item $file -Force }