List out files in directory and it's each sub-directory using Power Shell

Get list of file names in directory and it’s each sub directory using PowerShell

Step:- Open PowerShell as  Administrator mode and execute the below script

Get-ChildItem 'D:\Learn_Something' -recurse | where-object { $_.FullName -ne $NULL -and $_.DirectoryName -ne $NULL} |

select-object DirectoryName,Name,FullName

Export Results to CSV : -

If you want to export directory, file name along with path information into csv use below

Note: Change the Location and CSV export location

Get-ChildItem 'D:\Learn_Something' -recurse | where-object { $_.FullName -ne $NULL -and $_.DirectoryName -ne $NULL} |select-object DirectoryName,Name,FullName |

Export-CSV D:\Files_Info.csv


要查看或添加评论,请登录

社区洞察

其他会员也浏览了