src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs
/// <summary>
/// Implementation of entry point to ConsoleShell.
/// Used to create a custom Powershell console application.
/// </summary>
/// <param name="initialSessionState">InitialSessionState to be used by the ConsoleHost.</param>
/// <param name="bannerText">Banner text to be displayed by ConsoleHost.</param>
/// <param name="helpText">Help text for the shell.</param>
/// <param name="args">Commandline parameters specified by user.</param>
/// <param name="issProvided">True when the InitialSessionState object is provided by caller.</param>
/// <returns>An integer value which should be used as exit code for the process.</returns>
Implementation of entry point to ConsoleShell.
Used to create a custom Powershell console application.
Implementation of entry point to ConsoleShell . Used to create a custom Powershell console application .
private static int StartImpl(
            InitialSessionState initialSessionState,
            string? bannerText,
            string? helpText,
            string[] args,
            bool issProvided)
        {
            if (initialSessionState == null)
            {
                throw PSTraceSource.NewArgumentNullException(nameof(initialSessionState));
            }
            if (args == null)
            {
                throw PSTraceSource.NewArgumentNullException(nameof(args));
            }
            ConsoleHost.ParseCommandLine(args);
            ConsoleHost.DefaultInitialSessionState = initialSessionState;
            return ConsoleHost.Start(bannerText, helpText, issProvided);
        }
private static int StartImpl ( InitialSessionState initialSessionState , string ? bannerText , string ? helpText , string [ ] args , bool issProvided ) { if ( initialSessionState == null ) { throw PSTraceSource . NewArgumentNullException ( nameof ( initialSessionState ) ) ; } if ( args == null ) { throw PSTraceSource . NewArgumentNullException ( nameof ( args ) ) ; } ConsoleHost . ParseCommandLine ( args ) ; ConsoleHost . DefaultInitialSessionState = initialSessionState ; return ConsoleHost . Start ( bannerText , helpText , issProvided ) ; }
Implementation of entry point to ConsoleShell.
Implementation of entry point to ConsoleShell .
An integer value which should be used as exit code for the process.
An integer value which should be used as exit code for the process .
initialSessionState
InitialSessionState
InitialSessionState to be used by the ConsoleHost.
InitialSessionState to be used by the ConsoleHost .
bannerText
string?
Banner text to be displayed by ConsoleHost.
Banner text to be displayed by ConsoleHost .
helpText
string?
Help text for the shell.
Help text for the shell .
args
string[]
Commandline parameters specified by user.
Commandline parameters specified by user .
issProvided
bool
True when the InitialSessionState object is provided by caller.
True when the InitialSessionState object is provided by caller .