Skip to content

Commit 9f4c082

Browse files
Merge pull request #211 from StartAutomating/EZ-Fixes
EZOut 2.0.5
2 parents 258b434 + 15bca20 commit 9f4c082

File tree

7 files changed

+33
-34
lines changed

7 files changed

+33
-34
lines changed

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

EZOut.format.ps1xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Generated with EZOut 2.0.4: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
1+
<!-- Generated with EZOut 2.0.5: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
22
<Configuration>
33
<ViewDefinitions>
44
<View>

EZOut.psd1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@{
22
ModuleToProcess = 'EZOut.psm1'
3-
ModuleVersion = '2.0.4'
3+
ModuleVersion = '2.0.5'
44
GUID = 'cef786f0-8a0b-4a5d-a2c6-b433095354cd'
55
Author = 'James Brundage'
66
CompanyName = 'Start-Automating'
@@ -69,12 +69,10 @@
6969

7070
Tags = '.ps1xml', 'Format','Output','Types', 'Colorized'
7171
ReleaseNotes = @'
72-
## EZOut 2.0.4:
72+
## EZOut 2.0.5:
7373
74-
* Write-FormatViewExpression/Write-FormatCustomView now support -Frame, -LeftIndent, -RightIndent, -FirstLineHanging, -FirstLineIndent ( Fixes #164 )
75-
* Push-FormatData/Push-TypeData now create unique files per-process (Fixes #205 )
76-
77-
Thanks @NinMonkey !
74+
* Improving Strict mode Tolerance (#210)
75+
* Removing Mount error on multiple imports (#209)
7876
7977
---
8078

EZOut.psm1

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,19 @@ $executionContext.SessionState.PSVariable.Set(
5454
)
5555

5656
Export-ModuleMember -Function * -Alias * -Variable $myModule.Name
57-
$newPSDrive = $ExecutionContext.SessionState.InvokeCommand.GetCommand('New-PSDrive', 'Cmdlet')
58-
if ($newPSDrive) {
59-
try {
60-
$newDriveSplat = @{Name = $myModule.Name;Scope = 'Global';PSProvider='FileSystem'}
61-
$newDriveSplat.Root = $myModule | Split-Path
62-
& $newPSDrive @newDriveSplat
63-
} catch {
64-
Write-Verbose "$_"
65-
}
57+
58+
try {
59+
$newDriveSplat = @{Name = $myModule.Name;Scope = 'Global';PSProvider='FileSystem';ErrorAction='Ignore'}
60+
$newDriveSplat.Root = $myModule | Split-Path
61+
New-PSDrive @newDriveSplat
62+
} catch {
63+
Write-Verbose "$_"
6664
}
6765

6866
$myModule.OnRemove = {
6967
$myModule = Get-Module EZOut
7068
$debuggingTypeNames = $myModule.DebuggingTypeNames
71-
if ($debuggingTypeNames) {
72-
69+
if ($debuggingTypeNames) {
7370
foreach ($typeName in $debuggingTypeNames | Select-Object -Unique) {
7471
try {
7572
Remove-TypeData -TypeName $typeName -Confirm:$false -ErrorAction Ignore
@@ -79,13 +76,5 @@ $myModule.OnRemove = {
7976
}
8077
}
8178
Clear-FormatData
82-
Clear-TypeData
83-
$removePSDrive = $ExecutionContext.SessionState.InvokeCommand.GetCommand('Remove-PSDrive', 'Cmdlet')
84-
if ($removePSDrive) {
85-
try {
86-
& $removePSDrive -Name $myModule.Name -Confirm:$false
87-
} catch {
88-
Write-Debug "$_"
89-
}
90-
}
79+
Clear-TypeData
9180
}

EZOut.types.ps1xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Generated with EZOut 2.0.4: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
1+
<!-- Generated with EZOut 2.0.5: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
22
<Types>
33
<Type>
44
<Name>EZOut.Invisible</Name>

0 commit comments

Comments
 (0)