fix: Deploy-DomainMonitors encoding for PS 5.1 / NETLOGON (v1.6.2)

- ASCII runtime strings in domain deploy/install scripts
- Publish *.ps1 to NETLOGON with UTF-8 BOM
This commit is contained in:
2026-05-22 14:53:28 +10:00
parent 0c916b50c6
commit 7c13c96622
5 changed files with 44 additions and 23 deletions
+7 -7
View File
@@ -1,8 +1,8 @@
<#
.SYNOPSIS
Регистрирует задачи планировщика для доменных мониторов (Exchange; AD — позже).
Register scheduled tasks for domain monitors (Exchange; AD later).
.PARAMETER Target
Exchange Exchange-MailSecurity.ps1; Ad — зарезервировано.
Exchange - Exchange-MailSecurity.ps1; Ad - reserved.
#>
[CmdletBinding()]
param(
@@ -25,25 +25,25 @@ function Test-RunningElevated {
}
if (-not (Test-RunningElevated)) {
throw 'Запустите Install-DomainMonitors.ps1 от имени администратора.'
throw 'Run Install-DomainMonitors.ps1 as Administrator.'
}
switch ($Target) {
'Exchange' {
$scriptPath = Join-Path $InstallRoot 'Exchange-MailSecurity.ps1'
if (-not (Test-Path -LiteralPath $scriptPath)) {
throw "Не найден: $scriptPath"
throw "Not found: $scriptPath"
}
$notifyPath = Join-Path $InstallRoot 'Notify-Common.ps1'
if (-not (Test-Path -LiteralPath $notifyPath)) {
throw "Не найден: $notifyPath"
throw "Not found: $notifyPath"
}
& $PsExe -NoProfile -ExecutionPolicy Bypass -File $scriptPath -InstallTasks
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host "Exchange: задачи планировщика зарегистрированы."
Write-Host 'Exchange: scheduled tasks registered.'
}
'Ad' {
Write-Host 'AD-SecurityMonitor.ps1 пока не реализован — используйте Target Exchange.'
Write-Host 'AD-SecurityMonitor.ps1 is not implemented yet. Use -Target Exchange.'
exit 1
}
}