-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from StartAutomating/EZOutUpdates
Ez out updates
- Loading branch information
Showing
8 changed files
with
50 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters