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
Test-Connection: Increase output detail when performing a tcp test #11452
base: master
Are you sure you want to change the base?
Test-Connection: Increase output detail when performing a tcp test #11452
Conversation
…o TestConnection-AddVerboseTcpTest
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs
Outdated
Show resolved
Hide resolved
|
@vexx32 The difference between pings and TCP connections is that TCP connections continue to use system resources during the TIME_WAIT state after the connection is closed. So even if there is a throttle on how fast they are created, they will still exist for 4 minutes. See https://docs.microsoft.com/en-us/windows/client-management/troubleshoot-tcpip-port-exhaust
|
|
sending back to the committee for #11452 (comment) |
|
@PowerShell/powershell-committee reviewed this, we are concerned about a breaking change from 7.0 which is an LTS release. Proposed parameter sets: Test-Connection -TCPPort <port>
Test-Connection -TCPPort <port> -Detailed
Test-Connection -TCPPort <port> -Count <count>
Test-Connection -TCPPort <port> -RepeatTherefore,
|
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@SteveL-MSFT Thank you for the update! I've made the changes to implement the parameter sets you've described. As mentioned, the default return with Please let me know if these changes align with what's expected |
|
Commenting to bump, is there anything else required to merge these changes? I'm very excited to move things forward! |
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? |
|
/azp run PowerShell-CI-windows |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |


Test-Connection: Increase output detail when performing a tcp test
These changes provide more detail when using
Test-Connectioncmdlet with the-TCPPortoption. This will provide functionality more in line with the ping test, and the classicTest-NetConnectioncmdlet.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 much else.
Here's the current output:
Here is an example of the same command, with the changes:
The
-Countand-Repeatoptions are also implemented, as seen below:To provide a boolean output, the
-Quietoption is used:Most of the code changes are implementing a new TcpTestStatus class to facilitate the output. A few changes to existing code to implement the existing switches.
PR Context
This opens up a lot more functionality with
Test-Connectionwhen working with TCP. Often, while working on connectivity issues, we need more detail than just if the connection is established, or not.These changes should provide much of the fundamental TCP functionality from the classic
Test-NetConnection.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.Fix: #11440