Created
April 24, 2019 09:25
-
-
Save stuartpreston/3446ff41a69d1a139cd330f2043e7514 to your computer and use it in GitHub Desktop.
Habitat install/update one-liner
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
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; Remove-Item $env:ProgramData\habitat -Recurse -Force -ErrorAction Ignore; $s = "https://api.bintray.com/content/habitat/stable/windows/x86_64/hab-%24latest-x86_64-windows.zip?bt_package=hab-x86_64-windows"; (New-Object System.Net.WebClient).DownloadFile($s, "$env:TEMP\habitat.zip"); Expand-Archive $env:TEMP\habitat.zip -DestinationPath $env:ProgramData -Force; Get-ChildItem -Path $env:ProgramData -Filter "hab-*" -Depth 1 | Select-Object -First 1 | Rename-Item -NewName habitat -Force; [Environment]::SetEnvironmentVariable("PATH", "$env:ProgramData\habitat;$env:SystemDrive\hab\bin;$env:PATH", "Machine"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment