Last active
August 24, 2022 21:28
-
-
Save danielniccoli/565cb6239209211158ae71eef2a42686 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-Function { | |
[CmdletBinding()] | |
param( | |
[parameter(Mandatory, Position = 0, ValueFromPipeline)] | |
[string[]] | |
$Values | |
) | |
process { | |
$Values.ForEach({ | |
$newValue = foreach ($c in [char[]]$_) { | |
$rand = Get-Random -Minimum 0x300 -Maximum 0x36F | |
"$c$([char]$rand)" | |
} | |
[string]$newValue | |
}) | |
} | |
} | |
Test-Function "Hello there!", "Hello world!" | |
"Hello there!", "Hello world!" | Test-Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment