2017-02-20 18 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

相關問題