TP_SEI_Project/root/Powershell/arm_warning.ps1
2025-05-21 15:29:33 +02:00

18 lines
647 B
PowerShell

$buildLogPath = Join-Path $PSScriptRoot "arm_build.log"
$errorLogPath = Join-Path $PSScriptRoot "arm_warning.log"
if (Test-Path $buildLogPath) {
$content = Get-Content $buildLogPath
$matches = $content | Select-String -Pattern "\bwarning\b" -CaseSensitive:$true
if ($matches) {
$matches | ForEach-Object { $_.Line } | Set-Content $errorLogPath
Write-Host "Warning lines have been extracted to $errorLogPath"
Write-Host "Found $($matches.Count) matches"
} else {
Write-Host "No warnings found in the build log"
}
} else {
Write-Host "Error: Build log file not found at $buildLogPath"
}