Skip to content

Commit

Permalink
Update MicrosoftOneDrive
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronparker committed Sep 17, 2023
1 parent 2c61c16 commit 38a8031
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 48 deletions.
44 changes: 23 additions & 21 deletions Evergreen/Apps/Get-MicrosoftOneDrive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,73 +12,75 @@
[CmdletBinding(SupportsShouldProcess = $False)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Step through each release URI
foreach ($ring in $res.Get.Uri.GetEnumerator()) {
try {
[System.XML.XMLDocument] $xmlDocument = Invoke-WebRequestWrapper -Uri $res.Get.Uri[$ring.Key] -Raw
}
catch [System.Exception] {
throw "$($MyInvocation.MyCommand): failed to convert feed into an XML object with: $($_.Exception.Message)"
foreach ($ring in $res.Get.Update.Uri.GetEnumerator()) {
$params = @{
Uri = $res.Get.Update.Uri[$ring.Key]
ContentType = $res.Get.Update.ContentType
Raw = $true
ErrorAction = "Stop"
}
[System.XML.XMLDocument] $xmlDocument = Invoke-WebRequestWrapper @params

# Build an output object by selecting installer entries from the feed
if ($xmlDocument -is [System.XML.XMLDocument]) {

# Select the required node/s from the XML feed
$nodes = Select-Xml -Xml $xmlDocument -XPath $res.Get.XmlNode | Select-Object ExpandProperty "node"
$nodes = Select-Xml -Xml $xmlDocument -XPath $res.Get.Update.XmlNode | Select-Object -ExpandProperty "node"

# Find the latest version
foreach ($node in $nodes) {
if ([System.Boolean]($node.PSobject.Properties.name -match "amd64binary")) {
$PSObject = [PSCustomObject] @{
[PSCustomObject] @{
Version = $node.currentversion
Throttle = $node.throttle
Architecture = Get-Architecture -String $node.amd64binary.url
Ring = $ring.Name
Sha256 = $node.amd64binary.sha256hash
Type = [System.IO.Path]::GetExtension($node.amd64binary.url).Split(".")[-1]
Sha256 = $node.amd64binary.sha256hash
URI = $node.amd64binary.url
}
Write-Output -InputObject $PSObject
} | Write-Output
}

if ([System.Boolean]($node.PSobject.Properties.name -match "arm64binary")) {
$PSObject = [PSCustomObject] @{
[PSCustomObject] @{
Version = $node.currentversion
Throttle = $node.throttle
Architecture = Get-Architecture -String $node.arm64binary.url
Ring = $ring.Name
Type = Get-FileType -File $node.arm64binary.url
Sha256 = $node.arm64binary.sha256hash
Type = [System.IO.Path]::GetExtension($node.arm64binary.url).Split(".")[-1]
URI = $node.arm64binary.url
}
Write-Output -InputObject $PSObject
} | Write-Output
}

if ([System.Boolean]($node.PSobject.Properties.name -match "msixbinary")) {
# Construct the output for MSIX; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
[PSCustomObject] @{
Version = $node.currentversion
Throttle = $node.throttle
Architecture = Get-Architecture -String $node.msixbinary.url
Ring = $ring.Name
Type = Get-FileType -File $node.msixbinary.url
Sha256 = if ($node.msixbinary.sha256hash) { $node.msixbinary.sha256hash } else { "N/A" }
Type = [System.IO.Path]::GetExtension($node.msixbinary.url).Split(".")[-1]
URI = $node.msixbinary.url
}
Write-Output -InputObject $PSObject
} | Write-Output
}

# Construct the output for EXE; Return the custom object to the pipeline
if ([System.Boolean]($node.PSobject.Properties.name -match "binary")) {
$PSObject = [PSCustomObject] @{
Version = $node.currentversion
Throttle = $node.throttle
Architecture = Get-Architecture -String $node.binary.url
Ring = $ring.Name
Sha256 = $node.binary.sha256hash
Type = [System.IO.Path]::GetExtension($node.binary.url).Split(".")[-1]
Type = Get-FileType -File $node.binary.url
URI = $node.binary.url
}
Write-Output -InputObject $PSObject
Expand Down
52 changes: 26 additions & 26 deletions Evergreen/Manifests/MicrosoftOneDrive.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"Name": "Microsoft OneDrive",
"Source": "https://onedrive.live.com/",
"Get": {
"Uri": {
"Production": "https://g.live.com/1rewlive5skydrive/OneDriveProductionV2",
"Enterprise": "https://g.live.com/1rewlive5skydrive/OneDriveEnterpriseV2",
"Insider": "https://g.live.com/1rewlive5skydrive/OneDriveInsiderV2",
"InternalSlow": "https://g.live.com/1rewlive5skydrive/MsitSlowV2",
"InternalFast": "https://g.live.com/1rewlive5skydrive/MsitFastV2"
"Name": "Microsoft OneDrive",
"Source": "https://onedrive.live.com/",
"Get": {
"Update": {
"Uri": {
"Production": "https://g.live.com/1rewlive5skydrive/OneDriveProductionV2",
"Enterprise": "https://g.live.com/1rewlive5skydrive/OneDriveEnterpriseV2",
"Insider": "https://g.live.com/1rewlive5skydrive/OneDriveInsiderV2",
"InternalSlow": "https://g.live.com/1rewlive5skydrive/MsitSlowV2",
"InternalFast": "https://g.live.com/1rewlive5skydrive/MsitFastV2"
},
"ContentType": "application/xml; charset=utf-8",
"XmlNode": "//update"
}
},
"Install": {
"Setup": "OneDriveSetup*.exe",
"Preinstall": "",
"Physical": {
"Arguments": "/silent",
"PostInstall": []
},
"ContentType": "application/xml; charset=utf-8",
"XmlNode": "//update"
},
"Install": {
"Setup": "OneDriveSetup*.exe",
"Preinstall": "",
"Physical": {
"Arguments": "/silent",
"PostInstall": [
]
},
"Virtual": {
"Arguments": "/silent /ALLUSERS=1 /ALLUSER=1",
"PostInstall": [
]
}
}
"Virtual": {
"Arguments": "/silent /ALLUSERS=1 /ALLUSER=1",
"PostInstall": []
}
}
}
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Adds `UnitySetup` [#245](https://github.com/aaronparker/evergreen/issues/245)
* Updates `GoogleChrome` to address retirement of update source [#546](https://github.com/aaronparker/evergreen/issues/546)
* Updates `MicrosoftOneDrive` to add the `Throttle` property to assist filtering the current rollout version
* Removes `MicrosoftOpenJDK16`, `MicrosoftOpenJDK8` as binaries are not available

## 2309.840
Expand Down
2 changes: 1 addition & 1 deletion tests/Public/Invoke-EvergreenApp.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param ()

BeforeDiscovery {
$Uri = "https://evergreen-api.stealthpuppy.com/apps"
$AppsToSkip = "JetBrainsYouTrack"
$AppsToSkip = "JetBrainsYouTrack|MicrosoftOpenJDK8|MicrosoftOpenJDK16"
$Applications = (Invoke-RestMethod -Uri $Uri -UseBasicParsing) | Select-Object -ExpandProperty "Name" | Where-Object { $_ -notmatch $AppsToSkip }
}

Expand Down

0 comments on commit 38a8031

Please sign in to comment.