use WEBI_HOST rather than webinstall.dev
[webi-installers/.git] / _webi / bootstrap.ps1
index 020d6b7f1f9f05a43715fb2650753e035d88a31f..8ec299c8e685fe0761891df40e2b38e2e1d632cb 100644 (file)
@@ -1,3 +1,5 @@
+#!/usr/bin/env pwsh
+
 # If a command returns an error, halt the script.
 $ErrorActionPreference = 'Stop'
 
@@ -21,7 +23,7 @@ pushd .local\bin
 
 # TODO SetStrictMode
 # TODO Test-Path variable:global:Env:WEBI_HOST ???
-IF(!$Env:WEBI_HOST)
+IF(!($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "")) {
 {
     $Env:WEBI_HOST = "https://webinstall.dev"
 }
@@ -32,8 +34,9 @@ Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1" -OutFile webi.ps1
 
 popd
 
-# Run webi.bat
-& .\.local\bin\webi.bat {{ exename }}
+# Run webi.ps1
+#TODO Set-ExecutionPolicy -ExecutionPolicy Bypass
+Invoke-Expression "powershell -ExecutionPolicy Bypass .\.local\bin\webi.ps1 {{ exename }}"
 
 # Run pathman to set up the folder
 #& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\.local\.bin"