Amani
Amani

Reputation: 18123

How to Remove the Banner Message in PowerShell

When I start PowerShell it always start with a banner like this:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Loading personal and system profiles took 1025ms.
>>

Or in other environment it start with this:

PowerShell v6.0.2
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.
>>

What should I put in the profile file so that it start without the banner message? I'm on Windows 10 64bit, using PowerShell 6.0.2.

Upvotes: 32

Views: 29908

Answers (6)

chameleonhash
chameleonhash

Reputation: 51

Here is an answer you might want to try.

Edit your profile by going into powershell and typing:

notepad $profile

Delete everything in that file and input the following:

Clear-Host

If you want to add your own message you can also input the following below that line:

Write-Host "MESSAGE TEXT HERE"

Here's a snippet from my personal profile that clears all default banner text, then employs npm figlet with a personal message as banner art, and has a default "hacker" terminal color theme (Black background, green text).

Clear-Host
figlet -f "Merlin1" Powershellhell"
$host.ui.RawUI.BackgroundColor = "Black"
$host.ui.RawUI.ForegroundColor = "Green"

Upvotes: 2

jlanssie
jlanssie

Reputation: 127

Go to your user's Windows Terminal settings.

C:\Users\ME\AppData\Local\Packages\Microsoft.WindowsTerminal_1abcde1a1abcd\LocalState

Open settings.json. Add "commandline" : "powershell.exe -nologo" in the profiles section, e.g.

"profiles": 
    {
        "defaults": {},
        "list": 
        [
            {
                "guid": "{12a12abc-a1a1-1234-12a1-123a12ab12ab}",
                "hidden": false,
                "name": "Windows PowerShell",
                "commandline" : "powershell.exe -nologo"
            }
        ]
    },

Upvotes: 0

Gian Marco
Gian Marco

Reputation: 23209

If you are using Windows Terminal, just add -NoLogo parameter in the Command Line setting:

enter image description here

Upvotes: 13

smol dino
smol dino

Reputation: 1

The answer changes depending on where you are accessing powershell.

The general idea is to call powershell with the nologo argument (/nologo or -nologo).

In VSCode, the way I did this was by pasting "terminal.integrated.shellArgs.windows": ["-nologo"]] into my settings.JSON. Thanks to the comments for suggesting this. However this method is deprecated - use VSCode Shell profiles instead. VSCode automatically converted the deprecated command for me, but in case that is no longer working this is the code that VSCode added:

    "terminal.integrated.profiles.windows": {
    "C:\\Program Files\\PowerShell\\7\\pwsh.exe (migrated)": {
        "path": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
        "args": [
            "-nologo"
        ]
    }

To do this in Windows Terminal, simply go to the Shell settings menu and add /nologo to the command line arguments.

Note that there is no need to clear the screen here. The startup time and customizability significantly increased for me by doing this.

Upvotes: 0

hacker1024
hacker1024

Reputation: 3668

You can start PowerShell with the /nologo argument to disable the message.

powershell.exe /nologo

This argument can be added to the PowerShell profile in the Windows Terminal settings.

Upvotes: 42

Logix
Logix

Reputation: 590

I achieve this for Windows PowerShell in Windows Terminal by opening the terminal, typing notepad $profile (if it asks you to create the file, choose 'Yes'), and simply typing "clear" (without quotation marks) and saving the file. This command is then automatically run by PowerShell on start-up (this will require you to open a new terminal to see the changes).

Note: The banner stuff does appear briefly, but is automatically cleared as soon as the terminal finishes loading.

Note #2: I only know this to work with Windows Terminal.

If anyone knows how to remove the "Loading personal and system profiles took (n)ms." line, though, that'd be great.

Upvotes: 3

Related Questions