Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apps #800

Merged
merged 20 commits into from
Feb 24, 2025
Merged

Apps #800

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Evergreen/Apps/Get-ALMToolkit.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Function Get-ALMToolkit {
<#
.SYNOPSIS
Returns the available Microsoft ALM Toolkit version.

.NOTES
Author: Grayplex
#>
[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])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Uri
MatchVersion = $res.Get.MatchVersion
Filter = $res.Get.MatchFileTypes
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object
}
36 changes: 36 additions & 0 deletions Evergreen/Apps/Get-AnalogDevicesLTspice.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
function Get-AnalogDevicesLTspice {
<#
.NOTES
Author: Aaron Parker
#>
[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])
)

# Get the update feed
$params = @{
Uri = $res.Get.Update.Uri
UserAgent = $res.Get.Update.UserAgent
}
$UpdateFeed = Invoke-EvergreenRestMethod @params
if ($null -ne $UpdateFeed) {

# Convert the INI update feed to an object, replace strings that break conversion
$Updates = ConvertFrom-IniFile -InputObject ($UpdateFeed -replace ";aiu;")

# Output the latest version
[PSCustomObject]@{
Version = $Updates.Update.Version.Trim()
Date = $Updates.Update.ReleaseDate.Trim()
Size = $Updates.Update.Size.Trim()
Sha256 = $Updates.Update.SHA256.Trim()
Type = Get-FileType -File $Updates.Update.URL
URI = $Updates.Update.URL.Trim()
} | Write-Output
}
}
26 changes: 26 additions & 0 deletions Evergreen/Apps/Get-DAXStudio.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Function Get-DAXStudio {
<#
.SYNOPSIS
Returns the available DAX Studio version.

.NOTES
Author: Grayplex
#>
[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])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Uri
MatchVersion = $res.Get.MatchVersion
Filter = $res.Get.MatchFileTypes
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object
}
2 changes: 1 addition & 1 deletion Evergreen/Apps/Get-Fork.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Function Get-Fork {
# Convert the returned release data into a useable object with Version, URI etc.
$PSObject = [PSCustomObject] @{
Version = $Version
URI = $res.Get.Download.Uri
URI = $res.Get.Download.Uri -replace "#version", $Version
}
Write-Output -InputObject $PSObject
}
Expand Down
10 changes: 10 additions & 0 deletions Evergreen/Apps/Get-GitForWindows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,14 @@ function Get-GitForWindows {
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object

# Check the version string and remove the revision number if it is 1
$SystemVersion = [System.Version]$object[0].Version
if ($SystemVersion.Revision -eq 1) {
$object = $object | ForEach-Object { $_.Version = ($SystemVersion.Major, $SystemVersion.Minor, $SystemVersion.Build -join "."); $_ }
Write-Output -InputObject $object
}
else {
Write-Output -InputObject $object
}
}
14 changes: 6 additions & 8 deletions Evergreen/Apps/Get-GitHubDesktop.ps1
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
Function Get-GitHubDesktop {
function Get-GitHubDesktop {
<#
.NOTES
Author: Aaron Parker
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

$params = @{
"Uri" = $res.Get.Update.Uri
}
$Update = Invoke-EvergreenRestMethod @params
$Update = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri
if ($null -ne $Update) {
$Version = $Update.Version | Sort-Object -Descending | Select-Object -First 1

$Version = $Update.Version | Sort-Object -Property @{ Expression = { [System.Version]$_ }; Descending = $true } -Descending | Select-Object -First 1
Write-Verbose -Message "$($MyInvocation.MyCommand): Found version: $Version."

foreach ($Platform in $res.Get.Download.Uri.GetEnumerator()) {
Expand Down
17 changes: 12 additions & 5 deletions Evergreen/Apps/Get-MSIXHero.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ function Get-MSIXHero {

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Uri
MatchVersion = $res.Get.MatchVersion
Filter = $res.Get.MatchFileTypes
Uri = $res.Get.Update.Uri
}
$UpdateFeed = Invoke-EvergreenRestMethod @params

# Build the output object
if ($null -ne $UpdateFeed) {
$PSObject = [PSCustomObject] @{
Version = $UpdateFeed.lastVersion
Date = ConvertTo-DateTime -DateTime $UpdateFeed.released -Pattern $res.Get.Update.DateFormat
URI = $res.Get.Download.Uri -replace $res.Get.Download.ReplaceText, $UpdateFeed.lastVersion
}
Write-Output -InputObject $PSObject
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object
}
26 changes: 26 additions & 0 deletions Evergreen/Apps/Get-MarkMpnSQL4CDS.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function Get-MarkMpnSQL4CDS {
<#
.SYNOPSIS
Returns Mark Carrington's latest MarkMpn SQL 4 CDS version number and download.

.NOTES
Author: Adrian Scott
#>
[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])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Uri
MatchVersion = $res.Get.MatchVersion
Filter = $res.Get.MatchFileTypes
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object
}
11 changes: 5 additions & 6 deletions Evergreen/Apps/Get-MicrosoftFSLogixApps.ps1
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
Function Get-MicrosoftFSLogixApps {
function Get-MicrosoftFSLogixApps {
<#
.SYNOPSIS
Get the current version and download URL for the Microsoft FSLogix Apps agent.

.NOTES
Site: https://stealthpuppy.com
Author: Aaron Parker
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification="Product name is a plural")]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

ForEach ($item in $res.Get.Download.Uri.GetEnumerator()) {
foreach ($item in $res.Get.Download.Uri.GetEnumerator()) {

# Follow the download link which will return a 301
$response = Resolve-SystemNetWebRequest -Uri $res.Get.Download.Uri[$item.Key]

# Check returned URL. It should be a go.microsoft.com/fwlink/?linkid style link
If ($Null -ne $response) {
if ($null -ne $response) {

# Construct the output; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Expand Down
23 changes: 23 additions & 0 deletions Evergreen/Apps/Get-MicrosoftOutlook.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function Get-MicrosoftOutlook {
<#
.SYNOPSIS
Returns the available Microsoft Outlook versions and download URIs.

.NOTES
Author: Aaron Parker
#>
[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) {
Resolve-MicrosoftFwLink -Uri $Url | `
ForEach-Object { $_.Language = "Neutral"; $_ } | `
Write-Output
}
}
22 changes: 16 additions & 6 deletions Evergreen/Apps/Get-MicrosoftWindowsApp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,27 @@ function Get-MicrosoftWindowsApp {
$Headers = Invoke-EvergreenWebRequest @params
if ($null -ne $Headers) {

# Match filename
$Filename = [RegEx]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchFilename).Captures.Groups[1].Value
if ([System.String]::IsNullOrWhiteSpace($Headers['Content-Disposition'])) {
# Match filename
$Filename = [RegEx]::Match($ResolvedUrl.URI, $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" }
# Match version
$Version = [RegEx]::Match($ResolvedUrl.URI, $res.Get.Download.MatchVersion).Captures.Value
if ($Version.Length -eq 0) { $Version = "Unknown" }
}
else {
# 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
#Date = $Headers['Last-Modified'] | Select-Object -First 1
Architecture = Get-Architecture -String $Filename
Filename = $Filename
URI = $ResolvedUrl.URI
Expand Down
26 changes: 26 additions & 0 deletions Evergreen/Apps/Get-NodeVersionManager.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Function Get-NodeVersionManager {
<#
.SYNOPSIS
Returns the available Microsoft WSL versions.

.NOTES
Author: Kirill Trofimov
#>
[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])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Uri
MatchVersion = $res.Get.MatchVersion
Filter = $res.Get.MatchFileTypes
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object
}
81 changes: 81 additions & 0 deletions Evergreen/Apps/Get-Python.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
function Get-Python {
<#
.SYNOPSIS
Get the current version and download URL for Python Software Foundation version of Python.
#>
[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])
)

# Query the python API to get the list of versions
$updateFeed = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri
if ($null -ne $updateFeed) {

# Get latest versions from update feed (PSF typically maintain a version of Python2 and a version of Python 3)
$LatestVersions = $updateFeed | Where-Object { $_.is_latest -eq "True" }
if ($null -ne $LatestVersions) {
foreach ($PythonVersion in $LatestVersions) {

# Extract release ID from resource uri
try {
$releaseToQuery = [RegEx]::Match($PythonVersion.resource_uri, $res.Get.Update.MatchRelease).Captures.Groups[0].Value
Write-Verbose -Message "$($MyInvocation.MyCommand): Found ReleaseID: [$releaseToQuery]."
}
catch {
throw "$($MyInvocation.MyCommand): could not find release ID in resource uri."
}

# Query the python API to get the list of download uris
$params = @{
Uri = $res.Get.Download.Uri
Body = @{
os = "1"
release = $releaseToQuery
}
}
$downloadFeed = Invoke-EvergreenRestMethod @params

# Filter the download feed to obtain the installers; Match this release with entries from the download feed
$windowsDownloadFeed = $downloadFeed | Where-Object { $_.url -match $res.Get.Download.MatchFileTypes }
Write-Verbose -Message "$($MyInvocation.MyCommand): Processing $($PythonVersion.name)"
$WindowsRelease = $windowsDownloadFeed | Where-Object { $_.release -eq $PythonVersion.resource_uri }

if ($null -ne $WindowsRelease) {

# Each release typically has an x86 and x64 installer, so we need to loop through the results
foreach ($UniqueFile in $WindowsRelease) {
Write-Verbose -Message "$($MyInvocation.MyCommand): Found: $($UniqueFile.name)."

# Extract exact version (eg 3.9.6) from URI
try {
$FileVersion = [RegEx]::Match($UniqueFile.url, $res.Get.Download.MatchVersion).Captures.Groups[0].Value
Write-Verbose -Message "$($MyInvocation.MyCommand): Found version: [$FileVersion]."
}
catch {
throw "$($MyInvocation.MyCommand): Failed to find exact version from: $($UniqueFile.url)"
}

# Construct the output; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Version = $FileVersion
Release = $FileVersion.split('.')[0..1] -join '.' # Get the major.minor version
Python = $PythonVersion.version
Date = ConvertTo-DateTime -DateTime $PythonVersion.release_date -Pattern $res.Get.Download.DatePattern
Md5 = $UniqueFile.md5_sum
Size = $UniqueFile.filesize
Architecture = Get-Architecture $UniqueFile.name
Type = ($UniqueFile.url).Split('.')[-1]
URI = $UniqueFile.url
}
Write-Output -InputObject $PSObject
}
}
}
}
}
}
Loading
Loading