Home Dashboard Directory Help
Search

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


Status: 

Active


9
0
Sign in
to vote
Type: Bug
ID: 794785
Opened: 7/23/2013 8:37:19 AM
Access Restriction: Public
0
Workaround(s)
view
7
User(s) can reproduce this bug

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.
Details
Sign in to post a comment.
Sign in to post a workaround.