| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…o TestConnection-AddVerboseTcpTest
Sorry, something went wrong.
There was a problem hiding this comment.
Great work here!
A few minor things I think we should address but on the whole this looks like a great improvement 😊
Sorry, something went wrong.
There was a problem hiding this comment.
Couple smaller things I noticed on a re-read. 🙂
Sorry, something went wrong.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
|
Steve Lee (@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 -TCPPort will be boolean, and will be an object if using -Detailed, -Repeat, and -Count. Please let me know if these changes align with what's expected 😁 |
Sorry, something went wrong.
|
Commenting to bump, is there anything else required to merge these changes? I'm very excited to move things forward! |
Sorry, something went wrong.
|
This PR has 144 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience! Quantification details
Label : Medium Size : +126 -18 Percentile : 48.8% Total files changed: 3 Change summary by file extension: .cs : +98 -17 .ps1 : +28 -1 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? 👍 :ok_hand: :thumbsdown: (Email) |
Sorry, something went wrong.
|
/azp run PowerShell-CI-windows |
Sorry, something went wrong.
|
Azure Pipelines successfully started running 1 pipeline(s). |
Sorry, something went wrong.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
|
Travis Plunk (@TravisEz13) The documentation for this cmdlet needs to be updated. Please file a docs issue. |
Sorry, something went wrong.
|
🎉v7.4.0-preview.4 has been released which incorporates this pull request.:tada: Handy links: |
Sorry, something went wrong.
…owerShell#11452) * Added verbose TCP test logic * Cleaned up output, removed source IP address * Consolidated detailed output logic into ProcessConnectionByTCPPort() * Updated existing tests with -Quiet switch * Improved output formatting, changed logic to match * Error handling and logic improvements * Updated tests to match new output * Updated logic, tcp tests now run once by default * Moved TcpConnectionTestResult enum into TcpTestStatus class * Removed unnecessary whitespace * Wrapped TcpClient() in Using statement * Appended missing period on comments * Change TcpTestStatus to TcpPortStatus for better clarity * Set default count back to 4 * Move stopwatch reset into finally block * Change TcpConnectionTestResult.New to TcpConnectionTestResult.None * Formatting fixes * Increase column size for Result output * Update logic for -quiet option * Change "TestNum" property to "Id" * Change Destination and DestinationAddress to Target and TargetAddress in TcpPortStatus * Implement new form of using declaration * Fix indentation * Update output, improve logic and update tests * Add CancellationToken to allow cancel before timeout * Assign testResult.Connected to client.Connected * Move TcpPortStatus object creation to after connection test * Remove delay from final connection test in loop * Move Count logic from ProcessConnectionByTCPPort into own function * Fix small formatting error * Add handling for TaskCanceledException * Remove redundant CancellationToken getter * Clean up handling of SocketException * Increase readability of final loop check * Remove unnecessary TimeSpan invocation * Rename cancellationTokenSource to match convention * Move SetCountForTcpTest() into BeginProcessing() * Added nameof to Count check * Removed explicit type declaration for TcpClient * Move delay and timeout evaluation out of the cycle * Remove redundant CancellationTokenSource * Initialize detailed SwitchParameter * Add check for Detailed parameter * Remove redundant tests for non-detailed output * Add return after first boolean output * Update tests with new detailed parameter set --------- Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
| Back | FazBrowse Home | New Git URL |
Test-Connection: Increase output detail when performing a tcp test
These changes provide more detail when using Test-Connection cmdlet with the -TCPPort option. This will provide functionality more in line with the ping test, and 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 much else.
Here's the current output:
Here is an example of the same command, with the changes:
Test-Connection google.com -TCPPort 443 Destination: google.com Test Source Destination DestinationAddress Port Latency Result (ms) ---- ------ ----------- ------------------ ---- ------- ------ 1 Jacks-MBP google.com 172.217.3.174 443 15 SuccessThe -Count and -Repeat options are also implemented, as seen below:
Test-Connection google.com -TCPPort 443 -Count 4 Destination: google.com Test Source Destination DestinationAddress Port Latency Result (ms) ---- ------ ----------- ------------------ ---- ------- ------ 1 Jacks-MBP google.com 172.217.3.174 443 13 Success 2 Jacks-MBP google.com 172.217.3.174 443 10 Success 3 Jacks-MBP google.com 172.217.3.174 443 16 Success 4 Jacks-MBP google.com 172.217.3.174 443 16 SuccessTest-Connection google.com -TCPPort 443 -Repeat Destination: google.com Test Source Destination DestinationAddress Port Latency Result (ms) ---- ------ ----------- ------------------ ---- ------- ------ 1 Jacks-MBP google.com 172.217.3.174 443 15 Success 2 Jacks-MBP google.com 172.217.3.174 443 15 Success 3 Jacks-MBP google.com 172.217.3.174 443 10 Success 4 Jacks-MBP google.com 172.217.3.174 443 16 Success 5 Jacks-MBP google.com 172.217.3.174 443 16 Success 6 Jacks-MBP google.com 172.217.3.174 443 15 Success 7 Jacks-MBP google.com 172.217.3.174 443 18 Success 8 Jacks-MBP google.com 172.217.3.174 443 16 Success 9 Jacks-MBP google.com 172.217.3.174 443 16 Success 10 Jacks-MBP google.com 172.217.3.174 443 17 Success ...To provide a boolean output, the -Quiet option 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-Connection when 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
Fix: #11440