Better resolution of file system modules in Get-Module – Chapter 1 - #27847
Draft
Guillermo López-Anglada (guillermooo) wants to merge 99 commits into
Conversation
The API belongs to a different PowerShell module but is accessible.
The values are expected to be numbers, though.
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.
The comment may not apply to newer versions of .NET.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This was referenced Aug 13, 2026
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 number of small pure refactors that aim to improve the code base without altering any existing behavior.
Caution
This PR requires the following PRs to be merged first:
Get-Module#27790Get-Moduletests #27810Get-ModuleII #27811Get-ModuleIII #27819Get-ModuleIV #27822Get-ModuleV #27823This is the full series of changes:
Get-Module– Chapter 1 #27847Get-Module– Chapter 2 #27848Get-Module– Chapter 3 #27853PR Context
These changes were made while I was getting familiar with this area of the code base and working on fixes based on
Get-Module -ListAvailable -FullyQualifiedNamemodule resolution feels inconsistent #27716...that will be submitted in future PRs.
Important
These changes are not required and can be dropped individually, but some of them may objectively improve the code base, like parameter validation, renames, and improved documentation.
To verify conformity with existing behavior, I've used the following tests:
Get-Module#27790Get-Moduletests #27810Get-ModuleII #27811Get-ModuleIII #27819Get-ModuleIV #27822Get-ModuleV #27823I haven't run any other tests.
There's always a risk of inadvertently changing existing behavior, especially due to lack of sufficient test coverage, but I think the risk in this case is low to very low for all changes.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header