Powershell function to get hash value of a file
I think your code is okay. Some notes:


PowerShell 4 has a Get-FileHash command. Granted, most people don't have PS4 yet.
Why reinvent the wheel when other people have already done it better? E.g.: Boe Prox's Get-FileHash.
I believe the PowerShell Community Extensions also have a file hash command.
The dependency on certutil is not ideal. Do we know that the output format from all versions of certutil will be same everywhere and for all time?
You don't need the echo in the last line. The last line can consist of just $hashstring by itself. Since that value is not being consumed, it will be placed in the pipeline. (It's important, by the way, to understand how the pipeline works to use PowerShell.)