en-US/PSNetScanners.dll-Help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh">
  <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Test-PingAsync</command:name>
      <command:verb>Test</command:verb>
      <command:noun>PingAsync</command:noun>
      <maml:description>
        <maml:para>Sends ICMP echo requests (pings) to one or more targets in parallel.</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>The `Test-PingAsync` cmdlet sends ICMP echo requests to multiple targets concurrently using the .NET `Ping.SendPingAsync` method (https://learn.microsoft.com/en-us/dotnet/api/system.net.networkinformation.ping.sendpingasync).</maml:para>
      <maml:para>It provides a faster, lightweight alternative to `Test-Connection` when you need high-performance parallel scanning with basic options.</maml:para>
      <maml:para>&gt; [!IMPORTANT] &gt; &gt; This cmdlet never throws terminating errors . It uses a result-oriented pattern — any errors (DNS resolution failures, etc.) are captured in the `.Error` property of the returned object.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Test-PingAsync</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="ComputerName, HostName, Host, Server, Address">
          <maml:name>Target</maml:name>
          <maml:description>
            <maml:para>Specifies one or more targets to test. You can use hostnames, FQDNs, IPv4/IPv6 addresses, or URIs.</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
          <dev:type>
            <maml:name>String[]</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="bfs">
          <maml:name>BufferSize</maml:name>
          <maml:description>
            <maml:para>Specifies the size, in bytes, of the data buffer sent with the ICMP request.</maml:para>
            <maml:para>&gt; [!NOTE] &gt; &gt; The default value is 32 bytes.</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
          <dev:type>
            <maml:name>Int32</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>32</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="timeout, to, ct">
          <maml:name>ConnectionTimeout</maml:name>
          <maml:description>
            <maml:para>Specifies the timeout (in milliseconds) for each individual ping request.</maml:para>
            <maml:para>&gt; [!NOTE] &gt; &gt; - If a request does not complete within this time, its status becomes `TimedOut`. &gt; - Default value is 4000 (4 seconds).</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
          <dev:type>
            <maml:name>Int32</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>4000</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>DontFragment</maml:name>
          <maml:description>
            <maml:para>Sets the Don't Fragment flag in the IP header.</maml:para>
            <maml:para>See `PingOptions.DontFragment` (https://learn.microsoft.com/en-us/dotnet/api/system.net.networkinformation.pingoptions.dontfragment#system-net-networkinformation-pingoptions-dontfragment)for more information.</maml:para>
          </maml:description>
          <dev:type>
            <maml:name>SwitchParameter</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dns">
          <maml:name>ResolveDns</maml:name>
          <maml:description>
            <maml:para>Attempts to resolve the DNS hostname for each target and includes the result in the `DnsResult` property.</maml:para>
          </maml:description>
          <dev:type>
            <maml:name>SwitchParameter</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="tl">
          <maml:name>ThrottleLimit</maml:name>
          <maml:description>
            <maml:para>Limits the maximum number of concurrent ping requests.</maml:para>
            <maml:para>&gt; [!NOTE] &gt; &gt; The default value 50 .</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
          <dev:type>
            <maml:name>Int32</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>50</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>Ttl</maml:name>
          <maml:description>
            <maml:para>Sets the Time to Live (TTL) value for the ICMP packets (maximum number of hops).</maml:para>
            <maml:para>&gt; [!NOTE] &gt; &gt; Must be between 1 and 255 . Default is 128 .</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
          <dev:type>
            <maml:name>Int32</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>128</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="ComputerName, HostName, Host, Server, Address">
        <maml:name>Target</maml:name>
        <maml:description>
          <maml:para>Specifies one or more targets to test. You can use hostnames, FQDNs, IPv4/IPv6 addresses, or URIs.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
        <dev:type>
          <maml:name>String[]</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="bfs">
        <maml:name>BufferSize</maml:name>
        <maml:description>
          <maml:para>Specifies the size, in bytes, of the data buffer sent with the ICMP request.</maml:para>
          <maml:para>&gt; [!NOTE] &gt; &gt; The default value is 32 bytes.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
        <dev:type>
          <maml:name>Int32</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>32</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="timeout, to, ct">
        <maml:name>ConnectionTimeout</maml:name>
        <maml:description>
          <maml:para>Specifies the timeout (in milliseconds) for each individual ping request.</maml:para>
          <maml:para>&gt; [!NOTE] &gt; &gt; - If a request does not complete within this time, its status becomes `TimedOut`. &gt; - Default value is 4000 (4 seconds).</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
        <dev:type>
          <maml:name>Int32</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>4000</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>DontFragment</maml:name>
        <maml:description>
          <maml:para>Sets the Don't Fragment flag in the IP header.</maml:para>
          <maml:para>See `PingOptions.DontFragment` (https://learn.microsoft.com/en-us/dotnet/api/system.net.networkinformation.pingoptions.dontfragment#system-net-networkinformation-pingoptions-dontfragment)for more information.</maml:para>
        </maml:description>
        <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
        <dev:type>
          <maml:name>SwitchParameter</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>False</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dns">
        <maml:name>ResolveDns</maml:name>
        <maml:description>
          <maml:para>Attempts to resolve the DNS hostname for each target and includes the result in the `DnsResult` property.</maml:para>
        </maml:description>
        <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
        <dev:type>
          <maml:name>SwitchParameter</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>False</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="tl">
        <maml:name>ThrottleLimit</maml:name>
        <maml:description>
          <maml:para>Limits the maximum number of concurrent ping requests.</maml:para>
          <maml:para>&gt; [!NOTE] &gt; &gt; The default value 50 .</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
        <dev:type>
          <maml:name>Int32</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>50</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>Ttl</maml:name>
        <maml:description>
          <maml:para>Sets the Time to Live (TTL) value for the ICMP packets (maximum number of hops).</maml:para>
          <maml:para>&gt; [!NOTE] &gt; &gt; Must be between 1 and 255 . Default is 128 .</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
        <dev:type>
          <maml:name>Int32</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>128</dev:defaultValue>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.String[]</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>PSNetScanners.Ping.PingResult</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para>- DNS resolution occurs automatically when a hostname is provided.</maml:para>
        <maml:para>- Designed for performance — exceptions are never thrown.</maml:para>
        <maml:para>- Always check `.Status`, `.Success` and `.Error` on each result object.</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>---------- Example 1: Ping multiple hosts in parallel ----------</maml:title>
        <dev:code>PS ..\&gt; Test-PingAsync google.com, github.com
 
Source Destination Address Latency Status
------ ----------- ------- ------- ------
DESKTOP-XYZ google.com 142.251.128.46 9 ms Success
DESKTOP-XYZ github.com 4.228.31.150 41 ms Success</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>--------- Example 2: Resolve DNS names for the targets ---------</maml:title>
        <dev:code>PS ..\&gt; $result = Test-PingAsync 8.8.8.8, 8.8.4.4, 1.1.1.1 -ResolveDns
PS ..\&gt; $result.DnsResult
 
Status : Success
HostName : dns.google
AddressList : {8.8.8.8, 8.8.4.4}
Aliases : {}
 
Status : Success
HostName : dns.google
AddressList : {8.8.8.8, 8.8.4.4}
Aliases : {}
 
Status : Success
HostName : one.one.one.one
AddressList : {1.1.1.1, 1.0.0.1}
Aliases : {}</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>----------- Example 3: Specify a per-request timeout -----------</maml:title>
        <dev:code>PS ..\&gt; $range = 1..10 | ForEach-Object { "192.168.1.$_" }
PS ..\&gt; $range | Test-PingAsync -ConnectionTimeout 200
 
Source Destination Address Latency Status
------ ----------- ------- ------- ------
DESKTOP-XYZ 192.168.1.4 192.168.1.4 0 ms Success
DESKTOP-XYZ 192.168.1.1 192.168.1.1 35 ms Success
DESKTOP-XYZ 192.168.1.2 192.168.1.2 314 ms Success
DESKTOP-XYZ 192.168.1.3 * * TimedOut
DESKTOP-XYZ 192.168.1.5 * * TimedOut
DESKTOP-XYZ 192.168.1.6 * * TimedOut
DESKTOP-XYZ 192.168.1.7 * * TimedOut
DESKTOP-XYZ 192.168.1.8 * * TimedOut
DESKTOP-XYZ 192.168.1.9 * * TimedOut
DESKTOP-XYZ 192.168.1.10 * * TimedOut</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>----------- Example 4: Handling resolution failures -----------</maml:title>
        <dev:code>PS ..\&gt; $result = Test-PingAsync google.com, doesnotexist.xy
PS ..\&gt; $result
 
Source Destination Address Latency Status
------ ----------- ------- ------- ------
DESKTOP-XYZ google.com 142.251.128.238 11 ms Success
DESKTOP-XYZ doesnotexist.xy * * Unknown
 
PS ..\&gt; $result[1].Error
 
TargetSite :
Message : Failed to resolve host 'doesnotexist.xy'. No such host is known.
Data : {}
InnerException : System.Net.Sockets.SocketException (11001): No such host is known.
                    at System.Net.NameResolutionPal.ProcessResult(SocketError errorCode, GetAddrInfoExContext* context)
                    at System.Net.NameResolutionPal.GetAddressInfoExCallback(Int32 error, Int32 bytes, NativeOverlapped* overlapped)
                 --- End of stack trace from previous location ---
                    at System.Net.NetworkInformation.Ping.&lt;&gt;c.&lt;&lt;SendPingAsync&gt;b__56_0&gt;d.MoveNext()
                 --- End of stack trace from previous location ---
                    at System.Net.NetworkInformation.Ping.SendPingAsyncInternal[TArg](TArg getAddressArg, Func`3 getAddress, Int32 timeout, Byte[] buffer, PingOptions options, CancellationToken cancellationToken)
HelpLink :
Source :
HResult : -2146233088
StackTrace :</dev:code>
        <dev:remarks>
          <maml:para>&gt; [!IMPORTANT] &gt; &gt; This cmdlet does not throw exceptions. All errors are captured in the `.Error` property.</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>__`Ping` Class__</maml:linkText>
        <maml:uri>https://learn.microsoft.com/en-us/dotnet/api/system.net.networkinformation.ping</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>__`Ping.SendPingAsync` Method__</maml:linkText>
        <maml:uri>https://learn.microsoft.com/en-us/dotnet/api/system.net.networkinformation.ping.sendpingasync</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Test-TcpAsync</command:name>
      <command:verb>Test</command:verb>
      <command:noun>TcpAsync</command:noun>
      <maml:description>
        <maml:para>Tests TCP port connectivity to one or more targets in parallel.</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>The `Test-TcpAsync` cmdlet tests TCP connectivity to one or more targets across multiple ports using the .NET `TcpClient.ConnectAsync` method (https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.tcpclient.connectasync).</maml:para>
      <maml:para>It is a fast, parallel alternative to `Test-NetConnection -Port`.</maml:para>
      <maml:para>&gt; [!IMPORTANT] &gt; &gt; This cmdlet never throws terminating errors . It uses a result-oriented pattern — any errors (timeouts, refused connections, DNS issues, etc.) are captured in the `.Error` property of the returned object.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Test-TcpAsync</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="ComputerName, HostName, Host, Server, Address">
          <maml:name>Target</maml:name>
          <maml:description>
            <maml:para>Specifies one or more targets to test. Accepts hostnames, FQDNs, IPv4/IPv6 addresses, or URIs.</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
          <dev:type>
            <maml:name>String[]</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="p">
          <maml:name>Port</maml:name>
          <maml:description>
            <maml:para>Specifies one or more TCP ports to test.</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">Int32[]</command:parameterValue>
          <dev:type>
            <maml:name>Int32[]</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="timeout, to, ct">
          <maml:name>ConnectionTimeout</maml:name>
          <maml:description>
            <maml:para>Specifies the timeout (in milliseconds) for each connection attempt.</maml:para>
            <maml:para>&gt; [!NOTE] &gt; &gt; - If a request does not complete within this time, its status becomes `TimedOut`. &gt; - Default value is 4000 (4 seconds).</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
          <dev:type>
            <maml:name>Int32</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>4000</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="tl">
          <maml:name>ThrottleLimit</maml:name>
          <maml:description>
            <maml:para>Limits the maximum number of concurrent ping requests.</maml:para>
            <maml:para>&gt; [!NOTE] &gt; &gt; The default value 50 .</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
          <dev:type>
            <maml:name>Int32</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>50</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="ComputerName, HostName, Host, Server, Address">
        <maml:name>Target</maml:name>
        <maml:description>
          <maml:para>Specifies one or more targets to test. Accepts hostnames, FQDNs, IPv4/IPv6 addresses, or URIs.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
        <dev:type>
          <maml:name>String[]</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="p">
        <maml:name>Port</maml:name>
        <maml:description>
          <maml:para>Specifies one or more TCP ports to test.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">Int32[]</command:parameterValue>
        <dev:type>
          <maml:name>Int32[]</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="timeout, to, ct">
        <maml:name>ConnectionTimeout</maml:name>
        <maml:description>
          <maml:para>Specifies the timeout (in milliseconds) for each connection attempt.</maml:para>
          <maml:para>&gt; [!NOTE] &gt; &gt; - If a request does not complete within this time, its status becomes `TimedOut`. &gt; - Default value is 4000 (4 seconds).</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
        <dev:type>
          <maml:name>Int32</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>4000</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="tl">
        <maml:name>ThrottleLimit</maml:name>
        <maml:description>
          <maml:para>Limits the maximum number of concurrent ping requests.</maml:para>
          <maml:para>&gt; [!NOTE] &gt; &gt; The default value 50 .</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
        <dev:type>
          <maml:name>Int32</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>50</dev:defaultValue>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.Int32[]</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:inputType>
      <command:inputType>
        <dev:type>
          <maml:name>System.String[]</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>PSNetScanners.Tcp.TcpResult</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para>- DNS resolution occurs automatically when a hostname is provided.</maml:para>
        <maml:para>- This cmdlet is optimized for high-performance parallel scanning.</maml:para>
        <maml:para>- Always check the `Status` and `.Error` properties for detailed failure information.</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>------- Example 1: Test multiple ports on a single host -------</maml:title>
        <dev:code>PS ..\&gt; Test-TcpAsync google.com 20, 25, 80, 443
 
Source Destination Client Port Status
------ ----------- ------ ---- ------
DESKTOP-XYZ google.com 142.251.128.142 80 Opened
DESKTOP-XYZ google.com 142.251.128.142 443 Opened
DESKTOP-XYZ google.com 25 TimedOut
DESKTOP-XYZ google.com 20 TimedOut</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>------- Example 2: Test multiple ports on multiple hosts -------</maml:title>
        <dev:code>PS ..\&gt; Test-TcpAsync google.com, github.com 20, 25, 80, 443
 
Source Destination Client Port Status
------ ----------- ------ ---- ------
DESKTOP-XYZ google.com 142.251.134.14 443 Opened
DESKTOP-XYZ google.com 142.251.134.14 80 Opened
DESKTOP-XYZ github.com 20.201.28.151 80 Opened
DESKTOP-XYZ github.com 20.201.28.151 443 Opened
DESKTOP-XYZ google.com 20 TimedOut
DESKTOP-XYZ google.com 25 TimedOut
DESKTOP-XYZ github.com 20 TimedOut
DESKTOP-XYZ github.com 25 TimedOut</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>------------- Example 3: Specify a custom timeout -------------</maml:title>
        <dev:code>PS ..\&gt; $result = Test-TcpAsync github.com 20, 80 -ConnectionTimeout 30000
PS ..\&gt; $result
 
Source Destination Client Port Status
------ ----------- ------ ---- ------
DESKTOP-XYZ github.com 20.201.28.151 80 Opened
DESKTOP-XYZ github.com 20 Closed
 
PS ..\&gt; $result[1].Error
 
Message : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
SocketErrorCode : TimedOut
ErrorCode : 10060
NativeErrorCode : 10060
TargetSite : Void ThrowException(System.Net.Sockets.SocketError, System.Threading.CancellationToken)
Data : {}
InnerException :
HelpLink :
Source : System.Net.Sockets
HResult : -2147467259
StackTrace : at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
                     at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
                     at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.&lt;&gt;c.&lt;.cctor&gt;b__4_0(Object state)
                  --- End of stack trace from previous location ---
                     at System.Net.Sockets.TcpClient.CompleteConnectAsync(Task task)
                     at PSNetScanners.Tcp.TcpResult.CreateAsync(String source, TcpInput input, Cancellation cancellation, Int32 timeout) in D:\pwsh\PSNetScanners\src\PSNetScanners\Tcp\TcpResult.cs:line 57</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>--------- Example 4: Import targets and ports from CSV ---------</maml:title>
        <dev:code>PS ..\&gt; Import-Csv targets.csv | Test-TcpAsync
 
Source Destination Client Port Status
------ ----------- ------ ---- ------
DESKTOP-XYZ google.com 142.251.133.206 80 Opened
DESKTOP-XYZ google.com 142.251.133.206 443 Opened
DESKTOP-XYZ github.com 20.201.28.151 443 Opened
DESKTOP-XYZ github.com 20.201.28.151 80 Opened
DESKTOP-XYZ amazon.com 52.94.236.248 443 Opened
DESKTOP-XYZ cisco.com 72.163.4.185 443 Opened
DESKTOP-XYZ cisco.com 72.163.4.185 80 Opened
DESKTOP-XYZ amazon.com 52.94.236.248 80 Opened</dev:code>
        <dev:remarks>
          <maml:para>&gt; [!TIP] &gt; &gt; The cmdlet accepts pipeline input by property name. Any column name that matches the parameter name or any of its aliases will bind automatically.</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>__`TcpClient` Class__</maml:linkText>
        <maml:uri>https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.tcpclient</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>__`TcpClient.ConnectAsync` Method__</maml:linkText>
        <maml:uri>https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.tcpclient.connectasync</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>