Skip to content

Instantly share code, notes, and snippets.

@justenwalker
Last active November 1, 2019 03:32
Show Gist options
  • Save justenwalker/25211c0fa10ddd705a3f6077e2b7694c to your computer and use it in GitHub Desktop.
Save justenwalker/25211c0fa10ddd705a3f6077e2b7694c to your computer and use it in GitHub Desktop.
Boxstarter Script
# Based off https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f
$gistContent = "https://gist.githubusercontent.com/justenwalker/25211c0fa10ddd705a3f6077e2b7694c"
#--- Function Library ---#
# New-RegistryKey creates the specified registry key if it does not exist
# It will recursively create any parent keys
function New-RegistryKey
{
Param(
[Parameter(Mandatory=$true)]
[string] $Path
)
Process
{
If (Test-Path -Path $Path) {
return
}
$Parent = Split-Path -Path $Path -Parent
$Leaf = Split-Path -Path $Path -Leaf
If (-Not (Test-Path -Path $Parent)) {
New-RegistryKey -Path $Parent
}
New-Item -Path $Parent -Name $Leaf | Out-Null
}
}
# Update-Registry Key creates the registry key if it does not exist, and then updates the value
function Update-RegistryKey
{
Param(
[Parameter(Mandatory=$true)]
[string] $Name,
[Parameter(Mandatory=$true)]
[string] $Path,
[Parameter(Mandatory=$false)]
[Microsoft.Win32.RegistryValueKind] $Type = [Microsoft.Win32.RegistryValueKind]::DWord,
[Parameter(Mandatory=$true)]
$Value
)
Process
{
If (-Not (Test-Path -Path $Path)) {
New-RegistryKey -Path $Path
}
Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value
}
}
# Removes a registry key
function Remove-RegistryKey
{
Param(
[Parameter(Mandatory=$true)]
[string] $Path,
[Parameter(Mandatory=$true)]
[string] $Name
)
Process
{
If (Test-Path -Path $Path) {
Get-Item -Path $Path | Remove-ItemProperty -Name $Name | Out-Null
}
}
}
#--- Function Library ---#
# Temporary
Disable-UAC
#--- Remove Microsoft Bloatware
Get-AppxPackage -name "Microsoft.3DBuilder" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.BingTravel" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.BingHealthAndFitness" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.BingFoodAndDrink" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.BingWeather" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.BingFinance" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.BingNews" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.BingSports" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.Getstarted" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.Music.Preview" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.Office.OneNote" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.People" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.SkypeApp" |Remove-AppxPackage
Get-AppxPackage -name "Microsoft.WindowsCalculator" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.WindowsCamera" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.WindowsMaps" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.WindowsPhone" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.ZuneMusic" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.ZuneVideo" | Remove-AppxPackage
#-- Remove 3rd-Party Apps
Get-AppxPackage | Where-Object { -not $_.Publisher.Contains("O=Microsoft Corporation") } | Remove-AppxPackage
#--- Windows Subsystems/Features ---
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -All -NoRestart
#--- Install Packages ---
########
# Apps #
########
choco install -y firefox
choco install -y thunderbird
choco install -y 7zip.install # Zip/Unzip files
choco install -y vlc # Movie Player
choco install -y xnview # Picture Viewer
choco install -y sumatrapdf # PDF Viewer
choco install -y open-shell # Classic Start Menu
choco install -y shutup10 # utility to manage privacy/ad settings
choco install -y ccleaner # crap cleaner
###########
# Drivers #
###########
choco install -y nvidia-display-driver
############
# Security #
############
choco install -y bitwarden # Password Manager
choco install -y bitwarden-cli # ^^
choco install -y gpg4win # GPG/PGP tools
choco install -y keybase
choco install -y veracrypt # Encrypted volumes
###############
# Sync/Backup #
###############
choco install -y google-backup-and-sync # Google Drive
choco install -y synctrayzor # Syncthing + Tray Utility
choco install -y duplicati # Backup utility
choco install -y cryptomator # Secure file sync over cloud storage
#############
# Dev Tools #
#############
choco install -y git.install -params '"/GitAndUnixToolsOnPath /WindowsTerminal /NoGuiHereIntegration"'
choco install -y firacode # nice monospace font
choco install -y vscode # Visual Studio Code
choco install -y golang
choco install -y docker-desktop
##################
# Game Launchers #
##################
choco install -y steam
choco install -y goggalaxy
choco install -y epicgameslauncher
choco install -y origin
choco install -y uplay
#--- Install Ubuntu
Invoke-WebRequest -UseBasicParsing -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile "${env:TEMP}/ubuntu.appx"
Add-AppxPackage -Path $env:TEMP/ubuntu.appx
Remove-Item -Path "${env:TEMP}/ubuntu.appx"
##--- Settings Tweaks : https://gist.github.com/NickCraver/7ebf9efbfd0c3eab72e9
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Value 0
# To Restore:
#Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Value 0
# To Restore:
#Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Value 1
# WiFi Sense: HotSpot Sharing: Disable
Update-RegistryKey -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting -Name value -Value 0
# WiFi Sense: Shared HotSpot Auto-Connect: Disable
Update-RegistryKey -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots -Name value -Value 0
# Disable Telemetry (requires a reboot to take effect)
Update-RegistryKey -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Value 0
Get-Service DiagTrack,Dmwappushservice | Stop-Service | Set-Service -StartupType Disabled
# Disable BloatWare Installer
# From: https://twitter.com/Barnacules/status/1185783977941983233
Update-RegistryKey -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableWindowsConsumerFeatures -Value 1
# Start Menu: Disable Bing Search Results
Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name BingSearchEnabled -Value 0
# To Restore (Enabled):
# Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name BingSearchEnabled -Value 1
# Start Menu: Disale Cortana (Commented out by default - this is personal preference)
Update-RegistryKey -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name AllowCortana -Value 0
# To Restore (Enabled):
# Update-RegistryKey -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name AllowCortana -Value 1
# Apply ShutUp 10 privacy configuration
Invoke-WebRequest -UseBasicParsing -Outfile "${env:TEMP}\ooshutup10.cfg" `
-Uri "${gistContent}/raw/ooshutup10.cfg"
& OOSU10.exe /quiet /force "${env:TEMP}\ooshutup10.cfg"
Remove-Item -Path "${env:TEMP}/ooshutup10.cfg"
############################
# Personal Preferences on UI
############################
# Change Explorer home screen back to "This PC"
Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
# Change it back to "Quick Access" (Windows 10 default)
#Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 2
# These make "Quick Access" behave much closer to the old "Favorites"
# Disable Quick Access: Recent Files
#Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Value 0
# Disable Quick Access: Frequent Folders
#Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Value 0
# Disable the Lock Screen (the one before password prompt - to prevent dropping the first character)
Update-RegistryKey -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization -Name NoLockScreen -Value 1
# Use the Windows 7-8.1 Style Volume Mixer
Update-RegistryKey -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC" -Name EnableMtcUvc -Value 0
Remove-RegistryKey -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC" -Name EnableMtcUvc
# Better File Explorer
# - Expand explorer tree to current folder
#Update-RegistryKey -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1
# - Show all folders in Explorer including Recycle Bin, Desktop, Control Panel
Update-RegistryKey -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1
# - Multi-monitor Taskbar Mode:
# 0 = Show taskbar buttons on all taskbars
# 1 = Show taskbar buttons on main taskbar and taskbar where window is open
# 2 = Show taskbar buttons on taskbar where window is open
Update-RegistryKey -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
# - Hide Desktop Icons
Update-RegistryKey -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideIcons -Value 1
Disable-BingSearch
Disable-GameBarTips
Set-TaskbarOptions -Size Small -Lock -Dock Bottom -Combine Always
Set-TaskbarOptions -AlwaysShowIconsOff
Set-WindowsExplorerOptions `
-EnableShowHiddenFilesFoldersDrives `
-DisableShowProtectedOSFiles `
-EnableShowFileExtensions `
-EnableShowFullPathInTitleBar `
-DisableOpenFileExplorerToQuickAccess `
-DisableShowRecentFilesInQuickAccess `
-DisableShowFrequentFoldersInQuickAccess `
-EnableExpandToOpenFolder `
-EnableShowRibbon
#################
# Windows Updates
#################
# Change Windows Updates to "Notify to schedule restart"
Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name UxOption -Value 1
# To Restore (Automatic):
#Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name UxOption -Value 0
# Disable P2P Update downlods outside of local network
Update-RegistryKey -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config -Name DODownloadMode -Value 1
Update-RegistryKey -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization -Name SystemSettingsDownloadMode -Value 3
#--- Restore Temporary Settings ---
Enable-UAC
Enable-MicrosoftUpdate
Install-WindowsUpdate -acceptEula
#--- Rename the Computer ---
# Requires restart, or add the -Restart flag
$computername = "poseidon"
if ($env:computername -ne $computername) {
Rename-Computer -NewName $computername
}
############################################################################
# This file was created with O&O ShutUp10 and can be imported onto another computer.
#
# Download the application at https://www.oo-software.com/en/shutup10
# You can then import the file from within the program.
#
# Alternatively you can import it automatically over a command line. Simply use
# the following parameter:
# ooshutup10.exe <path to file>
#
# Selecting the Option /quiet ends the app right after the import and the user does not
# get any feedback about the import.
#
# We are always happy to answer any questions you may have!
# Copyright © O&O Software GmbH https://www.oo-software.com/
############################################################################
P001 +
P002 +
P003 +
P004 +
P005 +
P006 +
P008 +
P017 +
P026 +
P027 +
P028 +
P009 +
P010 -
P015 -
P016 -
P007 +
P025 +
P023 +
P012 -
P013 -
P019 -
P020 -
P011 -
P018 -
P021 -
P022 -
P014 -
P029 -
P030 -
P031 -
P032 -
P024 -
S001 +
S002 +
S003 +
S004 +
S005 +
S008 -
S009 -
S010 -
E001 +
E002 +
E003 +
E008 +
E007 +
E010 +
E009 -
E004 -
E005 -
E006 -
Y001 +
Y002 +
Y003 +
Y004 +
Y005 +
Y006 +
Y007 +
C012 +
C002 +
C004 +
C005 +
C006 +
C007 +
C008 +
C009 +
C010 +
C011 +
L001 +
L002 +
L003 +
L004 -
L005 -
L006 -
L007 -
L008 -
U001 +
U002 +
U003 +
U004 +
W001 +
W002 +
W003 +
W011 +
W004 -
W005 -
W010 -
W009 -
W006 -
W007 -
W008 -
M006 +
M011 +
M010 +
O003 -
O001 -
S012 -
S013 -
S014 -
S011 -
K001 +
K002 +
K005 +
M001 +
M002 +
M004 +
M005 +
M003 +
M012 -
M013 +
M014 +
M015 +
M016 -
N001 -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment