Skip to content

Instantly share code, notes, and snippets.

@lkrimphove
Last active June 7, 2024 06:44
Show Gist options
  • Save lkrimphove/1ec31ea442289c24a94350dc4de53d99 to your computer and use it in GitHub Desktop.
Save lkrimphove/1ec31ea442289c24a94350dc4de53d99 to your computer and use it in GitHub Desktop.
Uses winget to quickly setup new computers
param (
[string]$PackageListSource
)
function Get-PackageList {
param (
[string]$Source
)
if ($Source -match "^https?:\/\/") {
# It's a URL, download the file
$tempFile = [System.IO.Path]::GetTempFileName()
Write-Host "Downloading package list from $Source..."
Invoke-WebRequest -Uri $Source -OutFile $tempFile
$packageList = Get-Content -Path $tempFile
Remove-Item $tempFile
} elseif (Test-Path $Source) {
# It's a local file
Write-Host "Reading package list from local file $Source..."
$packageList = Get-Content -Path $Source
} else {
Write-Host "Invalid source: $Source"
exit 1
}
# Filter out comments and empty lines
$packageList = $packageList | Where-Object { $_ -notmatch "^\s*#" -and $_ -notmatch "^\s*$" }
return $packageList
}
# Get the package list
$packageIDs = Get-PackageList -Source $PackageListSource
# Loop through each package ID and install it using winget
foreach ($packageID in $packageIDs) {
Write-Host "Installing $packageID..."
winget install -e --id $packageID
}
## Web Browsers
Mozilla.Firefox
Google.Chrome
## Multimedia
Spotify.Spotify
## Development Tools
Microsoft.VisualStudioCode
Git.Git
Axosoft.GitKraken
Postman.Postman
Amazon.AWSCLI
#Docker.DockerDesktop
#OpenJS.NodeJS
## Productivity
Obsidian.Obsidian
## Utilities
Notepad++.Notepad++
KeePassXCTeam.KeePassXC
ShareX.ShareX
7zip.7zip
Logitech.OptionsPlus
tailscale.tailscale
## Terminal Utilities
charmbracelet.gum
charmbracelet.wishlist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment