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

2 2

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

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay