/// <summary> /// Creates and initiates the listener instance. /// </summary> /// <param name="args">This parameter is not used.</param> private static void Main(string[] args) { // Display the welcome message... Console.Title = "PowerShell Console Host Sample Application"; ConsoleColor oldFg = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(" PowerShell Console Host Interactive Sample"); Console.WriteLine(" ====================================="); Console.WriteLine(string.Empty); Console.WriteLine("This is an example of a simple interactive console host using the PowerShell"); Console.WriteLine("engine to interpret commands. Type 'exit' to exit."); Console.WriteLine(string.Empty); Console.ForegroundColor = oldFg; // Create the listener and run it - this never returns... PSListenerConsoleSample listener = new PSListenerConsoleSample(); listener.Run(); }
/// <summary> /// Creates and initiates the listener. /// </summary> /// <param name="args">The parameter is not used.</param> private static void Main(string[] args) { // Display the welcome message. Console.Title = "Windows PowerShell Console Host Application Sample"; ConsoleColor oldFg = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(" Windows PowerShell Console Host Interactive Sample"); Console.WriteLine(" =================================================="); Console.WriteLine(string.Empty); Console.WriteLine("This is an example of a simple interactive console host that uses "); Console.WriteLine("the Windows PowerShell engine to interpret commands."); Console.WriteLine("Type 'exit' to exit."); Console.WriteLine(string.Empty); Console.ForegroundColor = oldFg; // Create the listener and runs it. This method never returns. PSListenerConsoleSample listener = new PSListenerConsoleSample(); listener.Run(); }
/// <summary> /// Creates and initiates the listener instance. /// </summary> /// <param name="args">This parameter is not used.</param> private static void Main(string[] args) { // Display the welcome message. Console.Title = "PowerShell Console Host Sample Application"; ConsoleColor oldFg = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(" Windows PowerShell Console Host Application Sample"); Console.WriteLine(" =================================================="); Console.WriteLine(string.Empty); Console.WriteLine("This is an example of a simple interactive console host uses "); Console.WriteLine("the Windows PowerShell engine to interpret commands."); Console.WriteLine("Type 'exit' to exit."); Console.WriteLine(string.Empty); Console.ForegroundColor = oldFg; // Create the listener and runs it. This method never returns. PSListenerConsoleSample listener = new PSListenerConsoleSample(); listener.Run(); }
/// <summary> /// Initializes a new instance of the MyHost class. Keep a reference /// to the host application object so that it can be informed when /// to exit. /// </summary> /// <param name="program">A reference to the host application object.</param> public MyHost(PSListenerConsoleSample program) { this.program = program; }
public MyHost(PSListenerConsoleSample program) { this.program = program; }
/// <summary> /// Creates and initiates the listener instance... /// </summary> /// <param name="args">Ignored for now...</param> static void Main(string[] args) { // Display the welcome message... Console.Title = "PowerShell Console Host Sample Application"; ConsoleColor oldFg = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(" PowerShell Console Host Interactive Sample"); Console.WriteLine(" ====================================="); Console.WriteLine(""); Console.WriteLine("This is an example of a simple interactive console host using the PowerShell"); Console.WriteLine("engine to interpret commands. Type 'exit' to exit."); Console.WriteLine(""); Console.ForegroundColor = oldFg; // Create the listener and run it - this never returns... PSListenerConsoleSample listener = new PSListenerConsoleSample(); listener.Run(); }