CodShot
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))

Snippet actions

Pluto
Pluto
Updated: 2026-09-07 15:43
Public snippets
0
Forks
CodShot AI Help
Ask about CodShot features, plans, workspace, AI limits, referrals, and public help topics.
Hi! I can help you understand how CodShot works. What would you like to know?
For account-specific or sensitive issues, please open a support ticket. Open support