Skip to content

Instantly share code, notes, and snippets.

@IISResetMe
Created April 11, 2019 13:56
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 IISResetMe/af5939f9af39965452b36b9f34b28d34 to your computer and use it in GitHub Desktop.
Save IISResetMe/af5939f9af39965452b36b9f34b28d34 to your computer and use it in GitHub Desktop.
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