Skip to content

Instantly share code, notes, and snippets.

@jpbruckler
Forked from codebytes/DevMachineSetup.ps1
Last active September 6, 2024 14:06
Show Gist options
  • Save jpbruckler/54fe400fae0070bd751e9cbbd1fa8ca2 to your computer and use it in GitHub Desktop.
Save jpbruckler/54fe400fae0070bd751e9cbbd1fa8ca2 to your computer and use it in GitHub Desktop.
DevMachineSetup
#Install WinGet
#Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
$hasPackageManager = Get-Command winget -ErrorAction SilentlyContinue
[version]$version = if ($hasPackageManager) {
(winget --version).trim('v')
}
else {
'0.0.0'
}
$releasesUrl = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
[version]$latestVer = (Invoke-RestMethod -Uri $releasesUrl | Sort-Object -Property published_at -Descending | Select-Object -First 1 | Select-Object -ExpandProperty tag_name).trim('v')
if (!$hasPackageManager -or $version -lt $latestVer) {
"Installing winget Dependencies"
Add-AppxPackage -Path "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx"
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
Add-AppxPackage -Path "https://aka.ms/getwinget"
}
else {
"winget already installed"
}
#Configure WinGet
#Install New apps
Write-Output "Installing Apps"
$apps = @(
@{name = "Microsoft.AzureCLI" },
@{name = "Microsoft.PowerShell" },
@{name = "Microsoft.VisualStudioCode" },
@{name = "Microsoft.WindowsTerminal" },
@{name = "Microsoft.Azure.StorageExplorer" },
@{name = "Microsoft.PowerToys" },
@{name = "Git.Git" },
@{name = "Microsoft.DotNet.SDK.6" },
@{name = "Microsoft.DotNet.SDK.7" },
@{name = "Microsoft.DotNet.SDK.8" },
@{name = "Python.Launcher" }, # latest python
@{name = "Node.js" },
@{name = "zoomit" },
@{name = "WinMerge.WinMerge" },
@{name = "Microsoft.WinDbg" },
@{name = "NirSoft.ShellExView" },
@{name = "Microsoft.PowerToys" }
@{name = "Xmind.Xmind" },
@{name = "Bitwarden.Bitwarden" },
@{name = "Bitwarden.CLI" },
@{name = "Yubico.YubikeyManager" },
@{name = "Obsidian.Obsidian" },
@{name = "Microsoft.Sysinternals.TCPView" },
@{name = "Microsoft.Sysinternals.ProcessExplorer" },
@{name = "Microsoft.Sysinternals.ProcessMonitor" },
@{name = "Microsoft.Sysinternals.RDCMan" },
@{name = "Microsoft.RemoteDesktopClient" },
@{name = "mRemoteNG.mRemoteNG" },
@{name = "Espanso.Espanso" },
@{name = "WiresharkFoundation.Wireshark" }
);
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 --accept-package-agreements --force
}
else {
winget install --exact --silent $app.name --accept-package-agreements --accept-package-agreements --force
}
}
else {
Write-host "Skipping Install of " $app.name
}
}
#Remove Apps
Write-Output "Removing Apps"
$apps = "*3DPrint*", "Microsoft.MixedReality.Portal"
Foreach ($app in $apps)
{
Write-host "Uninstalling:" $app
Get-AppxPackage -allusers $app | Remove-AppxPackage
}
#Setup WSL
wsl --install -d Ubuntu-24.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment