如何更改 PowerShell 的字体?
PowerShell 首选项中只有几种字体。
有没有办法选择更多字体?
当您启动 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 下有一些导出,也可以更改字体。
现在,在 Windows 11 中,您需要执行以下步骤: