From c876337fd7d6095a5987e2433547d9c2a80cb0cc Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sun, 26 Sep 2021 01:37:31 +0300 Subject: [PATCH] Update Download_Sophia.ps1 --- Download_Sophia.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index adda85a6..c1262498 100644 --- a/Download_Sophia.ps1 +++ b/Download_Sophia.ps1 @@ -143,10 +143,12 @@ if (-not ("WinAPI.ForegroundWindow" -as [type])) Add-Type @SetForegroundWindow } -Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -eq "Sophia Script v*"} | ForEach-Object -Process { +Get-Process- Name explorer | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script v"} | ForEach-Object -Process { # Show window, if minimized [WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 5) + Start-Sleep -Seconds 3 + # Force move the console window to the foreground [WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle) }