Prompt Delivery

Chatting to a punctual acquaintance, I was directed towards a ‘sweet hack’ to ‘never fear a long path ever again’:

 

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]

"AutoRun"="prompt $P$_$+$G"

 

 

Admittedly, this is pretty cool, but I pointed out that I never use cmd.exe and that my friend shouldn't either. PowerShell all the way, man.

At this point, a metaphorical gauntlet was thrown by my chum: “port it over to PowerShell”

Here’s the result. The code should be added to $profile so it’s executed when the console starts - in the console type ‘ISE $profile’ to edit the relevant start-up script.

 

Function Prompt {

Write-Host ("PS " + $(Get-Location))

Return ">"

}