|
14 | 14 | #> |
15 | 15 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
16 | 16 |
|
17 | | -if ($Host.Version.Major -eq 5) ### |
| 17 | +if ($Host.Version.Major -eq 5) |
18 | 18 | { |
19 | 19 | # Progress bar can significantly impact cmdlet performance |
20 | 20 | # https://github.com/PowerShell/PowerShell/issues/2138 |
@@ -126,29 +126,44 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) |
126 | 126 | } |
127 | 127 | {$_ -ge 22631} |
128 | 128 | { |
129 | | - if ($Host.Version.Major -eq 5) |
| 129 | + if ((Get-WindowsEdition -Online).Edition -notmatch "EnterpriseS") |
130 | 130 | { |
131 | | - $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1 |
132 | | - $Parameters = @{ |
133 | | - Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.v$LatestRelease.zip" |
134 | | - OutFile = "$DownloadsFolder\Sophia.Script.zip" |
135 | | - UseBasicParsing = $true |
136 | | - Verbose = $true |
| 131 | + if ($Host.Version.Major -eq 5) |
| 132 | + { |
| 133 | + $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1 |
| 134 | + $Parameters = @{ |
| 135 | + Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.v$LatestRelease.zip" |
| 136 | + OutFile = "$DownloadsFolder\Sophia.Script.zip" |
| 137 | + UseBasicParsing = $true |
| 138 | + Verbose = $true |
| 139 | + } |
| 140 | + |
| 141 | + $Version = "Windows_11_PowerShell_5.1" |
| 142 | + } |
| 143 | + else |
| 144 | + { |
| 145 | + $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_7 |
| 146 | + $Parameters = @{ |
| 147 | + Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.PowerShell.7.v$LatestRelease.zip" |
| 148 | + OutFile = "$DownloadsFolder\Sophia.Script.zip" |
| 149 | + UseBasicParsing = $true |
| 150 | + Verbose = $true |
| 151 | + } |
| 152 | + |
| 153 | + $Version = "Windows_11_PowerShell_7" |
137 | 154 | } |
138 | | - |
139 | | - $Version = "Windows_11_PowerShell_5.1" |
140 | 155 | } |
141 | 156 | else |
142 | 157 | { |
143 | | - $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_7 |
| 158 | + $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_LTSC2024 |
144 | 159 | $Parameters = @{ |
145 | | - Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.PowerShell.7.v$LatestRelease.zip" |
| 160 | + Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.LTSC.2024.v$LatestRelease.zip" |
146 | 161 | OutFile = "$DownloadsFolder\Sophia.Script.zip" |
147 | 162 | UseBasicParsing = $true |
148 | 163 | Verbose = $true |
149 | 164 | } |
150 | 165 |
|
151 | | - $Version = "Windows_11_PowerShell_7" |
| 166 | + $Version = "LTSC2024" |
152 | 167 | } |
153 | 168 | } |
154 | 169 | } |
@@ -196,6 +211,14 @@ switch ($Version) |
196 | 211 | Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease" |
197 | 212 | } |
198 | 213 | } |
| 214 | + "LTSC2024" |
| 215 | + { |
| 216 | + Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease" |
| 217 | + if ((([System.Security.Principal.WindowsIdentity]::GetCurrent()).Owner -eq "S-1-5-32-544")) |
| 218 | + { |
| 219 | + Set-Location -Path "$DownloadsFolder\Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease" |
| 220 | + } |
| 221 | + } |
199 | 222 | "Windows_10_PowerShell_5.1" |
200 | 223 | { |
201 | 224 | Invoke-Item -Path "$DownloadsFolder\Sophia_Script_for_Windows_10_v$LatestRelease" |
|
0 commit comments