PowerShell
Public
Write binary data to a file
This snippet writes UTF-8 encoded text data with a null byte separator into a binary file using .NET file and text encoding classes.
PowerShell
$text = "CodShot binary rejection test" + [char]0 + "This should be rejected by the backend.";
[System.IO.File]::WriteAllBytes("codshot-import-test-binary.js", [System.Text.Encoding]::UTF8.GetBytes($text))