Skip to content

Commit 4914979

Browse files
fix: EZOut StrictMode Tolerance ( Fixes #210 )
1 parent 83633b7 commit 4914979

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

Commands/Format.PS1XML/Write-FormatListView.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,12 @@
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

Commands/Format.PS1XML/Write-FormatTableView.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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

Commands/Format.PS1XML/Write-FormatViewExpression.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,12 @@
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

0 commit comments

Comments
 (0)