Skip to content

Instantly share code, notes, and snippets.

@iogeek
Last active April 11, 2024 21:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save iogeek/ad0e7707b4af3329641b431bdca8eae0 to your computer and use it in GitHub Desktop.
Save iogeek/ad0e7707b4af3329641b431bdca8eae0 to your computer and use it in GitHub Desktop.
setup Windows dev PC
# MIT License
# Copyright (c) 2022 robbieh
# See https://mit-license.org/ for details about MIT License
# Prep WSL
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
### Make it mine
# Timeout / battery prefs
powercfg /Change monitor-timeout-ac 5
powercfg /Change standby-timeout-ac 0
powercfg /Change monitor-timeout-dc 5
powercfg /Change standby-timeout-dc 30
# Hibernate
powercfg.exe /hibernate on
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSetting" /v ShowHibernateOption /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v ShowHibernateOption /t REG_DWORD /d 1 /f
# Mouse
reg add "HKCU\Control Panel\Mouse" /v MouseSensitivity /t REG_SZ /d 20 /f
reg add "HKCU\Control Panel\Mouse" /v MouseSpeed /t REG_SZ /d 1 /f
reg add "HKCU\Control Panel\Mouse" /v MouseTrails /t REG_SZ /d 7 /f
# Mouse pointer size to 3
reg add "HKCU\Software\Microsoft\Accessibility" /v CursorSize /t REG_DWORD /d 3 /f
# Powershell here menu
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLinkedConnections /t REG_DWORD /d 00000001 /f
reg add HKCR\Directory\shell\powershellmenu /d "Open PowerShell Here" /f
reg add HKCR\Directory\shell\powershellmenu\command /d "powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'" /f
# Powershell fonts
$psList= '%SystemRoot%_SysWOW64_WindowsPowerShell_v1.0_powershell.exe', 'HKCU\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe'
foreach ($i in $psList) {
reg add "HKCU\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe" /v FaceName /t REG_SZ /d "Consolas" /f
reg add "HKCU\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe" /v FontFamily /t REG_DWORD /d 54 /f
reg add "HKCU\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe" /v FontSize /t REG_DWORD /d 917504 /f
reg add "HKCU\Console\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe" /v FontWeight /t REG_DWORD /d 400 /f
}
## Install Some apps
# Using winGet.... Finally. Package install in Windows 11
# winmerge search / winmerge upgrade -h --all
$appList= @('git.git',
'Microsoft.VisualStudioCode', 'Microsoft.VisualStudio.2022.Community',
'ArduinoSA.cli', 'winmerge.winmerge',
'StefansTools.grepWin', '7zip.7zip', 'Joplin.Joplin',
'TeraTermProject.teraterm'
#'Mobatek.MobaXterm'
);
# interesting packages RaspberryPiFoundation.RaspberryPiImager, zoom.zoom
# Mozilla.Firefox, Opera.Opera, Google.Chrome, LibreWolf.LibreWolf
# GitHub.cli, GitHub.GitHubDesktop
# ArduinoSA.IDE.stable
# FastStone.Viewer, Inkscape.Inkscape
foreach ($a in $appList) {
Write-Host $a
winget install --silent --accept-package-agreements --accept-source-agreements $a
}
# https://mermaid-js.github.io/mermaid
# dprecate manually injecting vscode extensions as these all get pickup the cloud / sync is enabled
# Code extensions
#code --install-extension ms-dotnettools.csharp
#code --install-extension ms-python.python
#code --install-extension ms-vscode.powershell
#code --install-extension ms-vscode.cpptools
#code --install-extension ms-vscode-remote.remote-wsl
#code --install-extension ms-vscode-remote.remote-ssh
#code --install-extension docsmsft.docs-markdown
# docsmsft.docs-images docsmsft.docs-yaml
# code --install-extension jebbs.plantuml
#code --install-extension platformio.platformio-ide
#code --install-extension redhat.vscode-xml
#code --install-extension sissel.shopify-liquid
#code --install-extension streetsidesoftware.code-spell-checker
#code --install-extension vsciot-vscode.vscode-arduino
#code --install-extension yiwwan.vscode-scope
# keep defender away from known good
Add-MpPreference -ExclusionPath D:\ScopePrj, d:\git -Force
#Add-MpPreference -ExclusionExtension obj, lib, c, cpp, cs, h, kql, script -Force
Add-MpPreference -ExclusionProcess code.exe, devenv.exe -Force
# Azure cli
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi
# Who doesn't love WSL
wsl --install -d ubuntu
Write-Host "All done! Now reboot for settings to take!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment