Function to change encoding of a file in PowerShell

This is a function to change encoding of a file: