-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUUP-API.ps1
More file actions
20 lines (17 loc) · 782 Bytes
/
UUP-API.ps1
File metadata and controls
20 lines (17 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -------------------------
# UUP API Requests
# -------------------------
$baseUrl = "https://api.uupdump.net"
$arch = "amd64"
$ring = "Dev"
$edition = "professional"
$lang = "en-us"
$fetchUrl = $baseUrl + "/fetchupd.php?arch=$arch&ring=$ring&edition=$edition"
$fetchRes = Invoke-RestMethod -Uri $fetchUrl -Method Get | ConvertTo-Json -Depth 100
$updateId = $fetchRes | jq ".response.updateId" | ForEach-Object {$_ -replace '"', ''}
$downloadUrl = "https://api.uupdump.net/get.php?id=" + $updateId + "&lang=$lang&edition=$edition"
$out = "$HOME\Downloads\Win11-Convert.zip"
Invoke-RestMethod -Uri $downloadUrl -OutFile $out
$unzipDir = "$HOME\Downloads\Win11-Convert"
New-Item $unzipDir -ItemType Directory
Expand-Archive -Path $out -OutputPath "$unzipDir" -Force -ShowProgress