Fix ConvertFrom-ClearlyDefinedCoordinates to handle API object coordinates (#26893)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
Co-authored-by: PowerShell Team Bot <69177312+pwshBot@users.noreply.github.com>
Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
This commit is contained in:
Copilot
2026-03-10 18:16:18 -04:00
committed by GitHub
co-authored by TravisEz13 Travis Plunk PowerShell Team Bot Dongbo Wang
parent e170b7210a
commit 312291762e
8 changed files with 29 additions and 18 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
"quality": "daily",
"qualityFallback": "preview",
"packageVersionPattern": "9.0.0-preview.6",
"sdkImageVersion": "10.0.101",
"sdkImageVersion": "11.0.100-preview.1.26104.118",
"nextChannel": "9.0.0-preview.7",
"azureFeed": "",
"sdkImageOverride": ""
@@ -8,7 +8,7 @@
<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<PackageReference Include="Markdig.Signed" Version="0.45.0" />
<PackageReference Include="Markdig.Signed" Version="1.0.0" />
<PackageReference Include="Microsoft.PowerShell.MarkdownRender" Version="7.2.1" />
</ItemGroup>
@@ -19,7 +19,7 @@
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="11.0.0-preview.1.26104.118" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="11.0.0-preview.1.26104.118" />
<!-- the following package(s) are from https://github.com/dotnet/fxdac -->
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.9.1" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.IO.Packaging" Version="11.0.0-preview.1.26104.118" />
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="11.0.0-preview.1.26104.118" />
@@ -10,6 +10,6 @@
<PackageReference Include="MarkdownLog.NS20" Version="0.10.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
<PackageReference Include="Perfolizer" Version="0.6.5" />
<PackageReference Include="Perfolizer" Version="0.6.7" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="11.0.0-preview.1.26104.118" />
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.9.1" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -30,7 +30,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="XunitXml.TestLogger" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
</ItemGroup>
<ItemGroup>
+4 -4
View File
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/component-detection-manifest.json",
"Registrations": [
{
"Component": {
@@ -65,7 +66,7 @@
"Type": "nuget",
"Nuget": {
"Name": "Markdig.Signed",
"Version": "0.45.0"
"Version": "1.0.0"
}
},
"DevelopmentDependency": false
@@ -495,7 +496,7 @@
"Type": "nuget",
"Nuget": {
"Name": "System.Data.SqlClient",
"Version": "4.9.0"
"Version": "4.9.1"
}
},
"DevelopmentDependency": false
@@ -750,6 +751,5 @@
},
"DevelopmentDependency": false
}
],
"$schema": "https://json.schemastore.org/component-detection-manifest.json"
]
}
@@ -40,19 +40,30 @@ function ConvertFrom-ClearlyDefinedCoordinates {
[CmdletBinding()]
param(
[parameter(mandatory = $true, ValueFromPipeline = $true)]
[string]
[object]
$Coordinates
)
Begin {}
Process {
$parts = $Coordinates.Split('/')
[PSCustomObject]@{
type = $parts[0]
provider = $parts[1]
namespace = $parts[2]
name = $parts[3]
revision = $parts[4]
if ($Coordinates -is [string]) {
$parts = $Coordinates.Split('/')
[PSCustomObject]@{
type = $parts[0]
provider = $parts[1]
namespace = $parts[2]
name = $parts[3]
revision = $parts[4]
}
} else {
# Coordinates is already an object (e.g., from ClearlyDefined API response)
[PSCustomObject]@{
type = $Coordinates.type
provider = $Coordinates.provider
namespace = $Coordinates.namespace
name = $Coordinates.name
revision = $Coordinates.revision
}
}
}
End {}