40 lines
1.0 KiB
PowerShell
40 lines
1.0 KiB
PowerShell
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[string] $OutPath,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[string] $ErrPath,
|
|
|
|
[string] $VerboseOutput = "0"
|
|
)
|
|
|
|
if ($VerboseOutput -eq "1") {
|
|
if (Test-Path -LiteralPath $OutPath) {
|
|
Get-Content -LiteralPath $OutPath
|
|
}
|
|
if (Test-Path -LiteralPath $ErrPath) {
|
|
Get-Content -LiteralPath $ErrPath
|
|
}
|
|
exit 0
|
|
}
|
|
|
|
if (Test-Path -LiteralPath $OutPath) {
|
|
foreach ($line in Get-Content -LiteralPath $OutPath) {
|
|
if ($line.StartsWith("[PASS]")) {
|
|
Write-Host $line -ForegroundColor Green
|
|
} elseif ($line.StartsWith("[NO]")) {
|
|
Write-Host $line -ForegroundColor Red
|
|
} elseif ($line.StartsWith("reason:")) {
|
|
Write-Host $line -ForegroundColor Red
|
|
}
|
|
}
|
|
}
|
|
|
|
if (Test-Path -LiteralPath $ErrPath) {
|
|
foreach ($line in Get-Content -LiteralPath $ErrPath) {
|
|
if ($line.StartsWith("[NO]") -or $line.StartsWith("reason:")) {
|
|
Write-Host $line -ForegroundColor Red
|
|
}
|
|
}
|
|
}
|