Command
Install-ManagedScript
Installs script resources through the managed C# resource engine.
Syntax
Install-ManagedScript
[-AcceptLicense]
[-AllowedAuthor <String[]>]
[-Credential <PSCredential>]
[-CredentialSecret <String>]
[-CredentialSecretFilePath <String>]
[-CredentialUserName <String>]
[-ExpectedPackageSha256 <String>]
[-Force]
[-MaximumVersion <String>]
[-MinimumVersion <String>]
[-Name] <String[]>
[-NoPathUpdate]
[-PackageCacheDirectory <String>]
[-Plan]
[-Prerelease]
[-ProfileName <String>]
[-Proxy <Uri>]
[-ProxyCredential <PSCredential>]
[[-Repository] <String>]
[-RepositoryName <String>]
[-RequireTrustedRepository]
[-Scope <CurrentUser| AllUsers| Custom>]
[-ScriptRoot <String>]
[-ShellEdition <Auto| Desktop| Core>]
[-TrustPolicy <ManagedModuleTrustPolicy>]
[-Version <String>]
[-VersionPolicy <String>]
[<CommonParameters>]#Parameter set:
All Parameter SetsExamples
Install the latest stable script from the default public gallery endpoint.
Install-ManagedScript -Name Invoke-CompanyTask -Scope CurrentUserParameters
- -AcceptLicense SwitchParameter
- Accept package licenses when packages declare license acceptance is required.
- 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 installed.
- -Force SwitchParameter
- Reinstall the script version when it already exists.
- -MaximumVersion String
- Maximum package version to install when Version is omitted.
- -MinimumVersion String
- Minimum package version to install when Version is omitted.
- -Name String[]
- Script resource names to install.
- -NoPathUpdate SwitchParameter
- Do not add the resolved script root to the current process PATH after installation.
- -PackageCacheDirectory String
- Optional package cache directory.
- -Plan SwitchParameter
- Return an inspectable install 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.
- -Scope ManagedScriptInstallScope
- Install scope used when ScriptRoot is not supplied.
- Possible values:
CurrentUser,AllUsers,Custom - -ScriptRoot String
- Explicit script root. When supplied, Scope is treated as Custom.
- -ShellEdition ManagedModuleShellEdition
- PowerShell path family used when resolving default CurrentUser or AllUsers script roots.
- Possible values:
Auto,Desktop,Core - -TrustPolicy ManagedModuleTrustPolicy
- Optional typed repository/package trust policy.
- -Version String
- Exact package version to install. When omitted, the latest repository version is used.
- -VersionPolicy String
- NuGet-style version range policy used when Version is omitted.
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.