2017-02-20 17 views

回答

1

尝试运行下面的代码:

(Get-Command Prompt).Definition 

这应返回

"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; 

如果没有,用自己的覆盖该功能defintition:

Function Prompt { 
    "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; 
} 
+0

这二d不会阻止>>弹出。这是我运行的文件(Get-Command Prompt).Definition。 “PS $($ executionContext.SessionState.Path.CurrentLocation)$( '>' *($ nestedPromptLevel + 1))”; #.Link #http://go.microsoft.com/fwlink/?LinkID=225750 #.ExternalHelp System.Management.Automation.dll -help.xml – Threekill

+0

如果你看看代码,你也会发现当'$ nestedPromptLevel -eq 1'时你会得到'>>'。你可以检查变量的值/查看是否有任何的原因,该变量已经存在增加(见“总结”部分的这篇博客文章的结尾:http://dpotter.net/technical/2008/ 10/nestedpromptlevel /) – JohnLBevan

相关问题