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 $Env:WEBI_HOST = 'https://webinstall.dev'
8 #$Env:WEBI_PKG = 'node@lts'
10 #$Env:WEBI_VERSION = v12.16.2
11 #$Env:WEBI_PKG_URL = "https://.../node-....zip"
12 #$Env:WEBI_PKG_FILE = "node-v12.16.2-win-x64.zip"
14 # Switch to userprofile
15 pushd $Env:USERPROFILE
17 # Make paths if needed
18 if (!(Test-Path -Path Downloads))
20 New-Item -Path Downloads -ItemType Directory
22 if (!(Test-Path -Path .local\bin))
24 New-Item -Path .local\bin -ItemType Directory
26 if (!(Test-Path -Path .local\opt))
28 New-Item -Path .local\opt -ItemType Directory