|
@ -109,14 +109,12 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) |
|
|
{ |
|
|
{ |
|
|
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_7 |
|
|
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_7 |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip" |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip" |
|
|
$Hash = "D77C427F20364A3CF037182FF143F3F631A735C997C14FAE7DACEEDE0F011BED" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_PowerShell_5_1 |
|
|
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_PowerShell_5_1 |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.v$LatestRelease.zip" |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.v$LatestRelease.zip" |
|
|
$Hash = "0786B745C6C75FF1EEFBEF8970D66A1AA42EF2CDAEDE52255AD2AE9E9402CADF" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
{$_ -ge 26100} |
|
|
{$_ -ge 26100} |
|
@ -130,32 +128,32 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) |
|
|
{ |
|
|
{ |
|
|
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_7 |
|
|
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_7 |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.PowerShell.7.v$LatestRelease.zip" |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.PowerShell.7.v$LatestRelease.zip" |
|
|
$Hash = "BE7BC1EEFC4D1099E3D0CD8085DBAFF703E1DA65A2947C4B3A448F5A04BCE130" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_5_1 |
|
|
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_5_1 |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.v$LatestRelease.zip" |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.v$LatestRelease.zip" |
|
|
$Hash = "080F2CFE3A80BD91C3D713595F1263BE52F9A0E7A4AC51B2A0FB4E9E58420227" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_LTSC2024 |
|
|
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_LTSC2024 |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.LTSC.2024.v$LatestRelease.zip" |
|
|
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.LTSC.2024.v$LatestRelease.zip" |
|
|
$Hash = "6C5B7FA807412B5BA89DC473ED2B7B6908A0D558C5E183D50804526BA7819E38" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Downloads folder |
|
|
# Downloads folder |
|
|
$Downloads = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" |
|
|
$Downloads = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" |
|
|
|
|
|
$Hash = (Get-FileHash -InputStream (Invoke-WebRequest -Uri $URL -UseBasicParsing).RawContentStream -Algorithm SHA256).Hash |
|
|
$packageArgs = @{ |
|
|
$packageArgs = @{ |
|
|
packageName = $env:ChocolateyPackageName |
|
|
packageName = $env:ChocolateyPackageName |
|
|
unzipLocation = $Downloads |
|
|
unzipLocation = $Downloads |
|
|
url = $URL |
|
|
url = $URL |
|
|
checksum64 = $Hash |
|
|
checksum = $Hash |
|
|
checksumType64 = "sha256" |
|
|
checksumType = "sha256" |
|
|
} |
|
|
} |
|
|
Install-ChocolateyZipPackage @packageArgs |
|
|
Install-ChocolateyZipPackage @packageArgs |
|
|