diff --git a/public_html/agent/install-windows.ps1 b/public_html/agent/install-windows.ps1 index 2e33dd5..bae0543 100644 --- a/public_html/agent/install-windows.ps1 +++ b/public_html/agent/install-windows.ps1 @@ -10,11 +10,16 @@ # irm https://jarvis.orbishosting.com/agent/install-windows.ps1 | iex param( - [string]$JarvisUrl = "https://jarvis.orbishosting.com", - [string]$Key = "f846a9aaf7ce9a61742c63c87c4186052a71d2a580c65518", - [string]$AgentName = $env:COMPUTERNAME.ToLower() + [string]$JarvisUrl = "", + [string]$Key = "", + [string]$AgentName = "" ) +# param() defaults don't apply when piped through iex — set here as fallback +if (-not $JarvisUrl) { $JarvisUrl = "https://jarvis.orbishosting.com" } +if (-not $Key) { $Key = "f846a9aaf7ce9a61742c63c87c4186052a71d2a580c65518" } +if (-not $AgentName) { $AgentName = $env:COMPUTERNAME.ToLower() } + $ErrorActionPreference = "Stop" $InstallDir = "C:\ProgramData\jarvis-agent" $AgentScript = "$InstallDir\jarvis-agent-windows.py"