@@ -30,6 +30,19 @@ public class ConsoleService : IDisposable
3030
3131 #region Constructors
3232
33+ /// <summary>
34+ /// Creates an instance of the ConsoleService class using the
35+ /// given IConsoleHost implementation to invoke host operations
36+ /// on behalf of the ConsolePSHost. An InitialSessionState may
37+ /// be provided to create the console runspace using a particular
38+ /// configuraiton.
39+ /// </summary>
40+ /// <param name="consoleHost">
41+ /// An IConsoleHost implementation which handles host operations.
42+ /// </param>
43+ /// <param name="initialSessionState">
44+ /// An optional InitialSessionState to use in creating the console runspace.
45+ /// </param>
3346 public ConsoleService (
3447 IConsoleHost consoleHost ,
3548 InitialSessionState initialSessionState = null )
@@ -56,6 +69,11 @@ public ConsoleService(
5669
5770 #region Public Methods
5871
72+ /// <summary>
73+ /// Executes a command in the console runspace.
74+ /// </summary>
75+ /// <param name="commandString">The command string to execute.</param>
76+ /// <returns>A Task that can be awaited for the command completion.</returns>
5977 public async Task ExecuteCommand ( string commandString )
6078 {
6179 PowerShell powerShell = PowerShell . Create ( ) ;
@@ -101,6 +119,15 @@ await Task.Factory.StartNew(
101119 }
102120 }
103121
122+ /// <summary>
123+ /// Sends a user's prompt choice response back to the specified prompt ID.
124+ /// </summary>
125+ /// <param name="promptId">
126+ /// The ID of the prompt to which the user is responding.
127+ /// </param>
128+ /// <param name="choiceResult">
129+ /// The index of the choice that the user selected.
130+ /// </param>
104131 public void ReceiveChoicePromptResult (
105132 int promptId ,
106133 int choiceResult )
@@ -109,6 +136,10 @@ public void ReceiveChoicePromptResult(
109136 this . consoleHost . PromptForChoiceResult ( promptId , choiceResult ) ;
110137 }
111138
139+ /// <summary>
140+ /// Sends a CTRL+C signal to the console to halt execution of
141+ /// the current command.
142+ /// </summary>
112143 public void SendControlC ( )
113144 {
114145 // TODO: Cancel the current pipeline execution
@@ -118,6 +149,9 @@ public void SendControlC()
118149
119150 #region IDisposable Implementation
120151
152+ /// <summary>
153+ /// Disposes the runspace in use by the ConsoleService.
154+ /// </summary>
121155 public void Dispose ( )
122156 {
123157 if ( this . currentRunspace != null )
0 commit comments