SkillAgentSearch skills...

PsNetTools

PsNetTools is a cross platform PowerShell module to test network features on Windows, Linux and Mac.

Install / Use

/learn @tinuwalther/PsNetTools

README

Table of Contents

PsNetTools

PsNetTools is a cross platform PowerShell module to test some network features on Windows, Linux and Mac.

PsNetTools

Image generated with PSWordCloud by Joel Sallow.

Install PsNetTools

Install the latest version from PSGallery:

Install-Module -Name PsNetTools -Repository PSGallery

List all ExportedCommands:

Get-Command -Module PsNetTools

CommandType Name                          Version Source
----------- ----                          ------- ------
Function    Add-PsNetDnsSearchSuffix      0.7.7   PsNetTools
Function    Add-PsNetHostsEntry           0.7.7   PsNetTools
Function    Clear-PsNetDnsSearchSuffix    0.7.7   PsNetTools
Function    Get-PsNetAdapterConfiguration 0.7.7   PsNetTools
Function    Get-PsNetAdapters             0.7.7   PsNetTools
Function    Get-PsNetDnsSearchSuffix      0.7.7   PsNetTools
Function    Get-PsNetHostsTable           0.7.7   PsNetTools
Function    Get-PsNetRoutingTable         0.7.7   PsNetTools
Function    Remove-PsNetDnsSearchSuffix   0.7.7   PsNetTools
Function    Remove-PsNetHostsEntry        0.7.7   PsNetTools
Function    Start-PsNetPortListener       0.7.7   PsNetTools
Function    Test-PsNetDig                 0.7.7   PsNetTools
Function    Test-PsNetPing                0.7.7   PsNetTools
Function    Test-PsNetTping               0.7.7   PsNetTools
Function    Test-PsNetTracert             0.7.7   PsNetTools
Function    Test-PsNetUping               0.7.7   PsNetTools
Function    Test-PsNetWping               0.7.7   PsNetTools

[Top]

Test-PsNetDig

Resolves a hostname to the IP addresses or an IP Address to the hostname.

Test-PsNetDig [-Destination] <String[]> [<CommonParameters>]

Example 1:

Test-PsNetDig -Destination sbb.ch

Succeeded   : True
InputString : sbb.ch
Destination : sbb.ch
IpV4Address : 194.150.245.142
IpV6Address : 2a00:4bc0:ffff:ffff::c296:f58e
TimeMs      : 3

Example 2:

Test-PsNetDig -Destination sbb.ch,google.com | Format-Table

Succeeded InputString Destination IpV4Address     IpV6Address                    TimeMs
--------- ----------- ----------- -----------     -----------                    ------
     True sbb.ch      sbb.ch      194.150.245.142 2a00:4bc0:ffff:ffff::c296:f58e      4
     True google.com  google.com  172.217.168.14  2a00:1450:400a:802::200e            3

Example 3:

'sbb.ch','google.com' | Test-PsNetDig | Format-Table

Succeeded InputString Destination IpV4Address     IpV6Address                    TimeMs
--------- ----------- ----------- -----------     -----------                    ------
     True sbb.ch      sbb.ch      194.150.245.142 2a00:4bc0:ffff:ffff::c296:f58e      4
     True google.com  google.com  216.58.215.238  2a00:1450:400a:801::200e           26

[Top]

Test-PsNetPing

Attempts to send an ICMP echo message to a remote computer and receive a corresponding ICMP echo reply message from the remote computer.

Test-PsNetPing [-Destination] <String[]> [[-try] <Int32>] [<CommonParameters>]
  • Destination: Hostname or IP Address or Alias as String or String-Array
  • try: Number of attempts to send ICMP echo message

Example 1:

Test-PsNetPing -Destination sbb.ch

IcmpSucceeded     : True
IPAddress         : 2a00:4bc0:ffff:ffff::c296:f58e
BytesSend         : 32
BytesReceived     : 0
TimeStamp         : 2019-05-26 09:34:48.388
Destination       : sbb.ch
StatusDescription : ICMP Success
MinTimeout        : 0
MaxTimeout        : 1000
TimeMs            : 19

Example 2:

Test-PsNetPing -Destination sbb.ch -try 5

2019-05-26 09:37:14.577 ICMP ping sbb.ch, IPAddress: 2a00:4bc0:ffff:ffff::c296:f58e, time: 19, send: 32, received: 32, ICMP Success
2019-05-26 09:37:14.577 ICMP ping sbb.ch, IPAddress: 2a00:4bc0:ffff:ffff::c296:f58e, time: 19, send: 32, received: 32, ICMP Success
2019-05-26 09:37:14.577 ICMP ping sbb.ch, IPAddress: 2a00:4bc0:ffff:ffff::c296:f58e, time: 19, send: 32, received: 32, ICMP Success
2019-05-26 09:37:14.577 ICMP ping sbb.ch, IPAddress: 2a00:4bc0:ffff:ffff::c296:f58e, time: 19, send: 32, received: 32, ICMP Success
2019-05-26 09:37:14.577 ICMP ping sbb.ch, IPAddress: 2a00:4bc0:ffff:ffff::c296:f58e, time: 19, send: 32, received: 32, ICMP Success

Example 3:

Test-PsNetPing -Destination sbb.ch, microsoft.com, google.com | Format-Table

IcmpSucceeded IPAddress                      BytesSend BytesReceived Destination   StatusDescription MinTimeout MaxTimeout TimeMs
------------- ---------                      --------- ------------- -----------   ----------------- ---------- ---------- ------
         True 2a00:4bc0:ffff:ffff::c296:f58e        32             0 sbb.ch        ICMP Success               0       1000     18
        False 0.0.0.0                               32             0 microsoft.com ICMP TimedOut              0       1000      0
         True 2a00:1450:400a:802::200e              32             0 google.com    ICMP Success               0       1000     18

Example 4:

Test-PsNetPing -Destination sbb.ch, microsoft.com, google.com -try 2

2019-05-26 09:41:06.319 ICMP ping sbb.ch, IPAddress: 2a00:4bc0:ffff:ffff::c296:f58e, time: 23, send: 32, received: 32, ICMP Success2019-05-26 09:41:07.350 ICMP ping sbb.ch, IPAddress: 2a00:4bc0:ffff:ffff::c296:f58e, time: 22, send: 32, received: 32, ICMP Success
2019-05-26 09:41:09.056 ICMP ping microsoft.com, IPAddress: 0.0.0.0, time: 0, send: 32, received: 0, ICMP TimedOut2019-05-26 09:41:11.056 ICMP ping microsoft.com, IPAddress: 0.0.0.0, time: 0, send: 32, received: 0, ICMP TimedOut
2019-05-26 09:41:12.084 ICMP ping google.com, IPAddress: 2a00:1450:400a:800::200e, time: 19, send: 32, received: 32, ICMP Success
2019-05-26 09:41:13.110 ICMP ping google.com, IPAddress: 2a00:1450:400a:800::200e, time: 19, send: 32, received: 32, ICMP Success

[Top]

Test-PsNetTping

Test connectivity to an endpoint over the specified Tcp port.
It's like the cmdlet Test-NetConnection, but with the ability to specify a timeout in ms.

Test-PsNetTping -Destination <String[]> [-CommonTcpPort] <String> [-MinTimeout <Int32>] [-MaxTimeout <Int32>]
Test-PsNetTping -Destination <String[]> -TcpPort <Int32[]> [-MinTimeout <Int32>] [-MaxTimeout <Int32>]
  • Destination: Hostname or IP Address or Alias as String or String-Array
  • TcpPort: Tcp Port to use as Interger or Integer-Array
  • MinTimeout: Timeout in ms (optional, default is 0ms)
  • MaxTimeout: Timeout in ms (optional, default is 1000ms)

Example 1:

Test-PsNetTping -Destination sbb.ch -TcpPort 443 -MaxTimeout 100

TcpSucceeded      : True
TcpPort           : 443
TimeStamp         : 2019-05-26 09:41:44.322
Destination       : sbb.ch
StatusDescription : TCP Test success
MinTimeout        : 0
MaxTimeout        : 100
TimeMs            : 8

Example 2:

Test-PsNetTping -Destination sbb.ch -CommonTcpPort HTTPS -MaxTimeout 100

TcpSucceeded      : True
TcpPort           : 443
TimeStamp         : 2019-05-26 09:41:44.322
Destination       : sbb.ch
StatusDescription : TCP Test success
MinTimeout        : 0
MaxTimeout        : 100
TimeMs            : 14

Example 3:

Test-PsNetTping -Destination sbb.ch, google.com -TcpPort 443 -MaxTimeout 100 | Format-Table

TcpSucceeded TcpPort Destination StatusDescription MinTimeout MaxTimeout TimeMs
------------ ------- ----------- ----------------- ---------- ---------- ------
        True     443 sbb.ch      TCP Test success           0        100      1
        True     443 google.com  TCP Test success           0        100      1

Example 4:

Test-PsNetTping -Destination sbb.ch, google.com -TcpPort 80, 443 -MaxTimeout 100 | Format-Table

TcpSucceeded TcpPort Destination StatusDescription MinTimeout MaxTimeout TimeMs
------------ ------- ----------- ----------------- ---------- ---------- ------
        True      80 sbb.ch      TCP Test success           0        100      5
        True     443 sbb.ch      TCP Test success           0        100      3
        True      80 google.com  TCP Test success           0        100      9
        True     443 google.com  TCP Test success           0        100      2

[Top]

Test-PsNetTracert

Test Trace Route to a destination

Test-PsNetTracert [-Destination] <String[]> [[-MaxHops] <Int32>] [[-MaxTimeout] <Int32>] [-Show]
  • Destination: Hostname or IP Address or Alias as String or String-Array
  • MaxHops: Count of gateways or router (optional, default is 30)
  • MaxTimeout: Timeout in ms (optional, default is 1000ms)
  • Show: Switch, show the output as line per router instead as Object

Example 1:

View on GitHub
GitHub Stars28
CategoryDevelopment
Updated5mo ago
Forks3

Languages

PowerShell

Security Score

92/100

Audited on Oct 31, 2025

No findings