-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acaeb0a
commit 6aa82ad
Showing
7 changed files
with
63 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,7 @@ | |
"Architectures": [ | ||
"x64", | ||
"x86" | ||
], | ||
"ReplaceText": "#version" | ||
] | ||
} | ||
}, | ||
"Install": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,7 @@ | |
}, | ||
"Architectures": [ | ||
"x64" | ||
], | ||
"ReplaceText": "#version" | ||
] | ||
} | ||
}, | ||
"Install": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,7 @@ | |
"Architectures": [ | ||
"x64", | ||
"x86" | ||
], | ||
"ReplaceText": "#version" | ||
] | ||
} | ||
}, | ||
"Install": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
function Get-OperaApp { | ||
<# | ||
.SYNOPSIS | ||
Returns the available version and URIs for Opera apps | ||
.NOTES | ||
Author: Aaron Parker | ||
Twitter: @stealthpuppy | ||
#> | ||
[OutputType([System.Management.Automation.PSObject])] | ||
[CmdletBinding(SupportsShouldProcess = $false)] | ||
param ( | ||
[Parameter(Mandatory = $false, Position = 0)] | ||
[ValidateNotNullOrEmpty()] | ||
[System.Management.Automation.PSObject] | ||
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) | ||
) | ||
|
||
foreach ($Channel in $res.Get.Update.Channels) { | ||
$Update = Invoke-RestMethodWrapper -Uri $res.Get.Update.Uri[$Channel] | ||
|
||
if ($null -ne $Update.($res.Get.Update.Property)) { | ||
Write-Verbose -Message "$($MyInvocation.MyCommand): checking property: $($res.Get.Update.Property)." | ||
Write-Verbose -Message "$($MyInvocation.MyCommand): found version: $($Update.($res.Get.Update.Property))" | ||
|
||
# Step through each installer type | ||
foreach ($Architecture in $res.Get.Download.Architectures) { | ||
|
||
# Create the URL | ||
$Url = $res.Get.Download.Uri[$Channel] -replace "#version", $Update.($res.Get.Update.Property) ` | ||
-replace "#architecture", $res.Get.Download.Architecture[$Architecture] | ||
|
||
# Build the output object; Output object to the pipeline | ||
$PSObject = [PSCustomObject] @{ | ||
Version = $Update.($res.Get.Update.Property) | ||
Channel = $Channel | ||
Architecture = $Architecture | ||
Type = Get-FileType -File $Url | ||
URI = $Url | ||
} | ||
Write-Output -InputObject $PSObject | ||
} | ||
} | ||
} | ||
} |