Skip to content

Increase output detail of Test-Connection when performing a tcp connection test  #11440

@jackdcasey

Description

@jackdcasey

Increase output detail of Test-Connection when performing a tcp connection test

My proposed change is to provide more detail when using Test-Connection cmdlet with the -TCPPort option. This would bring the command more in line with the classic Test-NetConnection cmdlet.

Currently, the returned value when performing this test is a boolean true / false. This provides some insight into if the connection was successful but not too much else. Here's an example output:

Test-Connection google.com -TCPPort 443

True

My proposed changes would provide more detail to the output. Here's an example of what that output might look like:

Test-Connection google.com -TCPPort 443

Source             : Jack-PC
SourceAddress      : 192.168.1.1
Destination        : google.com
DestinationAddress : 216.58.217.46
Port               : 443
Latency            : 16
TestResult         : Success

To provide the original behaviour, we can implement the existing -quiet option:

Test-Connection google.com -TCPPort 443 -Quiet

True

In my dayjob, I use the classic Test-NetConnection cmdlet all the time to troubleshoot network connectivity issues. I find the added output incredibly valuable. I believe this would increase the usability of this command by a fair bit.

I have forked the repository and have these changes implemented. However, before submitting any pull request I wanted to engage the community, as this is changing an existing implementation.

Please let me know what you think! I am new to this community, and would love any feedback of any kind :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions