Hi All,
I am new to PowerShell.!
Am executing below script and i would like to save all the data (Folder name, Created date, Folder size) to Excel sheet..
# Find foldersGet-ChildItem D:\PowershellScriptSearching -Recurse | Where-Object { $_.PSIsContainer } |
# Find cumulative size of the directories and put it into nice objects
ForEach-Object {
New-Object PSObject -Property @{
Path = $_.FullName
Size = [Math]::Round((Get-ChildItem -Recurse $_.FullName | Measure-Object Length -Sum -ErrorAction SilentlyContinue).Sum / 1MB, 2)
}
} |
# Exclude empty directories
Where-Object { $_.Size -gt 0 }
# Format nicely
Format-Table -AutoSize
Could you please help me.!
- Moved by Dave PatrickMVP Sunday, February 22, 2015 5:07 PM