Skip to content

Instantly share code, notes, and snippets.

@KaiWalter
Last active May 19, 2022 17:55
Show Gist options
  • Select an option

  • Save KaiWalter/50006d0777d955bfe60ee2480296b78b to your computer and use it in GitHub Desktop.

Select an option

Save KaiWalter/50006d0777d955bfe60ee2480296b78b to your computer and use it in GitHub Desktop.
Azure DevTest Lab VM install scripts
#Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/download/v1.2.10271/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -OutFile $(Join-Path $env:TEMP "WinGet.msixbundle");
#Invoke-Item $(Join-Path $env:TEMP "WinGet.msixbundle");
#Remove-Item $(Join-Path $env:TEMP "WinGet.msixbundle");
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
$releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$releases = Invoke-RestMethod -uri $releases_url
$latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1
"Installing winget from $($latestRelease.browser_download_url)"
Add-AppxPackage -Path $latestRelease.browser_download_url
Get-ChildItem stage*.ps1 | Copy-Item -Destination $(Join-Path $((Get-ChildItem -Path "C:\Users" -Exclude "Public").FullName) "Desktop")
$releases_url = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$releases = Invoke-RestMethod -uri $releases_url
$latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1
Write-Host "download from" $latestRelease.browser_download_url
Invoke-WebRequest -Uri $($latestRelease.browser_download_url) -OutFile $(Join-Path $env:TEMP "WinGet.msixbundle")
Invoke-Item $(Join-Path $env:TEMP "WinGet.msixbundle")
Read-Host "Hit enter to clean up when installation is finished"
Remove-Item $(Join-Path $env:TEMP "WinGet.msixbundle")
winget install Microsoft.PowerShell
winget install Git.Git
winget install Microsoft.VisualStudioCode
winget install Microsoft.Bicep
winget install Microsoft.AzureCLI
winget install Microsoft.VisualStudio.2022.Enterprise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment