-
-
Save ionred/8cfa13322faa46ec472a38038145942e to your computer and use it in GitHub Desktop.
Boxstarter Commands for a new Windows box.
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
# Description: Boxstarter Script | |
# Author: Jess Frazelle <[email protected]> | |
# Last Updated: 2019-10-27 BC | |
# | |
# Install boxstarter: | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# | |
# You might need to set: Set-ExecutionPolicy RemoteSigned | |
# | |
# Run this boxstarter by calling the following from an **elevated** command-prompt: | |
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST> | |
# OR | |
# Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots | |
# | |
# Learn more: http://boxstarter.org/Learn/WebLauncher | |
if ([Environment]::OSVersion.Version.Major -ne 10) { | |
Write-Error 'Upgrade to Windows 10 before running this script' | |
Exit | |
} | |
if (('Unrestricted', 'RemoteSigned') -notcontains (Get-ExecutionPolicy)) { | |
Write-Error @' | |
The execution policy on your machine is Restricted, but it must be opened up for this | |
installer with: | |
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force | |
'@ | |
} | |
if (!(Get-Command 'boxstarter' -ErrorAction SilentlyContinue)) { | |
Write-Error @' | |
You need Boxstarter to run this script; install with: | |
. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force; refreshenv | |
'@ | |
Exit | |
} | |
#--- Windows Update --- | |
Disable-UAC | |
Enable-MicrosoftUpdate | |
Install-WindowsUpdate -AcceptEula | |
if ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId -lt 1803) { | |
Write-Error 'You need to run Windows Update and install Feature Updates to at least version 1803' | |
Exit | |
} | |
#--- Windows Settings --- | |
Disable-BingSearch | |
Disable-GameBarTips | |
#Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
#Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -Lock | |
#Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -AlwaysShowIconsOn | |
#--- Windows Subsystems/Features --- | |
choco install Microsoft-Hyper-V-All --source='windowsfeatures' | |
choco install Microsoft-Windows-Subsystem-Linux --source='windowsfeatures' | |
choco install Microsoft-Hyper-V-Hypervisor --source='windowsfeatures' | |
#--- Install Ubuntu in WSL | |
curl.exe -L -o ubuntu-1804.appx https://aka.ms/wsl-ubuntu-1804 | |
Add-AppxPackage .\ubuntu-1804.appx | |
#--- Tools --- | |
choco install microsoft-windows-terminal | |
choco install git -params '"/GitAndUnixToolsOnPath /WindowsTerminal"' -y | |
choco install sysinternals -y | |
choco install 7zip -y | |
choco install curl -y | |
choco install dotnetcore-runtime -y | |
choco install notepadplusplus -y | |
choco install python3 -y | |
choco install bind-toolsonly -y | |
choco install curl -y | |
choco install Everything -y | |
choco install kdiff3 -y | |
choco install procexp -y | |
choco install python3 -y | |
choco install Sudo -y | |
#--- Apps --- | |
choco install googlechrome | |
choco install docker-for-windows | |
choco install putty -y | |
choco install chrome-remote-desktop-host -y | |
choco install ublockorigin-chrome -y | |
choco install brave -y | |
choco install filezilla -y | |
choco install foxitreader -y | |
choco install github-desktop -y | |
#choco install microsoft-edge-insider -y | |
choco install paint.net -y | |
choco install pia -y | |
choco install spotify -y | |
choco install steam -y | |
choco install veracrypt -y | |
choco install vlc -y | |
choco install plex -y | |
choco install nirlauncher --params "'/Sysinternals'" | |
#--- Visual Studio Code | |
choco install visualstudiocode -y | |
refreshenv | |
code --install-extension ms-vscode.PowerShell | |
code --install-extension streetsidesoftware.code-spell-checker | |
code --install-extension ms-vscode-remote.remote-wsl | |
#code --install-extension ms-python.python | |
code --install-extension vscode-icons-team.vscode-icons | |
code --install-extension visualstudioexptteam.vscodeintellicode | |
code --install-extension ms-azuretools.vscode-docker | |
code --install-extension pkief.material-icon-theme | |
code --install-extension christian-kohler.path-intellisense | |
code --install-extension zhuangtongfa.material-theme | |
#--- Uninstall unecessary applications that come with Windows out of the box --- | |
# 3D Builder | |
Get-AppxPackage Microsoft.3DBuilder | Remove-AppxPackage | |
# Alarms | |
Get-AppxPackage Microsoft.WindowsAlarms | Remove-AppxPackage | |
# Autodesk | |
Get-AppxPackage *Autodesk* | Remove-AppxPackage | |
# Bing Weather, News, Sports, and Finance (Money): | |
Get-AppxPackage Microsoft.BingFinance | Remove-AppxPackage | |
Get-AppxPackage Microsoft.BingNews | Remove-AppxPackage | |
Get-AppxPackage Microsoft.BingSports | Remove-AppxPackage | |
Get-AppxPackage Microsoft.BingWeather | Remove-AppxPackage | |
# BubbleWitch | |
Get-AppxPackage *BubbleWitch* | Remove-AppxPackage | |
# Candy Crush | |
Get-AppxPackage king.com.CandyCrush* | Remove-AppxPackage | |
# Comms Phone | |
Get-AppxPackage Microsoft.CommsPhone | Remove-AppxPackage | |
# Dell | |
Get-AppxPackage *Dell* | Remove-AppxPackage | |
# Dropbox | |
Get-AppxPackage *Dropbox* | Remove-AppxPackage | |
Get-AppxPackage *Facebook* | Remove-AppxPackage | |
# Feedback Hub | |
Get-AppxPackage Microsoft.WindowsFeedbackHub | Remove-AppxPackage | |
# Get Started | |
Get-AppxPackage Microsoft.Getstarted | Remove-AppxPackage | |
# Keeper | |
Get-AppxPackage *Keeper* | Remove-AppxPackage | |
# Mail & Calendar | |
#Get-AppxPackage microsoft.windowscommunicationsapps | Remove-AppxPackage | |
# Maps | |
Get-AppxPackage Microsoft.WindowsMaps | Remove-AppxPackage | |
# March of Empires | |
Get-AppxPackage *MarchofEmpires* | Remove-AppxPackage | |
# McAfee Security | |
Get-AppxPackage *McAfee* | Remove-AppxPackage | |
# Uninstall McAfee Security App | |
$mcafee = gci "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "McAfee Security" } | select UninstallString | |
if ($mcafee) { | |
$mcafee = $mcafee.UninstallString -Replace "C:\Program Files\McAfee\MSC\mcuihost.exe","" | |
Write "Uninstalling McAfee..." | |
start-process "C:\Program Files\McAfee\MSC\mcuihost.exe" -arg "$mcafee" -Wait | |
} | |
# Messaging | |
Get-AppxPackage Microsoft.Messaging | Remove-AppxPackage | |
# Minecraft | |
#Get-AppxPackage *Minecraft* | Remove-AppxPackage | |
# Netflix | |
#Get-AppxPackage *Netflix* | Remove-AppxPackage | |
# Office Hub | |
#Get-AppxPackage Microsoft.MicrosoftOfficeHub | Remove-AppxPackage | |
# One Connect | |
Get-AppxPackage Microsoft.OneConnect | Remove-AppxPackage | |
# OneNote | |
#Get-AppxPackage Microsoft.Office.OneNote | Remove-AppxPackage | |
# People | |
Get-AppxPackage Microsoft.People | Remove-AppxPackage | |
# Phone | |
Get-AppxPackage Microsoft.WindowsPhone | Remove-AppxPackage | |
# Photos | |
Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage | |
# Plex | |
Get-AppxPackage *Plex* | Remove-AppxPackage | |
# Skype (Metro version) | |
Get-AppxPackage Microsoft.SkypeApp | Remove-AppxPackage | |
# Sound Recorder | |
Get-AppxPackage Microsoft.WindowsSoundRecorder | Remove-AppxPackage | |
# Solitaire | |
Get-AppxPackage *Solitaire* | Remove-AppxPackage | |
# Sticky Notes | |
Get-AppxPackage Microsoft.MicrosoftStickyNotes | Remove-AppxPackage | |
# Sway | |
Get-AppxPackage Microsoft.Office.Sway | Remove-AppxPackage | |
Get-AppxPackage *Twitter* | Remove-AppxPackage | |
# Xbox | |
#Get-AppxPackage Microsoft.XboxApp | Remove-AppxPackage | |
#Get-AppxPackage Microsoft.XboxIdentityProvider | Remove-AppxPackage | |
# Zune Music, Movies & TV | |
Get-AppxPackage Microsoft.ZuneMusic | Remove-AppxPackage | |
Get-AppxPackage Microsoft.ZuneVideo | Remove-AppxPackage | |
#--- Windows Settings --- | |
# Some from: @NickCraver's gist https://gist.github.com/NickCraver/7ebf9efbfd0c3eab72e9 | |
# Privacy: Let apps use my advertising ID: Disable | |
####If (-Not (Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) { | |
#### New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo | Out-Null | |
####} | |
####Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 | |
# WiFi Sense: HotSpot Sharing: Disable | |
####If (-Not (Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { | |
#### New-Item -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting | Out-Null | |
####} | |
####Set-ItemProperty -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting -Name value -Type DWord -Value 0 | |
# WiFi Sense: Shared HotSpot Auto-Connect: Disable | |
####Set-ItemProperty -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots -Name value -Type DWord -Value 0 | |
# Start Menu: Disable Bing Search Results | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name BingSearchEnabled -Type DWord -Value 0 | |
# To Restore (Enabled): | |
# Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name BingSearchEnabled -Type DWord -Value 1 | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name AllowSearchToUseLocation -Type DWord -Value 0 | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name CortanaConsent -Type DWord -Value 0 | |
# Disable Telemetry (requires a reboot to take effect) | |
# Note this may break Insider builds for your organization | |
# Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWord -Value 0 | |
# Get-Service DiagTrack,Dmwappushservice | Stop-Service | Set-Service -StartupType Disabled | |
# Change Explorer home screen back to "This PC" | |
####Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Type DWord -Value 1 | |
# Change it back to "Quick Access" (Windows 10 default) | |
# Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Type DWord -Value 2 | |
# Better File Explorer | |
####Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1 | |
####Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1 | |
####Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2 | |
# These make "Quick Access" behave much closer to the old "Favorites" | |
# Disable Quick Access: Recent Files | |
####Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Type DWord -Value 0 | |
# Disable Quick Access: Frequent Folders | |
####Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Type DWord -Value 0 | |
# To Restore: | |
# Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Type DWord -Value 1 | |
# Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Type DWord -Value 1 | |
# Disable the Lock Screen (the one before password prompt - to prevent dropping the first character) | |
#If (-Not (Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization)) { | |
# New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows -Name Personalization | Out-Null | |
#} | |
#Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization -Name NoLockScreen -Type DWord -Value 1 | |
# To Restore: | |
# Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization -Name NoLockScreen -Type DWord -Value 1 | |
# Lock screen (not sleep) on lid close | |
#Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name AwayModeEnabled -Type DWord -Value 1 | |
# To Restore: | |
# Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name AwayModeEnabled -Type DWord -Value 0 | |
# Use the Windows 7-8.1 Style Volume Mixer | |
#If (-Not (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC")) { | |
# New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name MTCUVC | Out-Null | |
#} | |
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC" -Name EnableMtcUvc -Type DWord -Value 0 | |
# To Restore (Windows 10 Style Volume Control): | |
# Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC" -Name EnableMtcUvc -Type DWord -Value 1 | |
# Disable Xbox Gamebar | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name AppCaptureEnabled -Type DWord -Value 0 | |
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name GameDVR_Enabled -Type DWord -Value 0 | |
# Turn off People in Taskbar | |
####If (-Not (Test-Path "HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) { | |
#### New-Item -Path HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People | Out-Null | |
####} | |
####Set-ItemProperty -Path "HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name PeopleBand -Type DWord -Value 0 | |
#--- Restore Temporary Settings --- | |
Enable-MicrosoftUpdate | |
Install-WindowsUpdate -criteria "IsHidden=0 and IsInstalled=0" | |
Install-WindowsUpdate -criteria "IsHidden=0 and IsInstalled=0" -acceptEula | |
Install-WindowsUpdate -criteria "IsHidden=0 and IsInstalled=0" -acceptEula -getUpdatesFromMS | |
Enable-UAC | |
#--- Rename the Computer --- | |
# Requires restart, or add the -Restart flag | |
write-host "Computer Name is $env:computername. Do you wish to change it?" | |
if ((Read-Host) -in "Y","y") {write-host "Enter PC Name:"; $computername = (Read-Host)} | |
if ($env:computername -ne $computername) { | |
Rename-Computer -NewName $computername | |
refreshenv | |
Invoke-Reboot | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment