Skip to main content
Version: 4.0

Test-ADTNetworkConnection

SYNOPSIS

Tests for an active local network connection, excluding wireless and virtual network adapters.

SYNTAX

Test-ADTNetworkConnection [<CommonParameters>]

DESCRIPTION

Tests for an active local network connection, excluding wireless and virtual network adapters, by querying the Win32_NetworkAdapter WMI class. This function checks if any physical network adapter is in the 'Up' status.

EXAMPLES

EXAMPLE 1

Test-ADTNetworkConnection

Checks if there is an active wired network connection and returns true or false.

PARAMETERS

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

You cannot pipe objects to this function.

OUTPUTS

System.Boolean

Returns $true if a wired network connection is detected, otherwise returns $false.

NOTES

An active ADT session is NOT required to use this function.

Tags: psadt
Website: https://psappdeploytoolkit.com
Copyright: (C) 2025 PSAppDeployToolkit Team (Sean Lillis, Dan Cunningham, Muhammad Mashwani, Mitch Richters, Dan Gough).
License: https://opensource.org/license/lgpl-3-0

https://psappdeploytoolkit.com/docs/reference/functions/Test-ADTNetworkConnection