diff --git a/Engine/Engine.csproj b/Engine/Engine.csproj
index ac8f389e7..f38a4f4d7 100644
--- a/Engine/Engine.csproj
+++ b/Engine/Engine.csproj
@@ -46,6 +46,7 @@
+
diff --git a/Engine/ScriptAnalyzer.cs b/Engine/ScriptAnalyzer.cs
index 1a885eabe..da324dfe5 100644
--- a/Engine/ScriptAnalyzer.cs
+++ b/Engine/ScriptAnalyzer.cs
@@ -22,6 +22,7 @@
using System.Collections;
using System.Diagnostics;
using System.Text;
+using Microsoft.VisualStudio.Threading;
using Microsoft.Windows.PowerShell.ScriptAnalyzer.Extensions;
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer
@@ -2172,18 +2173,20 @@ public IEnumerable AnalyzeSyntaxTree(
result.Add(new ErrorRecord(scriptRuleException, Strings.RuleErrorMessage, ErrorCategory.InvalidOperation, scriptAst.Extent.File));
}
- verboseOrErrors.Add(result);
- }));
- Task.Factory.ContinueWhenAll(tasks.ToArray(), t => verboseOrErrors.CompleteAdding());
- while (!verboseOrErrors.IsCompleted)
+ return result;
+ }).WithTimeout(TimeSpan.FromSeconds(10))).ToList();
+ while (tasks.Count > 0)
{
- List