Skip to content

Commit edcfd75

Browse files
authored
Make startup banner simpler (#1141)
1 parent d46589e commit edcfd75

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs

+11
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ public StartEditorServicesCommand()
177177
[Parameter]
178178
public SwitchParameter SplitInOutPipes { get; set; }
179179

180+
/// <summary>
181+
/// The banner/logo to display when the Integrated Console is first started.
182+
/// </summary>
183+
[Parameter]
184+
public string StartupBanner { get; set; }
185+
180186
protected override void BeginProcessing()
181187
{
182188
#if DEBUG
@@ -331,6 +337,11 @@ private EditorServicesConfig CreateConfigObject()
331337
},
332338
};
333339

340+
if (StartupBanner != null)
341+
{
342+
editorServicesConfig.StartupBanner = StartupBanner;
343+
}
344+
334345
return editorServicesConfig;
335346
}
336347

src/PowerShellEditorServices.Hosting/Configuration/EditorServicesConfig.cs

+6
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ public EditorServicesConfig(
110110
/// If none are provided, these will be generated from the hosting PowerShell's profile paths.
111111
/// </summary>
112112
public ProfilePathConfig ProfilePaths { get; set; }
113+
114+
public string StartupBanner { get; set; } = @"
115+
116+
=====> PowerShell Integrated Console <=====
117+
118+
";
113119
}
114120

115121
/// <summary>

src/PowerShellEditorServices.Hosting/Internal/EditorServicesRunner.cs

+1-17
Original file line numberDiff line numberDiff line change
@@ -237,23 +237,7 @@ private void WriteStartupBanner()
237237
return;
238238
}
239239

240-
_config.PSHost.UI.WriteLine(@"
241-
242-
243-
__/\\\\\\\\\\\\\_______/\\\\\\\\\\\____/\\\\\\\\\\\________/\\\\\\\\\_
244-
_\/\\\/////////\\\___/\\\/////////\\\_\/////\\\///______/\\\////////__
245-
_\/\\\_______\/\\\__\//\\\______\///______\/\\\_______/\\\/___________
246-
_\/\\\\\\\\\\\\\/____\////\\\_____________\/\\\______/\\\_____________
247-
_\/\\\/////////_________\////\\\__________\/\\\_____\/\\\_____________
248-
_\/\\\_____________________\////\\\_______\/\\\_____\//\\\____________
249-
_\/\\\______________/\\\______\//\\\______\/\\\______\///\\\__________
250-
_\/\\\_____________\///\\\\\\\\\\\/____/\\\\\\\\\\\____\////\\\\\\\\\_
251-
_\///________________\///////////_____\///////////________\/////////__
252-
253-
254-
=====> PowerShell Integrated Console <=====
255-
256-
");
240+
_config.PSHost.UI.WriteLine(_config.StartupBanner);
257241
}
258242

259243
private void DebugServer_OnSessionEnded(object sender, EventArgs args)

0 commit comments

Comments
 (0)