Skip to content

Instantly share code, notes, and snippets.

@drichardson
drichardson / Out-FileUtf8NoBom.psm1
Created October 24, 2017 20:15 — forked from mklement0/Out-FileUtf8NoBom.ps1
PowerShell function that emulates Out-File for creating UTF-8-encoded files *without a BOM* (byte-order mark).
<#
.SYNOPSIS
Outputs to a UTF-8-encoded file *without a BOM* (byte-order mark).
.DESCRIPTION
Mimics the most important aspects of Out-File:
* Input objects are sent to Out-String first.
* -Append allows you to append to an existing file, -NoClobber prevents
overwriting of an existing file.
* -Width allows you to specify the line width for the text representations