liveBook · Manning

Public function

As explained in Practical Automation with PowerShell: Effective scripting from the console to the cloud

A public function is a module function intended to be available for direct use by module users.

A public function is a module function intended for direct use by module users. Place its .ps1 file in the module's Public folder to signal that it belongs to the usable module interface. section 2.2.3

Design public functions for discoverability and maintainability:

  • Use approved Verb-Noun names, singular nouns, Pascal casing for module and parameter names, and descriptive variable names. section 2.2.3
  • Separate public functions from private helper functions; helpers support module behavior but should not require direct user calls. section 2.2.3

How Practical Automation with PowerShell: Effective scripting from the console to the cloud covers it

How deep it goes
Explains folder organization, naming, public-private separation, and export selection without detailing function implementation.
Examples
Uses a Public folder and exports Remove-ArchivedFiles and Set-ArchiveFilePath as concrete module commands.
What you can do after
Apply it by organizing module functions and exporting the commands users should call directly.
How it connects
Connects public functions with modules, private functions, helper functions, module manifests, and PSModulePath.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Practical Automation with PowerShell: Effective scripting from the console to the cloud. The section links point to the parts of the book it draws on.