Share via


Set-PSRepository

Sets values for a registered repository.

Syntax

Default (Default)

Set-PSRepository
    -Name <String>
    [-SourceLocation <Uri>]
    [-PublishLocation <Uri>]
    [-InstallationPolicy <String>]
    [-PackageManagementProvider <String>]
    [<CommonParameters>]

Description

The Set-PSRepository cmdlet sets values for a registered module repository.

Examples

Example 1: Set the installation policy for a repository

PS C:\> Set-PSRepository -Name "myInternalSource" -InstallationPolicy Trusted

This command sets the installation policy for the myInternalSource repository to Trusted, so that users are not prompted before installing modules from that source.

Example 2: Set the source and publish locations for a repository

PS C:\> Set-PSRepository -Name "myInternalSource" -SourceLocation 'http://someNuGetUrl.com/api/v2' -PublishLocation 'http://someNuGetUrl.com/api/v2/packages'

This command sets the source location and publish location for myInternalSource to the specified URIs.

Parameters

-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

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of the repository.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PackageManagementProvider

Specifies the package management provider.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PublishLocation

Specifies the URI of the publish location. For example, for NuGet-based repositories, the publish location is similar to http://someNuGetUrl.com/api/v2/Packages.

Parameter properties

Type:Uri
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

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.