Skip to content

Instantly share code, notes, and snippets.

@smaglio81
Created August 8, 2020 21:34
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 smaglio81/557ab0dc1f39966a36de26b18617ae9a to your computer and use it in GitHub Desktop.
Save smaglio81/557ab0dc1f39966a36de26b18617ae9a to your computer and use it in GitHub Desktop.
function Get-RandomConjunction {
[CmdletBinding()]
param()
$Chance = Get-RandomPercent
switch ($Chance) {
{ 1..45 -contains $_ } { 'and' } # 45% chance for 'and'
{ 46..75 -contains $_ } { 'or' } # 25% chance for 'or'
{ 76..85 -contains $_ } { ',' } # 10% chance for 'comma'
{ 86..95 -contains $_ } { ';' } # 10% chance for 'semi-colon'
{ 96..100 -contains $_ } { ':' } # 5% chance for 'colon'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment