Skip to content

Instantly share code, notes, and snippets.

@frankcavazos
Forked from codebytes/DevMachineSetup.ps1
Last active August 16, 2025 22:18
Show Gist options
  • Save frankcavazos/bcf675f702ca56aaaa70eb206b53b89d to your computer and use it in GitHub Desktop.
Save frankcavazos/bcf675f702ca56aaaa70eb206b53b89d to your computer and use it in GitHub Desktop.
DevMachineSetup
# Install WinGet
# Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
# For more, see: https://timdeschryver.dev/blog/how-i-have-set-up-my-new-windows-development-environment-in-2022
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
"Installing winget Dependencies"
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
}
else {
"winget already installed"
}
# Configure WinGet
Write-Output "Configuring winget"
# winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location
$settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json";
$settingsJson =
@"
{
// For documentation on these settings, see: https://aka.ms/winget-settings
"experimentalFeatures": {
"experimentalMSStore": true,
}
}
"@;
$settingsJson | Out-File $settingsPath -Encoding utf8
#Install New apps
Write-Output "Installing Apps"
$apps = @(
@{name = "Google.Chrome" },
@{name = "Microsoft.Teams" },
@{name = "SlackTechnologies.Slack" },
@{name = "Discord.Discord.Canary" },
@{name = "Microsoft.PowerToys" },
@{name = "Microsoft.WindowsTerminal" },
@{name = "JanDeDobbeleer.OhMyPosh" },
@{name = "Git.Git" },
@{name = "GitHub.cli" },
@{name = "Notepad++.Notepad++" },
@{name = "Postman.Postman" },
@{name = "Microsoft.DotNet.SDK.7" },
@{name = "Microsoft.DotNet.SDK.8" },
@{name = "Microsoft.DotNet.SDK.9" },
@{name = "Schniz.fnm" },
@{name = "yarn.yarn" },
@{name = "winpython.winpython" },
@{name = "GoLang.Go" },
@{name = "Rustlang.Rustup" },
@{name = "Google.DartSDK" },
@{name = "Microsoft.VisualStudioCode" },
@{name = "Microsoft.VisualStudio.2022.Community" },
@{name = "MongoDB.Compass.Community" },
@{name = "DBeaver.DBeaver.Community" },
@{name = "JetBrains.PyCharm.Community" },
@{name = "Google.AndroidStudio" },
@{name = "7zip.7zip" },
@{name = "Ollama.Ollama" },
@{name = "Obsidian.Obsidian" }
);
Foreach ($app in $apps) {
$listApp = winget list --exact -q $app.name --accept-source-agreements
if (![String]::Join("", $listApp).Contains($app.name)) {
Write-host "Installing:" $app.name
if ($app.source -ne $null) {
winget install --exact --silent $app.name --source $app.source --accept-package-agreements
}
else {
winget install --exact --silent $app.name --accept-package-agreements
}
}
else {
Write-host "Skipping Install of " $app.name
}
}
dotnet tool install --global PowerShell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment