-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish-agent.ps1
More file actions
27 lines (23 loc) · 1.11 KB
/
Copy pathpublish-agent.ps1
File metadata and controls
27 lines (23 loc) · 1.11 KB
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
27
# Publishes the OpsCommandCenter Agent as a single self-contained portable executable.
# The exe IS the installer - deploy it anywhere and run:
# OpsCommandCenterAgent.exe --install --server=http://<server-ip>:5252 --interval=10
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
dotnet publish "src\OpsCommandCenter.Agent\OpsCommandCenter.Agent.csproj" `
-c Release `
-r win-x64 `
--self-contained true `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-p:EnableCompressionInSingleFile=true `
-o "publish"
if ($LASTEXITCODE -ne 0) { throw "Publish failed." }
Remove-Item "publish\OpsCommandCenterAgent.pdb" -ErrorAction SilentlyContinue
$exe = Get-Item "publish\OpsCommandCenterAgent.exe"
Write-Output ("Done: {0} ({1:N1} MB)" -f $exe.FullName, ($exe.Length / 1MB))
Write-Output ""
Write-Output "Silent install command (run elevated on each target PC):"
Write-Output ' OpsCommandCenterAgent.exe --install --server=http://<server-ip>:5252 --interval=10'
Write-Output ""
Write-Output "Silent uninstall command:"
Write-Output ' OpsCommandCenterAgent.exe --uninstall'