Functions/Helper/SymbolicLink/Test-ValentiaSymbolicLink.ps1

#Requires -Version 3.0

#-- SymbolicLink Functions --#

<#
.SYNOPSIS
This function will Test whether target path is Symbolic Link or not.
 
.DESCRIPTION
If target is Symbolic Link (reparse point), function will return $true.
Others, return $false.
 
.NOTES
Author: guitarrapc
Created: 12/Feb/2015
 
.EXAMPLE
Test-ValentiaSymbolicLink -Path "d:\SymbolicLink"
--------------------------------------------
As Path is Symbolic Link, this returns $true.
 
#>

function Test-ValentiaSymbolicLink
{
    [OutputType([System.IO.DirectoryInfo[]])]
    [cmdletBinding()]
    param
    (
        [parameter(mandatory = $true, Position  = 0, ValueFromPipeline =1, ValueFromPipelineByPropertyName = 1)]
        [Alias('FullName')]
        [String]$Path
    )
    
    begin
    {
        $script:ErrorActionPreference = $valentia.preference.ErrorActionPreference.custom
    }

    process
    {
        $result = Get-ValentiaSymbolicLink -Path $Path
        if ($null -eq $result)
        {
            return $false
        }
        return $true
    }
}