Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.169
Language: C# Updated: 2026-10-13

API Reference

Command

Save-ManagedModule

Namespace PSPublishModule
Inputs
PowerForge.ManagedModuleVersionInfo[] System.String[]
Outputs
PowerForge.ManagedModuleInstallResult PowerForge.ManagedModuleInstallPlan

Saves modules from a managed repository to an explicit module root.

Remarks

This command provides the module-save functionality of Save-PSResource through the same managed C# repository and archive engine as Install-ManagedModule. It accepts names or typed Find-ManagedModule output, saves unpacked modules or .nupkg files, and defaults to the current filesystem location when Path is omitted.

Examples

Authored help example

Save the latest stable module from the default public gallery endpoint


Save-ManagedModule -Name Company.Tools -Path C:\Modules
        

Save an exact version from a local feed


Save-ManagedModule -Name Company.Tools -RequiredVersion 1.2.0 -Repository C:\Packages -Path C:\Modules
        

Save typed find output with PowerShellGet-compatible XML metadata


Find-ManagedModule -Name Company.Tools -Version 1.2.0 -ProfileName CompanyModules | Save-ManagedModule -Path C:\OfflineModules -IncludeXml
        

Save a package file in the current directory


Save-ManagedModule -Name Company.Tools -Version 1.2.0 -AsNupkg
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Save-ManagedModule [-AcceptLicense] [-AllowClobber] [-AllowedAuthor <String[]>] [-AsNupkg] [-AuthenticodeCheck] [-BundleMetadataPath <String>] [-Credential <PSCredential>] [-CredentialSecret <String>] [-CredentialSecretFilePath <String>] [-CredentialUserName <String>] [-DependencyConcurrency <Int32>] [-ExpectedPackageSha256 <String>] [-Force] [-IncludeXml] [-MaximumVersion <String>] [-MinimumVersion <String>] -Name <String[]> [-PackageCacheDirectory <String>] [-Path <String>] [-Plan] [-Prerelease] [-ProfileName <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Quiet] [-Repository <String>] [-RepositoryName <String>] [-RequireTrustedRepository] [-ShowSummary] [-SkipDependencyCheck] [-TrustPolicy <ManagedModuleTrustPolicy>] [-Version <String>] [-VersionPolicy <String>] [<CommonParameters>]
#
Parameter set: NameParameterSet

Parameters

AcceptLicense SwitchParameter optionalposition: namedpipeline: False
Accept package licenses when packages declare license acceptance is required.
AllowClobber SwitchParameter optionalposition: namedpipeline: False
Allow command exports to overlap with other modules in the destination root.
AllowedAuthor String[] optionalposition: namedpipeline: Falsealiases: RequiredAuthor, TrustedAuthor
Allowed package author values from package metadata.
AsNupkg SwitchParameter optionalposition: namedpipeline: False
Save the selected packages as .nupkg files instead of unpacked module folders.
AuthenticodeCheck SwitchParameter optionalposition: namedpipeline: False
Validate Authenticode signatures for signable package files before saving.
BundleMetadataPath String optionalposition: namedpipeline: Falsealiases: MetadataPath, OfflineBundleMetadataPath
Optional path for offline bundle metadata written after successful saves.
Credential PSCredential optionalposition: namedpipeline: False
Optional repository credential.
CredentialSecret String optionalposition: namedpipeline: Falsealiases: Password, Token
Optional repository credential secret.
CredentialSecretFilePath String optionalposition: namedpipeline: Falsealiases: CredentialPath, TokenPath
Optional path to a file containing the repository credential secret.
CredentialUserName String optionalposition: namedpipeline: Falsealiases: UserName
Optional repository credential username.
DependencyConcurrency Int32 optionalposition: namedpipeline: False
Maximum number of dependency branches to save concurrently. Omit to use the managed engine default.
ExpectedPackageSha256 String optionalposition: namedpipeline: Falsealiases: PackageSha256, Sha256
Expected SHA256 hash of the root package before it is extracted and saved.
Force SwitchParameter optionalposition: namedpipeline: False
Overwrite an existing saved version.
IncludeXml SwitchParameter optionalposition: namedpipeline: False
Write PowerShellGet-compatible PSGetModuleInfo.xml metadata beside each saved unpacked module.
MaximumVersion String optionalposition: namedpipeline: False
Maximum package version to save when Version is omitted.
MinimumVersion String optionalposition: namedpipeline: False
Minimum package version to save when Version is omitted.
Name String[] requiredposition: 0pipeline: True (ByPropertyName)aliases: ModuleName
Module names to save.
PackageCacheDirectory String optionalposition: namedpipeline: False
Optional package cache directory.
Path String optionalposition: 1pipeline: Falsealiases: DestinationPath, ModuleRoot
Destination module root. Defaults to the current filesystem location.
Plan SwitchParameter optionalposition: namedpipeline: False
Return an inspectable save plan without writing files.
Prerelease SwitchParameter optionalposition: namedpipeline: Falsealiases: AllowPrerelease
Include prerelease versions when resolving the latest version.
ProfileName String optionalposition: namedpipeline: False
Saved repository profile name.
Proxy Uri optionalposition: namedpipeline: False
Optional HTTP proxy used for repository requests.
ProxyCredential PSCredential optionalposition: namedpipeline: False
Optional proxy credential used with Proxy.
Quiet SwitchParameter optionalposition: namedpipeline: False
Suppress optional host summaries and progress-style output without changing pipeline result objects.
Repository String optionalposition: namedpipeline: Falsealiases: RepositoryUri, Source
Repository URL, NuGet v3 service index, flat-container URL, or local folder feed.
RepositoryName String optionalposition: namedpipeline: False
Friendly repository name used in output.
RequireTrustedRepository SwitchParameter optionalposition: namedpipeline: False
Require the selected repository profile to be marked trusted.
ShowSummary SwitchParameter optionalposition: namedpipeline: False
Write a compact Spectre.Console summary for each plan or result.
SkipDependencyCheck SwitchParameter optionalposition: namedpipeline: Falsealiases: SkipDependenciesCheck
Skip installing dependencies declared by the package.
TrustPolicy ManagedModuleTrustPolicy optionalposition: namedpipeline: False
Optional typed repository/package trust policy.
Version String optionalposition: namedpipeline: Falsealiases: RequiredVersion
Exact package version to save. When omitted, the latest repository version is used.
VersionPolicy String optionalposition: namedpipeline: False
NuGet-style version range policy used when Version is omitted.

Outputs

PowerForge.ManagedModuleInstallResult, PowerForge.ManagedModuleInstallPlan

Save-ManagedModule [-AcceptLicense] [-AllowClobber] [-AllowedAuthor <String[]>] [-AsNupkg] [-AuthenticodeCheck] [-BundleMetadataPath <String>] [-Credential <PSCredential>] [-CredentialSecret <String>] [-CredentialSecretFilePath <String>] [-CredentialUserName <String>] [-DependencyConcurrency <Int32>] [-ExpectedPackageSha256 <String>] [-Force] [-IncludeXml] -InputObject <ManagedModuleVersionInfo[]> [-PackageCacheDirectory <String>] [-Path <String>] [-Plan] [-ProfileName <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Quiet] [-Repository <String>] [-RepositoryName <String>] [-RequireTrustedRepository] [-ShowSummary] [-SkipDependencyCheck] [-TrustPolicy <ManagedModuleTrustPolicy>] [<CommonParameters>]
#
Parameter set: InputObjectParameterSet

Parameters

AcceptLicense SwitchParameter optionalposition: namedpipeline: False
Accept package licenses when packages declare license acceptance is required.
AllowClobber SwitchParameter optionalposition: namedpipeline: False
Allow command exports to overlap with other modules in the destination root.
AllowedAuthor String[] optionalposition: namedpipeline: Falsealiases: RequiredAuthor, TrustedAuthor
Allowed package author values from package metadata.
AsNupkg SwitchParameter optionalposition: namedpipeline: False
Save the selected packages as .nupkg files instead of unpacked module folders.
AuthenticodeCheck SwitchParameter optionalposition: namedpipeline: False
Validate Authenticode signatures for signable package files before saving.
BundleMetadataPath String optionalposition: namedpipeline: Falsealiases: MetadataPath, OfflineBundleMetadataPath
Optional path for offline bundle metadata written after successful saves.
Credential PSCredential optionalposition: namedpipeline: False
Optional repository credential.
CredentialSecret String optionalposition: namedpipeline: Falsealiases: Password, Token
Optional repository credential secret.
CredentialSecretFilePath String optionalposition: namedpipeline: Falsealiases: CredentialPath, TokenPath
Optional path to a file containing the repository credential secret.
CredentialUserName String optionalposition: namedpipeline: Falsealiases: UserName
Optional repository credential username.
DependencyConcurrency Int32 optionalposition: namedpipeline: False
Maximum number of dependency branches to save concurrently. Omit to use the managed engine default.
ExpectedPackageSha256 String optionalposition: namedpipeline: Falsealiases: PackageSha256, Sha256
Expected SHA256 hash of the root package before it is extracted and saved.
Force SwitchParameter optionalposition: namedpipeline: False
Overwrite an existing saved version.
IncludeXml SwitchParameter optionalposition: namedpipeline: False
Write PowerShellGet-compatible PSGetModuleInfo.xml metadata beside each saved unpacked module.
InputObject ManagedModuleVersionInfo[] requiredposition: 0pipeline: True (ByValue, ByPropertyName)aliases: ParentResource
Module versions returned by Find-ManagedModule to save.
PackageCacheDirectory String optionalposition: namedpipeline: False
Optional package cache directory.
Path String optionalposition: 1pipeline: Falsealiases: DestinationPath, ModuleRoot
Destination module root. Defaults to the current filesystem location.
Plan SwitchParameter optionalposition: namedpipeline: False
Return an inspectable save plan without writing files.
ProfileName String optionalposition: namedpipeline: False
Saved repository profile name.
Proxy Uri optionalposition: namedpipeline: False
Optional HTTP proxy used for repository requests.
ProxyCredential PSCredential optionalposition: namedpipeline: False
Optional proxy credential used with Proxy.
Quiet SwitchParameter optionalposition: namedpipeline: False
Suppress optional host summaries and progress-style output without changing pipeline result objects.
Repository String optionalposition: namedpipeline: Falsealiases: RepositoryUri, Source
Repository URL, NuGet v3 service index, flat-container URL, or local folder feed.
RepositoryName String optionalposition: namedpipeline: False
Friendly repository name used in output.
RequireTrustedRepository SwitchParameter optionalposition: namedpipeline: False
Require the selected repository profile to be marked trusted.
ShowSummary SwitchParameter optionalposition: namedpipeline: False
Write a compact Spectre.Console summary for each plan or result.
SkipDependencyCheck SwitchParameter optionalposition: namedpipeline: Falsealiases: SkipDependenciesCheck
Skip installing dependencies declared by the package.
TrustPolicy ManagedModuleTrustPolicy optionalposition: namedpipeline: False
Optional typed repository/package trust policy.

Outputs

PowerForge.ManagedModuleInstallResult, PowerForge.ManagedModuleInstallPlan