DEV Community

Cover image for How to set Current Directory In Windows PowerShell & Remove The PowerShell Start Text?
Syed Sohan
Syed Sohan

Posted on • Originally published at syedsohan.hashnode.dev

How to set Current Directory In Windows PowerShell & Remove The PowerShell Start Text?

Today we will see a simple trick on Windows Terminal. I personally like minimal things on Terminal.

Normally when you Download Windows Terminal from Microsoft Store, you will see something like this.

Screenshot_3.png

So, I am going to Remove The Windows PowerShell Start Text and Set up the Current Directory in Windows PowerShell just like this.

Screenshot_2.png

Now let's see How to Set up the Current Directory in Windows PowerShell & Remove The Windows PowerShell Start Text 👇

1.) Download & Install Windows Terminal from Microsoft Store.

2.) Open Windows PowerShell / Terminal.

3.) Paste this line Set-ExecutionPolicy RemoteSigned -Scope CurrentUser. If it gives you any Error then please Open your PowerShell with the permission of the Administrator.

Screenshot_5.png

4.) Then type $profile

You will see something like this (%USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1);

5.) Now open your profile by typing notepad $profile

6.) Add the following to your profile:

Clear-Host
function prompt {
    $p = Split-Path -leaf -path (Get-Location)
    "$p> "
}
Enter fullscreen mode Exit fullscreen mode

7.) Save the profile.

Screenshot_4.png

8.) Restart Powershell and Boom 💥

Screenshot_2.png

Thanks for reading this post. Stay tuned for more.

You can find me here also.

If you like my content, please consider buying me a coffee.

Buy Me A Coffee

Discussion (0)