I find many Chocolatey
helper functions:
C:\ProgramData\chocolatey\helpers\functions
and extension functions
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?
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 ...
$Profile |
Select-Object -Property *
you can find the choco files here ...
Get-ChildItem -Path env:\choc*
for me, the loader is here ...
C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyInstall\helpers\chocolateyProfile.psm1
the code in my profile that loads it is ...
Import-Module $ChocolateyProfile
There is a Chocolatey Package that seeks to help with this sort of thing as well. You can find it here:
https://chocolatey.org/packages/chocolateypowershell
Once installed, you can simply double click the icon that is placed on your desktop, and you will have a PowerShell Session that already has the Chocolatey pieces loaded into the session.
This approach can be useful if you only want those pieces loaded at certain times, and not always.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With