Created
December 21, 2018 09:33
-
-
Save yrong/dd0966bbcdf6a0477e6a3abdcd16aaeb to your computer and use it in GitHub Desktop.
choco installer
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
### CONFIGURATION | |
### require administator rights | |
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
write-Warning "This setup needs admin permissions. Please run this file as admin." | |
break | |
} | |
### install chocolatey | |
if (Get-Command choco -errorAction SilentlyContinue) { | |
$choco_current_version = (choco --version) | |
write-host "[choco] $choco_current_version detected,ignore install" | |
}else{ | |
write-host "install choco:" | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
} | |
### install apps by choco | |
choco install -y microsoft-build-tools | |
choco install -y git.install | |
choco install -y python2 | |
choco install -y nodejs-lts | |
choco install -y yarn | |
### add app into startup | |
write-host "`n----------------------------" | |
write-host " add app into startup " | |
write-host "----------------------------`n" | |
$StartUp="$Env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" | |
New-Item -ItemType SymbolicLink -Path "$StartUp" -Name "Calculator.lnk" -Value "c:\windows\system32\calc.exe" -ErrorAction SilentlyContinue | |
write-host "Done !" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment