Last active
July 5, 2019 04:14
-
-
Save vedantroy/1cf433a1acdfa3b64fceea1927f8a309 to your computer and use it in GitHub Desktop.
A script for setting up a basic windows environment. Utterly useless and made for amusement only.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host @" | |
This script installs the following programs: | |
- Scoop (Package manager for Windows) | |
- Scoop "extras bucket" | |
- 7zip (auto-installed by scoop) | |
- Git | |
- flux | |
- mpv | |
- qbittorrent | |
- vscode | |
"@ | |
# Installs scoop: scoop.sh | |
Invoke-Expression (new-object net.webclient).downloadstring('https://get.scoop.sh') | |
# Necessary for buckets in scoop | |
scoop install git | |
# Necessary for installing certain programs with scoop | |
scoop bucket add extras | |
scoop install mpv | |
scoop install flux | |
scoop install qbittorrent | |
scoop install vscode | |
# Remove some default installed apps | |
[string[]]$AppsToKeep = @( | |
"Microsoft.DesktopAppInstaller", | |
"Microsoft.HEIFImageExtension", | |
"Microsoft.MicrosoftStickyNotes", | |
"Microsoft.MSPaint", | |
"Microsoft.ScreenSketch", | |
"Microsoft.StorePurchaseApp", | |
"Microsoft.VP9VideoExtensions", | |
"Microsoft.WebMediaExtensions", | |
"Microsoft.WebpImageExtension", | |
"Microsoft.Windows.Photos", | |
"Microsoft.WindowsAlarms", | |
"Microsoft.WindowsCalculator", | |
"Microsoft.WindowsCamera", | |
"Microsoft.WindowsSoundRecorder", | |
"Microsoft.WindowsStore", | |
"Microsoft.YourPhone" | |
) | |
:AppNameLoop foreach ($name in Get-AppXProvisionedPackage -Online | Select-Object PackageName) { | |
foreach($substring in $AppsToKeep) { | |
if($name -Match $substring) { | |
Write-Host "Keeping: " $name | |
continue AppNameLoop | |
} | |
} | |
Write-Host "Uninstalling: " $name | |
# Keep what is after the = sign in {PackageName=<package name>} | |
# Considering running Get-AppXProvisioned -Online | Select-Object PackageName in the terminal | |
# gives results that are just <package name>, I don't know why this extra @{} junk exists | |
$pkgNameFake = ([string]$name).split("=")[1] | |
# Trim off ending } | |
$pkgName = $pkgNameFake.Substring(0, $pkgNameFake.Length - 1) | |
Remove-AppXProvisionedPackage -Online -PackageName $pkgName | |
} | |
Write-Host "Reminder: If you want file associations with vscode then run the .reg file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment