Improved Export-FunctionSource + some Docker fixes
Export-FunctionSource to handle Filters and scripts + following Aliases. Edit-DockerCompose will allow editing of additional files next to the default docker-compose files. dcc, dcdown and dcup to work with ProjectPath parameter. Added ssh.conf to the config.files.json dictionary.
This commit is contained in:
parent
38dab59d62
commit
1bef8ca119
6 changed files with 51 additions and 11 deletions
|
@ -371,9 +371,23 @@ param(
|
|||
|
||||
$local:src = ""
|
||||
foreach ( $local:func in $FunctionName ) {
|
||||
$local:funcDef = $null
|
||||
foreach( $cmd in (Get-Command -All $func) ) {
|
||||
if( $cmd.CommandType -in @('Function','Filter') ) {
|
||||
$funcDef = $cmd.Definition
|
||||
break
|
||||
} elseif( -$funcDef -and ($cmd.CommandType -in @('Script','ExternalScript')) ) {
|
||||
$funcDef = Get-Content $cmd.Definition
|
||||
}
|
||||
}
|
||||
if( -not $funcDef ) {
|
||||
default { throw "Don't know how to handle $func" }
|
||||
}
|
||||
|
||||
if ( -not $NoHeader ) { $src += "`nfunction $func {" }
|
||||
$src += "`n"
|
||||
$src += $((Get-Command -Type Function $func).Definition)
|
||||
|
||||
$src += $funcDef
|
||||
if ( -not $NoHeader ) { $src += "`n}" }
|
||||
$src += "`n"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue