I'm trying to find a way to create a checksum/hash of CD or DVD using PowerShell. I know Get-Filehash works very well on files, but I can't figure out how to do it for optical media. I was thinking I might be able to use Get-Content to get the bitstream and pipe it to Get-Filehash, but running Get-Content -Path D:\ (where D: is the disc) return an "Access to the path 'D:\'is denied. Get-Volume only seems to return an object with properties, not the bitstream.
I already have an ISO image file for the disc. Am trying to get the checksum on the whole original disc to compare to the ISO to make sure it was ripped correctly.
Any suggestions or pointers?
From your example,
Get-Content -Path D:\fails because you're not pointing to a file. From the Get-Content documentation:I.e., the optical drive isn't the issue for that cmdlet; you'll see the same error if you tried that on your
C:/drive.From the question I'm not sure if your optical drive contains the extracted ISO or just the ISO, but something like this should get you started: