Skip to content

Instantly share code, notes, and snippets.

@alst74
Created December 20, 2018 10:32
Show Gist options
  • Save alst74/de4a4ba10e476820ef7b59cb80e8d578 to your computer and use it in GitHub Desktop.
Save alst74/de4a4ba10e476820ef7b59cb80e8d578 to your computer and use it in GitHub Desktop.
$sleep = 2 #Sleeptime in seconds between checks
$maxtry = 10 #Nr of tr
$successfile = "c:\temp\success.txt"
$failedfile = "c:\temp\fail.txt"
Write-Host "Waiting for deploy to complete"
for ($i=1; $i -le $maxtry; $i++) {
if (Test-Path "${successfile}") {
Write-Host "${successfile} found - Deploy was SUCCESSFUL!!"
Break
}
else {
Write-Host "try $i of $maxtry"
Start-Sleep -Seconds $sleep
if (Test-Path "${failedfile}") {
Write-Host "${failedfile} found - Deploy FAILED!!"
break
}
if ($i -eq 10) {
Write-Host "$successfile not found, Deploy failed?"
Break
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment