Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-ChildItem -Path E:\PathToScan\ -Recurse |`
- foreach{
- $Item = $_
- $Type = $_.Extension
- $Path = $_.FullName
- $Folder = $_.PSIsContainer
- $Size = $_.Length
- $Path | Select-Object `
- @{n="Name";e={$Item}},`
- @{n="Size";e={$Size}},`
- @{n="filePath";e={$Path}},`
- @{n="Extension";e={if($Folder){"Folder"}else{$Type}}}`
- }| Export-Csv E:\ResultFile.csv -NoTypeInformation -Encoding UTF8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement