Skip to content

Commit 890cd12

Browse files
committed
Merge pull request #481 from PowerShell/HangIssueFixBranch
Fix for hang issue
2 parents 3571167 + 27d9d2b commit 890cd12

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Engine/Helper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class Helper
3232

3333
private CommandInvocationIntrinsics invokeCommand;
3434
private IOutputWriter outputWriter;
35+
private Object getCommandLock = new object();
3536

3637
#endregion
3738

@@ -567,7 +568,10 @@ public bool PositionalParameterUsed(CommandAst cmdAst, bool moreThanThreePositio
567568
/// <returns></returns>
568569
public CommandInfo GetCommandInfo(string name, CommandTypes commandType = CommandTypes.Alias | CommandTypes.Cmdlet | CommandTypes.Configuration | CommandTypes.ExternalScript | CommandTypes.Filter | CommandTypes.Function | CommandTypes.Script | CommandTypes.Workflow)
569570
{
570-
return this.invokeCommand.GetCommand(name, commandType);
571+
lock (getCommandLock)
572+
{
573+
return this.invokeCommand.GetCommand(name, commandType);
574+
}
571575
}
572576

573577
/// <summary>

0 commit comments

Comments
 (0)