Browse Source

Merge branch 'farag2:master' into master

pull/341/head
THEBOSSMAGNUS 2 years ago
committed by GitHub
parent
commit
cda0dc6401
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      Download_Sophia.ps1
  2. 2
      README.md

19
Download_Sophia.ps1

@ -1,13 +1,16 @@
<#
.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
.EXAMPLE Download and the Sophia Script archive
irm script.sophi.app | iex
.EXAMPLE Download and expand Sophia Script archive
irm script.sophi.app -useb | iex
.EXAMPLE Download and expand the Wrapper archive
iex "& {$(irm script.sophi.app)} -Wrapper"
.EXAMPLE Download and expand Wrapper archive
iex "& {$(irm script.sophi.app -useb)} -Wrapper"
.NOTES
Current user
@ -136,7 +139,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
}
"22000"
{$_ -ge 22000}
{
if ($PSVersionTable.PSVersion.Major -eq 5)
{
@ -234,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

2
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`.

Loading…
Cancel
Save