Skip to content

Commit

Permalink
Merge pull request #57 from StartAutomating/EZOutUpdates
Browse files Browse the repository at this point in the history
Ez out updates
  • Loading branch information
StartAutomating authored Jul 26, 2022
2 parents ae4744e + 293cf98 commit ba0a9dc
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 105 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.8.8:
* Write-EZFormatFile generates scripts that output files. Fixes #56 and #43.
---

## 1.8.7:
* Out-FormatData: Now supports -Debug (#46)
* Format-YAML: Fixing Indentation (#49)
Expand Down
57 changes: 32 additions & 25 deletions EZOut.ezformat.ps1
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
#requires -Module EZOut
#requires -Module EZOut
# Install-Module EZOut or https://github.com/StartAutomating/EZOut
$myFile = $MyInvocation.MyCommand.ScriptBlock.File
$myModuleName = $($myFile | Split-Path -Leaf) -replace '\.ezformat\.ps1', ''
$myModuleName = 'EZOut'
$myRoot = $myFile | Split-Path
Push-Location $myRoot
$formatting = @(
# Write-FormatView
<# Write-FormatTreeView -TypeName System.IO.FileInfo, System.IO.DirectoryInfo -Branch ([char]9500 + [char]9472 + [char]9472) -Property Name -HasChildren {
if (-not $_.EnumerateFiles) { return $false }
foreach ($f in $_.EnumerateFiles()) {$f;break}
},
{
if (-not $_.EnumerateDirectories) { return $false }
foreach ($f in $_.EnumerateDirectories()) {$f;break}
} -Children {
$_.EnumerateFiles()
}, {
foreach ($d in $_.EnumerateDirectories()) {
if ($d.Attributes -band 'Hidden') { continue }
$d
}
}
#>
Join-Path $myRoot Formatting | Import-FormatView -FilePath { $_ }
# Add your own Write-FormatView here,
# or put them in a Formatting or Views directory
foreach ($potentialDirectory in 'Formatting','Views') {
Join-Path $myRoot $potentialDirectory |
Get-ChildItem -ea ignore |
Import-FormatView -FilePath {$_.Fullname}
}
)
$myFormatFile = Join-Path $myRoot "$myModuleName.format.ps1xml"
$formatting | Out-FormatData -ModuleName EZOut | Set-Content -Path $myFormatFile -Encoding UTF8

$destinationRoot = $myRoot

if ($formatting) {
$myFormatFile = Join-Path $destinationRoot "$myModuleName.format.ps1xml"
$formatting | Out-FormatData -Module $MyModuleName | Set-Content $myFormatFile -Encoding UTF8
Get-Item $myFormatFile
}

$types = @(
# Write-TypeView
# Add your own Write-TypeView statements here
# or declare them in the 'Types' directory
Join-Path $myRoot Types |
Get-Item -ea ignore |
Import-TypeView

)
$myTypesFile = Join-Path $myRoot "$myModuleName.types.ps1xml"
$types | Out-TypeData | Set-Content $myTypesFile -Encoding UTF8

if ($types) {
$myTypesFile = Join-Path $destinationRoot "$myModuleName.types.ps1xml"
$types | Out-TypeData | Set-Content $myTypesFile -Encoding UTF8
Get-Item $myTypesFile
}
Pop-Location
2 changes: 1 addition & 1 deletion EZOut.format.ps1xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-16"?>
<!-- Generated with EZOut 1.8.6: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<!-- Generated with EZOut 1.8.8: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Configuration>
<SelectionSets>
<SelectionSet>
Expand Down
6 changes: 5 additions & 1 deletion EZOut.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
ModuleToProcess = 'EZOut.psm1'
ModuleVersion = '1.8.7'
ModuleVersion = '1.8.8'
GUID = 'cef786f0-8a0b-4a5d-a2c6-b433095354cd'
Author = 'James Brundage'
CompanyName = 'Start-Automating'
Expand Down Expand Up @@ -42,6 +42,10 @@

Tags = '.ps1xml', 'Format','Output','Types', 'Colorized'
ReleaseNotes = @'
## 1.8.8:
* Write-EZFormatFile generates scripts that output files. Fixes #56 and #43.
---
## 1.8.7:
* Out-FormatData: Now supports -Debug (#46)
* Format-YAML: Fixing Indentation (#49)
Expand Down
40 changes: 1 addition & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,10 @@

EzOut [1.8.6]
=============
Easily Author Rich Format Files to Customize PowerShell Output
--------------------------------------------------------------
### Commands
|Verb |Noun |
|---------|--------------------|
|Add |FormatData |
|Add |TypeData |
|Clear |FormatData |
|Clear |TypeData |
|ConvertTo|PropertySet |
|Find |FormatView |
|Format |Heatmap |
|Format |Markdown |
|Format |Object |
|Format |RichText |
|Format |YAML |
|Get |EZOutExtension |
|Get |FormatFile |
|Get |PropertySet |
|Import |FormatView |
|Import |TypeView |
|Out |FormatData |
|Out |TypeData |
|Remove |FormatData |
|Remove |TypeData |
|Write |EZFormatFile |
|Write |FormatControl |
|Write |FormatCustomView |
|Write |FormatListView |
|Write |FormatTableView |
|Write |FormatTreeView |
|Write |FormatView |
|Write |FormatViewExpression|
|Write |FormatWideView |
|Write |PropertySet |
|Write |TypeView |
### Installing EZOut

You can install EZOut from the PowerShell Gallery. Simply:
~~~PowerShell
Install-Module EZOut -AllowClobber -Scope CurrentUser
~~~

### Understanding PowerShell Formatting

Unlike many languages, PowerShell has a formatting engine built into the box.
Expand Down
2 changes: 2 additions & 0 deletions Write-EZFormatFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ $destinationRoot = $_MyDestination
if ($formatting) {
$myFormatFile = Join-Path $destinationRoot "$myModuleName.format.ps1xml"
$formatting | Out-FormatData -Module $MyModuleName | Set-Content $myFormatFile -Encoding UTF8
Get-Item $myFormatFile
}
$types = @(
Expand All @@ -73,6 +74,7 @@ $types = @(
if ($types) {
$myTypesFile = Join-Path $destinationRoot "$myModuleName.types.ps1xml"
$types | Out-TypeData | Set-Content $myTypesFile -Encoding UTF8
Get-Item $myTypesFile
}
Pop-Location
'@
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.8.8:
* Write-EZFormatFile generates scripts that output files. Fixes #56 and #43.
---

## 1.8.7:
* Out-FormatData: Now supports -Debug (#46)
* Format-YAML: Fixing Indentation (#49)
Expand Down
40 changes: 1 addition & 39 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,10 @@

EzOut [1.8.6]
=============
Easily Author Rich Format Files to Customize PowerShell Output
--------------------------------------------------------------
### Commands
|Verb |Noun |
|---------|--------------------|
|Add |FormatData |
|Add |TypeData |
|Clear |FormatData |
|Clear |TypeData |
|ConvertTo|PropertySet |
|Find |FormatView |
|Format |Heatmap |
|Format |Markdown |
|Format |Object |
|Format |RichText |
|Format |YAML |
|Get |EZOutExtension |
|Get |FormatFile |
|Get |PropertySet |
|Import |FormatView |
|Import |TypeView |
|Out |FormatData |
|Out |TypeData |
|Remove |FormatData |
|Remove |TypeData |
|Write |EZFormatFile |
|Write |FormatControl |
|Write |FormatCustomView |
|Write |FormatListView |
|Write |FormatTableView |
|Write |FormatTreeView |
|Write |FormatView |
|Write |FormatViewExpression|
|Write |FormatWideView |
|Write |PropertySet |
|Write |TypeView |
### Installing EZOut

You can install EZOut from the PowerShell Gallery. Simply:
~~~PowerShell
Install-Module EZOut -AllowClobber -Scope CurrentUser
~~~

### Understanding PowerShell Formatting

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

0 comments on commit ba0a9dc

Please sign in to comment.