S
S
Spooky 20202021-06-08 23:12:20
PowerShell
Spooky 2020, 2021-06-08 23:12:20

How to open a "clean" powershell console?

How to call or what to write in the config, so that when you open the PowerShell console, it would be without service messages, such as:

PowerShell 7.1.3
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

Loading personal and system profiles took 1334ms.

And it contained only the path to the user's folder.
OS Windows 10, PowerShell 7.1.3

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2021-06-08
@spooky_2020

You can use the command line parameter pwsh.exe -NoLogo
Subscribe, if suddenly there is an option to override this through the profile, or environment variables.

E
Eugene, 2021-06-09
@yellowmew

not quite "remove" but it also allows you to get a blank screen when starting posh
1.
run powershell and look at the value of the $PROFILE variable - it will show where the autoloaded Posh profile for your user is stored
2.

  • if the file exists, add the last line Clear-Host there
  • if it does not exist, create it along the desired path and write the same there

Save
3. now when you start powershell under your account, this set of commands will always be executed first.
By the way, you can write a lot of useful aliases there, prescribe the necessary paths (which are required only in the powershell environment) - without redefining them at the system level, various environment variables, etc., etc., since this is a regular powershell script.
In general, an analogue of bashrc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question