ConvertTo-MockMeme.psm1
function ConvertTo-MockMeme { <# .SYNOPSIS i WanT a sYNopSis .DESCRIPTION i WAnT A deScRiPTiOn .EXAMPLE i nEEd An eXAmpLE to USe THiS #> [cmdletbinding()] [alias( "MakeText-MoreFunny", "Mocking-SpongeBob", "SpongeBob-ChickenMeme" )] param( [parameter(Mandatory = $true, Position = 1)] [string]$Message, [parameter(HelpMessage = "Enter an integer greater than 0 to limit repeat case.")] [ValidateRange(1, [int64]::MaxValue)] [int64]$RepeatLimit = 2 ) [int]$upperCount = 0 [int]$lowerCount = 0 for ($i = 0; $i -lt $Message.Length; $i++) { $char = $Message[$i] if ($char -match "[a-z]") { $randomNum = Get-Random -Maximum 2 if (($randomNum -eq 0 -and $upperCount -lt $RepeatLimit) -or ($lowerCount -ge $RepeatLimit)) { $convertedString += "$char".ToUpper() $upperCount++ $lowerCount = 0 } else { $convertedString += "$char".ToLower() $lowerCount++ $upperCount = 0 } } else { $convertedString += $char } } Write-Host $convertedString -ForegroundColor Cyan -NoNewline $convertedString | Set-Clipboard Write-Host " copied to clipboard!" -ForegroundColor Green } |