mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
[#6]: Optimise message building for hello message
This commit is contained in:
parent
05633f331f
commit
d515b22255
1 changed files with 15 additions and 15 deletions
|
|
@ -13,6 +13,11 @@ $ClientJobs | Add-Member -membertype ScriptMethod -name 'AddTicks' -value {
|
||||||
$ClientJobs | Add-Member -membertype ScriptMethod -name 'WindowsHello' -value {
|
$ClientJobs | Add-Member -membertype ScriptMethod -name 'WindowsHello' -value {
|
||||||
param([string]$os, [string]$fqdn, [string]$version, [bool]$force);
|
param([string]$os, [string]$fqdn, [string]$version, [bool]$force);
|
||||||
|
|
||||||
|
if ($this.hello_counter -ge 30) {
|
||||||
|
$this.hello_counter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this.hello_counter -eq 0 -Or $force -eq $TRUE) {
|
||||||
[hashtable]$hello = @{
|
[hashtable]$hello = @{
|
||||||
'os' = $os;
|
'os' = $os;
|
||||||
'fqdn' = $fqdn;
|
'fqdn' = $fqdn;
|
||||||
|
|
@ -28,11 +33,6 @@ $ClientJobs | Add-Member -membertype ScriptMethod -name 'WindowsHello' -value {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this.hello_counter -ge 30) {
|
|
||||||
$this.hello_counter = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this.hello_counter -eq 0 -Or $force -eq $TRUE) {
|
|
||||||
$response = $Icinga2.ClientProtocol.NewRequest(
|
$response = $Icinga2.ClientProtocol.NewRequest(
|
||||||
@('X-Windows-Hello: 1'),
|
@('X-Windows-Hello: 1'),
|
||||||
($hello | ConvertTo-Json -Depth 2 -Compress),
|
($hello | ConvertTo-Json -Depth 2 -Compress),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue