Windows PowerShell: changing the command prompt

前端 未结 6 816
渐次进展
渐次进展 2020-11-30 20:27

Using Windows PowerShell, how do I change the command prompt?

For example, the default prompt says

PS C:\\Documents and Settings\\govendes\\My Docume         


        
6条回答
  •  攒了一身酷
    2020-11-30 21:09

    This version of Warren Stevens' answer avoids the noisy "Microsoft.PowerShell.Core\FileSystem" in the path if you Set-Location to network shares.

    function prompt {"PS [$Env:username@$Env:computername]$($PWD.ProviderPath)`n> "} 
    

提交回复
热议问题