파일 또는 폴더 크기 통계

2196 단어 폴더
# 

Get-ChildItem -Path F:\BCP -Recurse | Where-Object {$_.mode -Like "-*"} | Select-Object -Property FullName, Length | Export-Csv -Path "f:\file list.csv" -Encoding UTF8



# temp 

$allfolder = Get-ChildItem -Path F:\BCP -Recurse | Where-Object {$_.Mode -Like "d*" -and $_.Name -eq "temp"} | select -Property Fullname

ForEach($folder in $allfolder) {

    $foldermeasure = Get-ChildItem -Path $folder.FullName | Measure-Object -Property length -Sum

    $folder.FullName + ',' + [System.Math]::Round($foldermeasure.Sum / 1048576) | Out-File -FilePath "f:\file list.csv" -Append -Encoding ascii

}

좋은 웹페이지 즐겨찾기