Module Autoloading

noun

say it: “MOD-yool AW-toh-loh-ding” /ˈmɑdʒul ˈɔtoʊˌloʊdɪŋ/

PowerShell loading a module by itself the first time one of its commands is used.

What is module autoloading?

Module autoloading means you rarely need Import-Module. When you type a command PowerShell doesn't know yet, it looks through the module folders on $env:PSModulePath, finds the module that has it, and loads that module for you.

Get-Module PlaylistTools     # nothing loaded yet
Get-Song -Path .\road-trip.csv   # works: PowerShell loaded PlaylistTools
Get-Module PlaylistTools     # now it's listed

In a sentence

  • “Thanks to module autoloading, Get-Song worked in a new window without Import-Module.”
  • “Module autoloading only finds modules in the module folders.”

Level: Journeyman · More PowerShell terms at this level

Updated