如何在PowerShell上更改字体

KiY*_*ter 5 powershell windows-10

如何更改PowerShell的字体?

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

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

Fra*_*cis 6

要在 PowerShell 中更改字体:

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

PowerShell 属性的屏幕截图


Ran*_*tta 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
Run Code Online (Sandbox Code Playgroud)

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

用于设置它的 cmdlet 是:

Set-ConsoleFont 10
Run Code Online (Sandbox Code Playgroud)

您可以查看4SysOps以供参考。

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