Skip to content

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