fix(Exchange): define Get-ExchangeInboxScanScopeLabel before InstallTasks (v1.6.6)

This commit is contained in:
PTah
2026-05-22 16:02:05 +10:00
parent 1584be89e2
commit 744f254c09
2 changed files with 12 additions and 12 deletions
+11 -11
View File
@@ -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:InstallRoot = [System.IO.Path]::GetFullPath("$env:ProgramData\RDP-login-monitor")
$script:CanonicalScriptName = 'Exchange-MailSecurity.ps1' $script:CanonicalScriptName = 'Exchange-MailSecurity.ps1'
$LogFile = Join-Path $script:InstallRoot 'Logs\exchange_mail_security.log' $LogFile = Join-Path $script:InstallRoot 'Logs\exchange_mail_security.log'
@@ -202,6 +202,16 @@ Initialize-NotifyCredentials -TelegramBotTokenProtectedB64 $TelegramBotTokenProt
if ($TelegramBotToken -eq '<TELEGRAM_BOT_TOKEN>') { $TelegramBotToken = '' } if ($TelegramBotToken -eq '<TELEGRAM_BOT_TOKEN>') { $TelegramBotToken = '' }
if ($TelegramChatID -eq '<TELEGRAM_CHAT_ID>') { $TelegramChatID = '' } if ($TelegramChatID -eq '<TELEGRAM_CHAT_ID>') { $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 { function Send-ExchangeInstallNotification {
$scope = Get-ExchangeInboxScanScopeLabel $scope = Get-ExchangeInboxScanScopeLabel
$vipNote = if ($VipMailboxesOnly) { "VIP on ($scope)" } else { 'VIP off (full scan)' } $vipNote = if ($VipMailboxesOnly) { "VIP on ($scope)" } else { 'VIP off (full scan)' }
@@ -381,16 +391,6 @@ function Test-MailboxInVipScope {
return $false 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 # FINDINGS
# ============================================ # ============================================
+1 -1
View File
@@ -1 +1 @@
1.6.5 1.6.6