Skip to content

Bugfix for comparing file path name to determine exact match #1817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anamnavi
Copy link
Member

@anamnavi anamnavi commented Apr 15, 2025

PR Summary

Utils.cs has GetMetadataFilesFromPath() that is used by the PublishPSResource and LocalServerApiCalls classes.

In that method we find files which match the package name such as the .psd1, .ps1, .nuspec files. It catches file names that match packageName* but that includes files that should not be matched. For example, the Az.KeyVault package has 2 .psd1 files: AzKeyVault.psd1 and Az.KeyVault.Extension.psd1 and the latter was getting considered as a valid match. This PR fixes that. The string.Compare() method is already correctly determining if the filename is a correct match so the code to store that file path as a path of interest should happen in that condition set by string.Compare()

PR Context

Resolves Azure/azure-powershell#27535

PR Checklist

@anamnavi
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using a local repository, Az.KeyVault reports version as 1.0.0 and does not work with Save-PSResource
1 participant