Exemplo n.º 1
0
 private void WriteOutTimeoutError(IEnumerable<string> computerNames)
 {
     const string errorId = "RestartComputerTimeout";
     foreach (string computer in computerNames)
     {
         string errorMsg = StringUtil.Format(ComputerResources.RestartcomputerFailed, computer, ComputerResources.TimeoutError);
         var exception = new RestartComputerTimeoutException(computer, Timeout, errorMsg, errorId);
         var error = new ErrorRecord(exception, errorId, ErrorCategory.OperationTimeout, computer);
         WriteError(error);
     }
 }
Exemplo n.º 2
0
		private void WriteOutTimeoutError(IEnumerable<string> computerNames)
		{
			foreach (string computerName in computerNames)
			{
				string str = StringUtil.Format(ComputerResources.RestartcomputerFailed, computerName, ComputerResources.TimeoutError);
				RestartComputerTimeoutException restartComputerTimeoutException = new RestartComputerTimeoutException(computerName, this.Timeout, str, "RestartComputerTimeout");
				ErrorRecord errorRecord = new ErrorRecord(restartComputerTimeoutException, "RestartComputerTimeout", ErrorCategory.OperationTimeout, computerName);
				base.WriteError(errorRecord);
			}
		}