I am writing a PS script that needs to download a decryption key from a server. However the PS engine parses the file as text when I want to retrieve it as a byte stream. For instance the file contains 84416e8e (ASCII: „AnŽ) and the downloaded file contains 6539653832646439 (ASCII: e9e82dd9) I've tried both Invoke-WebRequest and System.Net.WebClient without success, even when iwr has the option -ContentType "application/octet-stream"
Edit: The issue may not lie with PS, I've noticed that opening the URL to the key through Firefox allows me to download the file correctly, but opening it through Chrome produces the modified version. Is there something I'm missing here?