Browse Source

Update Download_Sophia.ps1

pull/252/head
Dmitry Nefedov 3 years ago
committed by GitHub
parent
commit
64e6406a65
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      Download_Sophia.ps1

26
Download_Sophia.ps1

@ -1,8 +1,34 @@
[CmdletBinding()]
param
(
[Parameter(Mandatory = $false)]
[switch]
$Wrapper
)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$LatestRelease = (Invoke-RestMethod -Uri "https://api.github.com/repos/farag2/Sophia-Script-for-Windows/releases/latest" -UseBasicParsing).tag_name
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
if ($Wrapper)
{
$LatestStableVersion = (Invoke-RestMethod -Uri "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json" -UseBasicParsing).Sophia_Script_Wrapper
$Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestRelease/Sophia.Script.Wrapper.v$LatestStableVersion.zip"
OutFile = "$DownloadsFolder\Sophia.Script.Wrapper.zip"
UseBasicParsing = $true
Verbose = $true
}
$Parameters = @{
Path = "$DownloadsFolder\Sophia.Script.Wrapper.zip"
DestinationPath = "$DownloadsFolder"
Force = $true
}
Expand-Archive @Parameters
}
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
{
"17763"

Loading…
Cancel
Save