Forum Discussion
marika-9-5
Nov 03, 2024Copper Contributor
How do I permanently store module?
Hi everyone, I'm new to powershell, I would like to know how to automatically load the modules I load with import-module in each instance; if I load the modules with import-module, when I close the i...
- Nov 03, 2024
You don't need to load all modules to use cmdlets from it; when you first call a cmdlet, it will (in most cases) import the module for you at that moment. If not, you can run notepad $profile to open your Powershell profile and add a line import-module xyz to import it automatically in your future sessions.
Nov 03, 2024
You don't need to load all modules to use cmdlets from it; when you first call a cmdlet, it will (in most cases) import the module for you at that moment. If not, you can run notepad $profile to open your Powershell profile and add a line import-module xyz to import it automatically in your future sessions.
marika-9-5
Nov 03, 2024Copper Contributor
thank you for your reply; yes it is actually useful and convenient to do so because you create your own script profiles and run them at the right time by loading modules in memory.
However I always wonder if it is possible to do what I said, keeping in mind that I certainly prefer your solution to what I asked.
However, out of curiosity I would like to know how to keep a fixed module at each system loading by inserting it in the variable $Env:PSModulePath.
Then if there is no way to do it I will not insist
I repeat at this point it is just a question of knowing whether it can be done or not, because I have already created the script in the profile.
However I always wonder if it is possible to do what I said, keeping in mind that I certainly prefer your solution to what I asked.
However, out of curiosity I would like to know how to keep a fixed module at each system loading by inserting it in the variable $Env:PSModulePath.
Then if there is no way to do it I will not insist
I repeat at this point it is just a question of knowing whether it can be done or not, because I have already created the script in the profile.
- Nov 03, 2024Install modules for AllUsers instead of CurrentUser (Install-Module xyz -Scope AllUsers)
- marika-9-5Nov 03, 2024Copper ContributorThanks