| external help file | PSModule-help.xml |
|---|---|
| Locale | en-US |
| Module Name | PowerShellGet |
| ms.custom | 3.0.22-beta22 |
| ms.date | 09/19/2023 |
| online version | https://learn.microsoft.com/powershell/module/powershellget/set-psrepository?view=powershellget-2.x&WT.mc_id=ps-gethelp |
| schema | 2.0.0 |
| title | Set-PSRepository |
Sets values for a registered repository.
Set-PSRepository [-Name] <String> [[-SourceLocation] <Uri>] [-PublishLocation <Uri>]
[-ScriptSourceLocation <Uri>] [-ScriptPublishLocation <Uri>] [-Credential <PSCredential>]
[-InstallationPolicy <String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>]
[-PackageManagementProvider <String>] [<CommonParameters>]
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.
This is a proxy cmdlet for the Set-PSResourceRepository cmdlet in the
Microsoft.PowerShell.PSResourceGet. For more information, see
Set-PSResourceRepository.
Set-PSRepository -Name "myInternalSource" -InstallationPolicy TrustedThis command sets the installation policy for the myInternalSource repository to Trusted, so that you are not prompted before installing modules from that source.
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.
The proxy cmdlet ignores this parameter since it's not supported by Set-PSResourceRepository.
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies the installation policy. Valid values are: Trusted, Untrusted.
The proxy cmdlet transforms the value of this parameter to the Trusted parameter of
Set-PSResourceRepository.
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: Trusted, Untrusted
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the name of the repository.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Set-PSResourceRepository.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Set-PSResourceRepository.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Set-PSResourceRepository.
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Set-PSResourceRepository.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Set-PSResourceRepository.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe proxy cmdlet ignores this parameter since it's not supported by Set-PSResourceRepository.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies 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.
The proxy cmdlet maps this parameter to the Uri parameter of Set-PSResourceRepository.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
The PowerShell Gallery no longer supports Transport Layer Security (TLS) versions 1.0 and 1.1. You must use TLS 1.2 or higher. Use the following command to ensure you are using TLS 1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12