Browse Source

Update Sophia.yml

pull/390/head
Dmitry Nefedov 2 years ago
committed by GitHub
parent
commit
9b2bb07a4d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      .github/workflows/Sophia.yml

8
.github/workflows/Sophia.yml

@ -59,18 +59,15 @@ jobs:
# Download Microsoft.Windows.SDK.NET.dll & WinRT.Runtime.dll # Download Microsoft.Windows.SDK.NET.dll & WinRT.Runtime.dll
$Parameters = @{ $Parameters = @{
Uri = "https://www.nuget.org/api/v2/package/Microsoft.Windows.SDK.NET.Ref" Uri = "https://www.nuget.org/api/v2/package/Microsoft.Windows.SDK.NET.Ref"
OutFile = "Scripts\microsoft.windows.sdk.net.ref.nupkg" OutFile = "Scripts\microsoft.windows.sdk.net.ref.zip"
UseBasicParsing = $true UseBasicParsing = $true
} }
Invoke-RestMethod @Parameters Invoke-RestMethod @Parameters
# Rename archive to able to expand it
Rename-Item -Path "Scripts\microsoft.windows.sdk.net.ref.nupkg" -NewName "microsoft.windows.sdk.net.ref.zip" -Force
# Extract Microsoft.Windows.SDK.NET.dll & WinRT.Runtime.dll from archive # Extract Microsoft.Windows.SDK.NET.dll & WinRT.Runtime.dll from archive
Add-Type -Assembly System.IO.Compression.FileSystem Add-Type -Assembly System.IO.Compression.FileSystem
$ZIP = [IO.Compression.ZipFile]::OpenRead("Scripts\microsoft.windows.sdk.net.ref.zip") $ZIP = [IO.Compression.ZipFile]::OpenRead("Scripts\microsoft.windows.sdk.net.ref.zip")
$Entries = $ZIP.Entries | Where-Object -FilterScript {($_.FullName -eq "lib/Microsoft.Windows.SDK.NET.dll") -or ($_.FullName -eq "lib/WinRT.Runtime.dll")} $Entries = $ZIP.Entries | Where-Object -FilterScript {($_.FullName -eq "lib/net6.0/Microsoft.Windows.SDK.NET.dll") -or ($_.FullName -eq "lib/net6.0/WinRT.Runtime.dll")}
$Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "Scripts\$($_.Name)", $true)} $Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "Scripts\$($_.Name)", $true)}
$ZIP.Dispose() $ZIP.Dispose()
@ -186,6 +183,7 @@ jobs:
Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip" -Verbose Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip" -Verbose
New-Item -Path "Sophia Script for Windows 10 LTSC 2021 v$LatestRelease\bin" -ItemType Directory -Force New-Item -Path "Sophia Script for Windows 10 LTSC 2021 v$LatestRelease\bin" -ItemType Directory -Force
$Parameters = @{ $Parameters = @{
Path = @("Scripts\PolicyFileEditor") Path = @("Scripts\PolicyFileEditor")
Destination = "Sophia Script for Windows 10 LTSC 2021 v$LatestRelease\bin" Destination = "Sophia Script for Windows 10 LTSC 2021 v$LatestRelease\bin"

Loading…
Cancel
Save