问题描述 投票:0回答:1
powershell命令

@echo off echo +==================================================+ echo ^|**********************Login***********************^| echo +==================================================+ echo. echo Login setlocal DisableDelayedExpansion set /p input=Username: ::powershell command set "psCommand=powershell -Command "$pword = read-host 'Enter password' -AsSecureString ; ^ $BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^ [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)"" for /f "usebackq delims=" %%p in (`%psCommand%`) do set passwords=%%p ) if %passwords% == 123 goto sucess exit END LOCAL :sucess cls echo welcom back %Username%! echo :) pause exit

我看到不同的 enter image description here在powershell命令之前

powershell命令 enter image description here


    

I认为问题源于

chcp 65001

有效,即UTF-8代码页。 enter image description herecode Page65001

实际上,呼叫

powershell.exe

-windowspowershell-不幸的是,不幸的是,您描述了您所描述的症状:enter image description here目前选择的字体已更改为遗产raster

raster
powershell batch-file cmd
1个回答
4
投票
raster

limited gllyph(parnece)supports。

以下命令演示了问题(从
cmd.exe

运行):

:: Unexpectedly switches to a raster font. :: Note: No longer occurs in PowerShell (Core) 7+, with pwsh.exe chcp 65001 & powershell -noprofile -c "'hi'"


您可以使用以下一个工作之一:
将您的批处理文件在Windows终端中删除,可在MicrosoftStore而不是在传统控制台窗口中使用。

您可以
themantaly

切换到代码页面

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.