My end goal here is to cd to a directory in powershell and then list all the alternate data stream files, then output all their content to a CSV.
I currently have the first two parts scripted:
cd c:\users\profilename\downloads\
gci -recurse | % { gi $_.FullName -stream * } | where stream -ne ':$Data'
To open an example data stream file, open cmd, cd to a directory, then run:
dir /r
After this, grab the zone identified name of one of the files and run this command without the :$data.
Example before removing :$Data
notepad test.docx:Zone.Identifier:$Data
After removing(run this command):
notepad test.docx:Zone.Identifier
How would I go about taking the output of the second command and using the PSPath field to open each of these files and then output all the contents in to one CSV file?
Any help is greatly appreciated.
I think this might be close to what you want:
Broken into multi-lines for legibility: