switch from bat to ps1
[webi-installers/.git] / _webi / template.ps1
1 # If a command returns an error, halt the script.
2 $ErrorActionPreference = 'Stop'
3
4 # Ignore progress events from cmdlets so Invoke-WebRequest is not painfully slow
5 $ProgressPreference = 'SilentlyContinue'
6
7 $Env:WEBI_HOST = 'https://webinstall.dev'
8 #$Env:WEBI_PKG = 'node@lts'
9 #$Env:PKG_NAME = node
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"
13
14 # Switch to userprofile
15 pushd $Env:USERPROFILE
16
17 # Make paths if needed
18 if (!(Test-Path -Path Downloads))
19 {
20     New-Item -Path Downloads -ItemType Directory
21 }
22 if (!(Test-Path -Path .local\bin))
23 {
24     New-Item -Path .local\bin -ItemType Directory
25 }
26 if (!(Test-Path -Path .local\opt))
27 {
28     New-Item -Path .local\opt -ItemType Directory
29 }
30
31 # {{ baseurl }}
32 # {{ version }}
33
34 {{ installer }}
35
36 # Done
37 popd