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
mso-bidi-font-family: "Lucida Console"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;">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.