Loading custom functions in PowerShell

后端 未结 2 1184
陌清茗
陌清茗 2020-12-24 00:55

I\'ve got some additional functions that I\'ve defined in an additional PowerShell script file, that I\'m trying to load in a main .ps1 file. However, when I call the .ps1 f

2条回答
  •  忘掉有多难
    2020-12-24 01:32

    You have to dot source them:

    . .\build_funtions.ps1
    . .\build_builddefs.ps1
    

    Note the extra .

    This heyscriptingguy article should be of help - How to Reuse Windows PowerShell Functions in Scripts

提交回复
热议问题