Question:
I find many Chocolatey
helper functions:
1 2 |
C:\ProgramData\chocolatey\helpers\functions |
and extension functions
1 2 |
C:\ProgramData\chocolatey\extensions\chocolatey-core |
are very useful when you develop even non Chocolatey
packages. Is there any way to import these function to Powershell
scripts and Powershell
Console sessions?
Answer:
when you install chocolatey, it puts a few lines of code in your powershell profile that load the various extensions & functions. [grin] you can find the various profiles here …
1 2 3 |
$Profile | Select-Object -Property * |
you can find the choco files here …
1 2 |
Get-ChildItem -Path env:\choc* |
for me, the loader is here …
1 2 |
C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyInstall\helpers\chocolateyProfile.psm1 |
the code in my profile that loads it is …
1 2 |
Import-Module $ChocolateyProfile |