From 744f254c093e907f1cf28058eb8e1d8b008019bd Mon Sep 17 00:00:00 2001 From: PTah Date: Fri, 22 May 2026 16:02:05 +1000 Subject: [PATCH] fix(Exchange): define Get-ExchangeInboxScanScopeLabel before InstallTasks (v1.6.6) --- Exchange-MailSecurity.ps1 | 22 +++++++++++----------- version.txt | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Exchange-MailSecurity.ps1 b/Exchange-MailSecurity.ps1 index 6074054..8000ec2 100644 --- a/Exchange-MailSecurity.ps1 +++ b/Exchange-MailSecurity.ps1 @@ -25,7 +25,7 @@ $ErrorActionPreference = 'Stop' # КОНФИГУРАЦИЯ # ============================================ -$ScriptVersion = '1.6.5' +$ScriptVersion = '1.6.6' $script:InstallRoot = [System.IO.Path]::GetFullPath("$env:ProgramData\RDP-login-monitor") $script:CanonicalScriptName = 'Exchange-MailSecurity.ps1' $LogFile = Join-Path $script:InstallRoot 'Logs\exchange_mail_security.log' @@ -202,6 +202,16 @@ Initialize-NotifyCredentials -TelegramBotTokenProtectedB64 $TelegramBotTokenProt if ($TelegramBotToken -eq '') { $TelegramBotToken = '' } if ($TelegramChatID -eq '') { $TelegramChatID = '' } +function Get-ExchangeInboxScanScopeLabel { + if (-not $VipMailboxesOnly) { + if ($MaxMailboxesPerRun -gt 0) { return "all mailboxes (limit $MaxMailboxesPerRun)" } + return 'all mailboxes' + } + $n = @($VipMailboxes | Where-Object { $_ }).Count + $p = @($VipMailboxPatterns | Where-Object { $_ }).Count + return "VIP list=$n patterns=$p" +} + function Send-ExchangeInstallNotification { $scope = Get-ExchangeInboxScanScopeLabel $vipNote = if ($VipMailboxesOnly) { "VIP on ($scope)" } else { 'VIP off (full scan)' } @@ -381,16 +391,6 @@ function Test-MailboxInVipScope { return $false } -function Get-ExchangeInboxScanScopeLabel { - if (-not $VipMailboxesOnly) { - if ($MaxMailboxesPerRun -gt 0) { return "all mailboxes (limit $MaxMailboxesPerRun)" } - return 'all mailboxes' - } - $n = @($VipMailboxes | Where-Object { $_ }).Count - $p = @($VipMailboxPatterns | Where-Object { $_ }).Count - return "VIP list=$n patterns=$p" -} - # ============================================ # FINDINGS # ============================================ diff --git a/version.txt b/version.txt index 9f05f9f..ec70f75 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.6.5 +1.6.6