Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Set-PSRepository
- Module:
- PowerShellGet Module
Sets values for a registered repository.
Syntax
Default (Default)
Set-PSRepository
[-Name] <String>
[[-SourceLocation] <Uri>]
[-PublishLocation <Uri>]
[-ScriptSourceLocation <Uri>]
[-ScriptPublishLocation <Uri>]
[-Credential <PSCredential>]
[-InstallationPolicy <String>]
[-Proxy <Uri>]
[-ProxyCredential <PSCredential>]
[-PackageManagementProvider <String>]
[<CommonParameters>]
Description
The Set-PSRepository cmdlet sets values for a registered module repository. The settings are
persistent for the current user and apply to all versions of PowerShell installed for that user.
Examples
Example 1: Set the installation policy for a repository
Set-PSRepository -Name "myInternalSource" -InstallationPolicy Trusted
This command sets the installation policy for the myInternalSource repository to Trusted, so that you are not prompted before installing modules from that source.
Example 2: Set the source and publish locations for a repository
Set-PSRepository -Name "myInternalSource" -SourceLocation 'https://someNuGetUrl.com/api/v2' -PublishLocation 'https://someNuGetUrl.com/api/v2/packages'
This command sets the source location and publish location for myInternalSource to the specified URIs.
Parameters
-Credential
Specifies a user account that has rights to change the repository settings.
Parameter properties
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-InstallationPolicy
Specifies the installation policy. Valid values are: Trusted, Untrusted.
Parameter properties
| Type: | String |
| Default value: | None |
| Accepted values: | Trusted, Untrusted |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Name
Specifies the name of the repository.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PackageManagementProvider
Specifies the package management provider.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Proxy
Specifies a proxy server for the request, rather than connecting directly to the Internet resource.
Parameter properties
| Type: | Uri |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ProxyCredential
Specifies a user account that has permission to use the proxy server that is specified by the Proxy parameter.
Parameter properties
| Type: | PSCredential |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PublishLocation
Specifies the URI of the publish location. For example, for NuGet-based repositories, the publish
location is similar to https://someNuGetUrl.com/api/v2/Packages.
Parameter properties
| Type: | Uri |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ScriptPublishLocation
Specifies the script publish location.
Parameter properties
| Type: | Uri |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ScriptSourceLocation
Specifies the script source location.
Parameter properties
| Type: | Uri |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-SourceLocation
Specifies the URI for discovering and installing modules from this repository. For example, for
NuGet-based repositories, the source location is similar to https://someNuGetUrl.com/api/v2.
Parameter properties
| Type: | Uri |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
PSCredential
Uri
Outputs
Object
Notes
Important
As of April 2020, the PowerShell Gallery no longer supports Transport Layer Security (TLS) versions 1.0 and 1.1. If you are not using TLS 1.2 or higher, you will receive an error when trying to access the PowerShell Gallery. Use the following command to ensure you are using TLS 1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
For more information, see the announcement in the PowerShell blog.
Related Links
PowerShellGet
Feedback
Was this page helpful?
