Skip to content

Instantly share code, notes, and snippets.

@echristopherson
Last active September 22, 2023 03:36
"Print" a file from a computer emulator by having the emulator pipe the print output to this script, which is supposed to put it in a file on the host filesystem, with a date/timestamp in its filename. The script takes one argument: the path to put the output file in.
$timeStr = $args[0] + '\' + [DateTime]::UtcNow.ToString('yyyy-MM-dd-HHmmss') + '-utc.txt'
$input |Out-File -FilePath $timeStr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment