Skip to content

Instantly share code, notes, and snippets.

@LabhanshAgrawal
Last active May 22, 2018 10:22
Show Gist options
  • Save LabhanshAgrawal/b7e21cb135d0e34541929ddada0bc49e to your computer and use it in GitHub Desktop.
Save LabhanshAgrawal/b7e21cb135d0e34541929ddada0bc49e to your computer and use it in GitHub Desktop.
Boxstarter commands for setting my pc. Inspired from gist by @jessfraz
# Description: Boxstarter Script
# Author: Labhansh Agrawal
# Last Updated: 2018-05-20
# Create an empty file 'Microsoft.PowerShell_profile.ps1' at ~/Documents/WindowsPowershell if not present
# 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
#---- TEMPORARY ---
Disable-UAC
#--- Windows Settings ---
Set-WindowsExplorerOptions -EnableShowFileExtensions
Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -Lock
#--- Windows Subsystems/Features ---
choco install Microsoft-Hyper-V-All -source windowsFeatures
choco install Microsoft-Windows-Subsystem-Linux -source windowsfeatures
#--- Tools ---
choco install git --params="'/GitOnlyOnPath /NoAutoCrlf /NoShellIntegration /WindowsTerminal'" -y
choco install -y poshgit
#--- Apps ---
choco install -y 7zip
choco install -y firefox
choco install -y gitkraken
choco install -y googlechrome
choco install -y hyper
choco install -y malwarebytes
choco install -y meld
choco install -y opera
choco install -y rufus
choco install -y screentogif
choco install -y thunderbird
choco install -y utorrent
choco install -y vcxsrv
choco install -y vlc
choco install -y vmwareworkstation
choco install -y vscode
choco install -y webstorm
choco install -y windirstat
#---Install Visual Studio Code Extensions---
code --install-extension ms-vscode.cpptools
code --install-extension ms-python.python
code --install-extension eg2.tslint
code --install-extension HookyQR.beautify
code --install-extension ms-vsliveshare.vsliveshare
code --install-extension formulahendry.auto-close-tag
code --install-extension formulahendry.auto-rename-tag
code --install-extension ms-vscode.PowerShell
code --install-extension formulahendry.code-runner
code --install-extension Shan.code-settings-sync
#--- Uninstall unecessary applications that come with Windows out of the box ---
# Autodesk
Get-AppxPackage *Autodesk* | Remove-AppxPackage
# BubbleWitch
Get-AppxPackage *BubbleWitch* | Remove-AppxPackage
# Candy Crush
Get-AppxPackage *CandyCrush* | Remove-AppxPackage
# Disney Magic Kingdoms
Get-AppxPackage *Disney* | Remove-AppxPackage
# Dolby Access
Get-AppxPackage *Dolby* | Remove-AppxPackage
# Dropbox
Get-AppxPackage *Dropbox* | Remove-AppxPackage
# Keeper
Get-AppxPackage *Keeper* | 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
}
# Minecraft
Get-AppxPackage *Minecraft* | Remove-AppxPackage
# Office Hub
Get-AppxPackage Microsoft.MicrosoftOfficeHub | Remove-AppxPackage
# One Connect
Get-AppxPackage Microsoft.OneConnect | Remove-AppxPackage
# Plex
Get-AppxPackage *Plex* | Remove-AppxPackage
# Solitaire
Get-AppxPackage *Solitaire* | Remove-AppxPackage
# Sway
Get-AppxPackage Microsoft.Office.Sway | 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
# 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
# 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
# Disable SMB1 (Because @NedPyle)
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
#----Windows Updates---
# Change Windows Updates to "Notify to schedule restart"
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name UxOption -Type DWord -Value 1
# To Restore (Automatic):
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name UxOption -Type DWord -Value 0
# Disable P2P Update downlods outside of local network
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config -Name DODownloadMode -Type DWord -Value 1
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization -Name SystemSettingsDownloadMode -Type DWord -Value 3
# To restore (PCs on my local network and PCs on the internet)
#Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config -Name DODownloadMode -Type DWord -Value 3
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization -Name SystemSettingsDownloadMode -Type DWord -Value 1
# To disable P2P update downloads completely:
#Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config -Name DODownloadMode -Type DWord -Value 0
#--- Restore Temporary Settings ---
Enable-UAC
Enable-MicrosoftUpdate
Install-WindowsUpdate -acceptEula
#--- Rename the Computer ---
# Requires restart, or add the -Restart flag
$computername = "Labhansh-PC"
if ($env:computername -ne $computername) {
Rename-Computer -NewName $computername
}
@ShikherVerma
Copy link

nice work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment