concourse/docs

Quick Start - Powershell section examples (script and one-liner)

instance-id opened this issue · 1 comments

Here are a few examples for the missing PowerShell portion of the Quick Start Guide:

Script: flyinstall.ps1 (Run As Admin)
# flyinstall.ps1

# -- Desired fly.exe location -----------
$concoursePath = 'C:\concourse\'
mkdir $concoursePath

# -- Sets User Env Variable -------------
[Environment]::SetEnvironmentVariable('PATH', "$ENV:PATH;${concoursePath}", 'USER')

# -- Sets System Env Variable -----------
# [Environment]::SetEnvironmentVariable("PATH", "$ENV:PATH;${concoursePath}", "MACHINE")

# -- Download fly.exe -------------------
$concourseURL = 'http://localhost:8080/api/v1/cli?arch=amd64&platform=windows'
Invoke-WebRequest $concourseURL -OutFile "${concoursePath}\fly.exe"
One-liner (Run As Admin)
$concoursePath = 'C:\concourse\'; mkdir $concoursePath; `
    [Environment]::SetEnvironmentVariable('PATH', "$ENV:PATH;${concoursePath}", 'USER'); `
    $concourseURL = 'http://localhost:8080/api/v1/cli?arch=amd64&platform=windows'; `
    Invoke-WebRequest $concourseURL -OutFile "${concoursePath}\fly.exe"

Thanks for this, I added it to the docs