-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
26 lines (24 loc) · 749 Bytes
/
Copy pathinstall.ps1
File metadata and controls
26 lines (24 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Param(
[Parameter(ValueFromRemainingArguments=$true)]
$RemainingArgs
)
$local = Join-Path $PSScriptRoot "scripts\install.ps1"
$raw = "https://raw.githubusercontent.com/loganbek/1install/main/scripts/install.ps1"
if (Test-Path $local) {
Write-Output "Running local $local"
& $local @RemainingArgs
} else {
Write-Output "Fetching installer from $raw"
if (Get-Command iwr -ErrorAction SilentlyContinue) {
iwr -UseBasicParsing -Uri $raw | iex
} else {
try {
$wc = New-Object System.Net.WebClient
$script = $wc.DownloadString($raw)
Invoke-Expression $script
} catch {
Write-Error "Failed to download installer: $_"
exit 1
}
}
}