Created
November 1, 2025 00:44
-
-
Save han-minhee/8e43e6eb0afa468f336653251cea5aee to your computer and use it in GitHub Desktop.
Install basic setup after install Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Requires Administrator privileges | |
| # ------------------------------- | |
| # 1. Allow running this script | |
| # ------------------------------- | |
| Set-ExecutionPolicy Bypass -Scope Process -Force | |
| Write-Host "Execution policy set to Bypass for this session." | |
| # ------------------------------- | |
| # 2. Ensure package managers exist | |
| # ------------------------------- | |
| # Check for winget | |
| if (-not (Get-Command winget -ErrorAction SilentlyContinue)) { | |
| Write-Host "Winget not found. Installing App Installer from Microsoft Store..." | |
| Invoke-WebRequest -Uri "https://aka.ms/getwinget" -OutFile "$env:TEMP\AppInstaller.msixbundle" | |
| Add-AppxPackage "$env:TEMP\AppInstaller.msixbundle" | |
| } | |
| # Check for Chocolatey | |
| if (-not (Get-Command choco -ErrorAction SilentlyContinue)) { | |
| Write-Host "Chocolatey not found. Installing..." | |
| Set-ExecutionPolicy Bypass -Scope Process -Force | |
| [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 | |
| Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | |
| } | |
| # Helper function for installing via winget or choco | |
| function Install-App { | |
| param( | |
| [string]$wingetName, | |
| [string]$chocoName | |
| ) | |
| Write-Host "Installing or upgrading $wingetName..." | |
| try { | |
| winget install --id $wingetName -e --source winget -h --accept-source-agreements --accept-package-agreements | |
| } catch { | |
| Write-Host "Winget install failed. Trying Chocolatey..." | |
| choco install $chocoName -y | |
| } | |
| } | |
| # ------------------------------- | |
| # 3. Install all applications | |
| # ------------------------------- | |
| $appList = @( | |
| @{winget='Bandisoft.Bandizip'; choco='bandizip'}, | |
| @{winget='DAUM.PotPlayer'; choco='potplayer'}, | |
| @{winget='Kakao.KakaoTalk'; choco='kakaotalk'}, | |
| @{winget='Microsoft.VisualStudioCode'; choco='vscode'}, | |
| @{winget='Microsoft.VisualStudio.2022.Community'; choco='visualstudio2022community'}, | |
| @{winget='Mozilla.Firefox'; choco='firefox'}, | |
| @{winget='Google.Chrome'; choco='googlechrome'}, | |
| @{winget='FVM.FVM'; choco='fvm'}, | |
| @{winget='CoreyButler.NVMforWindows'; choco='nvm.portable'}, | |
| @{winget='Google.AndroidStudio'; choco='androidstudio'}, | |
| @{winget='Rustlang.Rustup'; choco='rust'}, | |
| @{winget='Microsoft.WSL'; choco='wsl'}, | |
| @{winget='Microsoft.PowerShell'; choco='powershell'} | |
| ) | |
| foreach ($app in $appList) { | |
| Install-App -wingetName $app.winget -chocoName $app.choco | |
| } | |
| # ------------------------------- | |
| # 4. Post-install setup | |
| # ------------------------------- | |
| Write-Host "`nAll installations complete." | |
| # Optional: Ensure WSL2 enabled | |
| if ((Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux).State -ne "Enabled") { | |
| Write-Host "Enabling WSL and Virtual Machine Platform..." | |
| dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
| dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
| wsl --set-default-version 2 | |
| } | |
| Write-Host "`nSetup finished successfully." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Set-ExecutionPolicy Bypass -Scope Process -Forcemight have to be seperately run before running the script