From 3f065cb6d92514bc0fcbbf4e1e920434c79c4e71 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Tue, 3 May 2022 18:07:58 +0300 Subject: [PATCH 1/5] Update Download_Sophia.ps1 --- Download_Sophia.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index 63e9bbc8..2f628ea5 100644 --- a/Download_Sophia.ps1 +++ b/Download_Sophia.ps1 @@ -1,6 +1,14 @@ <# .SYNOPSIS Download the latest Sophia Script version, depending on what Windows or PowerShell versions are used to + + .SYNOPSIS + + Download the latest Sophia Script version, depending on what Windows or PowerShell versions are used to + + E.g., if you start script on Windows 11 via PowerShell 5.1 you will start downloading Sophia Script for Windows 11 PowerShell 5.1 + + E.g., if you start script on Windows 11 via PowerShell 5.1 you will start downloading Sophia Script for Windows 11 PowerShell 5.1 .EXAMPLE Download and the Sophia Script archive @@ -136,7 +144,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) } } - "22000" + {$_ -ge 22000} { if ($PSVersionTable.PSVersion.Major -eq 5) { From be08ec983dbb3f55f6bf50ad88ad785265a46cca Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Tue, 3 May 2022 18:09:01 +0300 Subject: [PATCH 2/5] Update Download_Sophia.ps1 --- Download_Sophia.ps1 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index 2f628ea5..9ddcfa86 100644 --- a/Download_Sophia.ps1 +++ b/Download_Sophia.ps1 @@ -3,18 +3,13 @@ Download the latest Sophia Script version, depending on what Windows or PowerShell versions are used to .SYNOPSIS - Download the latest Sophia Script version, depending on what Windows or PowerShell versions are used to - - E.g., if you start script on Windows 11 via PowerShell 5.1 you will start downloading Sophia Script for Windows 11 PowerShell 5.1 - - E.g., if you start script on Windows 11 via PowerShell 5.1 you will start downloading Sophia Script for Windows 11 PowerShell 5.1 - .EXAMPLE Download and the Sophia Script archive + .EXAMPLE Download and expand Sophia Script archive irm script.sophi.app | iex - .EXAMPLE Download and expand the Wrapper archive + .EXAMPLE Download and expand Wrapper archive iex "& {$(irm script.sophi.app)} -Wrapper" .NOTES From 1bbb40c41d8a6bab976c4437f451d1fa801a1752 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Mon, 16 May 2022 17:20:48 +0300 Subject: [PATCH 3/5] Update Download_Sophia.ps1 --- Download_Sophia.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Download_Sophia.ps1 b/Download_Sophia.ps1 index 9ddcfa86..261f8ca7 100644 --- a/Download_Sophia.ps1 +++ b/Download_Sophia.ps1 @@ -7,10 +7,10 @@ E.g., if you start script on Windows 11 via PowerShell 5.1 you will start downloading Sophia Script for Windows 11 PowerShell 5.1 .EXAMPLE Download and expand Sophia Script archive - irm script.sophi.app | iex + irm script.sophi.app -useb | iex .EXAMPLE Download and expand Wrapper archive - iex "& {$(irm script.sophi.app)} -Wrapper" + iex "& {$(irm script.sophi.app -useb)} -Wrapper" .NOTES Current user From e49f514fc5b2c9af1d82c7b2903db3cae8c3cd48 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Mon, 16 May 2022 17:21:28 +0300 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59f7ed8a..3ba72b5d 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ Or use an old-style format without the TAB functions autocomplete (the quotation * Download the always latest Sophia Script archive by invoking (`not as administrator too`) in PowerShell ```powershell -irm script.sophi.app | iex +irm script.sophi.app -useb | iex ``` * The command will download and expand the latest Sophia Script archive (`without running`) according which Windows and PowerShell versions it is run on. If you run it on, e.g., Windows 11 via PowerShell 5.1, it will download Sophia Script for `Windows 11 PowerShell 5.1`. From 3e842dc06be5293280329d825e4177c77514ff1f Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sat, 28 May 2022 16:04:33 +0300 Subject: [PATCH 5/5] 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