Skip to content

Commit 81667fb

Browse files
fix: Generating .commands.types.ps1xml by default ( Fixes #238, re #236 )
1 parent d3e200a commit 81667fb

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Commands/Write-EZFormatFile.ps1

+6-9
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ 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)
8980
Join-Path $myRoot Types |
9081
Get-Item -ea ignore |
9182
Import-TypeView
@@ -96,6 +87,12 @@ if ($types) {
9687
# You can also output to multiple paths by passing a hashtable to -OutputPath.
9788
$types | Out-TypeData -OutputPath $myTypesFilePath
9889
}
90+
91+
$MyModuleIsLoaded = Get-Module $MyModuleName
92+
if ($MyModuleIsLoaded) {
93+
$myCommandTypesFilePath = Join-Path $destinationRoot "$myModuleName.commands.types.ps1xml"
94+
Import-TypeView -Commands @($MyModuleIsLoaded.ExportedFunctions.Values) | Out-TypeData
95+
}
9996
Pop-Location
10097
'@
10198
}

0 commit comments

Comments
 (0)