File tree Expand file tree Collapse file tree 3 files changed +75
-1
lines changed
src/Sophia_Script_for_Windows_11/Module/Private Expand file tree Collapse file tree 3 files changed +75
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Download HEVC
2+
3+ on :
4+ workflow_dispatch :
5+
6+ permissions :
7+ contents : write
8+
9+ jobs :
10+ download-and-save :
11+ runs-on : windows-latest
12+
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@main
16+
17+ - name : Download HEVC package
18+ run : |
19+ . "Scripts\HEVC.ps1"
20+
21+ - name : Commit and push changes
22+ run : |
23+ # Save Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx to HEVC folder
24+ git config user.name "${{ github.actor }}"
25+ git config user.email "${{ github.actor }}@users.noreply.github.com"
26+
27+ git add HEVC/Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx
28+ git commit -m "Update Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx"
29+ git push
Original file line number Diff line number Diff line change 1+ # https://store.rg-adguard.net
2+ # https://apps.microsoft.com/detail/9N4WGH0Z6VHQ
3+
4+ try
5+ {
6+ $Body = @ {
7+ type = " url"
8+ url = " https://apps.microsoft.com/detail/9N4WGH0Z6VHQ"
9+ ring = " Retail"
10+ lang = " en-US"
11+ }
12+ $Parameters = @ {
13+ Uri = " https://ru.store.rg-adguard.net/api/GetFiles"
14+ Method = " Post"
15+ ContentType = " application/x-www-form-urlencoded"
16+ Body = $Body
17+ UseBasicParsing = $true
18+ Verbose = $true
19+ }
20+ $Raw = Invoke-WebRequest @Parameters
21+ }
22+ catch [System.Net.WebException ]
23+ {
24+ Write-Verbose - Message " Connection could not be established with https://store.rg-adguard.net" - Verbose
25+
26+ exit 1 # Exit with a non-zero status to fail the job
27+ }
28+
29+ # Get a temp URL
30+ $TempURL = $Raw.Links.href | Sort-Object - Property Length - Descending | Select-Object - First 1
31+ if (-not $TempURL )
32+ {
33+ Write-Verbose - Message " https://store.rg-adguard.net does not output correct URL" - Verbose
34+
35+ exit 1 # Exit with a non-zero status to fail the job
36+ }
37+
38+ # Download archive
39+ $Parameters = @ {
40+ Uri = $TempURL
41+ OutFile = " HEVC\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx"
42+ Verbose = $true
43+ UseBasicParsing = $true
44+ }
45+ Invoke-WebRequest @Parameters
Original file line number Diff line number Diff line change @@ -580,7 +580,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
580580 # Check SecurityHealthService service
581581 try
582582 {
583- Get-Service - Name SecurityHealthService - ErrorAction Stop | Start-Service - ErrorAction Stop - ErrorAction Stop
583+ Get-Service - Name SecurityHealthService - ErrorAction Stop | Start-Service - ErrorAction Stop
584584 }
585585 catch
586586 {
You can’t perform that action at this time.
0 commit comments