Skip to content

Better resolution of file system modules in Get-Module – Chapter 3 - #27853

Draft
Guillermo López-Anglada (guillermooo) wants to merge 117 commits into
PowerShell:masterfrom
guillermooo:users/guillermo/bugfix/better-fs-module-resolution-chapter-3
Draft

Better resolution of file system modules in Get-Module – Chapter 3#27853
Guillermo López-Anglada (guillermooo) wants to merge 117 commits into
PowerShell:masterfrom
guillermooo:users/guillermo/bugfix/better-fs-module-resolution-chapter-3

Conversation

@guillermooo

@guillermooo Guillermo López-Anglada (guillermooo) commented Aug 14, 2026

Copy link
Copy Markdown

PR Summary

Correctly resolve home-rooted module paths both with Get-Module -Name and Get-Module -FullyQualifiedName.

Important

Change approved by WG recommendation.

Warning

This is a breaking change. The output of Get-Module is now different for home-rooted paths such as ~/foo.psm1.

PR Context

This is the full series of changes:

PR Checklist

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.
Relatively short signature and no more than three parameters.
Relative-rooted paths such as:

.\foo.psm1
..\foo.psm1

and home-rooted paths such as:

~\foo.psm1

are now fully resolved via $executionContext.SessionState.Path.GetResolvedProviderPathFromPSPath()
instead of joining them with the working directory first, because
GetResolvedProviderPathFromPSPath() already joins relative paths with
the working directory as needed.

Before this commit, ~\foo.psm1 was resolved to $pwd\~\foo.psm1. After
this commit, ~\foo.psm1 correctly resolves to $HOME\foo.psm1.

A path like .\~\foo.psm1 still resolves to $pwd\~\foo.psm1.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@guillermooo Guillermo López-Anglada (guillermooo) changed the title Users/guillermo/bugfix/better fs module resolution chapter 3 Better resolution of file system modules in Get-Module – Chapter 3 Aug 14, 2026
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.

1 participant