PSResourceGet
PSResourceGet copied to clipboard
[WIP] Experiment on getting GitHub Packages packages correct casing
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
- 2019-05-01 https://github.com/PowerShell/PowerShellGetv2/issues/472
- 2022-05-14 https://github.com/PowerShell/PowerShell/issues/17342
- 2023-09-12 https://github.com/PowerShell/PSResourceGet/issues/1402
- 2023-10-15 https://github.com/PowerShell/PSResourceGet/issues/1446
PR Checklist
- [ ] PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- [ ] Summarized changes
- [ ] Make sure all
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header - [ ] This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix
-
Breaking changes
- [ ] None
- OR
- [ ] Documentation needed
- [ ] Issue filed:
-
User-facing changes
- [ ] Not Applicable
- OR
- [ ] Documentation needed
- [ ] Issue filed:
-
Testing - New and feature
- [ ] N/A or can only be tested interactively
- OR
- [ ] Make sure you've added a new test if existing tests do not effectively test the code changed
-
Tooling
- [ ] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
- OR
- [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary.