API Reference
Command
Save-ManagedScript
Saves script resources from a managed repository to an explicit script directory.
Remarks
Saves script resources from a managed repository to an explicit script directory.
Examples
Save the latest stable script from the default public gallery endpoint.
Save-ManagedScript -Name Invoke-CompanyTask -Path C:\Scripts
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-ManagedScript [-AcceptLicense] [-AllowedAuthor <String[]>] [-Credential <PSCredential>] [-CredentialSecret <String>] [-CredentialSecretFilePath <String>] [-CredentialUserName <String>] [-ExpectedPackageSha256 <String>] [-Force] [-MaximumVersion <String>] [-MinimumVersion <String>] -Name <String[]> [-PackageCacheDirectory <String>] -Path <String> [-Plan] [-Prerelease] [-ProfileName <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Repository <String>] [-RepositoryName <String>] [-RequireTrustedRepository] [-TrustPolicy <ManagedModuleTrustPolicy>] [-Version <String>] [-VersionPolicy <String>] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- AcceptLicense SwitchParameter
- Accept package licenses when packages declare license acceptance is required.
- AllowedAuthor String[]
- Allowed package author values from package metadata.
- 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.
- ExpectedPackageSha256 String
- Expected SHA256 hash of the script package before it is extracted and saved.
- Force SwitchParameter
- Overwrite an existing saved script.
- MaximumVersion String
- Maximum package version to save when Version is omitted.
- MinimumVersion String
- Minimum package version to save when Version is omitted.
- Name String[]
- Script resource names to save.
- PackageCacheDirectory String
- Optional package cache directory.
- Path String
- Destination directory for saved scripts.
- 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.
- 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.
- 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.ManagedScriptSaveResult, PowerForge.ManagedScriptSavePlan