< Back

Get-DTWFileEncodingTypeFromName

Sat Jan 18, 2020 9:32 pm

NAME Get-DTWFileEncodingTypeFromName



SYNOPSIS

Returns System.Text file encoding given name





SYNTAX

Get-DTWFileEncodingTypeFromName [-Name] <String> [-NoBom] [<CommonParameters>]





DESCRIPTION

Returns System.Text file encoding given name; can specify -NoBom for Byte Order

Marker.





PARAMETERS

-Name <String>

A name value of encoding type, such as Ascii, US-ASCII, UTF8, utf-8, etc.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-NoBom [<SwitchParameter>]

If specified, type will not include Byte Order Marker. Ignored if specified for

Ascii file encoding.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-DTWFileEncodingTypeFromName 'utf-8'



<returns UTF8 encoding with BOM>









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-DTWFileEncodingTypeFromName 'UTF8' -NoBOM



UTF8











RELATED LINKS