@@ -520,19 +520,28 @@ if (-not $noGui.IsPresent) {
520
520
$category = $_.SelectSingleNode (" m:properties/d:Tags" , $ns ).InnerText
521
521
# Select only packages that have the latest version, contain a category and the category is not excluded
522
522
if (($isLatestVersion -eq " true" ) -and ($category -ne " " ) -and ($excludedCategories -notcontains $category )) {
523
- $packageName = $_.properties.Id
524
- $description = $_.properties.Description
525
-
526
- # Initialize category as an empty array
527
- if (-not ($packagesByCategory.ContainsKey ($category ))) {
528
- $packagesByCategory [$category ] = @ ()
529
- }
530
- # Add the PackageName and PackageDesccription to each entry in the array
531
- $packagesByCategory [$category ] += [PSCustomObject ]@ {
532
- PackageName = $packageName
533
- PackageDescription = $description
534
- }
535
- }
523
+ $packageName = $_.properties.Id
524
+ $description = $_.properties.Description
525
+ $projectUrl = $_.properties.projectUrl
526
+
527
+ # Initialize category as an empty array
528
+ if (-not ($packagesByCategory.ContainsKey ($category ))) {
529
+ $packagesByCategory [$category ] = @ ()
530
+ }
531
+ # Check if $projectUrl contains a valid URL
532
+ if ($projectUrl -match " ^http" ) {
533
+ $packageObject = [PSCustomObject ]@ {
534
+ PackageName = $packageName
535
+ PackageDescription = $description
536
+ PackageUrl = $projectUrl }
537
+ }else {
538
+ $packageObject = [PSCustomObject ]@ {
539
+ PackageName = $packageName
540
+ PackageDescription = $description }
541
+ }
542
+ # Add the PackageName and PackageDescription (and PackageUrl if present) to each entry in the array
543
+ $packagesByCategory [$category ] += $packageObject
544
+ }
536
545
}
537
546
# Check if there is a next link in the XML and set the API URL to that link if it exists
538
547
$nextLink = $vm_packages.SelectSingleNode (" //atom:link[@rel='next']/@href" , $ns )
@@ -1003,6 +1012,23 @@ if (-not $noGui.IsPresent) {
1003
1012
$checkBox.Name = " checkBox$numCheckBoxPackages "
1004
1013
$checkboxesPackages.Add ($checkBox )
1005
1014
$panelCategories.Controls.Add ($checkBox )
1015
+ $url = $package.PackageUrl
1016
+ if ($url ){
1017
+ $linkProjectUrl = New-Object System.Windows.Forms.linkLabel
1018
+ $linkProjectUrl.Top = $checkbox.Top + 2
1019
+ $linkProjectUrl.Left = $checkbox.Right - 3
1020
+ $linkProjectUrl.AutoSize = $true
1021
+ $linkProjectUrl.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
1022
+ $linkProjectUrl.LinkColor = " BLUE" ;
1023
+ $linkProjectUrl.ActiveLinkColor = " RED"
1024
+ $linkProjectUrl.Text = $url
1025
+ # Create a temporary, local variable with the correct URL for this specific link.
1026
+ $linkProjectUrl.add_Click ({
1027
+ $tempUrl = $this.Text
1028
+ [system.Diagnostics.Process ]::start($tempUrl )
1029
+ })
1030
+ $panelCategories.Controls.Add ($linkProjectUrl )
1031
+ }
1006
1032
$verticalPosition2 += 20
1007
1033
$numCheckBoxPackages ++
1008
1034
}
0 commit comments