I encountered a problem in PowerShell in listing its child items.
$file = Get-ChildItem \\\\compname\\c$\\folder\\ -Recurse -Filter *filename.txt* |
Sel
You're still using PowerShell v2 or earlier. These early versions don't support member enumeration on arrays, which would allow you to access properties of array elements via the array object itself. Instead you get an empty result, because the array object does not have a property DirectoryName
or FullName
.
If you can't upgrade to at least PowerShell v3 you can work around this issue with a loop:
$file | ForEach-Object { $_.FullName }
or by expanding the property:
$file | Select-Object -Expand FullName