Minor changes to internal module commands code#27706
Open
guillermooo wants to merge 18 commits into
Open
Conversation
No call sites using parameter name.
No call sites using parameter name. Same parameter name as `System.IO.Path.GetRelativePath()`.
The argument for `moduleNameOrPath` cannot be null at the current call sites.
The point is to return a fully qualified path, which cannot be the case if `relativeTo` is `null` and we need to use it.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes small refactors in internal module-specification handling, focusing on string comparisons, module-name normalization, and clearer documentation around module specification behavior.
Changes:
- Use
EqualsOrdinalIgnoreCase(...)for module specification hashtable key comparisons and explicitly discard theGetMaximumVersion(...)return value. - Refine
ModuleSpecificationComparerequality semantics and documentation (including reference equality fast-path). - Refactor and re-document
ModuleIntrinsics.NormalizeModuleName(...)with updated parameter naming and argument validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/System.Management.Automation/engine/Modules/ModuleSpecification.cs | Refactors module-spec initialization comparisons and updates the structural equality comparer logic. |
| src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs | Refactors and expands docs for module-name normalization and updates null-handling behavior. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
A few relatively minor refactors.
PR Context
I'm getting familiar with the PowerShell code base and I found a few rough spots. I'm not sure whether this kind of spontaneous changes are welcome, though.
I haven't run any tests, mainly because I figured out how to build, but not yet how to run the test suite.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header