Export-ModuleMember

noun

say it: “EKS-port MOD-yool MEM-ber” /ˈɛkspɔrt ˈmɑdʒul ˈmɛmbɚ/

The line in a PowerShell module that lists which of its functions are handed out, keeping the rest inside as helpers.

What does Export-ModuleMember do?

Export-ModuleMember decides which of a module's functions people can call. The ones it lists are handed out; the rest stay inside the module as helpers, out of the way.

# the last line of PlaylistTools.psm1:
Export-ModuleMember -Function Get-Song, Measure-Playlist
# ConvertTo-Second stays inside

In a sentence

  • “Export-ModuleMember handed out Get-Song and Measure-Playlist and kept ConvertTo-Second inside.”
  • “Sam listed only the public commands in Export-ModuleMember.”

Level: Journeyman · More PowerShell terms at this level

Updated