< Back

Test-CUncPath

Sun Jan 12, 2020 11:34 pm

NAME Test-CUncPath



SYNOPSIS

Tests if a path is a UNC path.





SYNTAX

Test-CUncPath [-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.





PARAMETERS

-Path <String>

The path to test/check.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Test-CUncPath -Path '\\\\computer\\share'



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









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Test-CUncPath -Path 'C:\\Windows'



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











RELATED LINKS

Test-Path

http://blogs.microsoft.co.il/blogs/Scri ... -path.aspx