static void Main(string[] args) { PSListenerConsoleSample scc = new PSListenerConsoleSample(); ConsoleManager.Show(); scc.RuningPowerShell(); }
/// <summary> /// Creates and initiates the listener instance. /// </summary> /// <param name="args">This parameter is not used.</param> public void RuningPowerShell() { // Display the welcome message... Console.Title = "PowerShell Console Host "; ConsoleColor oldFg = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(" PowerShell Console Host For Building LongView"); Console.WriteLine(" ====================================="); Console.WriteLine(string.Empty); Console.WriteLine(" In Order To Run the Script You have To type Build.ps1 !"); 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> /// Initializes a new instance of the MyHost class. Keep /// a reference to the hosting application object so it can /// be informed of when to exit. /// </summary> /// <param name="program">A reference to the host application object.</param> public MyHost(PSListenerConsoleSample program) { this.program = program; }