Skip to content

Instantly share code, notes, and snippets.

@bentman
Last active April 23, 2024 14:01
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bentman/638c478ae791598780c70749139e382f to your computer and use it in GitHub Desktop.
Save bentman/638c478ae791598780c70749139e382f to your computer and use it in GitHub Desktop.
Script to install Dev Tools on Windows Server 2022
<#
.SYNOPSIS
Script to install Dev Tools on Windows Server (tested on 2022)
.DESCRIPTION
Installs the following from multiple resources:
Microsoft.VCLibs v14.00 (github)
Microsoft.UI v2.7.3 (github)
winget-cli v1.6.2771 (github)
Microsoft pwsh.exe vCurrent (winget)
Microsoft.WindowsTerminal v1.18.2822.0 (github)
Microsoft VSCode vCurrent (winget)
Azure CLI vCurrent (PoSh/MSI)
.NOTES
Add-DevToMyWinServer.ps1
Version: 1.0
Creation Date: 2023-10-20
Copyright (c) 2023 https://github.com/bentman
#>
# From github Microsoft.VCLibs
$MsftVc_Link = 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
$MsftVc_Name = 'Microsoft.VCLibs.x64.14.00.Desktop.appx'
Invoke-WebRequest -Uri $MsftVc_Link -OutFile .\$MsftVc_Name -Verbose
Add-AppPackage -Path .\$MsftVc_Name -Verbose
# From github Microsoft.UI.Xaml https://github.com/microsoft/microsoft-ui-xaml/releases
$MsftUi_Link = 'https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx'
$MsftUi_Name = 'Microsoft.UI.Xaml.2.7.x64.appx'
Invoke-WebRequest -Uri $MsftUi_Link -OutFile .\$MsftUi_Name -Verbose
Add-AppPackage -Path .\$MsftUi_Name -Verbose
# From github winget-cli https://github.com/microsoft/winget-cli/releases
$LicXml_Link = 'https://github.com/microsoft/winget-cli/releases/download/v1.6.2771/27abf0d1afe340e7a64fb696056b2672_License1.xml'
$LicXml_Name = '27abf0d1afe340e7a64fb696056b2672_License1.xml'
Invoke-WebRequest -Uri $LicXml_Link -OutFile .\$LicXml_Name
$WinGet_Link = 'https://github.com/microsoft/winget-cli/releases/download/v1.6.2771/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle'
$WinGet_Name = 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle'
Invoke-WebRequest -Uri $WinGet_Link -OutFile .\$WinGet_Name
Add-AppxProvisionedPackage -Online -PackagePath .\$WinGet_Name -LicensePath .\$LicXml_Name -Verbose
# From github Microsoft.WindowsTerminal https://github.com/microsoft/terminal/releases
$Term_Link = 'https://github.com/microsoft/terminal/releases/download/v1.18.2822.0/Microsoft.WindowsTerminal_1.18.2822.0_8wekyb3d8bbwe.msixbundle'
$Term_Name = 'Microsoft.WindowsTerminal_1.18.2822.0_8wekyb3d8bbwe.msixbundle'
Invoke-WebRequest -Uri $Term_Link -OutFile .\$Term_Name -Verbose
Add-AppPackage -Path .\$Term_Name -Verbose
# WinGet look for pwsh.exe versions (may prompt to accept terms)
winget search Microsoft.PowerShell
# Install pwsh.exe from winget
winget install --id Microsoft.Powershell --source winget
# WinGet look for VS Code versions (it may prompt to accept terms)
winget search Microsoft.VisualStudioCode
# Install VS Code from winget
winget install --id Microsoft.VisualStudioCode --source winget
# WinGet look for AzureCLI (it may prompt to accept terms)
winget search Microsoft.AzureCLI
# Install AzureCLI from winget
winget install --id Microsoft.AzureCLI --source winget
winget update all
@TrimarcJake
Copy link

Thanks! This rules!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment