Tests if a path is a UNC path.
Test-UncPath [-Path] <String> [<CommonParameters>]
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.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Path | String | The path to test/check. |
true | false |
Test-UncPath -Path '\\computer\share'
Returns true
since \\computer\share
is a UNC path. Note that Test-UncPath
does not have to exist.
Test-UncPath -Path 'C:\Windows'
Returns false
since C:\Windows
is not a UNC path.