Created
July 29, 2020 13:46
-
-
Save JordanTheITGuy/47c05b2bc78bed21ebc78765b54c903f to your computer and use it in GitHub Desktop.
SpongeBob Random silliness
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 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