Summary
We started this chapter by reminding ourselves of what we learned in earlier chapters regarding modules and placing that into a more formal context. We looked at the standard module locations and how we can add locations by editing the $ENV:PSModulePath
variable. We saw how PowerShell uses these locations to facilitate autoloading, and we saw how sometimes, we might not want that to happen. Then, we looked at how we can manually import modules and finished up our review by looking at the PowerShellGet
module.
After, we started to write our own modules. We began by looking at the earliest method for importing code, known as dot-sourcing, and saw why that could be a bad idea. Then, we created our first module by writing a script and converting it. Next, we looked at how we can build applications by nesting modules, before discussing some other types of modules, such as binary modules.
Then, we looked at the most common complex module type – the manifest module. We...