Skip to content

Commit 255c857

Browse files
committed
Fix formatting
1 parent 8f3577d commit 255c857

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

PSReadLine/ReadLine.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -492,20 +492,20 @@ private PSConsoleReadLine()
492492
// singleton is called on a thread with a runspace, but it is happening by coincidence.
493493
using (var ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace))
494494
{
495-
try
496-
{
495+
try
496+
{
497497
ps.AddCommand("Get-Variable").AddParameter("Name", "host").AddParameter("ValueOnly");
498-
var results = ps.Invoke();
499-
dynamic host = results.Count == 1 ? results[0] : null;
500-
if (host != null)
498+
var results = ps.Invoke();
499+
dynamic host = results.Count == 1 ? results[0] : null;
500+
if (host != null)
501+
{
502+
hostName = host.Name as string;
503+
}
504+
}
505+
catch
501506
{
502-
hostName = host.Name as string;
503507
}
504508
}
505-
catch
506-
{
507-
}
508-
}
509509
if (hostName == null)
510510
{
511511
hostName = "PSReadline";

0 commit comments

Comments
 (0)