Where-Object simplified Syntax doesn't support multiple expressions - by JasonHorner

Status : 

 


1
0
Sign in
to vote
ID 776728 Comments
Status Active Workarounds
Type Suggestion Repros 0
Opened 1/16/2013 11:03:11 AM
Access Restriction Public

Description

When using the simplified syntax introduced in V3:

Works:
Get-ChildItem | where { !$_.PSIsContainer -and $_.Attributes -notmatch "Archive" }

Does not work:
Get-ChildItem | where {PSIsContainer -and Attributes -notmatch "Archive"}

Even better:
Get-ChildItem | where PSIsContainer -and Attributes -notmatch "Archive"
Sign in to post a comment.