Skip to content

Instantly share code, notes, and snippets.

@deevus
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deevus/72383ef731d934ea6b30 to your computer and use it in GitHub Desktop.
Save deevus/72383ef731d934ea6b30 to your computer and use it in GitHub Desktop.
Powershell Script for Bootstrapping Scoop (Powershell 2 will be upgraded to 4.0)

Scoop Bootstrap Script

Use this script to bootstrap an install of Scoop regardless of your version of Powershell

To use run this from Powershell:

iex (new-object net.webclient).downloadstring('http://bit.ly/1ECcuEn')
try {
"Checking powershell version..."
# get psversion
$psversion = $psversiontable.psversion.major
if($psversion -lt 3) {
# update powershell using chocolatey
"Your Powershell is too old, we need to update it."
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install powershell -version 4.0.20141001
"#################################"
"# POWERSHELL HAS BEEN UPDATED #"
"# A REBOOT IS REQUIRED #"
"# RUN THIS AGAIN #"
"# AFTER REBOOTING #"
"#################################"
}
else {
"Powershell is up-to-date."
"Installing Scoop..."
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
}
}
finally {
read-host "Press enter to continue..."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment