Example #1
0
 private static void RetryAfter(PSNamespaceLongRunningOperation longrunningResponse, int longRunningOperationInitialTimeout)
 {
     if (longRunningOperationInitialTimeout >= 0)
     {
         //longrunningResponse.RetryAfter = longRunningOperationInitialTimeout;
     }
 }
        protected PSNamespaceLongRunningOperation WaitForOperationToComplete(PSNamespaceLongRunningOperation longRunningOperation)
        {
            WriteProgress(longRunningOperation);

            while (longRunningOperation.Status == OperationStatus.InProgress)
            {
                var retryAfter = longRunningOperation.RetryAfter ?? LongRunningOperationDefaultTimeout;

                Thread.Sleep(retryAfter);

                WriteProgress(longRunningOperation);
            }

            return(longRunningOperation);
        }
 protected void WriteProgress(PSNamespaceLongRunningOperation operation)
 {
     WriteProgress(new ProgressRecord(0, operation.OperationName, operation.Status.ToString()));
 }