Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(Test-IsAdmin -eq $false){
- throw "Please run this script with admin priviliges"
- }
- #Set proxy credentials
- [System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials;
- #Test if chocolatey is installed
- try{
- $null = choco
- } catch {
- #install chocolatey
- iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- # Find Chocolatey install and set working directory
- # so we dont need to restart the host console
- $Path = [Environment]::GetEnvironmentVariable('ChocolateyInstall')
- if($Path = $null){
- throw 'Unable to find chocolatey'
- }
- Set-Location -Path $Path
- }
- $Programs = {
- #Remove the # to install
- #IDEs
- 'intellijidea-community',
- 'SpringToolSuite',
- #'intellijidea-ultimate',
- #'eclipse', # Current version
- #'eclipse-java-neon', # 4.5.1
- #'eclipse-java-luna', # 4.4
- #'VisualStudioCode',
- #Tools
- 'git',
- 'python',
- 'maven',
- 'Tomcat',
- #'python',
- #'gradle',
- #'yo', # http://yeoman.io/
- 'jre8',
- 'jdk8'
- }
- #Install programs
- foreach($Program in $Programs){
- choco install -y $Program
- }
- #Helper
- function Test-IsAdmin {
- ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement