Skip to content

Instantly share code, notes, and snippets.

@sowamazing
Created January 21, 2016 16:37
Powershell 4
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