I've been using a very simple Get-ChildItem -Recurse command to generate a CSV inventory of a file directory for appraising said files for retention/deletion. I'm very new to PowerShell and I'm trying to keep the code as simple as possible, here is what I've been successfully using:
Get-ChildItem -Recurse | Select-Object FullName, Name, Extension, Length, CreationTime, LastAccessTime, LastWriteTime | Export-Csv "C:\file\path\file_list.csv"
But I would like to add a checksum to the Select-Object, I tried the following code but it created a CSV with only the checksum and no other file data. The checksum should be a column in the CSV next to the other Select-Object parameters.
Get-ChildItem -Recurse | Get-FileHash -Algorithm MD5 | Select-Object FullName, Name, Extension, Length, CreationTime, LastAccessTime, LastWriteTime, Hash | Export-Csv "C:\file\path\file_list.csv"
Any help is greatly appreciated, I'm VERY new to PowerShell, thanks!