About80Ninjas icon

WindowsSetup

About80Ninjas | PRO | 06/08/17 11:14:28 PM UTC | 0 ⭐ | 417 👁️ | Never ⏰ | []
PowerShell |

1.43 KB

|

None

|

0 👍

/

0 👎

 
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")
 
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎