Last active
August 29, 2015 13:57
-
-
Save alvinsim/9699481 to your computer and use it in GitHub Desktop.
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
######################### | |
# Autoinstall script using chocolatey | |
######################### | |
# Note: Net 4.0 must be installed prior to running this script | |
# | |
#Modify this line to change packages | |
$items = @("ccleaner", "microsoftsecurityessentials", "7zip", "adobereader", "javaruntime", "libreoffice", "googlechrome", "firefox", "vim", "teracopy", "winscp", "wget", "putty", "emacs", "hg") | |
################# | |
# Create packages.config based on passed arguments | |
################# | |
$xml = '<?xml version="1.0" encoding="utf-8"?>'+ "`n" +'<packages>' + "`n" | |
foreach ($item in $items) | |
{ | |
$xml += "`t" +'<package id="' + $item + '"/>' + "`n" | |
} | |
$xml += '</packages>' | |
$file = ([system.environment]::getenvironmentvariable("userprofile") + "\packages.config") | |
$xml | out-File $file | |
#### | |
# Install chocolatey | |
#### | |
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) && SET PATH=%PATH%;%systemdrive%\chocolatey\bin | |
###### | |
# Install packages with cinst | |
###### | |
cinst $file | |
######## | |
# Delete packages.config | |
Remove-Item $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment