Skip to content

Instantly share code, notes, and snippets.

@natsukium
Last active March 12, 2020 13:40
Show Gist options
  • Save natsukium/8c08c4b9661a9d8f99d29d5174fa0e29 to your computer and use it in GitHub Desktop.
Save natsukium/8c08c4b9661a9d8f99d29d5174fa0e29 to your computer and use it in GitHub Desktop.
Update-ExecutionPolicy -Policy RemoteSigned
Disable-UAC
Disable-BingSearch
Disable-GameBarTips
# Dark Mode
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name ColorPrevalence -Value 0 -Type Dword -Force
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0 -Type Dword -Force
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Set-TaskbarOptions -Size Small -Dock Top -Combine Full -Lock
# CapsLock -> Ctrl
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" `
-name "Scancode Map" -Value ([byte[]](`
0x00,0x00,0x00,0x00,`
0x00,0x00,0x00,0x00,`
0x02,0x00,0x00,0x00,`
0x1d,0x00,0x3a,0x00,`
0x00,0x00,0x00,0x00))
# Setup WSL
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
choco install Microsoft-Windows-Subsystem-Linux -source windowsfeatures
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubuntu.appx -UseBasicParsing
Add-AppxPackage -Path ~/Ubuntu.appx
RefreshEnv
Ubuntu1804 install --root
Ubuntu1804 run apt update
Ubuntu1804 run apt upgrade -y
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-version Ubuntu18.04 2
wsl --set-default-version 2
# Remove unnecessary apps
function removeApp {
Param ([string]$appName)
Write-Output "Trying to remove $appName"
Get-AppxPackage $appName -AllUsers | Remove-AppxPackage
Get-AppXProvisionedPackage -Online | Where-Object DisplayName -like $appName | Remove-AppxProvisionedPackage -Online
}
$removeApps = @(
"Microsoft.3DBuilder"
"Microsoft.BingFinance"
"Microsoft.BingNews"
"Microsoft.BingSports"
"Microsoft.BingWeather"
"Microsoft.CommsPhone"
"Microsoft.Getstarted"
"Microsoft.People"
"Microsoft.WindowsMaps"
"*MarchofEmpires*"
"Microsoft.GetHelp"
"Microsoft.Messaging"
"*Minecraft*"
"Microsoft.MicrosoftOfficeHub"
"Microsoft.OneConnect"
"Microsoft.WindowsAlarms"
"Microsoft.WindowsCamera"
"microsoft.windowscommunicationsapps"
"Microsoft.WindowsPhone"
"Microsoft.WindowsSoundRecorder"
"*Solitaire*"
"Microsoft.MicrosoftStickyNotes"
"Microsoft.Office.Sway"
"Microsoft.Xbox*"
"Microsoft.YourPhone"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
"Microsoft.NetworkSpeedTest"
"Microsoft.FreshPaint"
"Microsoft.Print3D"
"Microsoft.MSPaint"
"Microsoft.WindowsFeedbackHub"
"Microsoft.MixedReality.Portal"
"Microsoft.Windows.Photos"
"*Autodesk*"
"*BubbleWitch*"
"king.com*"
"G5*"
"*Dell*"
"*Facebook*"
"*Keeper*"
"*Netflix*"
"*Twitter*"
"*Plex*"
"*.Duolingo-LearnLanguagesforFree"
"*.EclipseManager"
"ActiproSoftwareLLC.562882FEEB491" # Code Writer
"*.AdobePhotoshopExpress"
);
foreach ($app in $removeApps) {
removeApp $app
}
$addApps = @(
"alacritty"
"autohotkey"
"docker-desktop"
"git"
"google-backup-and-sync"
"googlechrome"
"hackfont"
"keypirinha"
"kindle"
"line"
"typora"
"ultravnc"
"vivaldi"
"vscode"
"winscreenfetch"
)
foreach ($app in $addApps) {
choco install -y $app
}
Remove-Item .\Desktop\*
Enable-MicrosofUpdate
Install-WindowsUpdate -acceptEula
Enable-UAC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment