Skip to content

Commit

Permalink
Update Get-PaintDotNet.ps1
Browse files Browse the repository at this point in the history
Fix for version string mismatch in data
  • Loading branch information
aaronparker committed Nov 23, 2024
1 parent 4462a98 commit b0e29bf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Evergreen/Apps/Get-PaintDotNet.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-PaintDotNet {
function Get-PaintDotNet {
<#
.SYNOPSIS
Get the current version and download URL for the Paint.NET tools.
Expand All @@ -8,23 +8,24 @@ Function Get-PaintDotNet {
Twitter: @cit_bronson
#>
[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])
)

# Read the Paint.NET updates feed
$Content = Invoke-EvergreenWebRequest -Uri $res.Get.Uri
If ($Null -ne $Content) {
if ($null -ne $Content) {

# Convert the content from string data
$Data = $Content | ConvertFrom-StringData
$Key = $Data.Keys | Where-Object { $_ -match $res.Get.UrlProperty }

# Build the output object
ForEach ($url in ($Data.("$($Data.StableVersions)$($res.Get.UrlProperty)") -split $res.Get.UrlDelimiter)) {
foreach ($url in $Data.$Key) {
$PSObject = [PSCustomObject] @{
Version = $Data.($res.Get.VersionProperty)
URI = $url
Expand Down

0 comments on commit b0e29bf

Please sign in to comment.