I already know how to make a function in powershell. The problem is: How do I save that function so I can use it in the future?
When I write myFunction{3+3} in Powershell I can use that function in that session.
Altough, if I quit powershell and open it again, that function is gone. How do I "save" the function so I can use it even after I restart Powershell?
There are several ways:
You can compose it to a module and load it with import-module functions.psm1 into a script or via use the ps profile.
You can also dot sourc any saved functions into another ps1 ( . .\functions.ps1).
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