Created
June 7, 2019 21:14
-
-
Save ulikabbq/5c738cdbc05bb5a4d0d1640abec4d3ad 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
$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