-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Closed
Copy link
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Steps to reproduce
Create
InitialSessionState iss = InitialSessionState.Create();
iss.LanguageMode = PSLanguageMode.ConstrainedLanguage;
iss.ImportPSModule("Microsoft.Powershell.Utility", "Microsoft.PowerShell.Security");
Runspace myRunSpace = RunspaceFactory.CreateRunspace(_host, iss);
myRunSpace.Open();
PowerShell powershell = PowerShell.Create();
powershell.Runspace = myRunSpace;
powershell.AddScript("Hello World");
powershell.Invoke();Expected behavior
Hello World
Actual behavior
TryModuleAutoDiscovery calls LookupCommandInfo which calls TryModuleAutoDiscovery which calls LookupCommandInfo forever
| result = TryModuleAutoDiscovery(commandName, context, originalCommandName, commandOrigin, |
| result = LookupCommandInfo(commandName, commandTypes, searchResolutionOptions, commandOrigin, context); |
This is where the Exception gets swallowed allowing for the infinite loop when FileSystem provider is not present:
| catch (ProviderNotFoundException) |
Environment data
PowerShell 7.1.0 release 3
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime