Better....

Better Edit-DokcerCompose (suppress errors when permissions don't allow)
Better aliases (eds and edc)
Better Git commands.
This commit is contained in:
lksz 2021-09-10 01:20:12 -04:00
parent 86fdee1acc
commit 33b4c5166b
7 changed files with 59 additions and 7 deletions

View file

@ -0,0 +1,32 @@
[CmdletBinding()]param(
[string[]]$Path
# Path to script
)
BEGIN{}
PROCESS{
foreach( $local:scriptPath in $Path ) {
$rs = [runspacefactory]::CreateRunspace()
$rs.Open()
# Get the AST of the file
$tokens = $errors = $null
$ast = [System.Management.Automation.Language.Parser]::ParseFile(
$scriptPath,
[ref]$tokens,
[ref]$errors)
# Get only function definition ASTs
$functionDefinitions = $ast.FindAll({
param([System.Management.Automation.Language.Ast] $Ast)
$Ast -is [System.Management.Automation.Language.FunctionDefinitionAst] -and
# Class methods have a FunctionDefinitionAst under them as well, but we don't want them.
($PSVersionTable.PSVersion.Major -lt 5 -or
$Ast.Parent -isnot [System.Management.Automation.Language.FunctionMemberAst])
}, $true)
$functionDefinitions
}
}
END{}