Skip to content

Files

Latest commit

 

History

History

Custom_Prompt

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Custom PowerShell Command Prompt

You can customise your PowerShell prompt to show more informations like git branch status, command execution time, current directory, admin status etc. (This script is just an introduction how you can customise your PowerShell prompt, you can add several more customizations). To read more about PowerShell Prompt go here.

Dependencies

Git must be installed in order to utilise full potential of the script. Or you can safely comment the git code in the script. To install Git on Windows go here.

Setup Instructions

  1. Open a PowerShell prompt with admin. You can use WinKey + X to launch quick tools menu and select Windows PowerShell (Admin)

  2. Set script execution policy

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
  1. Check if there is an existing configuration, if not create a new file.
    if (!(Test-Path -Path $PROFILE)){ New-Item -Path $PROFILE -ItemType File } ; notepad $PROFILE
  1. A file will open, if there is an exisiting prompt function in the file then change the contents else paste everything from profile.ps1 in the file.

  2. Save and exit Notepad and relaunch PowerShell.

Output

  • Simple mode

  • Admin Mode

Author(s)

Created by Avinal Kumar