This repository contains a custom PowerShell prompt script designed to ✨enhance✨ your terminal experience, especially when working in Visual Studio Code (VSCode or VSCode Insiders).
- Dynamic Prompt: Displays the current working directory, virtual environment (if active), and Git branch information.
- Git Status: Shows a checkmark (✓) for a clean Git status or a cross (✗) for uncommitted changes.
- VSCode Detection: Automatically adjusts the prompt for VSCode environments.
- Clone this repository or copy the
Microsoft.PowerShell_profile.ps1
script. - Place the script in your PowerShell profile directory. The default path is:
$USER/Documents/PowerShell/Microsoft.PowerShell_profile.ps1
- If the
$PROFILE
file does not exist, you can create it by running:New-Item -ItemType File -Path $PROFILE -Force
- Copy the contents of the script into the newly created
$PROFILE
file. - Restart your PowerShell terminal to apply the changes.
- Open your PowerShell terminal.
- Navigate to a directory to see the enhanced prompt in action.
- If you're in a Git repository, the prompt will display the current branch and status.
- Activate a virtual environment to see its name reflected in the prompt.
I don't take all of the credit for this script. I was inspired by the Oh-My-Zsh Project particularly the robbyrussel theme. I learned a lot of converting most of the style to 💻PS >_
by visiting the PowerShell documentation. 🙂
And no, I didn't want to use Oh-My-Posh
as it was a fairly easy script. I already use Oh-My-Zsh
for my WSL and I don't themes for my Ubuntu machine.
Feel free to open issues or submit pull requests to improve this script. Contributions are welcome!
This project is licensed under the MIT License. See the LICENSE
file for details.