I'm new at powershell and i need some help to end my code. Everything is ok but i need on ELSE go back to DO doing a loop. How can i solve this?
DO {
$getinfo=Get-Content $wblogpath | Select-Object -last 1
Write-Host -NoNewline "."$counter
Start-Sleep -s 1
$counter++
}
WHILE ($getinfo -notlike '*ReadyToRun->Run*' -and
$getinfo -notlike '*test*' -and
$getinfo -notlike '*error*' -and
$counter -le 8)
IF ($getinfo -like '*ReadyToRun->Run*')
{
Write-Host "`nREADY TO RUN"
}
ELSEIF ($getinfo -like '*test*')
{
Write-Host "`ntest"
}
ELSEIF ($getinfo -like '*error*')
{
Write-Host "`nerror"
}
ELSE{
Write-Host "`nRESTARTing WINBASIS"
$counter=0
}
Thanks :)