Last active
November 7, 2015 04:32
-
-
Save spf13/206a1be3f98f9d72c4a8 to your computer and use it in GitHub Desktop.
Windows autoinstaller of programs using chocolatey. (Remove last line if you need to keep track of which packages were installed)
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
# Run the following line to execute this script | |
#@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/spf13/206a1be3f98f9d72c4a8/raw/15b8000d565f1370763a1826573be51541af682b/win_autoinstall_chocolatey.ps1')) | |
######################### | |
# Autoinstall script using chocolatey | |
######################### | |
# Note: Net 4.0 must be installed prior to running this script | |
# | |
#Modify this line to change packages | |
$items = @("GoogleChrome", "skype", "vlc", "quicktime", "flashplayerplugin", "javaruntime", "DotNet4.5", "dropbox", "Teracopy", "7zip.install", notepadplusplus.install", "git.install", "ConEmu", "cpu-z", "f.lux", "ffmpeg", "golang", "hg", "KickAssVim", "poweriso", "linkshellextension", "lastpass", "ConsoleZ", "SourceTree", "putty", "vim", "svn", "wget", "winscp", "windirstat", "speccy", "ctags", "ChocolateyGUI") | |
################# | |
# 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')) | |
###### | |
# 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