Skip to content

Commit ba0a9dc

Browse files
Merge pull request #57 from StartAutomating/EZOutUpdates
Ez out updates
2 parents ae4744e + 293cf98 commit ba0a9dc

File tree

8 files changed

+50
-105
lines changed

8 files changed

+50
-105
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.8.8:
2+
* Write-EZFormatFile generates scripts that output files. Fixes #56 and #43.
3+
---
4+
15
## 1.8.7:
26
* Out-FormatData: Now supports -Debug (#46)
37
* Format-YAML: Fixing Indentation (#49)

EZOut.ezformat.ps1

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
1-
#requires -Module EZOut
1+
#requires -Module EZOut
22
# Install-Module EZOut or https://github.com/StartAutomating/EZOut
33
$myFile = $MyInvocation.MyCommand.ScriptBlock.File
4-
$myModuleName = $($myFile | Split-Path -Leaf) -replace '\.ezformat\.ps1', ''
4+
$myModuleName = 'EZOut'
55
$myRoot = $myFile | Split-Path
6+
Push-Location $myRoot
67
$formatting = @(
7-
# Write-FormatView
8-
<# Write-FormatTreeView -TypeName System.IO.FileInfo, System.IO.DirectoryInfo -Branch ([char]9500 + [char]9472 + [char]9472) -Property Name -HasChildren {
9-
if (-not $_.EnumerateFiles) { return $false }
10-
foreach ($f in $_.EnumerateFiles()) {$f;break}
11-
},
12-
{
13-
if (-not $_.EnumerateDirectories) { return $false }
14-
foreach ($f in $_.EnumerateDirectories()) {$f;break}
15-
} -Children {
16-
$_.EnumerateFiles()
17-
}, {
18-
foreach ($d in $_.EnumerateDirectories()) {
19-
if ($d.Attributes -band 'Hidden') { continue }
20-
$d
21-
}
22-
}
23-
#>
24-
Join-Path $myRoot Formatting | Import-FormatView -FilePath { $_ }
8+
# Add your own Write-FormatView here,
9+
# or put them in a Formatting or Views directory
10+
foreach ($potentialDirectory in 'Formatting','Views') {
11+
Join-Path $myRoot $potentialDirectory |
12+
Get-ChildItem -ea ignore |
13+
Import-FormatView -FilePath {$_.Fullname}
14+
}
2515
)
26-
$myFormatFile = Join-Path $myRoot "$myModuleName.format.ps1xml"
27-
$formatting | Out-FormatData -ModuleName EZOut | Set-Content -Path $myFormatFile -Encoding UTF8
16+
17+
$destinationRoot = $myRoot
18+
19+
if ($formatting) {
20+
$myFormatFile = Join-Path $destinationRoot "$myModuleName.format.ps1xml"
21+
$formatting | Out-FormatData -Module $MyModuleName | Set-Content $myFormatFile -Encoding UTF8
22+
Get-Item $myFormatFile
23+
}
24+
2825
$types = @(
29-
# Write-TypeView
26+
# Add your own Write-TypeView statements here
27+
# or declare them in the 'Types' directory
28+
Join-Path $myRoot Types |
29+
Get-Item -ea ignore |
30+
Import-TypeView
31+
3032
)
31-
$myTypesFile = Join-Path $myRoot "$myModuleName.types.ps1xml"
32-
$types | Out-TypeData | Set-Content $myTypesFile -Encoding UTF8
33+
34+
if ($types) {
35+
$myTypesFile = Join-Path $destinationRoot "$myModuleName.types.ps1xml"
36+
$types | Out-TypeData | Set-Content $myTypesFile -Encoding UTF8
37+
Get-Item $myTypesFile
38+
}
39+
Pop-Location

EZOut.format.ps1xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-16"?>
2-
<!-- Generated with EZOut 1.8.6: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
2+
<!-- Generated with EZOut 1.8.8: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
33
<Configuration>
44
<SelectionSets>
55
<SelectionSet>

EZOut.psd1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@{
22
ModuleToProcess = 'EZOut.psm1'
3-
ModuleVersion = '1.8.7'
3+
ModuleVersion = '1.8.8'
44
GUID = 'cef786f0-8a0b-4a5d-a2c6-b433095354cd'
55
Author = 'James Brundage'
66
CompanyName = 'Start-Automating'
@@ -42,6 +42,10 @@
4242

4343
Tags = '.ps1xml', 'Format','Output','Types', 'Colorized'
4444
ReleaseNotes = @'
45+
## 1.8.8:
46+
* Write-EZFormatFile generates scripts that output files. Fixes #56 and #43.
47+
---
48+
4549
## 1.8.7:
4650
* Out-FormatData: Now supports -Debug (#46)
4751
* Format-YAML: Fixing Indentation (#49)

README.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,10 @@
1-
2-
EzOut [1.8.6]
3-
=============
4-
Easily Author Rich Format Files to Customize PowerShell Output
5-
--------------------------------------------------------------
6-
### Commands
7-
|Verb |Noun |
8-
|---------|--------------------|
9-
|Add |FormatData |
10-
|Add |TypeData |
11-
|Clear |FormatData |
12-
|Clear |TypeData |
13-
|ConvertTo|PropertySet |
14-
|Find |FormatView |
15-
|Format |Heatmap |
16-
|Format |Markdown |
17-
|Format |Object |
18-
|Format |RichText |
19-
|Format |YAML |
20-
|Get |EZOutExtension |
21-
|Get |FormatFile |
22-
|Get |PropertySet |
23-
|Import |FormatView |
24-
|Import |TypeView |
25-
|Out |FormatData |
26-
|Out |TypeData |
27-
|Remove |FormatData |
28-
|Remove |TypeData |
29-
|Write |EZFormatFile |
30-
|Write |FormatControl |
31-
|Write |FormatCustomView |
32-
|Write |FormatListView |
33-
|Write |FormatTableView |
34-
|Write |FormatTreeView |
35-
|Write |FormatView |
36-
|Write |FormatViewExpression|
37-
|Write |FormatWideView |
38-
|Write |PropertySet |
39-
|Write |TypeView |
401
### Installing EZOut
412

423
You can install EZOut from the PowerShell Gallery. Simply:
434
~~~PowerShell
445
Install-Module EZOut -AllowClobber -Scope CurrentUser
456
~~~
7+
468
### Understanding PowerShell Formatting
479

4810
Unlike many languages, PowerShell has a formatting engine built into the box.

Write-EZFormatFile.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ $destinationRoot = $_MyDestination
5959
if ($formatting) {
6060
$myFormatFile = Join-Path $destinationRoot "$myModuleName.format.ps1xml"
6161
$formatting | Out-FormatData -Module $MyModuleName | Set-Content $myFormatFile -Encoding UTF8
62+
Get-Item $myFormatFile
6263
}
6364
6465
$types = @(
@@ -73,6 +74,7 @@ $types = @(
7374
if ($types) {
7475
$myTypesFile = Join-Path $destinationRoot "$myModuleName.types.ps1xml"
7576
$types | Out-TypeData | Set-Content $myTypesFile -Encoding UTF8
77+
Get-Item $myTypesFile
7678
}
7779
Pop-Location
7880
'@

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.8.8:
2+
* Write-EZFormatFile generates scripts that output files. Fixes #56 and #43.
3+
---
4+
15
## 1.8.7:
26
* Out-FormatData: Now supports -Debug (#46)
37
* Format-YAML: Fixing Indentation (#49)

docs/README.md

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,10 @@
1-
2-
EzOut [1.8.6]
3-
=============
4-
Easily Author Rich Format Files to Customize PowerShell Output
5-
--------------------------------------------------------------
6-
### Commands
7-
|Verb |Noun |
8-
|---------|--------------------|
9-
|Add |FormatData |
10-
|Add |TypeData |
11-
|Clear |FormatData |
12-
|Clear |TypeData |
13-
|ConvertTo|PropertySet |
14-
|Find |FormatView |
15-
|Format |Heatmap |
16-
|Format |Markdown |
17-
|Format |Object |
18-
|Format |RichText |
19-
|Format |YAML |
20-
|Get |EZOutExtension |
21-
|Get |FormatFile |
22-
|Get |PropertySet |
23-
|Import |FormatView |
24-
|Import |TypeView |
25-
|Out |FormatData |
26-
|Out |TypeData |
27-
|Remove |FormatData |
28-
|Remove |TypeData |
29-
|Write |EZFormatFile |
30-
|Write |FormatControl |
31-
|Write |FormatCustomView |
32-
|Write |FormatListView |
33-
|Write |FormatTableView |
34-
|Write |FormatTreeView |
35-
|Write |FormatView |
36-
|Write |FormatViewExpression|
37-
|Write |FormatWideView |
38-
|Write |PropertySet |
39-
|Write |TypeView |
401
### Installing EZOut
412

423
You can install EZOut from the PowerShell Gallery. Simply:
434
~~~PowerShell
445
Install-Module EZOut -AllowClobber -Scope CurrentUser
456
~~~
7+
468
### Understanding PowerShell Formatting
479

4810
Unlike many languages, PowerShell has a formatting engine built into the box.

0 commit comments

Comments
 (0)