PowerShell
prompt can be changed by calling
Function prompt{"new_prompt "}
and on the cmd
prompt can be changed by calling
prompt $g$g$s
Once the current window is closed all the changes are gone and one will have to change them again when opening new instances of PowerShell
or cmd
. How can one make these changes permanent?
You have profile where you can put initialization for your PowerShell command prompts.
Type $profile
in your PowerShell command to see where it resides
Then modify it or create a new one if there doesn't exist one eg profile.ps1.
eg then add
function prompt { "PS " + $(get-date) ">"}
You can read more about profiles here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.