From 2ff79a85db3efc31e118fc575352d226e0fd07a5 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Fri, 2 Feb 2024 21:58:17 +0300 Subject: [PATCH] Update Download_Sophia.ps1 --- Download_Sophia.ps1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index cb591e68..d810ec56 100644 --- a/Download_Sophia.ps1 +++ b/Download_Sophia.ps1 @@ -204,7 +204,16 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); } if (-not ("WinAPI.ForegroundWindow" -as [type])) { - Add-Type @SetForegroundWindow + try + { + Add-Type @Signature + } + catch [System.ComponentModel.Win32Exception] + { + Write-Warning -Message "PowerShell 5.1 does not compile code if the username contains non-Latin characters (including emoji) and is written in lowercase." + + exit + } } Start-Sleep -Seconds 1