Skip to content

Instantly share code, notes, and snippets.

@myty
Last active December 9, 2022 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save myty/1d97e045a2f955c104a3c0ddd51b625a to your computer and use it in GitHub Desktop.
Save myty/1d97e045a2f955c104a3c0ddd51b625a to your computer and use it in GitHub Desktop.
DevBoxStarter
# POWERSHELL
Update-ExecutionPolicy Unrestricted
# Install Chocolatey
if ((Get-Command "choco" -ErrorAction SilentlyContinue) -eq $null)
{
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}
function Invoke-RefreshEnvironment {
RefreshEnv
}
Invoke-RefreshEnvironment
# Install Boxstarter
cinst Boxstarter -y
# Install Scoop
if ((Get-Command "scoop" -ErrorAction SilentlyContinue) -eq $null)
{
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
}
# Scoop Buckets
scoop bucket add extras
scoop bucket add nerd-fonts
scoop bucket add java
scoop bucket add jetbrains
scoop bucket add mytydev https://github.com/myty/scoop-mytydev.git
scoop bucket add Ash258 https://github.com/Ash258/Scoop-Ash258.git
scoop bucket add TheRandomLabs https://github.com/TheRandomLabs/Scoop-Bucket.git
# Scoop Globals
scoop install sudo aria2 innounp lessmsi
sudo scoop install git 7zip --global
# Fonts
sudo scoop install Delugia-Nerd-Font Delugia-Nerd-Font-Complete Cascadia-Code Cascadia-Mono Cascadia-MonoPL Cascadia-PL ubuntumono-nf ubuntu-nf inconsolata-nf firacode firacode-nf sourcecodepro-nf AnonymousPro-NF
# Base Utils
scoop install pwsh
scoop install oh-my-posh posh-git
scoop install shim sed psutils grep ngrok less gcc curl
#---- POWERSHELL GALLERY ---
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
#--- Setting up Windows ---
#--- Enable developer mode on the system ---
Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -Value 1
# 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
#--- Configuring Windows properties ---
#--- Windows Features ---
# Show hidden files, Show protected OS files, Show file extensions
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
#--- File Explorer Settings ---
# Will expand explorer to the actual folder you're in
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1
# Adds things back in your left pane like recycle bin
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1
# Opens PC to This PC, not quick access
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
# Taskbar where window is open for multi-monitor
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
# Hide Desktop icons
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoDesktop -Value 1
#--- Uninstall unecessary applications that come with Windows out of the box ---
Write-Host "Uninstall some applications that come with Windows out of the box" -ForegroundColor "Yellow"
#Referenced to build script
# https://docs.microsoft.com/en-us/windows/application-management/remove-provisioned-apps-during-update
# https://github.com/jayharris/dotfiles-windows/blob/master/windows.ps1#L157
# https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f
# https://gist.github.com/alirobe/7f3b34ad89a159e6daa1
# https://github.com/W4RH4WK/Debloat-Windows-10/blob/master/scripts/remove-default-apps.ps1
function Remove-WindowsApp {
Param ([string]$appName)
Write-Output "Trying to remove $appName"
Get-AppxPackage $appName -AllUsers | Remove-AppxPackage
Get-AppXProvisionedPackage -Online | Where DisplayNam -like $appName | Remove-AppxProvisionedPackage -Online
}
$applicationList = @(
"Microsoft.Getstarted"
"*MarchofEmpires*"
"Microsoft.GetHelp"
"Microsoft.WindowsPhone"
"Microsoft.Office.Sway"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
"*Autodesk*"
"*BubbleWitch*"
"king.com*"
"G5*"
"*Dell*"
"*Facebook*"
"*Keeper*"
"*Plex*"
"*.Duolingo-LearnLanguagesforFree"
"*.EclipseManager"
"ActiproSoftwareLLC.562882FEEB491" # Code Writer
"*.AdobePhotoshopExpress"
);
foreach ($app in $applicationList) {
Remove-WindowsApp $app
}
#--- Windows Features ---
Add-WindowsCapability -Online -Name OpenSSH.Client
Add-WindowsCapability -Online -Name IIS-WebServerRole
Add-WindowsCapability -Online -Name Microsoft-Hyper-V-All
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All
Add-WindowsCapability -Online -Name Microsoft-Windows-Subsystem-Linux
Add-WindowsCapability -Online -Name VirtualMachinePlatform
Invoke-RefreshEnvironment
# Shells
scoop install nu starship msys2 alpinewsl
# Setup WSL 2
wsl --set-version Alpine 2
wsl --set-default-version 2
Invoke-RefreshEnvironment
# Azure
scoop install azure-cli azure-functions-core-tools azuredatastudio
# Supplimental
scoop install vcredist2015 vcredist2019
# IDEs & Utils
scoop install nvm yarn nuget oneget
nvm install 13.11.0
nvm use 13.11.0
yarn add global npm
yarn add global npx
# IDEs & Utils
scoop install vscode neovim lighttable Rider
# Setup vscode
code --install-extension eamodio.gitlens
code --install-extension esbenp.prettier-vscode
code --install-extension heaths.vscode-guid
code --install-extension johnpapa.vscode-peacock
code --install-extension karigari.chat
code --install-extension kayteh.plastic-slate
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-dotnettools.csharp
code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-vscode-remote.remote-ssh
code --install-extension ms-vscode-remote.remote-ssh-edit
code --install-extension ms-vscode-remote.remote-wsl
code --install-extension ms-vscode-remote.vscode-remote-extensionpack
code --install-extension ms-vscode.cpptools
code --install-extension ms-vscode.powershell
code --install-extension ms-vscode.vs-keybindings
code --install-extension ms-vsliveshare.vsliveshare
code --install-extension ms-vsliveshare.vsliveshare-audio
code --install-extension ms-vsliveshare.vsliveshare-pack
code --install-extension redhat.vscode-yaml
code --install-extension VisualStudioExptTeam.vscodeintellicode
code --install-extension vscode-icons-team.vscode-icons
code --install-extension will-stone.plastic
# Android
scoop install openjdk adb adopt8-hotspot android-sdk flutter
# Languages
scoop install go rustup dotnet-core-sdk python ruby haxe perl dotnet-script
# Apps / Utils
scoop install windirstat docker posh-docker brave everything firefox gimp github inkscape insomnia postman
#--- Rename the Computer ---
$computername = "myty-surface"
if ($env:computername -ne $computername) {
Rename-Computer -NewName $computername
}
@kiquenet
Copy link

kiquenet commented Dec 9, 2022

Boxstarter utils ?

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