Created
December 20, 2018 10:32
-
-
Save alst74/de4a4ba10e476820ef7b59cb80e8d578 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$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