小编bat*_*a09的帖子

警告原因:PowerShell 检测到您可能正在使用屏幕阅读器并出于兼容性目的禁用了 PSReadLine

脚步

在 Windows 10 上启动 PowerShell 7。

实际结果

PowerShell 7.0.0
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

Warning: PowerShell detected that you might be using a screen reader and has disabled PSReadLine for compatibility purposes. If you want to re-enable it, run 'Import-Module PSReadLine'.
Run Code Online (Sandbox Code Playgroud)

预期结果

PowerShell 启动时不显示警告,因为我没有使用屏幕阅读器。

解决方法

运行指定的命令Import-Module PSReadLine。自从我第一次想了解为什么会出现警告以来,我就没有运行过它。

$PSVersionTable 输出:

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, …
Run Code Online (Sandbox Code Playgroud)

powershell powershell-v7

12
推荐指数
2
解决办法
8009
查看次数

标签 统计

powershell ×1

powershell-v7 ×1