echo $env:PSModulePath
).Create a folder by the name of the module you want to create e.g. Utilities. Within that folder, create a .psm1 file by the same name as that folder e.g. Utilities.psm1. Any function you create in the .psm1 file will be imported when you import the module.
Additional information:
- gmo -ListAvailable should list your new module, along with others installed in your system.
- ipmo Utilities will load your module (if it is called Utilities).
- rmo Utilities will unload your module (if it is called Utilities).
- gcm -Module Utilities will list all the functions exported by your module once it is loaded (if it is called Utilities).
- Export-ModuleMember allows you to choose which functions you export from your module.
0 comments:
Post a Comment