Browse Source

Updated building scripts

pull/740/head
Dmitry Nefedov 3 weeks ago
parent
commit
a588256d01
  1. 2
      .github/workflows/Chocolatey.yml
  2. 16
      .github/workflows/Gallery.yml
  3. 18
      Download_Latest_Sophia.ps1
  4. 54
      Download_Sophia.ps1
  5. 16
      ReleaseNotesTemplate.md
  6. 9
      Scripts/Building/WinGet_SFX.ps1
  7. 18
      Scripts/Building/Windows_10.ps1
  8. 18
      Scripts/Building/Windows_10_LTSC_2019.ps1
  9. 18
      Scripts/Building/Windows_10_LTSC_2021.ps1
  10. 20
      Scripts/Building/Windows_10_PS_7.ps1
  11. 18
      Scripts/Building/Windows_11.ps1
  12. 18
      Scripts/Building/Windows_11_Arm.ps1
  13. 18
      Scripts/Building/Windows_11_Arm_PS_7.ps1
  14. 18
      Scripts/Building/Windows_11_LTSC_2024.ps1
  15. 18
      Scripts/Building/Windows_11_LTSC_2024_PS7.ps1
  16. 18
      Scripts/Building/Windows_11_PS_7.ps1
  17. 4
      Scripts/Building/Wrapper.ps1
  18. 51
      Scripts/Chocolatey/tools/chocolateyinstall.ps1
  19. 69
      Scripts/ReleaseNotesTemplate.ps1
  20. 5
      Scripts/WinGet/WinGet.ps1
  21. 45
      Scripts/chocolatey.ps1

2
.github/workflows/Chocolatey.yml

@ -17,7 +17,7 @@ jobs:
- name: Pack and push to Chocolatey
run: |
# $Latest_Release.Sophia_Script_Windows_11_PowerShell_5_1
# $Latest_Release.Sophia_Script_Windows_11
Write-Verbose -Message $env:LatestRelease -Verbose
# Replace variables with script latest versions

16
.github/workflows/Gallery.yml

@ -18,38 +18,38 @@ jobs:
run: |
# https://www.powershellgallery.com/packages/SophiaScript
$Token = $env:GITHUB_TOKEN
$Headers = @{
Accept = "application/vnd.github+json"
Authorization = "Bearer $Token"
Authorization = "Bearer $env:GITHUB_TOKEN"
}
# Get latest version tag for Windows 11
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/refs/heads/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/refs/heads/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Version = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1
$JSON = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$($Version)/Sophia.Script.for.Windows.11.v$($Version).zip"
OutFile = "$DownloadsFolder\Sophia.Script.for.Windows.11.v$($Version).zip"
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$($JSON)/Sophia.Script.for.Windows.11.v$($JSON).zip"
OutFile = "$DownloadsFolder\Sophia.Script.for.Windows.11.v$($JSON).zip"
UseBasicParsing = $true
Verbose = $true
}
$Request = Invoke-WebRequest @Parameters
$Parameters = @{
Path = "$DownloadsFolder\Sophia.Script.for.Windows.11.v$($Version).zip"
Path = "$DownloadsFolder\Sophia.Script.for.Windows.11.v$($JSON).zip"
DestinationPath = $DownloadsFolder
Force = $true
}
Expand-Archive @Parameters
$Parameters = @{
Path = "$DownloadsFolder\Sophia_Script_for_Windows_11_v$($Version)"
Path = "$DownloadsFolder\Sophia_Script_for_Windows_11_v$($JSON)"
ApiKey = $env:GALLERY_KEY
Repository = "PSGallery"
Verbose = $true

18
Download_Latest_Sophia.ps1

@ -41,17 +41,13 @@ try
}
catch [System.Net.WebException]
{
Write-Warning -Message "https://github.com is unreachable. Please fix connection or change your DNS records."
Write-Warning -Message "https://codeload.github.com is unreachable. Please check Internet connection or change your DNS records."
Write-Information -MessageData "" -InformationAction Continue
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
$DNS = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Where-Object -FilterScript {$_.Status -eq "Up"} | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
}
else
{
$DNS = (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"} | Get-NetIPInterface -AddressFamily IPv4 | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
}
$DNS = (Get-NetRoute -AddressFamily IPv4 | Where-Object -FilterScript {$_.Protocol -eq "NetMgmt"} | Get-NetAdapter | Where-Object -FilterScript {
($_.Status -eq "Up") -and (-not $_.Virtual)
} | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
Write-Warning -Message "You're using $(if ($DNS.Count -gt 1) {$DNS -join ', '} else {$DNS}) DNS records"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
@ -172,7 +168,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
try
{
# tar.exe cannot expand archive if username contains unicode characters, so we download archive to the system drive root
# tar.exe cannot extract an archive if it is located in a folder whose path includes $env:USERPROFILE path, so we download the archive to the $env:SystemDrive\Sophia_Script_Temp folder
& "$env:SystemRoot\System32\tar.exe" -xvf "$env:SystemDrive\Sophia_Script_Temp\main.zip" -C "$env:SystemDrive\Sophia_Script_Temp" --strip-components=2 "Sophia-Script-for-Windows-main/src/$Version"
}
catch
@ -260,7 +256,7 @@ $Parameters = @{
}
Copy-Item @Parameters
Remove-Item -Path $env:SystemDrive\Sophia_Script_Temp -Recurse -Force
Remove-Item -Path "$env:SystemDrive\Sophia_Script_Temp" -Force -Recurse
switch ($Version)
{

54
Download_Sophia.ps1

@ -31,6 +31,7 @@ try
$Parameters = @{
Uri = "https://api.github.com/repos/farag2/Sophia-Script-for-Windows/releases/latest"
UseBasicParsing = $true
Verbose = $true
}
$LatestGitHubRelease = (Invoke-RestMethod @Parameters).tag_name
}
@ -39,14 +40,10 @@ catch [System.Net.WebException]
Write-Warning -Message "https://api.github.com is unreachable. Please check Internet connection or change your DNS records."
Write-Information -MessageData "" -InformationAction Continue
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
$DNS = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Where-Object -FilterScript {$_.Status -eq "Up"} | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
}
else
{
$DNS = (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"} | Get-NetIPInterface -AddressFamily IPv4 | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
}
$DNS = (Get-NetRoute -AddressFamily IPv4 | Where-Object -FilterScript {$_.Protocol -eq "NetMgmt"} | Get-NetAdapter | Where-Object -FilterScript {
($_.Status -eq "Up") -and (-not $_.Virtual)
} | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
Write-Warning -Message "You're using $(if ($DNS.Count -gt 1) {$DNS -join ', '} else {$DNS}) DNS records"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
@ -59,24 +56,21 @@ catch [System.Net.WebException]
try
{
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$JSONVersions = Invoke-RestMethod @Parameters
$JSON = Invoke-RestMethod @Parameters
}
catch [System.Net.WebException]
{
Write-Warning -Message "https://raw.githubusercontent.com is unreachable. Please check Internet connection or change your DNS records."
Write-Information -MessageData "" -InformationAction Continue
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
$DNS = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Where-Object -FilterScript {$_.Status -eq "Up"} | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
}
else
{
$DNS = (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"} | Get-NetIPInterface -AddressFamily IPv4 | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
}
$DNS = (Get-NetRoute -AddressFamily IPv4 | Where-Object -FilterScript {$_.Protocol -eq "NetMgmt"} | Get-NetAdapter | Where-Object -FilterScript {
($_.Status -eq "Up") -and (-not $_.Virtual)
} | Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
Write-Warning -Message "You're using $(if ($DNS.Count -gt 1) {$DNS -join ', '} else {$DNS}) DNS records"
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
@ -96,7 +90,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
# Windows 10 LTSC 2019
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName) -match "LTSC 2019")
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2019
$LatestRelease = $JSON.Sophia_Script_Windows_10_LTSC_2019
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2019.v$LatestRelease.zip"
OutFile = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -129,10 +123,10 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
"19044"
{
# Check for Windows 10 LTSC 2021
# Windows 10 LTSC 2021
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName) -match "LTSC 2021")
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2021
$LatestRelease = $JSON.Sophia_Script_Windows_10_LTSC_2021
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip"
OutFile = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -165,9 +159,10 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
"19045"
{
$LatestRelease = $JSON.Sophia_Script_Windows_10
if ($Host.Version.Major -eq 5)
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_PowerShell_5_1
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.v$LatestRelease.zip"
OutFile = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -180,7 +175,6 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
else
{
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_7
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip"
OutFile = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -197,10 +191,11 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
# Windows 11 LTSC 2024
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName) -match "LTSC 2024")
{
$LatestRelease = $JSON.Sophia_Script_Windows_11_LTSC_2024
# PowerShell 5.1
if ($Host.Version.Major -eq 5)
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.LTSC.2024.v$LatestRelease.zip"
OutFile = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -214,7 +209,6 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
else
{
# PowerShell 7
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_LTSC2024_PowerShell_7
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$LatestRelease.zip"
OutFile = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -228,13 +222,14 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
else
{
$LatestRelease = $JSON.Sophia_Script_Windows_11
# PowerShell 5.1
if ($Host.Version.Major -eq 5)
{
if ((Get-CimInstance -ClassName CIM_Processor).Caption -match "ARM")
{
# Arm based
$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 = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -247,7 +242,6 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
else
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_5_1
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.v$LatestRelease.zip"
OutFile = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -261,11 +255,12 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
else
{
$LatestRelease = $JSON.Sophia_Script_Windows_11
# PowerShell 7
if ((Get-CimInstance -ClassName CIM_Processor).Caption -match "ARM")
{
# Arm based
$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 = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -278,7 +273,6 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
}
else
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_7
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.PowerShell.7.v$LatestRelease.zip"
OutFile = "$env:SystemDrive\Sophia_Script_Temp\Sophia.Script.zip"
@ -422,7 +416,7 @@ if (-not ("WinAPI.ForegroundWindow" -as [type]))
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"} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 5)

16
ReleaseNotesTemplate.md

@ -110,7 +110,7 @@ Diff from vOldVersion
</tr>
<tr>
<td align="left">
<a href="https://github.com/farag2/Sophia-Script-for-Windows/releases/download/NewVersion/Sophia.Script.for.Windows.10.LTSC.2019.vSophia_Script_Windows_10_LTSC2019.zip">
<a href="https://github.com/farag2/Sophia-Script-for-Windows/releases/download/NewVersion/Sophia.Script.for.Windows.10.LTSC.2019.vSophia_Script_Windows_10_LTSC_2019.zip">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/LTSC%202019.svg?label=Windows%2010&amp;variant=outline&amp;size=sm&amp;mode=dark">
<img src="https://shieldcn.dev/badge/LTSC%202019.svg?label=Windows%2010&amp;variant=outline&amp;size=sm&amp;mode=light">
@ -118,7 +118,7 @@ Diff from vOldVersion
</a>
</td>
<td align="left">
<a href="https://www.virustotal.com/gui/file/SHA256_Sophia_Script_Windows_10_LTSC2019">
<a href="https://www.virustotal.com/gui/file/SHA256_Sophia_Script_Windows_10_LTSC_2019">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/VirusTotal.svg?logo=virustotal&amp;variant=outline&amp;size=sm&amp;mode=dark">
<img src="https://shieldcn.dev/badge/VirusTotal.svg?logo=virustotal&amp;variant=outline&amp;size=sm&amp;mode=light">
@ -126,7 +126,7 @@ Diff from vOldVersion
</a>
</td>
<td align="left">
<a href="https://github.com/farag2/Sophia-Script-for-Windows/releases/download/NewVersion/Sophia.Script.for.Windows.11.LTSC.2024.vSophia_Script_Windows_11_LTSC2024_PowerShell_5_1.zip">
<a href="https://github.com/farag2/Sophia-Script-for-Windows/releases/download/NewVersion/Sophia.Script.for.Windows.11.LTSC.2024.vSophia_Script_Windows_11_LTSC_2024_PowerShell_5_1.zip">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/PowerShell%205.1.svg?label=Windows%2011%20LTSC%202024&amp;variant=outline&amp;size=sm&amp;mode=dark">
<img src="https://shieldcn.dev/badge/PowerShell%205.1.svg?label=Windows%2011%20LTSC%202024&amp;variant=outline&amp;size=sm&amp;mode=light">
@ -134,7 +134,7 @@ Diff from vOldVersion
</a>
</td>
<td align="left">
<a href="https://www.virustotal.com/gui/file/SHA256_Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1">
<a href="https://www.virustotal.com/gui/file/SHA256_Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/VirusTotal.svg?logo=virustotal&amp;variant=outline&amp;size=sm&amp;mode=dark">
<img src="https://shieldcn.dev/badge/VirusTotal.svg?logo=virustotal&amp;variant=outline&amp;size=sm&amp;mode=light">
@ -144,7 +144,7 @@ Diff from vOldVersion
</tr>
<tr>
<td align="left">
<a href="https://github.com/farag2/Sophia-Script-for-Windows/releases/download/NewVersion/Sophia.Script.for.Windows.10.LTSC.2021.vSophia_Script_Windows_10_LTSC2021.zip">
<a href="https://github.com/farag2/Sophia-Script-for-Windows/releases/download/NewVersion/Sophia.Script.for.Windows.10.LTSC.2021.vSophia_Script_Windows_10_LTSC_2021.zip">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/LTSC%202021.svg?label=Windows%2010&amp;variant=outline&amp;size=sm&amp;mode=dark">
<img src="https://shieldcn.dev/badge/LTSC%202021.svg?label=Windows%2010&amp;variant=outline&amp;size=sm&amp;mode=light">
@ -152,7 +152,7 @@ Diff from vOldVersion
</a>
</td>
<td align="left">
<a href="https://www.virustotal.com/gui/file/SHA256_Sophia_Script_Windows_10_LTSC2021">
<a href="https://www.virustotal.com/gui/file/SHA256_Sophia_Script_Windows_10_LTSC_2021">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/VirusTotal.svg?logo=virustotal&amp;variant=outline&amp;size=sm&amp;mode=dark">
<img src="https://shieldcn.dev/badge/VirusTotal.svg?logo=virustotal&amp;variant=outline&amp;size=sm&amp;mode=light">
@ -160,7 +160,7 @@ Diff from vOldVersion
</a>
</td>
<td align="left">
<a href="https://github.com/farag2/Sophia-Script-for-Windows/releases/download/NewVersion/Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.vSophia_Script_Windows_11_LTSC2024_PowerShell_7.zip">
<a href="https://github.com/farag2/Sophia-Script-for-Windows/releases/download/NewVersion/Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.vSophia_Script_Windows_11_LTSC_2024_PowerShell_7.zip">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/PowerShell%207.svg?label=Windows%2011%20LTSC%202024&amp;variant=outline&amp;size=sm&amp;mode=dark">
<img src="https://shieldcn.dev/badge/PowerShell%207.svg?label=Windows%2011%20LTSC%202024&amp;variant=outline&amp;size=sm&amp;mode=light">
@ -168,7 +168,7 @@ Diff from vOldVersion
</a>
</td>
<td align="left">
<a href="https://www.virustotal.com/gui/file/SHA256_Sophia_Script_Windows_11_LTSC2024_PowerShell_7">
<a href="https://www.virustotal.com/gui/file/SHA256_Sophia_Script_Windows_11_LTSC_2024_PowerShell_7">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/VirusTotal.svg?logo=virustotal&amp;variant=outline&amp;size=sm&amp;mode=dark">
<img src="https://shieldcn.dev/badge/VirusTotal.svg?logo=virustotal&amp;variant=outline&amp;size=sm&amp;mode=light">

9
Scripts/Building/WinGet_SFX.ps1

@ -4,14 +4,15 @@ Write-Verbose -Message SFX -Verbose
winget install --id RARLab.WinRAR --accept-source-agreements --force
# Get latest version tag for Windows 11
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/refs/heads/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/refs/heads/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_11_PowerShell_5_1 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1
$Latest_Release_Windows_11 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11
(Get-Content -Path Scripts\WinGet\WinGet_SFX_config.txt -Encoding utf8NoBOM -Raw) | Foreach-Object -Process {$_ -replace "SophiaScriptVersion", $Latest_Release_Windows_11_PowerShell_5_1} | Set-Content -Path Scripts\WinGet\WinGet_SFX_config.txt -Encoding utf8NoBOM -Force
(Get-Content -Path Scripts\WinGet\WinGet_SFX_config.txt -Encoding utf8NoBOM -Raw) | Foreach-Object -Process {$_ -replace "SophiaScriptVersion", $Latest_Release_Windows_11} | Set-Content -Path Scripts\WinGet\WinGet_SFX_config.txt -Encoding utf8NoBOM -Force
# Create SFX archive
& "$env:ProgramFiles\WinRAR\RAR.exe" a -sfx -z"Scripts\WinGet\WinGet_SFX_config.txt" -ep1 -r "Sophia_Script\Sophia.Script.for.Windows.11.v$($Latest_Release_Windows_11_PowerShell_5_1)_WinGet.exe" "Sophia_Script\Sophia_Script_for_Windows_11_v$($Latest_Release_Windows_11_PowerShell_5_1)\*"
& "$env:ProgramFiles\WinRAR\RAR.exe" a -sfx -z"Scripts\WinGet\WinGet_SFX_config.txt" -ep1 -r "Sophia_Script\Sophia.Script.for.Windows.11.v$($Latest_Release_Windows_11)_WinGet.exe" "Sophia_Script\Sophia_Script_for_Windows_11_v$($Latest_Release_Windows_11)\*"

18
Scripts/Building/Windows_10.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_10_PowerShell_5_1 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_5_1
$Latest_Release_Windows_10 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10
Write-Verbose -Message "Sophia.Script.for.Windows.10.v$Latest_Release_Windows_10_PowerShell_5_1.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.10.v$Latest_Release_Windows_10.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_10_v$Latest_Release_Windows_10_PowerShell_5_1\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_10_v$Latest_Release_Windows_10\Module\Binaries" -ItemType Directory -Force
# Copy Windows 10 PS 5.1 version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_10" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_10_v$Latest_Release_Windows_10_PowerShell_5_1" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_10" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_10_v$Latest_Release_Windows_10" -Recurse -Force
# Add LGPO.exe
$Parameters = @{
Path = "Sophia_Script\LGPO.exe"
Destination = "Sophia_Script\Sophia_Script_for_Windows_10_v$Latest_Release_Windows_10_PowerShell_5_1\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_10_v$Latest_Release_Windows_10\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_10_v$Latest_Release_Windows_10_PowerShell_5_1"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.10.v$Latest_Release_Windows_10_PowerShell_5_1.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_10_v$Latest_Release_Windows_10"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.10.v$Latest_Release_Windows_10.zip"
CompressionLevel = "Fastest"
Force = $true
}

18
Scripts/Building/Windows_10_LTSC_2019.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_10_LTSC2019 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC2019
$Latest_Release_Windows_10_LTSC_2019 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC_2019
Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2019.v$Latest_Release_Windows_10_LTSC2019.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2019.v$Latest_Release_Windows_10_LTSC_2019.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2019_v$Latest_Release_Windows_10_LTSC2019\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2019_v$Latest_Release_Windows_10_LTSC_2019\Module\Binaries" -ItemType Directory -Force
# Copy Windows 10 LTSC 2019 PS 5.1 version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_10_LTSC_2019" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2019_v$Latest_Release_Windows_10_LTSC2019" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_10_LTSC_2019" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2019_v$Latest_Release_Windows_10_LTSC_2019" -Recurse -Force
# Add LGPO.exe
$Parameters = @{
Path = "Sophia_Script\LGPO.exe"
Destination = "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2019_v$Latest_Release_Windows_10_LTSC2019\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2019_v$Latest_Release_Windows_10_LTSC_2019\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2019_v$Latest_Release_Windows_10_LTSC2019"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.10.LTSC.2019.v$Latest_Release_Windows_10_LTSC2019.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2019_v$Latest_Release_Windows_10_LTSC_2019"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.10.LTSC.2019.v$Latest_Release_Windows_10_LTSC_2019.zip"
CompressionLevel = "Fastest"
Force = $true
}

18
Scripts/Building/Windows_10_LTSC_2021.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_10_LTSC2021 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC2021
$Latest_Release_Windows_10_LTSC_2021 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC_2021
Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2021.v$Latest_Release_Windows_10_LTSC2021.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2021.v$Latest_Release_Windows_10_LTSC_2021.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2021_v$Latest_Release_Windows_10_LTSC2021\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2021_v$Latest_Release_Windows_10_LTSC_2021\Module\Binaries" -ItemType Directory -Force
# Copy Windows 10 LTSC 2021 PS 5.1 version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_10_LTSC_2021" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2021_v$Latest_Release_Windows_10_LTSC2021" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_10_LTSC_2021" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2021_v$Latest_Release_Windows_10_LTSC_2021" -Recurse -Force
# Add LGPO.exe
$Parameters = @{
Path = "Sophia_Script\LGPO.exe"
Destination = "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2021_v$Latest_Release_Windows_10_LTSC2021\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2021_v$Latest_Release_Windows_10_LTSC_2021\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2021_v$Latest_Release_Windows_10_LTSC2021"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.10.LTSC.2021.v$Latest_Release_Windows_10_LTSC2021.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_10_LTSC_2021_v$Latest_Release_Windows_10_LTSC_2021"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.10.LTSC.2021.v$Latest_Release_Windows_10_LTSC_2021.zip"
CompressionLevel = "Fastest"
Force = $true
}

20
Scripts/Building/Windows_10_PS_7.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_10_PowerShell_7 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_7
$Latest_Release_Windows_10 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10
Write-Verbose -Message "Sophia.Script.for.Windows.10.PowerShell.7.v$Latest_Release_Windows_10_PowerShell_7.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.10.PowerShell.7.v$Latest_Release_Windows_10.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_10_PowerShell_7_v$Latest_Release_Windows_10_PowerShell_7\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_10_PowerShell_7_v$Latest_Release_Windows_10\Module\Binaries" -ItemType Directory -Force
# Copy Windows 10 PS 7 version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_10_PowerShell_7" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_10_PowerShell_7_v$Latest_Release_Windows_10_PowerShell_7" -Recurse -Force
# Copy Windows 10 PowerShell 7 version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_10_PowerShell_7" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_10_PowerShell_7_v$Latest_Release_Windows_10" -Recurse -Force
# Add LGPO.exe, WinRT.Runtime.dll, and Microsoft.Windows.SDK.NET.dll
$Parameters = @{
Path = @("Sophia_Script\LGPO.exe", "Sophia_Script\WinRT.Runtime.dll", "Sophia_Script\Microsoft.Windows.SDK.NET.dll")
Destination = "Sophia_Script\Sophia_Script_for_Windows_10_PowerShell_7_v$Latest_Release_Windows_10_PowerShell_7\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_10_PowerShell_7_v$Latest_Release_Windows_10\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_10_PowerShell_7_v$Latest_Release_Windows_10_PowerShell_7"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.10.PowerShell.7.v$Latest_Release_Windows_10_PowerShell_7.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_10_PowerShell_7_v$Latest_Release_Windows_10"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.10.PowerShell.7.v$Latest_Release_Windows_10.zip"
CompressionLevel = "Fastest"
Force = $true
}

18
Scripts/Building/Windows_11.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_11_PowerShell_5_1 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1
$Latest_Release_Windows_11 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11
Write-Verbose -Message "Sophia.Script.for.Windows.11.v$Latest_Release_Windows_11_PowerShell_5_1.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.11.v$Latest_Release_Windows_11.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_v$Latest_Release_Windows_11_PowerShell_5_1\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_v$Latest_Release_Windows_11\Module\Binaries" -ItemType Directory -Force
# Copy Windows 11 PS 5.1 version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_v$Latest_Release_Windows_11_PowerShell_5_1" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_v$Latest_Release_Windows_11" -Recurse -Force
# Add LGPO.exe
$Parameters = @{
Path = "Sophia_Script\LGPO.exe"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_v$Latest_Release_Windows_11_PowerShell_5_1\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_v$Latest_Release_Windows_11\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_11_v$Latest_Release_Windows_11_PowerShell_5_1"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.v$Latest_Release_Windows_11_PowerShell_5_1.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_11_v$Latest_Release_Windows_11"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.v$Latest_Release_Windows_11.zip"
CompressionLevel = "Fastest"
Force = $true
}

18
Scripts/Building/Windows_11_Arm.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_11_Arm_PowerShell_5_1 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1
$Latest_Release_Windows_11_Arm = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11
Write-Verbose -Message "Sophia.Script.for.Windows.11.Arm.v$Latest_Release_Windows_11_Arm_PowerShell_5_1.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.11.Arm.v$Latest_Release_Windows_11_Arm.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_Arm_v$Latest_Release_Windows_11_Arm_PowerShell_5_1\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_Arm_v$Latest_Release_Windows_11_Arm\Module\Binaries" -ItemType Directory -Force
# Copy Windows 11 PS 5.1 (ARM) version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_Arm" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_Arm_v$Latest_Release_Windows_11_Arm_PowerShell_5_1" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_Arm" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_Arm_v$Latest_Release_Windows_11_Arm" -Recurse -Force
# Add LGPO.exe
$Parameters = @{
Path = "Sophia_Script\LGPO.exe"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_Arm_v$Latest_Release_Windows_11_Arm_PowerShell_5_1\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_Arm_v$Latest_Release_Windows_11_Arm\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_11_Arm_v$Latest_Release_Windows_11_Arm_PowerShell_5_1"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.Arm.v$Latest_Release_Windows_11_Arm_PowerShell_5_1.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_11_Arm_v$Latest_Release_Windows_11_Arm"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.Arm.v$Latest_Release_Windows_11_Arm.zip"
CompressionLevel = "Fastest"
Force = $true
}

18
Scripts/Building/Windows_11_Arm_PS_7.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_11_Arm_PowerShell_7 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_7
$Latest_Release_Windows_11_Arm = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11
Write-Verbose -Message "Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$Latest_Release_Windows_11_Arm_PowerShell_7.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$Latest_Release_Windows_11_Arm.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_Arm_PowerShell_7_v$Latest_Release_Windows_11_Arm_PowerShell_7\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_Arm_PowerShell_7_v$Latest_Release_Windows_11_Arm\Module\Binaries" -ItemType Directory -Force
# Copy Windows 11 PS 7 (ARM) version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_Arm_PowerShell_7" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_Arm_PowerShell_7_v$Latest_Release_Windows_11_Arm_PowerShell_7" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_Arm_PowerShell_7" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_Arm_PowerShell_7_v$Latest_Release_Windows_11_Arm" -Recurse -Force
# Add LGPO.exe, WinRT.Runtime.dll, and Microsoft.Windows.SDK.NET.dll
$Parameters = @{
Path = @("Sophia_Script\LGPO.exe", "Sophia_Script\WinRT.Runtime.dll", "Sophia_Script\Microsoft.Windows.SDK.NET.dll")
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_Arm_PowerShell_7_v$Latest_Release_Windows_11_Arm_PowerShell_7\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_Arm_PowerShell_7_v$Latest_Release_Windows_11_Arm\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_11_Arm_PowerShell_7_v$Latest_Release_Windows_11_Arm_PowerShell_7"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$Latest_Release_Windows_11_Arm_PowerShell_7.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_11_Arm_PowerShell_7_v$Latest_Release_Windows_11_Arm"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$Latest_Release_Windows_11_Arm.zip"
CompressionLevel = "Fastest"
Force = $true
}

18
Scripts/Building/Windows_11_LTSC_2024.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_11_LTSC2024 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1
$Latest_Release_Windows_11_LTSC_2024 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_LTSC_2024
Write-Verbose -Message "Sophia.Script.for.Windows.11.LTSC.2024.v$Latest_Release_Windows_11_LTSC2024.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.11.LTSC.2024.v$Latest_Release_Windows_11_LTSC_2024.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_v$Latest_Release_Windows_11_LTSC2024\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_v$Latest_Release_Windows_11_LTSC_2024\Module\Binaries" -ItemType Directory -Force
# Copy Windows 11 LTSC 2024 version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_LTSC_2024" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_v$Latest_Release_Windows_11_LTSC2024" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_LTSC_2024" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_v$Latest_Release_Windows_11_LTSC_2024" -Recurse -Force
# Add LGPO.exe
$Parameters = @{
Path = "Sophia_Script\LGPO.exe"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_v$Latest_Release_Windows_11_LTSC2024\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_v$Latest_Release_Windows_11_LTSC_2024\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_v$Latest_Release_Windows_11_LTSC2024"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.LTSC.2024.v$Latest_Release_Windows_11_LTSC2024.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_v$Latest_Release_Windows_11_LTSC_2024"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.LTSC.2024.v$Latest_Release_Windows_11_LTSC_2024.zip"
CompressionLevel = "Fastest"
Force = $true
}

18
Scripts/Building/Windows_11_LTSC_2024_PS7.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_11_LTSC2024_PowerShell_7 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_LTSC2024_PowerShell_7
$Latest_Release_Windows_11_LTSC_2024 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_LTSC_2024
Write-Verbose -Message "Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$Latest_Release_Windows_11_LTSC2024_PowerShell_7.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$Latest_Release_Windows_11_LTSC_2024.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7_v$Latest_Release_Windows_11_LTSC2024_PowerShell_7\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7_v$Latest_Release_Windows_11_LTSC_2024\Module\Binaries" -ItemType Directory -Force
# Copy Windows 11 LTSC 2024 PS 7 version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7_v$Latest_Release_Windows_11_LTSC2024_PowerShell_7" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7_v$Latest_Release_Windows_11_LTSC_2024" -Recurse -Force
# Add LGPO.exe, WinRT.Runtime.dll, and Microsoft.Windows.SDK.NET.dll
$Parameters = @{
Path = @("Sophia_Script\LGPO.exe", "Sophia_Script\WinRT.Runtime.dll", "Sophia_Script\Microsoft.Windows.SDK.NET.dll")
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7_v$Latest_Release_Windows_11_LTSC2024_PowerShell_7\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7_v$Latest_Release_Windows_11_LTSC_2024\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7_v$Latest_Release_Windows_11_LTSC2024_PowerShell_7"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$Latest_Release_Windows_11_LTSC2024_PowerShell_7.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_11_LTSC_2024_PowerShell_7_v$Latest_Release_Windows_11_LTSC_2024"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$Latest_Release_Windows_11_LTSC_2024.zip"
CompressionLevel = "Fastest"
Force = $true
}

18
Scripts/Building/Windows_11_PS_7.ps1

@ -1,30 +1,30 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$Latest_Release_Windows_11_PowerShell_7 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_7
$Latest_Release_Windows_11 = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11
Write-Verbose -Message "Sophia.Script.for.Windows.11.PowerShell.7.v$Latest_Release_Windows_11_PowerShell_7.zip" -Verbose
Write-Verbose -Message "Sophia.Script.for.Windows.11.PowerShell.7.v$Latest_Release_Windows_11.zip" -Verbose
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_PowerShell_7_v$Latest_Release_Windows_11_PowerShell_7\Module\Binaries" -ItemType Directory -Force
New-Item -Path "Sophia_Script\Sophia_Script_for_Windows_11_PowerShell_7_v$Latest_Release_Windows_11\Module\Binaries" -ItemType Directory -Force
# Copy Windows 11 PS 7 (ARM) version to new folder
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_PowerShell_7" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_PowerShell_7_v$Latest_Release_Windows_11_PowerShell_7" -Recurse -Force
Get-ChildItem -Path "src\Sophia_Script_for_Windows_11_PowerShell_7" -Force | Copy-Item -Destination "Sophia_Script\Sophia_Script_for_Windows_11_PowerShell_7_v$Latest_Release_Windows_11" -Recurse -Force
# Add LGPO.exe, WinRT.Runtime.dll, and Microsoft.Windows.SDK.NET.dll
$Parameters = @{
Path = @("Sophia_Script\LGPO.exe", "Sophia_Script\WinRT.Runtime.dll", "Sophia_Script\Microsoft.Windows.SDK.NET.dll")
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_PowerShell_7_v$Latest_Release_Windows_11_PowerShell_7\Module\Binaries"
Destination = "Sophia_Script\Sophia_Script_for_Windows_11_PowerShell_7_v$Latest_Release_Windows_11\Module\Binaries"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
$Parameters = @{
Path = "Sophia_Script\Sophia_Script_for_Windows_11_PowerShell_7_v$Latest_Release_Windows_11_PowerShell_7"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.PowerShell.7.v$Latest_Release_Windows_11_PowerShell_7.zip"
Path = "Sophia_Script\Sophia_Script_for_Windows_11_PowerShell_7_v$Latest_Release_Windows_11"
DestinationPath = "Sophia_Script\Sophia.Script.for.Windows.11.PowerShell.7.v$Latest_Release_Windows_11.zip"
CompressionLevel = "Fastest"
Force = $true
}

4
Scripts/Building/Wrapper.ps1

@ -1,6 +1,6 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/sophia_script_versions.json
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}

51
Scripts/Chocolatey/tools/chocolateyinstall.ps1

@ -11,7 +11,19 @@
.EXAMPLE To download for PowerShell 7
choco install sophia --params "/PS7" --force -y
#>
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Clear-Host
$Error.Clear()
if ($Host.Version.Major -eq 5)
{
# Progress bar can significantly impact cmdlet performance
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
}
$Parameters = @{
Uri = "https://api.github.com/repos/farag2/Sophia-Script-for-Windows/releases/latest"
@ -20,12 +32,13 @@ $Parameters = @{
}
$LatestGitHubRelease = (Invoke-RestMethod @Parameters).tag_name
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$JSONVersions = Invoke-RestMethod @Parameters
$JSON = Invoke-RestMethod @Parameters
$packageParameters = $env:chocolateyPackageParameters
@ -34,16 +47,16 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
"17763"
{
# Windows 10 LTSC 2019
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2019
$LatestRelease = $JSON.Sophia_Script_Windows_10_LTSC_2019
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2019.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_10_LTSC2019"
$Hash = "Hash_Sophia_Script_Windows_10_LTSC_2019"
}
"19044"
{
# Windows 10 LTSC 2021
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2021
$LatestRelease = $JSON.Sophia_Script_Windows_10_LTSC_2021
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_10_LTSC2021"
$Hash = "Hash_Sophia_Script_Windows_10_LTSC_2021"
}
"19045"
{
@ -51,37 +64,37 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{
if ($packageParameters.Contains('PS7'))
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_PowerShell_7
$LatestRelease = $JSON.Sophia_Script_Windows_10
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_10_PowerShell_7"
}
}
else
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_PowerShell_5_1
$LatestRelease = $JSON.Sophia_Script_Windows_10
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_10_PowerShell_5_1"
$Hash = "Hash_Sophia_Script_Windows_10"
}
}
{$_ -eq 26100}
{
# Check for Windows 11 LTSC 2024
# Windows 11 LTSC 2024
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName) -match "LTSC 2024")
{
if ($packageParameters)
{
if ($packageParameters.Contains('PS7'))
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_LTSC2024_PowerShell_7
$LatestRelease = $JSON.Sophia_Script_Windows_11_LTSC_2024
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_11_LTSC2024_PowerShell_7"
$Hash = "Hash_Sophia_Script_Windows_11_LTSC_2024"
}
}
else
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1
$LatestRelease = $JSON.Sophia_Script_Windows_11_LTSC_2024
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.LTSC.2024.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1"
$Hash = "Hash_Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1"
}
}
}
@ -93,13 +106,13 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{
if ((Get-CimInstance -ClassName CIM_Processor).Caption -match "ARM")
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_Arm_PowerShell_7
$LatestRelease = $JSON.Sophia_Script_Windows_11_Arm
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_11_Arm_PowerShell_7"
}
else
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_7
$LatestRelease = $JSON.Sophia_Script_Windows_11
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.PowerShell.7.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_11_PowerShell_7"
}
@ -109,13 +122,13 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{
if ((Get-CimInstance -ClassName CIM_Processor).Caption -match "ARM")
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_Arm_PowerShell_5_1
$LatestRelease = $JSON.Sophia_Script_Windows_11
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.Arm.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_11_Arm_PowerShell_5_1"
}
else
{
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_5_1
$LatestRelease = $JSON.Sophia_Script_Windows_11
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.v$LatestRelease.zip"
$Hash = "Hash_Sophia_Script_Windows_11_PowerShell_5_1"
}

69
Scripts/ReleaseNotesTemplate.ps1

@ -12,25 +12,26 @@ $Parameters = @{
$OldTag = (Invoke-RestMethod @Parameters).tag_name | Select-Object -First 1
# Parse json for the latest script versions
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
$JSON = Invoke-RestMethod @Parameters
$Archives = [ordered]@{
"Sophia_Script_Windows_10_PowerShell_5_1" = "Sophia.Script.for.Windows.10.v$($JSON.Sophia_Script_Windows_10_PowerShell_5_1).zip"
"Sophia_Script_Windows_10_PowerShell_7" = "Sophia.Script.for.Windows.10.PowerShell.7.v$($JSON.Sophia_Script_Windows_10_PowerShell_7).zip"
"Sophia_Script_Windows_10_LTSC2019" = "Sophia.Script.for.Windows.10.LTSC.2019.v$($JSON.Sophia_Script_Windows_10_LTSC2019).zip"
"Sophia_Script_Windows_10_LTSC2021" = "Sophia.Script.for.Windows.10.LTSC.2021.v$($JSON.Sophia_Script_Windows_10_LTSC2021).zip"
"Sophia_Script_Windows_11_PowerShell_5_1" = "Sophia.Script.for.Windows.11.v$($JSON.Sophia_Script_Windows_11_PowerShell_5_1).zip"
"Sophia_Script_Windows_11_PowerShell_7" = "Sophia.Script.for.Windows.11.PowerShell.7.v$($JSON.Sophia_Script_Windows_11_PowerShell_7).zip"
"Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1" = "Sophia.Script.for.Windows.11.LTSC.2024.v$($JSON.Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1).zip"
"Sophia_Script_Windows_11_LTSC2024_PowerShell_7" = "Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$($JSON.Sophia_Script_Windows_11_LTSC2024_PowerShell_7).zip"
"Sophia_Script_Windows_11_Arm_PowerShell_5_1" = "Sophia.Script.for.Windows.11.Arm.v$($JSON.Sophia_Script_Windows_11_Arm_PowerShell_5_1).zip"
"Sophia_Script_Windows_11_Arm_PowerShell_7" = "Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$($JSON.Sophia_Script_Windows_11_Arm_PowerShell_7).zip"
"Sophia_Script_Wrapper" = "Sophia.Script.Wrapper.v$($JSON.Sophia_Script_Wrapper).zip"
"Sophia_Script_Windows_10_PowerShell_5_1" = "Sophia.Script.for.Windows.10.v$($JSON.Sophia_Script_Windows_10).zip"
"Sophia_Script_Windows_10_PowerShell_7" = "Sophia.Script.for.Windows.10.PowerShell.7.v$($JSON.Sophia_Script_Windows_10).zip"
"Sophia_Script_Windows_10_LTSC_2019" = "Sophia.Script.for.Windows.10.LTSC.2019.v$($JSON.Sophia_Script_Windows_10_LTSC_2019).zip"
"Sophia_Script_Windows_10_LTSC_2021" = "Sophia.Script.for.Windows.10.LTSC.2021.v$($JSON.Sophia_Script_Windows_10_LTSC_2021).zip"
"Sophia_Script_Windows_11_PowerShell_5_1" = "Sophia.Script.for.Windows.11.v$($JSON.Sophia_Script_Windows_11).zip"
"Sophia_Script_Windows_11_PowerShell_7" = "Sophia.Script.for.Windows.11.PowerShell.7.v$($JSON.Sophia_Script_Windows_11).zip"
"Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1" = "Sophia.Script.for.Windows.11.LTSC.2024.v$($JSON.Sophia_Script_Windows_11_LTSC_2024).zip"
"Sophia_Script_Windows_11_LTSC_2024_PowerShell_7" = "Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$($JSON.Sophia_Script_Windows_11_LTSC_2024).zip"
"Sophia_Script_Windows_11_Arm_PowerShell_5_1" = "Sophia.Script.for.Windows.11.Arm.v$($JSON.Sophia_Script_Windows_11).zip"
"Sophia_Script_Windows_11_Arm_PowerShell_7" = "Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$($JSON.Sophia_Script_Windows_11).zip"
"Sophia_Script_Wrapper" = "Sophia.Script.Wrapper.v$($JSON.Sophia_Script_Wrapper).zip"
}
$Hashes = [ordered]@{}
@ -45,30 +46,30 @@ foreach ($Token in $Archives.Keys)
# Replace variables with script latest versions
(Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Raw) | Foreach-Object -Process {
# ${{ github.ref_name }}
$_ -replace "SHA256_Sophia_Script_Windows_10_PowerShell_5_1", $Hashes.Sophia_Script_Windows_10_PowerShell_5_1 `
-replace "SHA256_Sophia_Script_Windows_10_PowerShell_7", $Hashes.Sophia_Script_Windows_10_PowerShell_7 `
-replace "SHA256_Sophia_Script_Windows_10_LTSC2019", $Hashes.Sophia_Script_Windows_10_LTSC2019 `
-replace "SHA256_Sophia_Script_Windows_10_LTSC2021", $Hashes.Sophia_Script_Windows_10_LTSC2021 `
-replace "SHA256_Sophia_Script_Windows_11_PowerShell_5_1", $Hashes.Sophia_Script_Windows_11_PowerShell_5_1 `
-replace "SHA256_Sophia_Script_Windows_11_PowerShell_7", $Hashes.Sophia_Script_Windows_11_PowerShell_7 `
-replace "SHA256_Sophia_Script_Windows_11_Arm_PowerShell_5_1", $Hashes.Sophia_Script_Windows_11_Arm_PowerShell_5_1 `
-replace "SHA256_Sophia_Script_Windows_11_Arm_PowerShell_7", $Hashes.Sophia_Script_Windows_11_Arm_PowerShell_7 `
-replace "SHA256_Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1", $Hashes.Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1 `
-replace "SHA256_Sophia_Script_Windows_11_LTSC2024_PowerShell_7", $Hashes.Sophia_Script_Windows_11_LTSC2024_PowerShell_7 `
-replace "SHA256_Sophia_Script_Wrapper", $Hashes.Sophia_Script_Wrapper `
$_ -replace "SHA256_Sophia_Script_Windows_10_PowerShell_5_1", $Hashes.Sophia_Script_Windows_10_PowerShell_5_1 `
-replace "SHA256_Sophia_Script_Windows_10_PowerShell_7", $Hashes.Sophia_Script_Windows_10_PowerShell_7 `
-replace "SHA256_Sophia_Script_Windows_10_LTSC_2019", $Hashes.Sophia_Script_Windows_10_LTSC_2019 `
-replace "SHA256_Sophia_Script_Windows_10_LTSC_2021", $Hashes.Sophia_Script_Windows_10_LTS_C2021 `
-replace "SHA256_Sophia_Script_Windows_11_PowerShell_5_1", $Hashes.Sophia_Script_Windows_11_PowerShell_5_1 `
-replace "SHA256_Sophia_Script_Windows_11_PowerShell_7", $Hashes.Sophia_Script_Windows_11_PowerShell_7 `
-replace "SHA256_Sophia_Script_Windows_11_Arm_PowerShell_5_1", $Hashes.Sophia_Script_Windows_11_Arm_PowerShell_5_1 `
-replace "SHA256_Sophia_Script_Windows_11_Arm_PowerShell_7", $Hashes.Sophia_Script_Windows_11_Arm_PowerShell_7 `
-replace "SHA256_Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1", $Hashes.Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1 `
-replace "SHA256_Sophia_Script_Windows_11_LTSC_2024_PowerShell_7", $Hashes.Sophia_Script_Windows_11_LTSC_2024_PowerShell_7 `
-replace "SHA256_Sophia_Script_Wrapper", $Hashes.Sophia_Script_Wrapper `
-replace "NewVersion", $env:INPUT_TAG `
-replace "OldVersion", $OldTag `
-replace "Sophia_Script_Windows_10_PowerShell_5_1", $JSON.Sophia_Script_Windows_10_PowerShell_5_1 `
-replace "Sophia_Script_Windows_10_PowerShell_7", $JSON.Sophia_Script_Windows_10_PowerShell_7 `
-replace "Sophia_Script_Windows_10_LTSC2019", $JSON.Sophia_Script_Windows_10_LTSC2019 `
-replace "Sophia_Script_Windows_10_LTSC2021", $JSON.Sophia_Script_Windows_10_LTSC2021 `
-replace "Sophia_Script_Windows_11_PowerShell_5_1", $JSON.Sophia_Script_Windows_11_PowerShell_5_1 `
-replace "Sophia_Script_Windows_11_PowerShell_7", $JSON.Sophia_Script_Windows_11_PowerShell_7 `
-replace "Sophia_Script_Windows_11_Arm_PowerShell_5_1", $JSON.Sophia_Script_Windows_11_Arm_PowerShell_5_1 `
-replace "Sophia_Script_Windows_11_Arm_PowerShell_7", $JSON.Sophia_Script_Windows_11_Arm_PowerShell_7 `
-replace "Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1", $JSON.Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1 `
-replace "Sophia_Script_Windows_11_LTSC2024_PowerShell_7", $JSON.Sophia_Script_Windows_11_LTSC2024_PowerShell_7 `
-replace "Sophia_Script_Wrapper", $JSON.Sophia_Script_Wrapper
-replace "Sophia_Script_Windows_10_PowerShell_5_1", $JSON.Sophia_Script_Windows_10 `
-replace "Sophia_Script_Windows_10_PowerShell_7", $JSON.Sophia_Script_Windows_10 `
-replace "Sophia_Script_Windows_10_LTSC_2019", $JSON.Sophia_Script_Windows_10_LTSC_2019 `
-replace "Sophia_Script_Windows_10_LTSC_2021", $JSON.Sophia_Script_Windows_10_LTSC_2021 `
-replace "Sophia_Script_Windows_11_PowerShell_5_1", $JSON.Sophia_Script_Windows_11 `
-replace "Sophia_Script_Windows_11_PowerShell_7", $JSON.Sophia_Script_Windows_11 `
-replace "Sophia_Script_Windows_11_Arm_PowerShell_5_1", $JSON.Sophia_Script_Windows_11 `
-replace "Sophia_Script_Windows_11_Arm_PowerShell_7", $JSON.Sophia_Script_Windows_11 `
-replace "Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1", $JSON.Sophia_Script_Windows_11_LTSC_2024 `
-replace "Sophia_Script_Windows_11_LTSC_2024_PowerShell_7", $JSON.Sophia_Script_Windows_11_LTSC_2024 `
-replace "Sophia_Script_Wrapper", $JSON.Sophia_Script_Wrapper
} | Set-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Force
# https://trstringer.com/github-actions-multiline-strings/

5
Scripts/WinGet/WinGet.ps1

@ -52,13 +52,14 @@ if ([System.Version]$LocalManifest -lt [System.Version]$LatestManifest)
}
# Get latest version tag for Windows 11
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/refs/heads/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
Headers = $Headers
UseBasicParsing = $true
Verbose = $true
}
$Version = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1
$Version = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11
# Get archive hash
$Parameters = @{

45
Scripts/chocolatey.ps1

@ -1,5 +1,6 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/main/Sophia_Script_Releases.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/sophia_script_versions.json"
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/main/Sophia_Script_Releases.json"
UseBasicParsing = $true
Verbose = $true
}
@ -13,31 +14,31 @@ $Parameters = @{
$assets = (Invoke-RestMethod @Parameters).assets
# Get SHA256 hash sum of each asset
$Sophia_Script_Windows_10_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.v$($Latest_Release.Sophia_Script_Windows_10_PowerShell_5_1).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_10_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_10_PowerShell_7).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_10_LTSC2019 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.LTSC.2019.v$($Latest_Release.Sophia_Script_Windows_10_LTSC2019).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_10_LTSC2021 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.LTSC.2021.v$($Latest_Release.Sophia_Script_Windows_10_LTSC2021).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.v$($Latest_Release.Sophia_Script_Windows_11_PowerShell_5_1).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_Arm_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.Arm.v$($Latest_Release.Sophia_Script_Windows_11_Arm_PowerShell_5_1).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_Arm_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_11_Arm_PowerShell_7).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_11_PowerShell_7).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.LTSC.2024.v$($Latest_Release.Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_LTSC2024_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_11_LTSC2024_PowerShell_7).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_10_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.v$($Latest_Release.Sophia_Script_Windows_10).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_10_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_10).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_10_LTSC_2019 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.LTSC.2019.v$($Latest_Release.Sophia_Script_Windows_10_LTSC_2019).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_10_LTSC_2021 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.LTSC.2021.v$($Latest_Release.Sophia_Script_Windows_10_LTSC_2021).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.v$($Latest_Release.Sophia_Script_Windows_11).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_Arm_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.Arm.v$($Latest_Release.Sophia_Script_Windows_11).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_Arm_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_11).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_11).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.LTSC.2024.v$($Latest_Release.Sophia_Script_Windows_11_LTSC_2024).zip"}).digest.Replace("sha256:", "")
$Sophia_Script_Windows_11_LTSC_2024_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.LTSC.2024.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_11_LTSC_2024).zip"}).digest.Replace("sha256:", "")
# Replace variables with script latest versions
(Get-Content -Path "Scripts\Chocolatey\tools\chocolateyinstall.ps1" -Encoding utf8 -Raw) | Foreach-Object -Process {
$_ -replace "Hash_Sophia_Script_Windows_10_PowerShell_5_1", $Sophia_Script_Windows_10_PowerShell_5_1 `
-replace "Hash_Sophia_Script_Windows_10_PowerShell_7", $Sophia_Script_Windows_10_PowerShell_7 `
-replace "Hash_Sophia_Script_Windows_10_LTSC2019", $Sophia_Script_Windows_10_LTSC2019 `
-replace "Hash_Sophia_Script_Windows_10_LTSC2021", $Sophia_Script_Windows_10_LTSC2021 `
-replace "Hash_Sophia_Script_Windows_11_PowerShell_5_1", $Sophia_Script_Windows_11_PowerShell_5_1 `
-replace "Hash_Sophia_Script_Windows_11_Arm_PowerShell_5_1", $Sophia_Script_Windows_11_Arm_PowerShell_5_1 `
-replace "Hash_Sophia_Script_Windows_11_Arm_PowerShell_7", $Sophia_Script_Windows_11_Arm_PowerShell_7 `
-replace "Hash_Sophia_Script_Windows_11_PowerShell_7", $Sophia_Script_Windows_11_PowerShell_7 `
-replace "Hash_Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1", $Sophia_Script_Windows_11_LTSC2024_PowerShell_5_1 `
-replace "Hash_Sophia_Script_Windows_11_LTSC2024_PowerShell_7", $Sophia_Script_Windows_11_LTSC2024_PowerShell_7
$_ -replace "Hash_Sophia_Script_Windows_10_PowerShell_5_1", $Sophia_Script_Windows_10_PowerShell_5_1 `
-replace "Hash_Sophia_Script_Windows_10_PowerShell_7", $Sophia_Script_Windows_10_PowerShell_7 `
-replace "Hash_Sophia_Script_Windows_10_LTSC_2019", $Sophia_Script_Windows_10_LTSC_2019 `
-replace "Hash_Sophia_Script_Windows_10_LTSC_2021", $Sophia_Script_Windows_10_LTSC_2021 `
-replace "Hash_Sophia_Script_Windows_11_PowerShell_5_1", $Sophia_Script_Windows_11_PowerShell_5_1 `
-replace "Hash_Sophia_Script_Windows_11_Arm_PowerShell_5_1", $Sophia_Script_Windows_11_Arm_PowerShell_5_1 `
-replace "Hash_Sophia_Script_Windows_11_Arm_PowerShell_7", $Sophia_Script_Windows_11_Arm_PowerShell_7 `
-replace "Hash_Sophia_Script_Windows_11_PowerShell_7", $Sophia_Script_Windows_11_PowerShell_7 `
-replace "Hash_Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1", $Sophia_Script_Windows_11_LTSC_2024_PowerShell_5_1 `
-replace "Hash_Sophia_Script_Windows_11_LTSC_2024_PowerShell_7", $Sophia_Script_Windows_11_LTSC_2024_PowerShell_7
} | Set-Content -Path "Scripts\Chocolatey\tools\chocolateyinstall.ps1" -Encoding utf8 -Force
# Save latest release tag for sophia.nuspec
$LatestRelease = $Latest_Release.Sophia_Script_Windows_11_PowerShell_5_1
$LatestRelease = $Latest_Release.Sophia_Script_Windows_11
"LatestRelease=$LatestRelease" >> $env:GITHUB_ENV

Loading…
Cancel
Save