From 3e842dc06be5293280329d825e4177c77514ff1f Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sat, 28 May 2022 16:04:33 +0300 Subject: [PATCH] Update Download_Sophia.ps1 --- Download_Sophia.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index 261f8ca7..c902447d 100644 --- a/Download_Sophia.ps1 +++ b/Download_Sophia.ps1 @@ -237,12 +237,12 @@ if (-not ("WinAPI.ForegroundWindow" -as [type])) Add-Type @SetForegroundWindow } +Start-Sleep -Seconds 1 + Get-Process -Name explorer | Where-Object -FilterScript {$_.MainWindowTitle -match "Sophia Script for Windows $([System.Environment]::OSVersion.Version.Major)"} | 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) -} +} | Out-Null