How to hide terminal path while using PowerShell?

CharlieLor 551 Reputation points

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.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,698 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,407 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 31,171 Reputation points Microsoft Vendor

    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.

    2 people found this answer helpful.
    0 comments No comments

  2. CharlieLor 551 Reputation points

    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