Browse Source

Improved downloading th elatest provided script version

pull/658/head
Dmitry Nefedov 8 months ago
parent
commit
a294a19a8e
  1. 22
      Download_Latest_Sophia.ps1
  2. 34
      Download_Sophia.ps1
  3. 2
      src/Sophia_Script_for_Windows_11_ARM/Manifest/SophiaScript.psd1
  4. 2
      src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1
  5. 2
      src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1

22
Download_Latest_Sophia.ps1

@ -124,12 +124,12 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{
if ((Get-CimInstance -ClassName CIM_Processor).Caption -match "ARM")
{
$Version = "Sophia_Script_for_Windows_11_ARM"
$Version = "Windows_11_PowerShell_5_1"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 (Arm) | Latest | Made with $([System.Char]::ConvertFromUtf32(0x1F497)) of Windows | $([System.Char]0x00A9) farag, Inestic & lowl1f3, 2014$([System.Char]0x2013)2025"
}
else
{
$Version = "Sophia_Script_for_Windows_11"
$Version = "Windows_11_Arm_PowerShell_5_1"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 | Latest | Made with $([System.Char]::ConvertFromUtf32(0x1F497)) of Windows | $([System.Char]0x00A9) farag, Inestic & lowl1f3, 2014$([System.Char]0x2013)2025"
}
}
@ -321,6 +321,24 @@ switch ($Version)
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_PowerShell_7_Latest"
if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_PowerShell_7_Latest"
}
}
"Sophia_Script_for_Windows_11_Arm_PowerShell_5_1"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_Arm_Latest"
if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_PowerShell_7_Latest"
}
}
"Sophia_Script_for_Windows_11_Arm_PowerShell_7"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_Arm_PowerShell_7_Latest"
if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_PowerShell_7_Latest"

34
Download_Sophia.ps1

@ -155,7 +155,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
Invoke-WebRequest @Parameters
$Version = "Windows_10_PowerShell_5.1"
$Version = "Windows_10_PowerShell_5_1"
}
else
{
@ -182,7 +182,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
if ((Get-CimInstance -ClassName CIM_Processor).Caption -match "ARM")
{
# Arm based
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_5_1
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_Arm_PowerShell_5_1
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.ARM.v$LatestRelease.zip"
OutFile = "$DownloadsFolder\Sophia.Script.zip"
@ -191,7 +191,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
Invoke-WebRequest @Parameters
$Version = "Windows_11_PowerShell_5.1"
$Version = "Windows_11_Arm_PowerShell_5_1"
}
else
{
@ -204,7 +204,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
Invoke-WebRequest @Parameters
$Version = "Windows_11_PowerShell_5.1"
$Version = "Windows_11_PowerShell_5_1"
}
}
else
@ -213,7 +213,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
if ((Get-CimInstance -ClassName CIM_Processor).Caption -match "ARM")
{
# Arm based
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_7
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_Arm_PowerShell_7
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.ARM.PowerShell.7.v$LatestRelease.zip"
OutFile = "$DownloadsFolder\Sophia.Script.zip"
@ -222,7 +222,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
Invoke-WebRequest @Parameters
$Version = "Windows_11_PowerShell_7"
$Version = "Windows_11_Arm_PowerShell_7"
}
else
{
@ -326,7 +326,7 @@ switch ($Version)
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease"
}
}
"Windows_10_PowerShell_5.1"
"Windows_10_PowerShell_5_1"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_v$LatestRelease"
@ -344,7 +344,7 @@ switch ($Version)
Set-Location -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"
@ -362,6 +362,24 @@ switch ($Version)
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease"
}
}
"Windows_11_Arm_PowerShell_5_1"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_Arm_v$LatestRelease"
if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544"))
{
Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_Arm_v$LatestRelease"
}
}
"Windows_11_Arm_PowerShell_7"
{
Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_Arm_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_Arm_PowerShell_7_v$LatestRelease"
}
}
}
$Signature = @{

2
src/Sophia_Script_for_Windows_11_ARM/Manifest/SophiaScript.psd1

@ -6,7 +6,7 @@
Copyright = '(c) 2014—2025 Team Sophia. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '5.1'
ProcessorArchitecture = 'AMD64'
ProcessorArchitecture = 'None'
FunctionsToExport = '*'
PrivateData = @{

2
src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1

@ -261,7 +261,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check CPU architecture
$Caption = (Get-CimInstance -ClassName CIM_Processor).Caption
if (($Caption -notmatch "AMD64") -and ($Caption -notmatch "Intel64"))
if ($Caption -notmatch "Arm")
{
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Localization.UnsupportedArchitecture -f $Caption)

2
src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1

@ -274,7 +274,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Check CPU architecture
$Caption = (Get-CimInstance -ClassName CIM_Processor).Caption
if (($Caption -notmatch "AMD64") -and ($Caption -notmatch "Intel64"))
if ($Caption -notmatch "Arm")
{
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Localization.UnsupportedArchitecture -f $Caption)

Loading…
Cancel
Save