Browse Source

Update chocolateyinstall.ps1

pull/625/head
Dmitry Nefedov 2 months ago
parent
commit
715e16c0c4
  1. 15
      README.md
  2. 94
      chocolatey/tools/chocolateyinstall.ps1
  3. 17
      docs/README_de-de.md
  4. 15
      docs/README_ru-ru.md
  5. 19
      docs/README_uk-ua.md

15
README.md

@ -49,6 +49,7 @@ Made with <img src="https://raw.githubusercontent.com/farag2/Sophia-Script-for-W
* [How to use](#how-to-use) * [How to use](#how-to-use)
* [Download via PowerShell](#download-via-powershell) * [Download via PowerShell](#download-via-powershell)
* [Download via Chocolatey](#download-via-chocolatey)
* [Manual method](#manual-method) * [Manual method](#manual-method)
* [How to run the specific function(s)](#how-to-run-the-specific-functions) * [How to run the specific function(s)](#how-to-run-the-specific-functions)
* [Wrapper](#wrapper) * [Wrapper](#wrapper)
@ -85,6 +86,20 @@ The command will download and expand the latest Sophia Script archive (`without
iwr sl.sophia.team -useb | iex iwr sl.sophia.team -useb | iex
``` ```
### Download via Chocolatey
The command will download and expand the latest Sophia Script archive (`without running`) according which Windows it is run on. If you run it on Windows 11, it will download Sophia Script for `Windows 11`. For `PowerShell 5.1` by default is not otherwise specified.
```powershell
choco install sophia --force -y
```
Download `Sophia Script for Windows` for `PowerShell 7`.
```powershell
choco install sophia --params "/PS7" --force -y
```
### Manual method ### Manual method
* Download an [archive](https://github.com/farag2/Sophia-Script-for-Windows/releases/latest) according to your Windows and PowerShell versions; * Download an [archive](https://github.com/farag2/Sophia-Script-for-Windows/releases/latest) according to your Windows and PowerShell versions;

94
chocolatey/tools/chocolateyinstall.ps1

@ -1,20 +1,18 @@
<# <#
.SYNOPSIS .SYNOPSIS
Get direct URL of Sophia Script archive, depending on which Windows or PowerShell versions are used to Get direct URL of Sophia Script archive, depending on which Windows it is run on
.SYNOPSIS .SYNOPSIS
For example, if you start script on Windows 11 via PowerShell 5.1 you will start downloading Sophia Script for Windows 11 PowerShell 5.1 For example, if you start script on Windows 11 you will start downloading Sophia Script for Windows 11
.EXAMPLE To download for PowerShell 5.1
choco install sophia --force -y
.EXAMPLE To download for PowerShell 7
choco install sophia --params "/PS7" --force -y
#> #>
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
if ($Host.Version.Major -eq 5)
{
# Progress bar can significantly impact cmdlet performance
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
}
$Parameters = @{ $Parameters = @{
Uri = "https://api.github.com/repos/farag2/Sophia-Script-for-Windows/releases/latest" Uri = "https://api.github.com/repos/farag2/Sophia-Script-for-Windows/releases/latest"
UseBasicParsing = $true UseBasicParsing = $true
@ -46,6 +44,9 @@ $Parameters = @{
} }
$JSONVersions = Invoke-RestMethod @Parameters $JSONVersions = Invoke-RestMethod @Parameters
$null = $packageParameters
$packageParameters = $env:chocolateyPackageParameters
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber) switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{ {
"17763" "17763"
@ -55,15 +56,6 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{ {
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2019 $LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2019
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2019.v$LatestRelease.zip" $URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2019.v$LatestRelease.zip"
$Parameters = @{
Uri = $URL
OutFile = "$DownloadsFolder\Sophia.Script.zip"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
$Version = "Windows_10_LTSC2019"
} }
else else
{ {
@ -89,13 +81,6 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{ {
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2021 $LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2021
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip" $URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip"
$Parameters = @{
Uri = $URL
OutFile = "$DownloadsFolder\Sophia.Script.zip"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
} }
else else
{ {
@ -116,72 +101,43 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
} }
"19045" "19045"
{ {
if ($Host.Version.Major -eq 5) if ($packageParameters)
{ {
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_PowerShell_5_1 if ($packageParameters.Contains('PS7'))
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.v$LatestRelease.zip"
$Parameters = @{
Uri = $URL
OutFile = "$DownloadsFolder\Sophia.Script.zip"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
}
else
{ {
$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"
$Parameters = @{
Uri = $URL
OutFile = "$DownloadsFolder\Sophia.Script.zip"
UseBasicParsing = $true
Verbose = $true
} }
Invoke-WebRequest @Parameters }
else
{
$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"
} }
} }
{$_ -ge 22631} {$_ -ge 26100}
{ {
# Check for Windows 11 LTSC 2024 # Check for Windows 11 LTSC 2024
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName) -notmatch "LTSC 2024") if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName) -notmatch "LTSC 2024")
{ {
if ($Host.Version.Major -eq 5) if ($packageParameters)
{ {
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_5_1 if ($packageParameters.Contains('PS7'))
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.v$LatestRelease.zip"
$Parameters = @{
Uri = $URL
OutFile = "$DownloadsFolder\Sophia.Script.zip"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
}
else
{ {
$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"
$Parameters = @{
Uri = $URL
OutFile = "$DownloadsFolder\Sophia.Script.zip"
UseBasicParsing = $true
Verbose = $true
} }
Invoke-WebRequest @Parameters }
else
{
$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"
} }
} }
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"
$Parameters = @{
Uri = $URL
OutFile = "$DownloadsFolder\Sophia.Script.zip"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
} }
} }
} }

17
docs/README_de-de.md

@ -49,6 +49,7 @@ Mit <img src="https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows
* [Verwendung](#verwendung) * [Verwendung](#verwendung)
* [Herunterladen über PowerShell](#herunterladen-über-powershell) * [Herunterladen über PowerShell](#herunterladen-über-powershell)
* [Herunterladen über Chocolatey](#herunterladen-über-chocolatey)
* [Manuelle Methode](#manuelle-methode) * [Manuelle Methode](#manuelle-methode)
* [Verwendung von spezifischen Funktionen](#verwendung-von-spezifischen-funktionen) * [Verwendung von spezifischen Funktionen](#verwendung-von-spezifischen-funktionen)
* [Wrapper](#wrapper) * [Wrapper](#wrapper)
@ -79,12 +80,26 @@ Der Befehl lädt das neueste Sophia Script-Archiv herunter und extrahiert es (`o
iwr script.sophia.team -useb | iex iwr script.sophia.team -useb | iex
``` ```
Der Befehl lädt das neueste Sophia Script-Archiv (ohne es auszuführen) aus dem letzten verfügbaren Commit herunter und erweitert es, je nachdem, auf welchen Windows- und PowerShell-Versionen es ausgeführt wird. Der Befehl lädt das neueste Sophia Script-Archiv (`ohne es auszuführen`) aus dem letzten verfügbaren Commit herunter und erweitert es, je nachdem, auf welchen Windows- und PowerShell-Versionen es ausgeführt wird.
```powershell ```powershell
iwr sl.sophia.team -useb | iex iwr sl.sophia.team -useb | iex
``` ```
### Herunterladen über Chocolatey
Der Befehl lädt das neueste Sophia Script-Archiv herunter und erweitert es (`ohne es auszuführen)`, je nachdem, unter welchem Windows er ausgeführt wird. Wenn Sie ihn unter Windows 11 ausführen, wird Sophia Script für `Windows 11` heruntergeladen. Für `PowerShell 5.1` ist standardmäßig nichts anderes angegeben.
```powershell
choco install sophia --force -y
```
Download `Sophia Script for Windows` for `PowerShell 7`.
```powershell
choco install sophia --params "/PS7" --force -y
```
### Manuelle Methode ### Manuelle Methode
* Laden Sie ein [Archiv](https://github.com/farag2/Sophia-Script-for-Windows/releases/latest) entsprechend Ihrer Windows- und PowerShell-Version herunter; * Laden Sie ein [Archiv](https://github.com/farag2/Sophia-Script-for-Windows/releases/latest) entsprechend Ihrer Windows- und PowerShell-Version herunter;

15
docs/README_ru-ru.md

@ -49,6 +49,7 @@
* [Как использовать](#как-использовать) * [Как использовать](#как-использовать)
* [Скачать через PowerShell](#скачать-через-powershell) * [Скачать через PowerShell](#скачать-через-powershell)
* [Скачать через Chocolatey](#скачать-через-chocolatey)
* [Вручную](#вручную) * [Вручную](#вручную)
* [Как выполните конкретную функцию(и)](#как-выполните-конкретную-функциюи) * [Как выполните конкретную функцию(и)](#как-выполните-конкретную-функциюи)
* [Wrapper](#wrapper) * [Wrapper](#wrapper)
@ -85,6 +86,20 @@ iwr script.sophia.team -useb | iex
iwr sl.sophia.team -useb | iex iwr sl.sophia.team -useb | iex
``` ```
### Скачать через Chocolatey
Команда скачает и распакуют последнюю версию архива Sophia Script (`без последующего запуска`) согласно версии Windows, на которой она запускалась. Допустим, если вы запустите ее на Windows 11, то скачается Sophia Script для `Windows 11`. По умолчанию для `PowerShell 5.1`, если не указано обратное.
```powershell
choco install sophia --force -y
```
Скачать `Sophia Script for Windows` для `PowerShell 7`.
```powershell
choco install sophia --params "/PS7" --force -y
```
### Вручную ### Вручную
* Скачайте [архив](https://github.com/farag2/Sophia-Script-for-Windows/releases/latest) согласно версиям вашей Windows и PowerShell; * Скачайте [архив](https://github.com/farag2/Sophia-Script-for-Windows/releases/latest) согласно версиям вашей Windows и PowerShell;

19
docs/README_uk-ua.md

@ -48,7 +48,8 @@
## Зміст ## Зміст
* [Як користуватися](#як-користуватися) * [Як користуватися](#як-користуватися)
* [Як завантажити Sophia Script через PowerShell](#завантажити-через-powershell) * [Завантажити через PowerShell](#завантажити-через-powershell)
* [Завантажити через Chocolatey](#завантажити-через-chocolatey)
* [Вручну](#вручну) * [Вручну](#вручну)
* [Як запустити певну функцію(ї)](#як-запустити-певну-функціюї) * [Як запустити певну функцію(ї)](#як-запустити-певну-функціюї)
* [Wrapper](#wrapper) * [Wrapper](#wrapper)
@ -71,7 +72,7 @@
> >
> `Sophia Script для Windows` може не працювати на "самопальних" збірках Windows. Особливо, якщо збірка була створена так, що в ній спеціально було зламано Microsoft Defender і вимкнено телеметрію, вирізавши системні компоненти. > `Sophia Script для Windows` може не працювати на "самопальних" збірках Windows. Особливо, якщо збірка була створена так, що в ній спеціально було зламано Microsoft Defender і вимкнено телеметрію, вирізавши системні компоненти.
## Завантажити через PowerShell ### Завантажити через PowerShell
Команда завантажить і розпакує останній архів Sophia Script (`без запуску`) відповідно до того, під якою версією Windows і PowerShell він запускається. Якщо запустити її, наприклад, в Windows 11 через PowerShell 5.1, вона завантажить Sophia Script для `Windows 11 PowerShell 5.1`. Команда завантажить і розпакує останній архів Sophia Script (`без запуску`) відповідно до того, під якою версією Windows і PowerShell він запускається. Якщо запустити її, наприклад, в Windows 11 через PowerShell 5.1, вона завантажить Sophia Script для `Windows 11 PowerShell 5.1`.
@ -85,6 +86,20 @@ iwr script.sophia.team -useb | iex
iwr sl.sophia.team -useb | iex iwr sl.sophia.team -useb | iex
``` ```
### Завантажити через Chocolatey
TКоманда завантажить і розпакує останню версію архіву Sophia Script (`без подальшого запуску`) згідно з версією Windows, на якій вона запускалася. Припустимо, якщо ви запустите її на Windows 11, то завантажиться Sophia Script для `Windows 11`. За замовчуванням для `PowerShell 5.1`, якщо не вказано зворотне.
```powershell
choco install sophia --force -y
```
Завантажити `Sophia Script for Windows` для `PowerShell 7`.
```powershell
choco install sophia --params "/PS7" --force -y
```
### Вручну ### Вручну
* Завантажити [архів](https://github.com/farag2/Sophia-Script-for-Windows/releases/latest) згідно з вашою версією Windows і PowerShell; * Завантажити [архів](https://github.com/farag2/Sophia-Script-for-Windows/releases/latest) згідно з вашою версією Windows і PowerShell;

Loading…
Cancel
Save