Last active
January 21, 2020 17:14
-
-
Save samalone/70d1731fa642f07f4915b2da203e6403 to your computer and use it in GitHub Desktop.
PowerShell script to set up Windows 10 for Antigen Plus development
This file contains 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
# Based on https://edi.wang/post/2018/12/21/automate-windows-10-developer-machine-setup | |
# and https://github.com/EdiWang/EnvSetup/ | |
Set-ExecutionPolicy RemoteSigned | |
function Check-Command($cmdname) { | |
return [bool](Get-Command -Name $cmdname -ErrorAction SilentlyContinue) | |
} | |
Write-Host "" | |
Write-Host "Disable Sleep on AC Power..." -ForegroundColor Green | |
Write-Host "------------------------------------" -ForegroundColor Green | |
Powercfg /Change monitor-timeout-ac 20 | |
Powercfg /Change standby-timeout-ac 0 | |
Write-Host "" | |
Write-Host "Add 'This PC' Desktop Icon..." -ForegroundColor Green | |
Write-Host "------------------------------------" -ForegroundColor Green | |
$thisPCIconRegPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" | |
$thisPCRegValname = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" | |
$item = Get-ItemProperty -Path $thisPCIconRegPath -Name $thisPCRegValname -ErrorAction SilentlyContinue | |
if ($item) { | |
Set-ItemProperty -Path $thisPCIconRegPath -name $thisPCRegValname -Value 0 | |
} | |
else { | |
New-ItemProperty -Path $thisPCIconRegPath -Name $thisPCRegValname -Value 0 -PropertyType DWORD | Out-Null | |
} | |
Write-Host "" | |
Write-Host "Removing Edge Desktop Icon..." -ForegroundColor Green | |
Write-Host "------------------------------------" -ForegroundColor Green | |
$edgeLink = $env:USERPROFILE + "\Desktop\Microsoft Edge.lnk" | |
Remove-Item $edgeLink | |
# To list all appx packages: | |
# Get-AppxPackage | Format-Table -Property Name,Version,PackageFullName | |
Write-Host "Removing UWP Rubbish..." -ForegroundColor Green | |
Write-Host "------------------------------------" -ForegroundColor Green | |
$uwpRubbishApps = @( | |
"Microsoft.Messaging", | |
"king.com.CandyCrushSaga", | |
"Microsoft.BingNews", | |
"Microsoft.MicrosoftSolitaireCollection", | |
"Microsoft.People", | |
"Microsoft.WindowsFeedbackHub", | |
"Microsoft.YourPhone", | |
"Fitbit.FitbitCoach", | |
"4DF9E0F8.Netflix", | |
"Microsoft.XboxGameOverlay") | |
foreach ($uwp in $uwpRubbishApps) { | |
Get-AppxPackage -Name $uwp | Remove-AppxPackage | |
} | |
if (Check-Command -cmdname 'choco') { | |
Write-Host "Choco is already installed, skip installation." | |
} | |
else { | |
Write-Host "" | |
Write-Host "Installing Chocolate for Windows..." -ForegroundColor Green | |
Write-Host "------------------------------------" -ForegroundColor Green | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
} | |
# Install Visual Studio | |
choco upgrade visualstudio2019professional -y --no-progress | |
choco upgrade visualstudio2019-workload-azure -y --no-progress | |
choco upgrade visualstudio2019-workload-manageddesktop -y --no-progress | |
choco upgrade visualstudio2019-workload-data -y --no-progress | |
choco upgrade visualstudio2019-workload-netweb -y --no-progress | |
choco upgrade visualstudio2019-workload-visualstudioextension -y --no-progress | |
# Install-ChocolateyVsixPackage -PackageName "githubextensionforvisualstudio" -VsixUrl https://github.gallerycdn.vsassets.io/extensions/github/githubextensionforvisualstudio/2.10.8.8132/1572065776561/GitHub.VisualStudio-v2.10.8.8132.vsix | |
choco upgrade dotnet3.5 -y --no-progress | |
choco upgrade git -y --no-progress | |
choco upgrade wixtoolset -y --no-progress | |
choco upgrade sql-server-management-studio -y --no-progress | |
choco upgrade winmerge -y --no-progress | |
choco upgrade tortoisegit -y --no-progress | |
choco upgrade resharper -y --no-progress | |
#choco upgrade sql-server-express -y --no-progress | |
choco upgrade sql-server-express -y --no-progress --install-arguments="'/IACCEPTSQLSERVERLICENSETERMS /Q /ACTION=Patch /allinstances /UPDATEENABLED=TRUE'" --override-arguments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment