Created
February 13, 2018 09:48
-
-
Save jeevan-vj/cb4799c0eac7d98bdc48058d2f089ff1 to your computer and use it in GitHub Desktop.
array element exists in another array checking in powershell
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
$requiredFruit= @("apple","pear","nectarine","grape") | |
$someFruit= @("apple","banana","pear","nectarine","orange","grape") | |
$moreFruit= @("apple","banana","nectarine","grape") | |
-not @($requiredFruit| where {$someFruit -notcontains $_}).Count | |
-not @($requiredFruit| where {$moreFruit -notcontains $_}).Count | |
-not @($requiredFruit| where {$moreFruit -notcontains $_}| select -first 1).Count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment