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.
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.
-
Open a PowerShell prompt with admin. You can use
WinKey + X
to launch quick tools menu and select Windows PowerShell (Admin) -
Set script execution policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
- 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
-
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. -
Save and exit Notepad and relaunch PowerShell.
- Simple mode
- Admin Mode
Created by Avinal Kumar