# Read sync log - last 60 lines try { $log = [System.IO.File]::ReadAllText("\\192.168.0.6\C$\Shares\test\scripts\sync-from-nas.log") $logLines = $log -split "`n" Write-Output "=== SYNC LOG (last 60 lines) ===" $logLines | Select-Object -Last 60 | ForEach-Object { Write-Output $_ } } catch { Write-Output "ERROR reading log: $_" }