不知道什么原因,在有些系统上打开PowerShell命令行窗口后,光标无法显示。这种情况在Windows Server 2008/2012、Windows 8/9/10上都出现过,估计是由于某些系统软件/组件的兼容性问题导致的。

遇到这种情况,通过修改PowerShell命令行窗口的背景颜色可以使光标正常显示,但关闭PowerShell窗口后重新打开,问题依然存在。

最终的解决办法是:通过在PowerShell profile中添加设置来确保光标能够正常显示。

创建PowerShell profile

new-item -path $profile -itemtype file -force

打开PowerShell profile

notepad $profile

执行上述命令后,会打开一个新的notepad窗口,在notepad输入:

[console]::cursorsize=25

保存并关闭notepad

关闭并重新打开PowerShell窗口,光标就可以正常显示了,一劳永逸。

 

相关文章:

  • 2021-06-10
  • 2021-04-15
  • 2021-10-27
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-01-22
猜你喜欢
  • 2021-07-18
  • 2021-09-30
  • 2021-05-31
  • 2022-12-23
  • 2022-02-10
  • 2021-04-13
相关资源
相似解决方案