-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #748 from aaronparker/apps
Apps
- Loading branch information
Showing
10 changed files
with
125 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
function Get-MicrosoftWindowsApp { | ||
<# | ||
.NOTES | ||
Site: https://stealthpuppy.com | ||
Author: Aaron Parker | ||
Twitter: @stealthpuppy | ||
#> | ||
[OutputType([System.Management.Automation.PSObject])] | ||
[CmdletBinding(SupportsShouldProcess = $false)] | ||
param ( | ||
[Parameter(Mandatory = $false, Position = 0)] | ||
[ValidateNotNull()] | ||
[System.Management.Automation.PSObject] | ||
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) | ||
) | ||
|
||
foreach ($Url in $res.Get.Download.Uri) { | ||
# Grab the download link headers to find the file name | ||
$params = @{ | ||
Uri = $Url | ||
Method = "Head" | ||
ReturnObject = "Headers" | ||
} | ||
$Headers = Invoke-EvergreenWebRequest @params | ||
if ($null -ne $Headers) { | ||
|
||
# Match filename | ||
$Filename = [RegEx]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchFilename).Captures.Groups[1].Value | ||
|
||
# Match version | ||
$Version = [RegEx]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchVersion).Captures.Value | ||
if ($Version.Length -eq 0) { $Version = "Unknown" } | ||
|
||
# Construct the output; Return the custom object to the pipeline | ||
$PSObject = [PSCustomObject] @{ | ||
Version = $Version | ||
Date = $Headers['Last-Modified'] | Select-Object -First 1 | ||
Architecture = Get-Architecture -String $Filename | ||
Filename = $Filename | ||
URI = $Url | ||
} | ||
Write-Output -InputObject $PSObject | ||
} | ||
} | ||
} |
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,33 @@ | ||
{ | ||
"Name": "Microsoft Windows App", | ||
"Source": "https://learn.microsoft.com/en-us/windows-app/whats-new", | ||
"Get": { | ||
"Update": {}, | ||
"Download": { | ||
"Uri": [ | ||
"https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RW1pC6G", | ||
"https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RW1pHol", | ||
"https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RW1pJV5" | ||
], | ||
"ApiUri": "https://query.prod.cms.rt.microsoft.com/cms/api", | ||
"ApiHeader1": "X-CMS-Tenant", | ||
"ApiHeader2": "X-CMS-Type", | ||
"ApiHeader3": "X-CMS-DocumentId", | ||
"MatchFilename": "(WindowsApp_.*_Release_.*.msix)", | ||
"MatchVersion": "(\\d+(\\.\\d+){1,4})", | ||
"SplitText": "filename=", | ||
"DatePattern": "ddd, dd MMM yyyy HH:mm:ss GMT" | ||
} | ||
}, | ||
"Install": { | ||
"Setup": "", | ||
"Physical": { | ||
"Arguments": "", | ||
"PostInstall": [] | ||
}, | ||
"Virtual": { | ||
"Arguments": "", | ||
"PostInstall": [] | ||
} | ||
} | ||
} |
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
File renamed without changes.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.