public static void SetProperty(PswsCmdlet cmdlet, string propertyName, SmtpAddress propertyValue) { if (propertyValue.Length > 0) { cmdlet.Parameters[propertyName] = propertyValue.ToString(); } }
public static void SetProperty(PswsCmdlet cmdlet, string propertyName, OrganizationIdParameter propertyValue) { if (propertyValue != null) { cmdlet.Parameters[propertyName] = propertyValue.ToString(); } }
public static void SetProperty(PswsCmdlet cmdlet, string propertyName, WindowsLiveId propertyValue) { if (propertyValue != null) { cmdlet.Parameters[propertyName] = propertyValue.ToString(); } }
public static void CheckForError(Task task, PswsCmdlet cmdlet) { ArgumentValidator.ThrowIfNull("task", task); ArgumentValidator.ThrowIfNull("cmdlet", cmdlet); if (!string.IsNullOrEmpty(cmdlet.Error)) { string errMsg = cmdlet.Error.ToString(); EOPRecipient.PublishErrorEvent(errMsg); string text = "<NULL>"; Authenticator authenticator = cmdlet.Authenticator as Authenticator; if (authenticator != null) { text = text.ToString(); } ExManagementApplicationLogger.LogEvent(ManagementEventLogConstants.Tuple_FfoReportingRecipientTaskFailure, new string[] { cmdlet.Organization ?? "<NULL>", cmdlet.HostServerName ?? "<NULL>", cmdlet.ToString() ?? "<NULL>", cmdlet.AdditionalHeaders.ToString() ?? "<NULL>", (cmdlet.RequestTimeout != null) ? cmdlet.RequestTimeout.Value.ToString() : "<NULL>", cmdlet.Exception.ToString() ?? "<NULL>" }); task.WriteError(cmdlet.Exception, ErrorCategory.InvalidOperation, null); } }
public static void SetProperty(PswsCmdlet cmdlet, string propertyName, CountryInfo propertyValue) { ArgumentValidator.ThrowIfNull("cmdlet", cmdlet); if (propertyValue != null) { cmdlet.Parameters[propertyName] = propertyValue; } }
public static void SetProperty(PswsCmdlet cmdlet, string propertyName, ProxyAddress propertyValue) { ArgumentValidator.ThrowIfNull("cmdlet", cmdlet); if (propertyValue != null) { cmdlet.Parameters[propertyName] = propertyValue.ProxyAddressString; } }
public static void SetProperty(PswsCmdlet cmdlet, string propertyName, string propertyValue) { ArgumentValidator.ThrowIfNull("cmdlet", cmdlet); if (!string.IsNullOrEmpty(propertyValue)) { cmdlet.Parameters[propertyName] = propertyValue; } }