feat: single deploy startup, stop mode, notification_body 1.2.31-SAC

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-05-31 18:11:18 +10:00
parent a74c8df877
commit e1ae9834a9
4 changed files with 108 additions and 44 deletions
+8 -2
View File
@@ -253,12 +253,18 @@ function Get-SacHostBlock {
hostname = $hostname
os_family = 'windows'
}
if (Get-Variable -Name ServerDisplayName -ErrorAction SilentlyContinue) {
$displayLabel = $hostname
if (Get-Command -Name Get-MonitorServerLabelWithIp -ErrorAction SilentlyContinue) {
$displayLabel = [string](Get-MonitorServerLabelWithIp)
} elseif (Get-Variable -Name ServerDisplayName -ErrorAction SilentlyContinue) {
$label = (Get-Variable -Name ServerDisplayName -ValueOnly)
if (-not [string]::IsNullOrWhiteSpace([string]$label)) {
$hostBlock.display_name = [string]$label.Trim()
$displayLabel = [string]$label.Trim()
}
}
if (-not [string]::IsNullOrWhiteSpace($displayLabel)) {
$hostBlock.display_name = $displayLabel
}
$ipv4 = Get-SacHostIPv4
if (-not [string]::IsNullOrWhiteSpace($ipv4)) {
$hostBlock.ipv4 = $ipv4