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 8e35e17 commit 9d44110Copy full SHA for 9d44110
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
@@ -651,7 +651,7 @@ private PSConsoleReadLine()
651
652
try
653
654
- var results = ps.AddScript("$Host").Invoke<PSHost>();
+ var results = ps.AddScript("$Host", useLocalScope: true).Invoke<PSHost>();
655
PSHost host = results.Count == 1 ? results[0] : null;
656
hostName = host?.Name;
657
0 commit comments