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.

-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

-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


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

  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 '' -PublishLocation ''

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

Related Links