How to get a list of custom Powershell functions?

后端 未结 3 2014
野性不改
野性不改 2021-02-12 09:46

I use custom powershell functions to make my life easier.

Example:

# custom function
> function build {cmd /c build.ps1}

# invoke the function
>          


        
相关标签:
3条回答
  • 2021-02-12 10:28

    To get a list of available functions

    > Get-ChildItem function:\
    

    To remove a powershell function

    # removes `someFunction`
    > Remove-Item function:\someFunction
    
    0 讨论(0)
  • 2021-02-12 10:34

    Add this to your profile:

    $sysfunctions = gci function:
    function myfunctions {gci function: | where {$sysfunctions -notcontains $_} }
    

    and myfunctions will list just the functions that were created since the session started.

    0 讨论(0)
  • 2021-02-12 10:54

    One solution for you is to put all your functions in a psm1 file and create a module. That way you can import the module and have all the commands in a nice module.

    0 讨论(0)
提交回复
热议问题