1 # If a command returns an error, halt the script.
2 $ErrorActionPreference = 'Stop'
4 # Ignore progress events from cmdlets so Invoke-WebRequest is not painfully slow
5 $ProgressPreference = 'SilentlyContinue'
7 # Switch to userprofile
10 # Make paths if needed
11 if (!(Test-Path -Path .local\bin))
13 New-Item -Path .local\bin -ItemType Directory
23 # TODO Test-Path variable:global:Env:WEBI_HOST ???
26 $Env:WEBI_HOST = "https://webinstall.dev"
30 Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1.bat" -OutFile webi.bat
31 Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1" -OutFile webi.ps1
36 #TODO Set-ExecutionPolicy -ExecutionPolicy Bypass
37 & Invoke-Expression "powershell -ExecutionPolicy Bypass .\.local\bin\webi.ps1 {{ exename }}"
39 # Run pathman to set up the folder
40 #& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\.local\.bin"
41 & "$Env:USERPROFILE\.local\bin\pathman.exe" add .local\.bin