fix: Sac-Client splat syntax for PS 5.1
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+8
-4
@@ -788,7 +788,8 @@ function Send-NotifyOrSac {
|
|||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
$hbDetails = Merge-SacNotifyDetails -Details $Details -TelegramVia 'sac'
|
$hbDetails = Merge-SacNotifyDetails -Details $Details -TelegramVia 'sac'
|
||||||
return (Send-SacEvent @ (Get-SacEventInvokeArgs -EventType $EventType -Severity $Severity -Title $Title -Summary $Summary -Details $hbDetails -OccurredAt $OccurredAt))
|
$sacEventArgs = Get-SacEventInvokeArgs -EventType $EventType -Severity $Severity -Title $Title -Summary $Summary -Details $hbDetails -OccurredAt $OccurredAt
|
||||||
|
return (Send-SacEvent @sacEventArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
@@ -797,16 +798,19 @@ function Send-NotifyOrSac {
|
|||||||
}
|
}
|
||||||
'exclusive' {
|
'exclusive' {
|
||||||
$merged = Merge-SacNotifyDetails -Details $Details -TelegramVia 'sac'
|
$merged = Merge-SacNotifyDetails -Details $Details -TelegramVia 'sac'
|
||||||
return (Send-SacEvent @ (Get-SacEventInvokeArgs -EventType $EventType -Severity $Severity -Title $Title -Summary $Summary -Details $merged -OccurredAt $OccurredAt))
|
$sacEventArgs = Get-SacEventInvokeArgs -EventType $EventType -Severity $Severity -Title $Title -Summary $Summary -Details $merged -OccurredAt $OccurredAt
|
||||||
|
return (Send-SacEvent @sacEventArgs)
|
||||||
}
|
}
|
||||||
'dual' {
|
'dual' {
|
||||||
$merged = Merge-SacNotifyDetails -Details $Details -TelegramVia 'agent'
|
$merged = Merge-SacNotifyDetails -Details $Details -TelegramVia 'agent'
|
||||||
Send-SacEvent @ (Get-SacEventInvokeArgs -EventType $EventType -Severity $Severity -Title $Title -Summary $Summary -Details $merged -OccurredAt $OccurredAt) | Out-Null
|
$sacEventArgs = Get-SacEventInvokeArgs -EventType $EventType -Severity $Severity -Title $Title -Summary $Summary -Details $merged -OccurredAt $OccurredAt
|
||||||
|
Send-SacEvent @sacEventArgs | Out-Null
|
||||||
return (Send-SacLocalChannels -TelegramMessage $TelegramMessage -EmailSubject $EmailSubject)
|
return (Send-SacLocalChannels -TelegramMessage $TelegramMessage -EmailSubject $EmailSubject)
|
||||||
}
|
}
|
||||||
'fallback' {
|
'fallback' {
|
||||||
$merged = Merge-SacNotifyDetails -Details $Details -TelegramVia 'sac'
|
$merged = Merge-SacNotifyDetails -Details $Details -TelegramVia 'sac'
|
||||||
if (Send-SacEvent @ (Get-SacEventInvokeArgs -EventType $EventType -Severity $Severity -Title $Title -Summary $Summary -Details $merged -OccurredAt $OccurredAt)) {
|
$sacEventArgs = Get-SacEventInvokeArgs -EventType $EventType -Severity $Severity -Title $Title -Summary $Summary -Details $merged -OccurredAt $OccurredAt
|
||||||
|
if (Send-SacEvent @sacEventArgs) {
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
return (Send-SacLocalChannels -TelegramMessage $TelegramMessage -EmailSubject $EmailSubject)
|
return (Send-SacLocalChannels -TelegramMessage $TelegramMessage -EmailSubject $EmailSubject)
|
||||||
|
|||||||
Reference in New Issue
Block a user