如何在 PowerShell 上更改字体

问题描述 投票:0回答:3

如何更改 PowerShell 的字体?

PowerShell 首选项中只有几种字体。

有没有办法选择更多字体?

powershell windows-10
3个回答
6
投票

要更改 PowerShell 中的字体:

  1. 右键单击 PowerShell 屏幕左上角的 PowerShell 图标
  2. 单击属性
  3. 出现一个窗口,显示字体大小、系列、颜色等选项。


4
投票

当您启动 Powershell.exe 时,客户端服务器运行时子系统 (csrss.exe) 会生成一个名为 conhost.exe 的子进程。

你可以尝试用更难的方法来处理字体:

Set-Location HKCU:\Console
New-Item '.\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe'
Set-Location '.\%SystemRoot%_System32_WindowsPowerShell_v1.0_powershell.exe'
New-ItemProperty . FaceName -type STRING -value "Lucida Console"
New-ItemProperty . FontFamily -type DWORD -value 0x00000036
New-ItemProperty . FontSize -type DWORD -value 0x000c0000
New-ItemProperty . FontWeight -type DWORD -value 0x00000190

除此之外,还有一个适用于 PowerShell 的 SetConsoleFont 模块。

用于设置它的 cmdlet 是:

Set-ConsoleFont 10

您可以查看4SysOps作为参考。

kernel32.dll 下有一些导出,也可以更改字体。


0
投票

现在,在 Windows 11 中,您需要执行以下步骤:

  1. 打开PowerShell
  2. 右键单击窗口顶部栏
  3. 选择设置
  4. 您将看到左侧的滚动条带有不同的选项卡。选择 PowerShell 选项卡。
  5. 其他设置空间中选择外观
  6. 文本空间中,您将找到字体大小设置。
© www.soinside.com 2019 - 2024. All rights reserved.