It seems Get-ChildItem returns a single object instead of an array of one object if it only finds one item. For example this returns 5:
$files = Get-ChildItem -Filter "e*.txt"
$files.length
But the following should return 1 but returns 61321:
$files = Get-ChildItem -Filter "exact.txt"
$files.length
The 61321 is the size in bytes of the file exact.txt.
How can we consistently check if there were files found?