Functions/Data/Convert-StringToHex.ps1
function Convert-StringToHex { [CmdletBinding()] Param ( # Incoming String [Parameter(Mandatory=$true,ValueFromPipeline=$true)] [String] $String ) Process { # Instantiate Outgoing HEX String $HEX = "" $String.ToCharArray() | foreach {$HEX += '{0:X}' -f [int][char]$_} return "0x$HEX" } } |