Avatar of Leo Torres
Leo Torres
Flag for United States of America asked on

Powershell out put

I am trying to get this out in line but its displaying as an array.  Can someone help me display values in line.

	$OutPutBox.Text =  "Server			Port		Open`r`n"
	$OutPutBox.Text += "------			----		----`r`n"
	
	$Servers = $Serverbox.Text -split "`r`n"
	foreach ($Server IN $Servers)
	{
		$text = Test-Port -computer $Server -port $PortNumber.Text
		$OutPutBox.Text += $text  
	}

Open in new window



Server			Port		Open
------			----		----
@{Server=localhost; Port=90; TypePort=TCP; Open=False; Notes=Connection to Port Timed Out}

Open in new window

Powershell.NET ProgrammingC#

Avatar of undefined
Last Comment
SubSun

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
SubSun

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck