Created
January 21, 2016 16:37
Powershell 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (!$Process.HasExited){ | |
#Write-Host $Process.StandardOutput.ReadLine() | |
$splitString = $Process.StandardOutput.ReadLine() -split "/1.1`" " | |
if ($splitString[1]) | |
{ | |
Write-Host $splitString[1].Substring(0, 3) | |
$datarow = 5 | |
if ($splitString[1].Substring(0, 3) -eq "500") | |
{ | |
$data = $ExcelWorkSheet.Cells.Item($datarow,1).Value2 #500 errors | |
if ($data) | |
{ | |
$data = [int]$data + 1 | |
} | |
else | |
{ | |
$data = 1 | |
} | |
$ExcelWorkSheet.Cells.Item($datarow,1) = $data | |
Write-Host $data | |
} | |
if ($splitString[1].Substring(0, 3) -eq "200") | |
{ | |
$data = $ExcelWorkSheet.Cells.Item($datarow,2).Value2 #200 errors | |
if ($data) | |
{ | |
$data = [int]$data + 1 | |
} | |
else | |
{ | |
$data = 1 | |
} | |
$ExcelWorkSheet.Cells.Item($datarow,2) = $data | |
Write-Host $data | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment