Join our Newsletter — 33% off our NHI Course
Home› Glossary› Architecture & Implementation› FunctionsToExport
Architecture & Implementation

FunctionsToExport

← Back to Glossary
By NHI Mgmt Group Updated November 9, 2026 Domain: Architecture & Implementation

FunctionsToExport is a PowerShell module manifest setting that lists the functions a module makes available to importers. PowerShell uses it to expose only named functions by default, which limits the module’s public surface and keeps helper functions internal.

What FunctionsToExport Controls

FunctionsToExport is a PowerShell module manifest field that defines which functions become part of a module’s exported interface. By making the public surface explicit, it helps module authors separate supported entry points from helper code, reduce accidental exposure, and keep module behaviour predictable for importers.

Why Export Lists Matter in PowerShell Modules

An export list is one of the simplest ways to shape module boundaries. If every function is exported, consumers can call internal helpers that were never intended as stable APIs. When only named functions are exported, the module becomes easier to understand, safer to refactor, and less likely to leak implementation details into automation that depends on it.

This matters most when a module is shared across teams or used in production automation. A narrow public surface lowers the chance that downstream scripts depend on undocumented internals, which is a common source of brittle upgrades and hidden breakage.

Public Interface, Encapsulation, and Compatibility

FunctionsToExport supports encapsulation in the same way that an API contract does. The manifest tells PowerShell which functions are intended for import, while helper functions can remain private within the module. That separation gives authors room to reorganise internal logic without automatically changing what importers can see.

In practice, the setting is also a compatibility tool. If a module exposes too much, later cleanup becomes difficult because consumers may already rely on those extra commands. A deliberately small export list makes versioning easier to manage and helps preserve a stable experience for callers.

Security and Exposure Implications

Although FunctionsToExport is not a security control by itself, it can reduce exposure by limiting what an imported module presents to users and scripts. A smaller exported surface reduces the chance that privileged or sensitive helper routines are discovered and misused through ordinary module discovery.

It also supports a least-exposure mindset for automation code. The more commands a module exports, the more opportunities there are for confused usage, accidental invocation, or dependency on functions that were never meant to be externally callable.

How It Is Used in Module Design

Authors typically use FunctionsToExport to declare an intentional public API for the module rather than relying on broad wildcard export behaviour. In well-structured modules, exported functions are the ones documented for consumers, while non-exported helpers handle parsing, validation, logging, or internal workflow steps.

For maintainability, that means the manifest should be treated as part of the design, not just packaging metadata. The export list should reflect the module’s supported operations and stay aligned with what the author is willing to maintain as a contract over time.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5AC-6 — Least PrivilegeExporting only named functions limits what module consumers can invoke.
Recommendation — Restrict module exports to the smallest set of functions needed by consumers.
ISO/IEC 27001:2022A.8.9 — Configuration managementModule manifests define controlled software configuration and published interfaces.
Recommendation — Treat the manifest export list as controlled configuration and review changes before release.
CIS Controls v8CIS-16 — Application Software SecurityModule export surfaces are part of secure application and script release practices.
Recommendation — Limit exported commands to documented entry points and remove unnecessary public functions.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 9, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org