Skip to content

Instantly share code, notes, and snippets.

@ulikabbq
Created June 7, 2019 21:14
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 ulikabbq/5c738cdbc05bb5a4d0d1640abec4d3ad to your computer and use it in GitHub Desktop.
Save ulikabbq/5c738cdbc05bb5a4d0d1640abec4d3ad to your computer and use it in GitHub Desktop.
$target = "Spooler", "Spork Client", "WinRM", "Spork Agent Service", "BITS","WSearch"
$list = "winrm", "foo", "spooler", "spor*", "bar"
$array = @()
foreach($item in $list){
foreach($word in $target){
if($word -like $item) {
$array += $item
}
}
}
((Compare-Object $list $array) | select $_.InputObject | where {$_.SideIndicator -eq '<='}).InputObject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment