Skip to content

Change CommandInfo lookup for commands in the form module\cmdletName #2125

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: main
Choose a base branch
from

Conversation

liamjpeters
Copy link
Contributor

@liamjpeters liamjpeters commented Aug 19, 2025

PR Summary

When the CommandInfoCache is used to lookup some fully qualified commands (by way of Get-Command), a nested module name is returned.

PR changes CommandInfoCache when a CommandInfo is looked up for a command in the form module\cmdletName. It passes this module name hint along to Get-Command to allow correct resolution.

With the MicrosoftTeams module installed, as an example, running:

Get-Command -Name 'MicrosoftTeams\Get-CsOnlineLisCivicAddress'

Reports the commands module as Microsoft.Teams.ConfigAPI.Cmdlets.

Instead running:

Get-Command -Name 'Get-CsOnlineLisCivicAddress' -Module 'MicrosoftTeams'

Correctly reports the module as MicrosoftTeams.

Also happens for Az.resources\Get-AzRoleEligibilitySchedule

Fixes #2123
Fixes #2023

PR Checklist

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.

Code Formatter: Don't remove module names from cmdlet calls UseCorrectCasing removes <module>\ from <module>\<cmdlet> in vscode-powershell
1 participant