Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function Search-Stuff
{
param([string]$String)
$Data = 'lol', 'lol123', '123lol', '123lol123'
$Filter = if([WildcardPattern]::ContainsWildcardCharacters($string)){
{ $_ -like $string }
} else {
{ $_ -eq $string }
}
return $Data |Where-Object $Filter
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.