Last active
November 4, 2016 11:03
-
-
Save torgro/4f6de0093b80e509e7e20091a21c48d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-String | |
{ | |
param( | |
[parameter(Valuefrompipeline)] | |
[string]$InputObject | |
) | |
Begin | |
{} | |
Process | |
{ | |
$bytes = [System.Text.Encoding]::ASCII.GetBytes("$InputObject") | |
$asciiValue = [System.Text.Encoding]::ASCII.GetString($bytes) | |
[pscustomobject]@{ | |
InputString = $InputObject | |
ASCIIvalue = $asciiValue | |
IsEqual = $asciiValue -eq $InputObject | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment