Browse Source

Create Windows_10_PS_7.ps1

pull/401/head
Dmitry Nefedov 2 years ago
committed by GitHub
parent
commit
d18e8968b0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      Scripts/Windows_10_PS_7.ps1

32
Scripts/Windows_10_PS_7.ps1

@ -0,0 +1,32 @@
# https://github.com/farag2/Sophia-Script-for-Windows/blob/master/sophia_script_versions.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json"
}
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_7
Write-Verbose -Message "Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip" -Verbose
New-Item -Path "Sophia Script for Windows 10 PowerShell 7 v$LatestRelease\bin" -ItemType Directory -Force
$Parameters = @{
Path = @("Scripts\PolicyFileEditor", "Scripts\WinRT.Runtime.dll", "Scripts\Microsoft.Windows.SDK.NET.dll")
Destination = "Sophia Script for Windows 10 PowerShell 7 v$LatestRelease\bin"
Recurse = $true
Force = $true
}
Copy-Item @Parameters
Get-ChildItem -Path "Sophia Script\Sophia Script for Windows 10 PowerShell 7" -Force | Copy-Item -Destination "Sophia Script for Windows 10 PowerShell 7 v$LatestRelease" -Recurse -Force
$Parameters = @{
Path = "Sophia Script for Windows 10 PowerShell 7 v$LatestRelease"
DestinationPath = "Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip"
CompressionLevel = "Fastest"
Force = $true
}
Compress-Archive @Parameters
# Calculate hash
Get-Item -Path "Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip" -Force | ForEach-Object -Process {
"$($_.Name) $((Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash)"
} | Add-Content -Path SHA256SUM -Encoding utf8 -Force
Loading…
Cancel
Save