Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

start sleep script need understanding

$
0
0
$job = Start-Job {$i=0; $c=0; while (1) { 
Write-Progress Activity "Step $i"; $i++; Start-Sleep -sec 1 }}
while ($job.State -eq 'Running' -And $c -lt 5) {
$c++;
$progress=$job.ChildJobs[0].progress; 
$progress | %{$_.StatusDescription}; 
$progress.Clear(); Start-Sleep 1 }

I have been trying to work around a script which waits for backup to complete and than executes the next block of code, but i could not do it with start-job and wait-job, i found the above code and pasted into my document and it worked, but as i am new to powershell i dont know what exactly this script is doing


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>