Skip to content

Instantly share code, notes, and snippets.

@Sourav2005
Last active September 15, 2021 12:46
Show Gist options
  • Save Sourav2005/28e58fc13b00d31aef70374277a869cb to your computer and use it in GitHub Desktop.
Save Sourav2005/28e58fc13b00d31aef70374277a869cb to your computer and use it in GitHub Desktop.
Install Windows 10 script with boxstarter
# Disable Windows Defender
$tools = 'D:\Tools'
Add-MpPreference -exclusionpath "$tools\dControl"
timeout 10 /nobreak
cmd /c "$tools\dControl\dControl.exe" /D
# Change Time Zone
cmd /c tzutil /s "India Standard Time"
# Better way to install winget
# GUI Specs
Write-Host "Checking winget..."
# Check if winget is installed
if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe){
'Winget Already Installed'
}
else{
# Installing winget from the Microsoft Store
Write-Host "Winget not found, installing it now."
Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
$nid = (Get-Process AppInstaller).Id
Wait-Process -Id $nid
Write-Host Winget Installed
}
Invoke-WebRequest https://wpd.app/get/latest.zip -Outfile $env:TEMP\wpd.zip
Expand-Archive -Path $env:TEMP\wpd.zip -DestinationPath $env:TEMP\wpd
Start-Process -Filepath $env:TEMP\wpd -argumentlist "-recommended -close" -wait
Invoke-Expression $tools\Sophia\install.ps1
# Scoop
Invoke-WebRequest -useb get.scoop.sh | Invoke-Expression
scoop install git
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
$restart = Read-Host "Do you want to restart your pc?"
if($restart -eq 'yes'){
Restart-Computer -Force
wsl --update
wsl --set-default-version 2
}else {
exit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment