Skip to content

Commit ca64404

Browse files
author
James Brundage
committed
feat: OpenGraph EZOut ( Fixes #5 )
1 parent c243561 commit ca64404

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Build/OpenGraph.ezout.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#requires -Module EZOut
2+
# Install-Module EZOut or https://github.com/StartAutomating/EZOut
3+
$myFile = $MyInvocation.MyCommand.ScriptBlock.File
4+
$myRoot = $myFile | Split-Path | Split-Path
5+
$myModuleName = $myFile | Split-Path | Split-Path | Split-Path -Leaf
6+
Push-Location $myRoot
7+
$formatting = @(
8+
# Add your own Write-FormatView here,
9+
# or put them in a Formatting or Views directory
10+
foreach ($potentialDirectory in 'Formatting','Views','Types') {
11+
Join-Path $myRoot $potentialDirectory |
12+
Get-ChildItem -ea ignore |
13+
Import-FormatView -FilePath {$_.Fullname}
14+
}
15+
)
16+
17+
$destinationRoot = $myRoot
18+
19+
if ($formatting) {
20+
$myFormatFilePath = Join-Path $destinationRoot "$myModuleName.format.ps1xml"
21+
# You can also output to multiple paths by passing a hashtable to -OutputPath.
22+
$formatting | Out-FormatData -Module $MyModuleName -OutputPath $myFormatFilePath
23+
}
24+
25+
$types = @(
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+
32+
)
33+
34+
if ($types) {
35+
$myTypesFilePath = Join-Path $destinationRoot "$myModuleName.types.ps1xml"
36+
# You can also output to multiple paths by passing a hashtable to -OutputPath.
37+
$types | Out-TypeData -OutputPath $myTypesFilePath
38+
}
39+
Pop-Location

0 commit comments

Comments
 (0)