Skip to content

Commit 4d7317a

Browse files
feat: add windows installer flag to install from zip (#217)
1 parent d1dbf1e commit 4d7317a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/install.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ param (
22
[Parameter()]
33
[String]$version,
44
[Parameter()]
5+
[String]$zip_dir,
6+
[Parameter()]
57
[String]$observe_collection_endpoint,
68
[Parameter()]
79
[String]$observe_token
@@ -25,7 +27,13 @@ New-Item -ItemType Directory -Force -Path $observeagent_install_dir\config
2527
New-Item -ItemType Directory -Force -Path $observeagent_install_dir\connections
2628
New-Item -ItemType Directory -Force -Path $program_data_filestorage
2729

28-
Invoke-WebRequest -Uri $installer_url -OutFile $local_installer
30+
if ($PSBoundParameters.ContainsKey('zip_dir')){
31+
Write-Output "Installing from provided zip file: $zip_dir..."
32+
$local_installer=$zip_dir
33+
} else {
34+
Write-Output "Downloading observe-agent from $installer_url..."
35+
Invoke-WebRequest -Uri $installer_url -OutFile $local_installer
36+
}
2937

3038
# Stop the observe agent if its running so that we can copy the new .exe
3139
if((Get-Service ObserveAgent -ErrorAction SilentlyContinue)){

0 commit comments

Comments
 (0)