0
我在Windows 10 PowerShell的一个问题,当我过通过更改驱动器号或设置位置的驱动器,我得到一个“>>”的提示随机。PowerShell驱动器变化引起提示
这从来没有发生过在Windows 7
我在Windows 10 PowerShell的一个问题,当我过通过更改驱动器号或设置位置的驱动器,我得到一个“>>”的提示随机。PowerShell驱动器变化引起提示
这从来没有发生过在Windows 7
尝试运行下面的代码:
(Get-Command Prompt).Definition
这应返回
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
如果没有,用自己的覆盖该功能defintition:
Function Prompt {
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
}
这二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
如果你看看代码,你也会发现当'$ nestedPromptLevel -eq 1'时你会得到'>>'。你可以检查变量的值/查看是否有任何的原因,该变量已经存在增加(见“总结”部分的这篇博客文章的结尾:http://dpotter.net/technical/2008/ 10/nestedpromptlevel /) – JohnLBevan