Set-PSRepository

Sets values for a registered repository.
Set-PSRepository [-InstallationPolicy {Trusted | Untrusted}] [-PackageManagementProvider [<String>]][-PublishLocation [<Uri>]] [-ScriptPublishLocation [<Uri>]] [-ScriptSourceLocation [<Uri>]] [-SourceLocation[<Uri>]] -Name* <String> [<CommonParameters>]

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

Parameters
-InstallationPolicy [<String>]

Specifies the installation policy. Valid values are: Trusted, UnTrusted.

-Name <String>

  • This value is required

Specifies the name of the repository.

-PackageManagementProvider [<String>]

Specifies the package management provider.

-PublishLocation [<Uri>]

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.

-ScriptPublishLocation [<Uri>]
 
-ScriptSourceLocation [<Uri>]
 
-SourceLocation [<Uri>]

Specifies the URI for discovering and installing modules from this repository. For example, for NuGet-based repositories, the source location is similar to http://someNuGetUrl.com/api/v2.

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Examples
  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.

  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.

Related Links

Get-PSRepository
Register-PSRepository
Unregister-PSRepository