Skip to content

Commit

Permalink
Small code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
farag2 committed Oct 20, 2024
1 parent 8441e46 commit cf8067b
Show file tree
Hide file tree
Showing 26 changed files with 3,396 additions and 4,431 deletions.
22 changes: 14 additions & 8 deletions Download_Sophia.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
Verbose = $true
}

$Version = "LTSC2019"
$Version = "Windows_10_LTSC2019"
}
else
{
Expand Down Expand Up @@ -79,7 +79,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
UseBasicParsing = $true
Verbose = $true
}
$Version = "LTSC2021"
$Version = "Windows_10_LTSC2021"
}
else
{
Expand Down Expand Up @@ -163,7 +163,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
Verbose = $true
}

$Version = "LTSC2024"
$Version = "Windows_11_LTSC2024"
}
}
}
Expand All @@ -176,10 +176,10 @@ if (-not (Test-Path -Path "$DownloadsFolder\Sophia.Script.zip"))
# Check for updates
Start-Process -FilePath "$env:SystemRoot\System32\UsoClient.exe" -ArgumentList StartInteractiveScan

# Open the "Windows Update" page
# Open t"Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate"

return
exit
}

$Parameters = @{
Expand All @@ -195,23 +195,25 @@ Start-Sleep -Second 1

switch ($Version)
{
"LTSC2019"
"Windows_10_LTSC2019"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease"

if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease"
}
}
"LTSC2021"
"Windows_10_LTSC2021"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease"

if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease"
}
}
"LTSC2024"
"Windows_11_LTSC2024"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease"
if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
Expand All @@ -222,6 +224,7 @@ switch ($Version)
"Windows_10_PowerShell_5.1"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_v$LatestRelease"

if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_v$LatestRelease"
Expand All @@ -230,6 +233,7 @@ switch ($Version)
"Windows_10_PowerShell_7"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease"

if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease"
Expand All @@ -238,6 +242,7 @@ switch ($Version)
"Windows_11_PowerShell_5.1"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_v$LatestRelease"

if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_v$LatestRelease"
Expand All @@ -246,6 +251,7 @@ switch ($Version)
"Windows_11_PowerShell_7"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease"

if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease"
Expand Down
2 changes: 1 addition & 1 deletion Wrapper/Localizations/en-US/tooltip_Windows_10.json
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,7 @@
"Arg": {
"Zero": {
"Tag": "",
"ToolTip": "Display all policy registry keys (even manually created ones) in the Local Group Policy Editor snap-in (gpedit.msc). This can take up to 30 minutes, depending on on the number of policies created in the registry and your system resources."
"ToolTip": "Display all policy registry keys (even manually created ones) in the Local Group Policy Editor snap-in (gpedit.msc). This can take up to 30 minutes, depending on the number of policies created in the registry and your system resources."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Wrapper/Localizations/en-US/tooltip_Windows_11.json
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@
"Arg": {
"Zero": {
"Tag": "",
"ToolTip": "Display all policy registry keys (even manually created ones) in the Local Group Policy Editor snap-in (gpedit.msc). This can take up to 30 minutes, depending on on the number of policies created in the registry and your system resources."
"ToolTip": "Display all policy registry keys (even manually created ones) in the Local Group Policy Editor snap-in (gpedit.msc). This can take up to 30 minutes, depending on the number of policies created in the registry and your system resources."
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TweakerWarning = Стабільність вашої
Bin = У папці bin відсутні файли. Будь ласка, повторно завантажте архів.
RebootPending = Комп'ютер очікує на перезавантаження.
UnsupportedRelease = Виявлено нову версію.
KeyboardArrows = Для вибору відповіді на клавіатурі стрілки {0} і {1}
KeyboardArrows = Для вибору відповіді використовуйте на клавіатурі стрілки {0} і {1}
CustomizationWarning = Ви налаштували всі функції в пресет-файлі {0} перед запуском Sophia Script?
WindowsComponentBroken = {0} пошкоджено або видалено з ОС.
UpdateDefender = Визначення Microsoft Defender застаріли. Запустіть Windows Update і повторіть спробу.
Expand Down
Loading

0 comments on commit cf8067b

Please sign in to comment.