I have the following code working - based on the great help here on stackoverflow - to parse a CSV file. I would like to replace the $_.File - matches with data from a second CSV file that contains a list of files.
Import-csv "D:\NTFSInfo_C_.csv" -header("File","ParentName","Extension","Attributes","SizeInBytes","CreationDate","LastModificationDate","LastAccessDate","LastAttrChangeDate","Status","USN","FRN","ParentFRN","FileNameCreationDate","FileNameLastModificationDate","FileNameLastAccessDate","FileNameLastAttrModificationDate")|
Where-Object{($_.File -match "null.sys") -or ($_.File -match "explorer.exe")} |
Select-Object File, CreationDate, FileNameCreationDate, ParentName |
Export-CSV -Path c:\NTFS_KNOW_IOC.csv -NoTypeInformation
Question. How do I read a list of file names from a TXT or CSV into an array and then use that array in the Where-Object as shown above?
Thank you!