Get-ChildItem.Length is Wrong
问题 I am writing a recursive function that goes through a directory and copies every file and folder in it. The first check I have in the function is to see if the path passed in has children. To find this out, I use the following method: [array]$arrExclude = @("Extras") Function USBCopy { Param ([string]$strPath, [string]$strDestinationPath) try { $pathChildren = Get-ChildItem -Path $strPath if($pathChildren.Length -gt 0) { foreach($child in $pathChildren) { if($arrExclude -notcontains $child) {