I am using a for loop to find the hash values of files (I am doing this to 10,000 files):
For ($var = 0; $var -le 9999; $var++) { Get-FileHash -Path C:UsersNameDocumentsFilename$var.txt }
However, I want to save the outputs of the file to a separate file to be able to search for a specific hash value. This is the command I have for that so far:
For ($var = 0; $var -le 9999; $var++) { Get-FileHash -Path C:UsersNameDocumentsFilename$var.txt | Out-File -FilePath C:UsersNameDocumentsHashFiles.txt }
This code is rewriting the file each time, so I was wondering how I would be able to keep all of the hash values that I search? Also, if anyone has any tips for how to write the file’s name before the hash, that would also be helpful. TYIA!
Brittany Broome is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.