I'm learning PowerShell and have seen this used on Technet:
Test-Path -Path $DirectoryPath -PathType 'Leaf'
What is the meaning of the path type Leaf?
It is clear what the Container and Any path types are
Leaf : file
Container : folder / directory
Any : file or folder
.
The metaphor is that your file system is like a tree hierarchy, with each branching node either being able to branch further (folder), or being a leaf node that cannot branch further (file).
Illustrated example:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With