Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielniccoli/565cb6239209211158ae71eef2a42686 to your computer and use it in GitHub Desktop.
Save danielniccoli/565cb6239209211158ae71eef2a42686 to your computer and use it in GitHub Desktop.
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