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

19
64
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') {
@ -140,10 +141,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
@ -176,4 +187,6 @@ function Main {
Remove-Item -Path $flagPath -Force -ErrorAction SilentlyContinue
}
Main
Main
Write-Host "Press any key to exit."
[Console]::ReadKey($true) > $null

21
dx
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') {
@ -11,7 +12,7 @@ function Main {
Write-Warning "This script does not support Windows RT. Exiting..."
return 1
}
$flagPath = "$env:TEMP\elevation_success.flag"
if (Test-Path $flagPath) { Remove-Item $flagPath -ErrorAction SilentlyContinue }
@ -116,10 +117,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
@ -145,4 +156,6 @@ function Main {
Remove-Item -Path $flagPath -Force -ErrorAction SilentlyContinue
}
Main
Main
Write-Host "Press any key to exit."
[Console]::ReadKey($true) > $null

View file

@ -2,6 +2,7 @@
# This script is hosted on <b>https://get.msvc.win/</b> for <b><a href="https://msvc.win/">MSVC Win Project</a></b><br />To get started, run <b>irm get.msvc.win | iex</b> inside of PowerShell<hr><pre>
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') {
@ -139,10 +140,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
@ -183,4 +194,6 @@ function Main {
Remove-Item -Path $flagPath -Force -ErrorAction SilentlyContinue
}
Main
Main
Write-Host "Press any key to exit."
[Console]::ReadKey($true) > $null