Import-Module

noun

say it: “IM-port MOD-yool” /ˈɪmpɔrt ˈmɑdʒul/

A PowerShell command that loads a module, so its commands can be used in the current window.

What does Import-Module do?

Import-Module loads a module, so its commands work in your window. Point it at a module's folder while you're building it, and add -Force to load your latest changes. A module in a folder PowerShell knows about loads by itself when you use one of its commands.

Import-Module .\PlaylistTools -Force
Get-Command -Module PlaylistTools   # Get-Song, Measure-Playlist

In a sentence

  • “Import-Module loaded Get-Song and Measure-Playlist from the PlaylistTools folder.”
  • “Sam ran Import-Module with -Force after changing the .psm1.”

Level: Journeyman · More PowerShell terms at this level

Updated