add shebang to all .ps1
[webi-installers/.git] / _webi / webi.ps1
index 3e302420babbc85050d8da3a2ecf2e1590bf0d69..21a4e957966f794c200d91c58af903b775031c56 100644 (file)
@@ -1,4 +1,6 @@
-# If a command returns an error, halt the script.
+#!/usr/bin/env pwsh
+
+# If a command returns an error, halt the script.
 $ErrorActionPreference = 'Stop'
 
 # Ignore progress events from cmdlets so Invoke-WebRequest is not painfully slow
@@ -26,6 +28,13 @@ if (!(Test-Path -Path .local\tmp))
     New-Item -Path .local\tmp -ItemType Directory
 }
 
+# TODO SetStrictMode
+# TODO Test-Path variable:global:Env:WEBI_HOST ???
+IF(!$Env:WEBI_HOST)
+{
+    $Env:WEBI_HOST = "https://webinstall.dev"
+}
+
 if (!(Test-Path -Path .local\bin\pathman.exe))
 {
     & curl.exe -fsSL -A "$Env:WEBI_UA" "$Env:WEBI_HOST/packages/pathman/install.ps1" -o .\.local\tmp\pathman-setup.ps1