Skip to content

Commit 101f9e0

Browse files
author
Matt Wilkinson
committed
Move polling delay to end of loop (otherwise user must always wait the polling delay for no reason)
1 parent c5fddca commit 101f9e0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Microsoft.Xrm.Data.PowerShell/Microsoft.Xrm.Data.PowerShell.psm1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,8 +2163,7 @@ function Import-CrmSolution{
21632163
Write-Host "Import of file completed, waiting on completion of importId: $importId"
21642164
try{
21652165
while($isProcessing -and $secondsSpentPolling -lt $MaxWaitTimeInSeconds){
2166-
#delay
2167-
Start-Sleep -Seconds $pollingDelaySeconds
2166+
21682167
#check the import job for success/fail/inProgress
21692168
try{
21702169
$import = Get-CrmRecord -conn $conn -EntityLogicalName importjob -Id $importId -Fields solutionname,data,completedon,startedon,progress
@@ -2244,6 +2243,8 @@ function Import-CrmSolution{
22442243
$isProcessing = $false
22452244
break
22462245
}
2246+
2247+
Start-Sleep -Seconds $pollingDelaySeconds
22472248
}
22482249
} Catch {
22492250
Write-Error "ImportJob with ID: $importId has encountered an exception: $_ "

0 commit comments

Comments
 (0)