Skip to content

Instantly share code, notes, and snippets.

@JordanTheITGuy
Created July 29, 2020 13:46
Show Gist options
  • Save JordanTheITGuy/47c05b2bc78bed21ebc78765b54c903f to your computer and use it in GitHub Desktop.
Save JordanTheITGuy/47c05b2bc78bed21ebc78765b54c903f to your computer and use it in GitHub Desktop.
SpongeBob Random silliness
function Invoke-Spongebob {
[cmdletbinding()]
param(
[Parameter(HelpMessage = "provide string" , Mandatory = $true)]
[string]$Message
)
$charArray = $Message.ToCharArray()
foreach ($char in $charArray) {
$Var = $(Get-Random) % 2
if ($var -eq 0) {
$string = $char.ToString()
$Upper = $string.ToUpper()
$output = $output + $Upper
}
else {
$lower = $char.ToString()
$output = $output + $lower
}
}
$output
$output = $null
}
Invoke-Spongebob -message "What do you mean invoke sarcasm?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment