| 1 |
echo "" |
| 2 |
$install_dir = join-path $env:ProgramW6432 "Smallstep Labs" |
| 3 |
echo "Installing step: '$install_dir'" |
| 4 |
mkdir $install_dir >$null |
| 5 |
echo "" |
| 6 |
$exe_file = join-path $install_dir "step.exe" |
| 7 |
curl.exe -L -o $exe_file https://files.smallstep.com/step-windows-${CLI_VERSION}.exe |
| 8 |
$uninstall_file = join-path $install_dir "uninstall-step.ps1" |
| 9 |
curl.exe -L -o $uninstall_file https://files.smallstep.com/uninstall-step.ps1 |
| 10 |
echo "" |
| 11 |
echo 'Adding step.exe to the Machine $Path' |
| 12 |
$path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") |
| 13 |
$path = @($Env:Path.split(";") | where {$_ -ne $install_dir}) -join ";" |
| 14 |
[System.Environment]::SetEnvironmentVariable("Path", $path + ";$install_dir", "Machine") |
| 15 |
echo "" |
| 16 |
echo "Enabling ssh-agent..." |
| 17 |
Set-Service -Name ssh-agent -StartupType Automatic |
| 18 |
Start-Service ssh-agent |
| 19 |
Get-Service ssh-agent | Select Name, Status, StartType |
| 20 |
echo "" |
| 21 |
echo "Please restart shell sessions to pickup path changes." |