We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ConstrainedLanguageMode
1 parent 2463620 commit 88a21e4Copy full SHA for 88a21e4
PSReadLine/ReadLine.cs
@@ -230,7 +230,7 @@ internal static PSKeyInfo ReadKey()
230
if (ps == null)
231
{
232
ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
233
- ps.AddScript("0");
+ ps.AddScript("0", useLocalScope: true);
234
}
235
236
// To detect output during possible event processing, see if the cursor moved
@@ -653,7 +653,7 @@ private PSConsoleReadLine()
653
654
try
655
656
- var results = ps.AddScript("$Host").Invoke<PSHost>();
+ var results = ps.AddScript("$Host", useLocalScope: true).Invoke<PSHost>();
657
PSHost host = results.Count == 1 ? results[0] : null;
658
hostName = host?.Name;
659
0 commit comments