Skip to content

Commit

Permalink
fix: Generating .commands.types.ps1xml by default ( Fixes #238, re #236
Browse files Browse the repository at this point in the history
… )
  • Loading branch information
StartAutomating committed Jul 7, 2024
1 parent d3e200a commit 81667fb
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Commands/Write-EZFormatFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ if ($formatting) {
$types = @(
# Add your own Write-TypeView statements here
# or declare them in the 'Types' directory
$ImportTypeViewOptions = [Ordered]@{}
$myModuleIsLoaded = Get-Module $myModuleName
if ($myModuleIsLoaded) {
$ImportTypeViewOptions.Commands = @($myModuleIsLoaded.ExportedFunctions.Values)
}
# The following code will import all TypeView files in the Types directory (the default)
Join-Path $myRoot Types |
Get-Item -ea ignore |
Import-TypeView
Expand All @@ -96,6 +87,12 @@ if ($types) {
# You can also output to multiple paths by passing a hashtable to -OutputPath.
$types | Out-TypeData -OutputPath $myTypesFilePath
}
$MyModuleIsLoaded = Get-Module $MyModuleName
if ($MyModuleIsLoaded) {
$myCommandTypesFilePath = Join-Path $destinationRoot "$myModuleName.commands.types.ps1xml"
Import-TypeView -Commands @($MyModuleIsLoaded.ExportedFunctions.Values) | Out-TypeData
}
Pop-Location
'@
}
Expand Down

0 comments on commit 81667fb

Please sign in to comment.