Test-UncPath

Tests if a path is a UNC path.

Syntax

Test-UncPath [-Path] <String> [<CommonParameters>]

Description

Converts the path to a URI and returns the value of its IsUnc property.

This function does not test if path exists. Use Test-Path for that.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Path String

The path to test/check.

true false

EXAMPLE 1

Test-UncPath -Path '\\computer\share'

Returns true since \\computer\share is a UNC path. Note that Test-UncPath does not have to exist.

EXAMPLE 2

Test-UncPath -Path 'C:\Windows'

Returns false since C:\Windows is not a UNC path.