@ -72,7 +72,7 @@ if ($Wrapper)
Start-Sleep -Second 1
Start-Sleep -Second 1
Invoke-Item -Path " $ DownloadsFolder\Sophia Script Wrapper v $ LatestRelease "
Invoke-Item -Path " $ DownloadsFolder\Sophia_Script_Wrapper_ v $ LatestRelease "
}
}
switch ( ( Get-CimInstance -ClassName Win32_OperatingSystem ) . BuildNumber )
switch ( ( Get-CimInstance -ClassName Win32_OperatingSystem ) . BuildNumber )
@ -204,38 +204,38 @@ switch ($Version)
{
{
" Wrapper "
" Wrapper "
{
{
Invoke-Item -Path " $ DownloadsFolder\Sophia Script Wrapper v $ LatestRelease "
Invoke-Item -Path " $ DownloadsFolder\Sophia_Script_Wrapper_ v $ LatestRelease "
}
}
" LTSC2019 "
" LTSC2019 "
{
{
Invoke-Item -Path " $ DownloadsFolder\Sophia Script for Windows 10 LTSC 2019 v $ LatestRelease "
Invoke-Item -Path " $ DownloadsFolder\Sophia_Script_for_Windows_10_LTSC_2019_ v $ LatestRelease "
}
}
" LTSC2021 "
" LTSC2021 "
{
{
Invoke-Item -Path " $ DownloadsFolder\Sophia Script for Windows 10 LTSC 2021 v $ LatestRelease "
Invoke-Item -Path " $ DownloadsFolder\Sophia_Script_for_Windows_10_LTSC_2021_ v $ LatestRelease "
}
}
" Windows_10_PowerShell_5.1 "
" Windows_10_PowerShell_5.1 "
{
{
Invoke-Item -Path " $ DownloadsFolder\Sophia Script for Windows 10 v $ LatestRelease "
Invoke-Item -Path " $ DownloadsFolder\Sophia_Script_for_Windows_10_ v $ LatestRelease "
}
}
" Windows_10_PowerShell_7 "
" Windows_10_PowerShell_7 "
{
{
Invoke-Item -Path " $ DownloadsFolder\Sophia Script for Windows 10 PowerShell 7 v $ LatestRelease "
Invoke-Item -Path " $ DownloadsFolder\Sophia_Script_for_Windows_10_PowerShell_7_ v $ LatestRelease "
}
}
" Windows_11_PowerShell_5.1 "
" Windows_11_PowerShell_5.1 "
{
{
Invoke-Item -Path " $ DownloadsFolder\Sophia Script for Windows 11 v $ LatestRelease "
Invoke-Item -Path " $ DownloadsFolder\Sophia_Script_for_Windows_11_ v $ LatestRelease "
}
}
" Windows_11_PowerShell_7 "
" Windows_11_PowerShell_7 "
{
{
Invoke-Item -Path " $ DownloadsFolder\Sophia Script for Windows 11 PowerShell 7 v $ LatestRelease "
Invoke-Item -Path " $ DownloadsFolder\Sophia_Script_for_Windows_11_PowerShell_7_ v $ LatestRelease "
}
}
}
}
$SetForegroundWindow = @ {
$SetForegroundWindow = @ {
Namespace = " WinAPI "
Namespace = " WinAPI "
Name = " ForegroundWindow "
Name = " ForegroundWindow "
Language = " CSharp "
Language = " CSharp "
MemberDefinition = @ "
MemberDefinition = @ "
[ DllImport ( " user32.dll " ) ]
[ DllImport ( " user32.dll " ) ]
public static extern bool ShowWindowAsync ( IntPtr hWnd , int nCmdShow ) ;
public static extern bool ShowWindowAsync ( IntPtr hWnd , int nCmdShow ) ;
@ -251,7 +251,7 @@ if (-not ("WinAPI.ForegroundWindow" -as [type]))
Start-Sleep -Seconds 1
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 {
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
# Show window, if minimized
[WinAPI.ForegroundWindow] :: ShowWindowAsync ( $_ . MainWindowHandle , 5 )
[WinAPI.ForegroundWindow] :: ShowWindowAsync ( $_ . MainWindowHandle , 5 )