src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs
/// <summary>
/// Returns the object that generates events to be monitored
/// </summary>
Returns the object that generates events to be monitored
Returns the object that generates events to be monitored
protected override Object GetSourceObject()
        {
            if (
                (Action == null) &&
                (!(bool)Forward)
               )
            {
                ErrorRecord errorRecord = new ErrorRecord(
                    new ArgumentException(EventingStrings.ActionMandatoryForLocal),
                    "ACTION_MANDATORY_FOR_LOCAL",
                    ErrorCategory.InvalidArgument,
                    null);
                ThrowTerminatingError(errorRecord);
            }
            return null;
        }
protected override Object GetSourceObject ( ) { if ( ( Action == null ) && ( ! ( bool ) Forward ) ) { ErrorRecord errorRecord = new ErrorRecord ( new ArgumentException ( EventingStrings . ActionMandatoryForLocal ) , " " , ErrorCategory . InvalidArgument , null ) ; ThrowTerminatingError ( errorRecord ) ; } return null ; }
Returns the object that generates events to be monitored
Returns the object that generates events to be monitored
// If it's not a forwarded event, the user must specify // an action