Test-Path can check whether a file or folder exists. If you add -PathType and specify Leaf (for files) or Container (for folders), the result can be even more specific:
$path = 'c:\windows' Test-Path -Path $path Test-Path -Path $path -PathType Leaf Test-Path -Path $path -PathType Container