Created
July 3, 2018 17:08
-
-
Save vexx32/7dd113abceab7a2351300f829ad478c5 to your computer and use it in GitHub Desktop.
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 Select-Things { | |
[CmdletBinding()] | |
param( | |
[Parameter(Position = 0, Mandatory)] | |
[string[]] | |
$Param1 | |
) | |
if ($Param1 -contains "one") { | |
switch ($Param1) { | |
"two" { | |
$Param1 -match "two" | |
} | |
"three" { | |
$Param1 -replace "three", "infinity" | |
} | |
default { | |
$Param1 | Where-Object {$_ -like '*ab*'} | |
throw "a ball" | |
} | |
} | |
} | |
else { | |
$PSCmdlet.ThrowTerminatingError("Requisite string not found.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment