[CmdletBinding()] Param( # None ) $InvokeRestMethodSplat = @{ Uri = "https://api.github.com/repos/microsoft/winget-cli/releases/latest" Method = 'GET' } $InvokeWebRequestSplat = @{ Uri = ((Invoke-RestMethod @InvokeRestMethodSplat).assets | Where-Object {$_.name -like '*.appxbundle'}).browser_download_url Out = "$env:temp\winget.appxbundle" } Invoke-WebRequest @InvokeWebRequestSplat $InvokeWebRequestSplat = @{ Uri = "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx" Out = "$env:temp\vclibs.appx" } Invoke-WebRequest @InvokeWebRequestSplat If (Test-Path -Path "$env:temp\winget.appxbundle") { & dism.exe /Online /Add-ProvisionedAppxPackage /PackagePath:"$env:temp\winget.appxbundle" /SkipLicense /DependencyPackagePath:"$env:temp\vclibs.appx" }