Skip to content

Instantly share code, notes, and snippets.

@carstengehling
Last active May 22, 2024 10:42
Show Gist options
  • Save carstengehling/4b4dd5bcb62a695d57875f873e779747 to your computer and use it in GitHub Desktop.
Save carstengehling/4b4dd5bcb62a695d57875f873e779747 to your computer and use it in GitHub Desktop.
Powershell script to install vital apps and behaviours on a fresh Windows 11 install
# Remove Windows 11 crapware
winget uninstall "Cortana" --silent --accept-source-agreements
winget uninstall "Disney+" --silent --accept-source-agreements
winget uninstall "Mail and Calendar" --silent --accept-source-agreements
winget uninstall "Microsoft News" --silent --accept-source-agreements
winget uninstall "Microsoft OneDrive" --silent --accept-source-agreements
winget uninstall "Microsoft Tips" --silent --accept-source-agreements
winget uninstall "MSN Weather" --silent --accept-source-agreements
winget uninstall "Movies & TV" --silent --accept-source-agreements
winget uninstall "Office" --silent --accept-source-agreements
winget uninstall "Spotify Music" --silent --accept-source-agreements
winget uninstall "Windows Maps" --silent --accept-source-agreements
winget uninstall "Xbox TCUI" --silent --accept-source-agreements
winget uninstall "Xbox Game Bar Plugin" --silent --accept-source-agreements
winget uninstall "Xbox Game Bar" --silent --accept-source-agreements
winget uninstall "Xbox Identity Provider" --silent --accept-source-agreements
winget uninstall "Xbox Game Speech Windows" --silent --accept-source-agreements
# Remove Widgets board
Get-AppxPackage -AllUsers | Where-Object {$_.Name -like "*WebExperience*"} | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
# Install Chocolatey and from there install all apps needed
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
choco install notepadplusplus
choco install 7zip
choco install vim
choco install git
choco install gitversion
choco install gitversion.portable
choco install f.lux.install
choco install gimp
choco install totalcommander
choco install winmerge
choco install forticlientvpn
choco install lazygit
choco install rdcman
choco install sumatrapdf.install
choco install inkscape
choco install fiddler
choco install dnspy
choco install keypirinha
choco install sharex
choco install microsoft-teams
choco install GoogleChrome
choco install visualstudio2022professional
choco install dellcommandupdate
choco install jabra-direct
choco install wacom-drivers
choco install postman
choco install sql-server-management-studio
choco install slack
choco install soapui
choco install fontforge
choco install nswagstudio
refreshenv
# Setup git environment
Install-PackageProvider NuGet -Force;
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module git-aliases -Scope CurrentUser -AllowClobber
git config --global user.name "Carsten Gehling"
git config --global user.email "cg@airsupport.dk"
# Disable CAPS-LOCK
Set-Itemproperty -path 'HKLM:SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Type Binary -Name 'Scancode Map' -value ([byte[]] (00,00,00,00,00,00,00,00,02,00,00,00,00,00,0x3A,00,00,00,00,00))
# Mapped drives
md -Force C:\repos
Set-ItemProperty -Path 'HKLM:SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices' -Name 'R:' -Value '\??\C:\repos'
md -Force C:\work
Set-ItemProperty -Path 'HKLM:SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices' -Name 'W:' -Value '\??\C:\work'
# Bring back old explorer context menu
New-Item -Path 'HKCU:SOFTWARE\CLASSES\CLSID' -Name '{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}'
New-Item -Path 'HKCU:SOFTWARE\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}' -Name 'InprocServer32'
Set-ItemProperty -Path 'HKCU:SOFTWARE\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32' -Name '(Default)' -Value ''
Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment