Skip to content

Commit 4b42bf6

Browse files
feat: Write-EZFormatFile uses Import-TypeView -Command ( Fixes #238, re #236 )
1 parent 873d8f2 commit 4b42bf6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Commands/Write-EZFormatFile.ps1

+9-1
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,18 @@ if ($formatting) {
7777
$types = @(
7878
# Add your own Write-TypeView statements here
7979
# or declare them in the 'Types' directory
80+
$ImportTypeViewOptions = [Ordered]@{}
81+
82+
$myModuleIsLoaded = Get-Module $myModuleName
83+
84+
if ($myModuleIsLoaded) {
85+
$ImportTypeViewOptions.Commands = @($myModuleIsLoaded.ExportedFunctions.Values)
86+
}
87+
88+
# The following code will import all TypeView files in the Types directory (the default)
8089
Join-Path $myRoot Types |
8190
Get-Item -ea ignore |
8291
Import-TypeView
83-
8492
)
8593
8694
if ($types) {

0 commit comments

Comments
 (0)