PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

[WIP] Experiment on getting GitHub Packages packages correct casing

Open o-l-a-v opened this issue 5 months ago • 0 comments

PR Summary

Just experimenting on getting correct casing of GitHub Packages packages.

Far from done, just an idea on how one could get correct casing on GitHub Packages NuGet v3 packages.

It builds, and I've tested it against NuGet organization package NuGet.Internal.GithubIssueTagger:

PS > Save-PSResource -TrustRepository -Path ([System.Environment]::GetFolderPath('Desktop')) -Verbose -Repository 'gh-nuget' -Name 'NuGet.Internal.GithubIssueTagger'

VERBOSE: Setting Secret Management network credentials
VERBOSE: credential successfully read from vault and set for repository: gh-nuget
VERBOSE: Attempting to search for packages in 'gh-nuget'
VERBOSE: Performing the operation "Save-PSResource" on target "Package to save: 'nuget.internal.githubissuetagger', version: '2025.4.30'".
VERBOSE: Performing the operation "Save-PSResource" on target "Package to install: 'nuget.internal.githubissuetagger', version: '2025.4.30'".
VERBOSE: This resource is not a PowerShell package and will be installed to the modules path: .
VERBOSE: pkgName: "nuget.internal.githubissuetagger", actual name of nuspec file: "NuGet.Internal.GithubIssueTagger.nuspec"
VERBOSE: Installation source path is: 'C:\Users\<redacted>\AppData\Local\Temp\fb55f6b9-3acb-445c-8b5b-3e14e3e57537\nuget.internal.githubissuetagger\2025.4.30'
VERBOSE: Installation destination path is: 'C:\Users\<redacted>\Desktop\nuget.internal.githubissuetagger\2025.4.30'
VERBOSE: Attempting to move 'C:\Users\<redacted>\AppData\Local\Temp\fb55f6b9-3acb-445c-8b5b-3e14e3e57537\nuget.internal.githubissuetagger\2025.4.30' to 'C:\Users\<redacted>\Desktop\nuget.internal.githubissuetagger\2025.4.30'
VERBOSE: Successfully installed package 'nuget.internal.githubissuetagger' to location 'C:\Users\<redacted>\Desktop'
VERBOSE: Attempting to delete 'C:\Users\<redacted>\AppData\Local\Temp\fb55f6b9-3acb-445c-8b5b-3e14e3e57537'
VERBOSE: Successfully deleted 'C:\Users\<redacted>\AppData\Local\Temp\fb55f6b9-3acb-445c-8b5b-3e14e3e57537'

PS >

See verbose line about pckName vs actual name of nuspec file.

The API returns package ID as lowercase (see https://github.com/PowerShell/PSResourceGet/issues/1446#issuecomment-3173689847), so the idea is to extract the .nupkg and get info from its' content.

So, we can work around / mitigate / fix the casing of the install path this way, but the output from Find-PSResource will be lowercase, because that's what the API returns.

PR Context

PR Checklist

o-l-a-v avatar Aug 11 '25 09:08 o-l-a-v