$_ should be accessible without curly brackets with Where-Object
Votes from Connect: 5
Original Date Submitted: 10/30/2014 6:04:29 AM
Description:
Contact Information
Handle: Peter M10
Site Name: PowerShell
Feedback ID: 1014939
Frequency: Always Happens
Regression: Yes, this happens in all previous versions
Problem Description:
I would like to access the pipeline object with Where-Object without curly brackets like so:
1..10 | Where-Object $_ % 2 -eq 1
to get only uneven numbers.
Product Studio item created by Connect Synchronizer due to creation of feedback ID 1014939 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1014939).
Repro Steps:
1..10 | Where-Object $_ % 2 -eq 1
Expected Results:
Gives an "Cannot validate argument on parameter 'Property'." error.
Internal BugId: 13075
