Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/System.Management.Automation/engine/ICommandRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ namespace System.Management.Automation
/// implementation of this class and pass it to cmdlets before calling the Cmdlet Invoke() or
/// Execute() methods.
/// </remarks>
#nullable enable
public interface ICommandRuntime
{
/// <summary>
/// Returns an instance of the PSHost implementation for this environment.
/// </summary>
PSHost Host { get; }
PSHost? Host { get; }
#region Write
/// <summary>
/// Display debug information.
Expand Down Expand Up @@ -65,7 +66,7 @@ public interface ICommandRuntime
/// When the cmdlet wants to write a single object out, it will call this
/// API. It is up to the implementation to decide what to do with these objects.
/// </remarks>
void WriteObject(object sendToPipeline);
void WriteObject(object? sendToPipeline);

/// <summary>
/// Called to write one or more objects to the output pipe.
Expand All @@ -83,7 +84,7 @@ public interface ICommandRuntime
/// When the cmdlet wants to write multiple objects out, it will call this
/// API. It is up to the implementation to decide what to do with these objects.
/// </remarks>
void WriteObject(object sendToPipeline, bool enumerateCollection);
void WriteObject(object? sendToPipeline, bool enumerateCollection);

/// <summary>
/// Called by the cmdlet to display progress information.
Expand Down Expand Up @@ -515,7 +516,7 @@ public interface ICommandRuntime
/// Gets an object that surfaces the current PowerShell transaction.
/// When this object is disposed, PowerShell resets the active transaction.
/// </summary>
PSTransactionContext CurrentPSTransaction { get; }
PSTransactionContext? CurrentPSTransaction { get; }
#endregion Transaction Support

#region Misc
Expand Down Expand Up @@ -554,6 +555,7 @@ public interface ICommandRuntime
#endregion misc

}
#nullable disable

/// <summary>
/// This interface defines the set of functionality that must be implemented to directly
Expand Down