PowerShell驱动器更改导致提示

PowerShell驱动器更改导致提示,powershell,Powershell,我对Windows 10上的PowerShell有问题。 每当我更改驱动器号或设置位置时,都会随机收到“>>”提示 这在Windows 7上从未发生过。请尝试运行以下代码: (Get-Command Prompt).Definition 这应该会回来 "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; 如果没有,请使用您自己的定义覆盖此函数: Fun

我对Windows 10上的PowerShell有问题。 每当我更改驱动器号或设置位置时,都会随机收到“>>”提示


这在Windows 7上从未发生过。

请尝试运行以下代码:

(Get-Command Prompt).Definition
这应该会回来

"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
如果没有,请使用您自己的定义覆盖此函数:

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

这并没有阻止>>弹出。下面是我运行的命令(get命令提示符)。“PS$($executionContext.SessionState.Path.CurrentLocation)$('>'*($NestedPrompLevel+1))”;#。链接###.ExternalHelp System.Management.Automation.dll-help.xml如果查看代码,您还将发现当
$nestedPromptLevel-eq 1
时,您将得到
>
。您是否可以检查该变量的值/查看该变量增加的原因是否存在(请参阅本文末尾的“总结”部分:)