#!/bin/pwsh

function Install-Winget {
    $downloadLink = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle";
    $file = New-TemporaryFile;
    $file = Rename-Item $file "$file.msixbundle";
    Invoke-WebRequest "$downloadLink" -OutFile "$file";
    choco install -y winget;
    Add-AppxPackage "$file";
    Remove-Item $file;
}