Forum Discussion
phantom2000
Mar 22, 2022Copper Contributor
Get result under a column
Hello,
I have a command that checks connectivity to a port.
Test-NetConnection -ComputerName google.com -Port 443 | Select-Object TcpTestSucceeded
The result for this comes as follows.
TcpTestSucceeded
----------------
True
I only want the result "True" put into a variable for later use. How can I achieve this?
Thanks in advance.
- $x=(Test-NetConnection -ComputerName google.com -Port 443 | Select-Object TcpTestSucceeded).TcpTestSucceeded
- farismalaebSteel Contributor$x=(Test-NetConnection -ComputerName google.com -Port 443 | Select-Object TcpTestSucceeded).TcpTestSucceeded
- phantom2000Copper ContributorThank you.