Skip to content

Commit e723880

Browse files
authored
Fix unexpected recommendation message (#20880)
1 parent 7ca311e commit e723880

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Accounts/Accounts/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Fixed an issue that the helper message about missing modules shows up at the wrong time. [#19228]
2223

2324
## Version 2.11.2
2425
* Supported Web Account Manager on ARM64-based Windows systems. Fixed an issue where `Connect-AzAccount` failed with error "Unable to load DLL 'msalruntime_arm64'". [#20700]

src/Accounts/Accounts/Utilities/CommandNotFoundHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ public static void RegisterCommandNotFoundAction(CommandInvocationIntrinsics cii
131131

132132
private static void OnCommandNotFound(object sender, CommandLookupEventArgs args)
133133
{
134-
if (IsAzOrAzureRMCmdlet(args.CommandName))
134+
// The command was dispatched by the msh engine as a result of a dispatch request from an already running command.
135+
// We are not interested in such cases.
136+
if (args.CommandOrigin == CommandOrigin.Runspace && IsAzOrAzureRMCmdlet(args.CommandName))
135137
{
136138
bool isHelpful = true;
137139
if (IsAzureRMCommand(args.CommandName))

0 commit comments

Comments
 (0)