我使用下面的Powershell脚本来度量目录的递归大小。(Get-ChildItem $downloadPath -recurse | Measure-Object -property Length -sum).Sum
此脚本适用于“普通”目录和文件,但如果该目录仅包含.tmp文件,则将出现以下错误。Measure-Object : The property "Length" cannot be found in the input for any objects.At line:1
在我输入文件夹名称后$Path = Read-Host -Prompt 'Please enter the folder name: '
我得到以下错误:
Measure-Object : The property "length" cannot be found in the input for anyAt C:\Users\Erik\Desktop\powers