3 # If a command returns an error, halt the script.
4 $ErrorActionPreference = 'Stop'
6 # Ignore progress events from cmdlets so Invoke-WebRequest is not painfully slow
7 $ProgressPreference = 'SilentlyContinue'
9 # Switch to userprofile
10 pushd $Env:USERPROFILE
12 # Make paths if needed
13 if (!(Test-Path -Path .local\bin))
15 New-Item -Path .local\bin -ItemType Directory
25 # TODO Test-Path variable:global:Env:WEBI_HOST ???
26 IF($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "")
28 $Env:WEBI_HOST = "https://webinstall.dev"
32 echo "$Env:WEBI_HOST/packages/_webi/webi.ps1"
33 curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1.bat" -o webi.bat
34 curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1" -o webi.ps1
39 #TODO Set-ExecutionPolicy -ExecutionPolicy Bypass
40 Invoke-Expression "powershell -ExecutionPolicy Bypass .\.local\bin\webi.ps1 {{ exename }}"
42 # Run pathman to set up the folder
43 #& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\.local\.bin"
44 & "$Env:USERPROFILE\.local\bin\pathman.exe" add .local\.bin