Whenever I open the terminal in Visual Studio, I get the following boilerplate header:
**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.5.1
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
Looking at the terminal settings in Options > Environment > Terminal
, I'm using the following shell location:
C:\Program Files\PowerShell\7\pwsh.exe
Along with the following arguments:
-NoExit -Command "& { Import-Module """$env:VSAPPIDDIR\..\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell -SkipAutomaticLocation -SetDefaultWindowTitle -InstallPath $env:VSAPPIDDIR\..\..\}"
Normally, you can remove the powershell header text by adding the -NoLogo
flag which "Hides the copyright banner at startup.", but that doesn't seem to have an effect here.
I think this is being generated from the Enter-VsDevShell
portion.
The reason this is particularly annoying is I usually have the terminal pinned to the bottom with minimal height, so there's a very high demand on visual real estate.
Any way to remove the startup text here?
Add redirection *>$null
to silence all output from Enter-VsDevShell
In general, use \"
to escape embedded "
chars. (which works with both powershell.exe
(Windows PowerShell) and pwsh.exe
(PowerShell (Core) 7+).
Remove the unnecessary enclosure in & { ... }
- just ...
will do.
-NoExit -Command "Import-Module $env:VSAPPIDDIR\..\Tools\Microsoft.VisualStudio.DevShell.dll; Enter-VsDevShell -SkipAutomaticLocation -SetDefaultWindowTitle -InstallPath $env:VSAPPIDDIR\..\..\ *>$null"