Skip to content

Instantly share code, notes, and snippets.

@jeffgreenca
Created November 6, 2015 22:31
Show Gist options
  • Save jeffgreenca/532b38cb3107302d85b8 to your computer and use it in GitHub Desktop.
Save jeffgreenca/532b38cb3107302d85b8 to your computer and use it in GitHub Desktop.
function find-common-values($oArr) {
$i = 0
$commonValues = $oArr[0]
$oArr | % {
$i++
if($commonValues -eq $null) { return "Well shucks, after $i iterations" }
$commonValues = Compare-Object $commonValues $_ -IncludeEqual -PassThru -ExcludeDifferent
}
return $commonValues
}
Compare-Object (find-common-values $evcProblemVms) (vd $evcOKVms[0]) | ? {$_SideIndicator -eq "<="}
$values = @()
$evcProblemPenryn | % { $values += (vd $_) }
$values = ""
$values = $evcProblemPenryn | % { vd $_ }
$uniqueValues = $values | sort | get-unique
$commonValues = @()
foreach($v in $uniqueValues) {
if( ($values | ? {$_ -eq $v}).Count -eq 6 ) { $commonValues += $v }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment