Fix the issue where emoji doesn't display in conhost

This commit is contained in:
Calyx Hikari 2025-07-01 23:29:38 +08:00
parent a7027ca5e8
commit 9d5727f1d6
4 changed files with 65 additions and 13 deletions

19
32
View file

@ -1,4 +1,5 @@
Add-Type -AssemblyName System.IO.Compression.FileSystem
Add-Type -AssemblyName "System.Console"
function Main {
if ($PSVersionTable.PSEdition -ne 'Desktop' -and $env:OS -ne 'Windows_NT') {
@ -119,10 +120,20 @@ function Main {
Write-Host "Verifying signature of $($item.Name)..."
$signature = Get-AuthenticodeSignature $outFile
if ($signature.SignerCertificate.Subject -like "*CN=Microsoft Corporation*" -and $signature.Status -eq "Valid") {
Write-Host "✅ Valid Microsoft signature found from $($item.Name)."
if ($env:WT_SESSION) {
Write-Host "✅ Valid Microsoft signature found from $($item.Name)."
}
else {
Write-Host "[OKAY] Valid Microsoft signature found from $($item.Name)."
}
}
else {
Write-Warning "⚠️ $($item.Name) is not signed by Microsoft. The download may get corrupted or your PC is infected with virus."
if ($env:WT_SESSION) {
Write-Warning "⚠️ $($item.Name) is not signed by Microsoft. The download may get corrupted or your PC is infected with virus."
}
else {
Write-Warning "[WARN] $($item.Name) is not signed by Microsoft. The download may get corrupted or your PC is infected with virus."
}
$response = Read-Host -Prompt "Would you like to proceed anyway? (Y/N)"
if ($response -eq 'Y' -or $response -eq 'y') {
continue
@ -155,4 +166,6 @@ function Main {
Remove-Item -Path $flagPath -Force -ErrorAction SilentlyContinue
}
Main
Main
Write-Host "Press any key to exit."
[Console]::ReadKey($true) > $null