API Reference
Save-ManagedModule
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
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>]#NameParameterSetParameters
- AcceptLicense SwitchParameter
- Accept package licenses when packages declare license acceptance is required.
- AllowClobber SwitchParameter
- Allow command exports to overlap with other modules in the destination root.
- AllowedAuthor String[]
- Allowed package author values from package metadata.
- AsNupkg SwitchParameter
- Save the selected packages as .nupkg files instead of unpacked module folders.
- AuthenticodeCheck SwitchParameter
- Validate Authenticode signatures for signable package files before saving.
- BundleMetadataPath String
- Optional path for offline bundle metadata written after successful saves.
- Credential PSCredential
- Optional repository credential.
- CredentialSecret String
- Optional repository credential secret.
- CredentialSecretFilePath String
- Optional path to a file containing the repository credential secret.
- CredentialUserName String
- Optional repository credential username.
- DependencyConcurrency Int32
- Maximum number of dependency branches to save concurrently. Omit to use the managed engine default.
- ExpectedPackageSha256 String
- Expected SHA256 hash of the root package before it is extracted and saved.
- Force SwitchParameter
- Overwrite an existing saved version.
- IncludeXml SwitchParameter
- Write PowerShellGet-compatible PSGetModuleInfo.xml metadata beside each saved unpacked module.
- MaximumVersion String
- Maximum package version to save when Version is omitted.
- MinimumVersion String
- Minimum package version to save when Version is omitted.
- Name String[]
- Module names to save.
- PackageCacheDirectory String
- Optional package cache directory.
- Path String
- Destination module root. Defaults to the current filesystem location.
- Plan SwitchParameter
- Return an inspectable save plan without writing files.
- Prerelease SwitchParameter
- Include prerelease versions when resolving the latest version.
- ProfileName String
- Saved repository profile name.
- Proxy Uri
- Optional HTTP proxy used for repository requests.
- ProxyCredential PSCredential
- Optional proxy credential used with Proxy.
- Quiet SwitchParameter
- Suppress optional host summaries and progress-style output without changing pipeline result objects.
- Repository String
- Repository URL, NuGet v3 service index, flat-container URL, or local folder feed.
- RepositoryName String
- Friendly repository name used in output.
- RequireTrustedRepository SwitchParameter
- Require the selected repository profile to be marked trusted.
- ShowSummary SwitchParameter
- Write a compact Spectre.Console summary for each plan or result.
- SkipDependencyCheck SwitchParameter
- Skip installing dependencies declared by the package.
- TrustPolicy ManagedModuleTrustPolicy
- Optional typed repository/package trust policy.
- Version String
- Exact package version to save. When omitted, the latest repository version is used.
- VersionPolicy String
- 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>]#InputObjectParameterSetParameters
- AcceptLicense SwitchParameter
- Accept package licenses when packages declare license acceptance is required.
- AllowClobber SwitchParameter
- Allow command exports to overlap with other modules in the destination root.
- AllowedAuthor String[]
- Allowed package author values from package metadata.
- AsNupkg SwitchParameter
- Save the selected packages as .nupkg files instead of unpacked module folders.
- AuthenticodeCheck SwitchParameter
- Validate Authenticode signatures for signable package files before saving.
- BundleMetadataPath String
- Optional path for offline bundle metadata written after successful saves.
- Credential PSCredential
- Optional repository credential.
- CredentialSecret String
- Optional repository credential secret.
- CredentialSecretFilePath String
- Optional path to a file containing the repository credential secret.
- CredentialUserName String
- Optional repository credential username.
- DependencyConcurrency Int32
- Maximum number of dependency branches to save concurrently. Omit to use the managed engine default.
- ExpectedPackageSha256 String
- Expected SHA256 hash of the root package before it is extracted and saved.
- Force SwitchParameter
- Overwrite an existing saved version.
- IncludeXml SwitchParameter
- Write PowerShellGet-compatible PSGetModuleInfo.xml metadata beside each saved unpacked module.
- InputObject ManagedModuleVersionInfo[]
- Module versions returned by Find-ManagedModule to save.
- PackageCacheDirectory String
- Optional package cache directory.
- Path String
- Destination module root. Defaults to the current filesystem location.
- Plan SwitchParameter
- Return an inspectable save plan without writing files.
- ProfileName String
- Saved repository profile name.
- Proxy Uri
- Optional HTTP proxy used for repository requests.
- ProxyCredential PSCredential
- Optional proxy credential used with Proxy.
- Quiet SwitchParameter
- Suppress optional host summaries and progress-style output without changing pipeline result objects.
- Repository String
- Repository URL, NuGet v3 service index, flat-container URL, or local folder feed.
- RepositoryName String
- Friendly repository name used in output.
- RequireTrustedRepository SwitchParameter
- Require the selected repository profile to be marked trusted.
- ShowSummary SwitchParameter
- Write a compact Spectre.Console summary for each plan or result.
- SkipDependencyCheck SwitchParameter
- Skip installing dependencies declared by the package.
- TrustPolicy ManagedModuleTrustPolicy
- Optional typed repository/package trust policy.
Outputs
PowerForge.ManagedModuleInstallResult, PowerForge.ManagedModuleInstallPlan