Second run of same Select-Object propName -Expand collectionPropName generates error - by Keith Hill MVP

Status : 

 


9
0
Sign in
to vote
ID 794785 Comments
Status Active Workarounds
Type Bug Repros 7
Opened 7/23/2013 8:37:19 AM
Access Restriction Public

Description

Apparently when you use this form of Select-Object:

Get-Command -Type Cmdlet Get-Process | Select Verb,Noun -ExpandProperty ParameterSets -ea Stop

It modifies the psobject wrapper and that gets re-used/cached such that when you run the command a second time it errors because the property Verb already exists on the target object.
Sign in to post a comment.