Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,37 @@ public int Start(string consoleFilePath, string[] args)
int exitCode = 0;
try
{
#if CORECLR
string assemblyPath = typeof(PSVersionInfo).GetTypeInfo().Assembly.Location;
string buildVersion = FileVersionInfo.GetVersionInfo(assemblyPath).FileVersion;
string shellBanner;
if (Platform.IsWindows)
{
// the Powershell branding should be different with Nano builtin Powershell versus Open Powershell.
if (assemblyPath.StartsWith(System.Environment.ExpandEnvironmentVariables("%systemroot%"), StringComparison.InvariantCultureIgnoreCase))
{
shellBanner = ManagedEntranceStrings.ShellBanner;
}
else
{
shellBanner = String.Format(CultureInfo.InvariantCulture, ManagedEntranceStrings.ShellBannerNonWindowsPowerShell, buildVersion);
}
}
exitCode = Microsoft.PowerShell.ConsoleShell.Start(
null,
shellBanner,
ManagedEntranceStrings.ShellHelp,
warning == null ? null : warning.Message,
args);
#else

exitCode = Microsoft.PowerShell.ConsoleShell.Start(
configuration,
ManagedEntranceStrings.ShellBanner,
ManagedEntranceStrings.ShellHelp,
warning == null ? null : warning.Message,
args);
#endif
}
catch (System.Management.Automation.Host.HostException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
<value>Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.</value>
</data>
<data name="ShellBannerNonWindowsPowerShell" xml:space="preserve">
<value>PowerShell 6.0.0-alpha.{0} for Linux/OS-X/Nano Server</value>
</data>
<data name="ShellHelp" xml:space="preserve">
<value>PowerShell[.exe] [-PSConsoleFile &lt;file&gt; | -Version &lt;version&gt;]
[-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive]
Expand Down