These are mainly for me to jot down as reminders for myself. If I want to determine if file system object is a file (leaf) or folder (directory) I can use these two tests:
- Test folder: Test-Path -PathC: est -PathTypeContainer
- Test file: Test-Path -PathC: est -PathType Leaf
$False, in these cases, can indicate two things:
- The item does not exist
- The item is not the PathType indicated
Be sure you know which you are testing for.
0 comments:
Post a Comment