function Write-Log {
param([string]$Message)
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logLine = "[$timestamp] $Message"
# Пишем в файл, а не в консоль
Add-Content -Path "$env:TEMP\BruteForceBlock.log" -Value $logLine -ErrorAction SilentlyContinue
}