File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 158158 elseif ($styleProp -match ' \.' ) {
159159 $targetObject = $psStyle
160160 foreach ($dotProperty in $styleProp -split ' (?<!\.)\.' ) {
161- if ($targetObject.Item -is [Management.Automation.PSMethodInfo ] -or
162- $targetObject -is [Collections.IDictionary ]) {
161+ if (
162+ ($targetObject.psobject.Members [' Item' ] -and
163+ ($targetObject.Item -is [Management.Automation.PSMethodInfo ])
164+ ) -or
165+ $targetObject -is [Collections.IDictionary ]
166+ ) {
163167 $targetObject = $targetObject [$dotProperty ]
164168 } else {
165169 $targetObject = $targetObject .$dotProperty
Original file line number Diff line number Diff line change @@ -218,8 +218,12 @@ function Write-FormatTableView
218218 elseif ($styleProp -match ' \.' ) {
219219 $targetObject = $psStyle
220220 foreach ($dotProperty in $styleProp -split ' (?<!\.)\.' ) {
221- if ($targetObject.Item -is [Management.Automation.PSMethodInfo ] -or
222- $targetObject -is [Collections.IDictionary ]) {
221+ if (
222+ ($targetObject.psobject.Members [' Item' ] -and
223+ ($targetObject.Item -is [Management.Automation.PSMethodInfo ])
224+ ) -or
225+ $targetObject -is [Collections.IDictionary ]
226+ ) {
223227 $targetObject = $targetObject [$dotProperty ]
224228 } else {
225229 $targetObject = $targetObject .$dotProperty
Original file line number Diff line number Diff line change 215215 elseif ($styleProp -match ' \.' ) {
216216 $targetObject = $psStyle
217217 foreach ($dotProperty in $styleProp -split ' (?<!\.)\.' ) {
218- if ($targetObject.Item -is [Management.Automation.PSMethodInfo ] -or
219- $targetObject -is [Collections.IDictionary ]) {
218+ if (
219+ ($targetObject.psobject.Members [' Item' ] -and
220+ ($targetObject.Item -is [Management.Automation.PSMethodInfo ])
221+ ) -or
222+ $targetObject -is [Collections.IDictionary ]
223+ ) {
220224 $targetObject = $targetObject [$dotProperty ]
221225 } else {
222226 $targetObject = $targetObject .$dotProperty
You can’t perform that action at this time.
0 commit comments