I am having a PowerShell script which is walking a directory tree, and sometimes I have auxiliary files hardlinked there which should not be processed. Is there an easy way
here is a one-liner that checks one file $FilePath and returns if it is a symlink or not, works for files and directories
$FilePath
if((Get-ItemProperty $FilePath).LinkType){"symboliclink"}else{"normal path"}