How to hide terminal path while using PowerShell?

CharlieLor 566 Reputation points
2023-04-11T14:55:05.7466667+00:00

How do I hide the terminal path in Visual Studio under Windows Server? Currently it's showing this: PS C:\Users\user-name> I want to only show PS instead of the whole path there. Thank you.

Windows for business Windows Server User experience PowerShell
Developer technologies Visual Studio Other
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2023-04-12T03:20:23.9233333+00:00

    Hi, You can just add a prompt function to your PowerShell profile $HOME\Documents\WindowsPowerShell\Profile.ps1

    function prompt{"PS >"}
    

    Best Regards,

    Ian Xue

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    3 people found this answer helpful.
    0 comments No comments

  2. CharlieLor 566 Reputation points
    2023-04-12T15:27:21.3066667+00:00

    Thank you for the response. Is there a way to add this setting to my User > settings.json file? If so, what's the correct syntax? Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.