Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

where-object doesn't match correct value

$
0
0

PS E:\> Get-EC2Image ami-123456 | ?{$_ | where-object {$($_.Tag.Value) -match "val1"}} | select-object @{Name='TagValue
s'; Expression={$_.Tag.Value} }

TagValues
---------
{436, Val1, TTT}

 

The output suppose to return 'Val1' only. Why it returns all the values?

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles