Skip to content

Instantly share code, notes, and snippets.

@howiezhao
Last active November 2, 2023 02:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save howiezhao/0f8edd961c45d3d886fcbed97064df0e to your computer and use it in GitHub Desktop.
Save howiezhao/0f8edd961c45d3d886fcbed97064df0e to your computer and use it in GitHub Desktop.
A Windows11 new environment installation script
Write-Output "---------------A Windows11 new environment installation script---------------"
Write-Output "---------------Install and Run: Invoke-Expression (Invoke-WebRequest url)---------------"
Write-Output "---------------First you need to login Microsoft account to sync settings and Microsoft Store Apps!---------------"
Write-Output "---------------winget will be downloaded from the Microsoft Store, and then the following script can be executed---------------"
Write-Output "---------------Configure Windows11 environment:---------------"
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Value 1
Enable-WindowsOptionalFeature -Online -FeatureName "TelnetClient"
Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux"
Enable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform"
Write-Output "---------------Install and configure development environment:---------------"
winget install Python.Python OpenJS.NodeJS.LTS
Write-Output "---------------Install command line software from winget:---------------"
Write-Output "---------------Install GUI software from winget:---------------"
winget install 7zip.7zip Google.Chrome SublimeHQ.SublimeText.4 Daum.Potplayer \
Meld.Meld nmap WiresharkFoundation.Wireshark obs-studio dismplusplus proxifier-portable teamviewer JetBrains.Toolbox \
Microsoft.PowerToys Tencent.WeChat XunLei.xunleix Tencent.QQ Valve.Steam qBittorrent.qBittorrent VMware.WorkstationPro \
OpenVPNTechnologies.OpenVPN Microsoft.Office Mozilla.Firefox Docker.DockerDesktop Postman.Postman Git.Git JanDeDobbeleer.OhMyPosh \
Microsoft.VisualStudio.2022.Community
Write-Output "---------------Install PowerShell Module from PowerShell Gallery:---------------"
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
Install-Module posh-git DockerCompletion windows-screenfetch Carbon -Scope CurrentUser
Install-Module PSReadLine -Force -Scope CurrentUser
Write-Output "---------------Install WSL2:---------------"
wsl --update
wsl --shutdown
wsl --install --distribution Ubuntu
Write-Output "---------------Post Install:---------------"
mkdir $HOME/work
git config --global user.email "howiezhaohr@hotmail.com"
git config --global user.name "howiezhao"
git config --global icdiff.options '--highlight --line-numbers'
git clone git@gist.github.com:0f8edd961c45d3d886fcbed97064df0e.git $HOME/github/gist/0f8edd961c45d3d886fcbed97064df0e
git clone git@github.com:howiezhao/dotfiles.git $HOME/github/dotfiles
Write-Output "---------------Then you should manual install JDK!---------------"
Write-Output "---------------Successful!---------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment