Browse Source

Update Download_Sophia.ps1

pull/264/head
Dmitry Nefedov 3 years ago
committed by GitHub
parent
commit
d1c73a29ea
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Download_Sophia.ps1

4
Download_Sophia.ps1

@ -143,10 +143,12 @@ if (-not ("WinAPI.ForegroundWindow" -as [type]))
Add-Type @SetForegroundWindow Add-Type @SetForegroundWindow
} }
Get-Process | Where-Object -FilterScript {$_.MainWindowTitle -eq "Sophia Script v*"} | ForEach-Object -Process { Get-Process -Name explorer | Where-Object -FilterScript {$_.MainWindowTitle -eq "Sophia Script v*"} | ForEach-Object -Process {
# Show window, if minimized # Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 5) [WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 5)
Start-Sleep -Seconds 3
# Force move the console window to the foreground # Force move the console window to the foreground
[WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle) [WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle)
} }

Loading…
Cancel
Save