Functions/Data/Convert-StringToBytes.ps1
Function Convert-StringToBytes { [CmdletBinding()] Param ( # Incoming String to Convert [Parameter(Mandatory=$true,ValueFromPipeline=$true)] [String] $String, # Encoding Choice [Parameter(Mandatory=$false)] [ValidateSet("Unicode","ASCII","BigEndianUnicode","Default","UTF7","UTF8","UTF32")] [String] $Encoding = "UTF8" ) Process {$([Text.Encoding]::$Encoding.GetBytes($String))} } |