Creating a file of md5 hashes for all files in a directory in PowerShell
I rewrote your code from scratch how I would have written it myself. Maybe it can give you some ideas.

$lines = gci -Recurse -File | 
    Get-FileHash -Algorithm MD5 | % { 
        $unixPath = $_.Path -replace '\\','/'
        $hash = $_.Hash.ToLower()
        "$hash $unixPath" }

$lines -join "`n" | 
    Out-File -Encoding ascii -NoNewline $ENV:USERPROFILE\Desktop\hashes.txt


Notes:


gci is an alias for Get-ChildItem.
I used gci -File to get files only.
% is an alias for ForEach-Object.
I didn't use it, but here is the help for FileSystemInfo.FullName
cat is an alias for Get-Content.


Feel free to ask any questions.