I need to write the same bytes to all files with extension TIFF in a particular folder. I am completely new to PowerShell (or any other coding for that matter). I have worked out how to change the bytes in a single file like this (simplified for this post):
$bytes = [System.IO.File]::ReadAllBytes("C:\test.tiff")
$bytes[5] = 0x51
$bytes[8] = 0x4A
[System.IO.File]::WriteAllBytes("C:\test.tiff", $bytes)
However, rather than specifying the file I need to loop through the files in a particular folder to check if they have the extension TIFF before writing the bytes and I am not sure how to do that. Any help would be appreciated.