Skip to content

useLocalScope to true so that it works in CLM #1527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PSReadLine/ReadLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ internal static PSKeyInfo ReadKey()
if (ps == null)
{
ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
ps.AddScript("0");
ps.AddScript("0", useLocalScope: true);
}

// To detect output during possible event processing, see if the cursor moved
Expand Down Expand Up @@ -653,7 +653,7 @@ private PSConsoleReadLine()
{
try
{
var results = ps.AddScript("$Host").Invoke<PSHost>();
var results = ps.AddScript("$Host", useLocalScope: true).Invoke<PSHost>();
PSHost host = results.Count == 1 ? results[0] : null;
hostName = host?.Name;
}
Expand Down