Set-PSRepositorySet-PSRepository

Set-PSRepository define valores para um repositório registrado.Set-PSRepository sets values for a registered repository.

DescriçãoDescription

O cmdlet Set-PSRepository define valores para um repositório de módulo registrado.The Set-PSRepository cmdlet sets values for a registered module repository.

Sintaxe do cmdletCmdlet syntax

Get-Command -Name Set-PSRepository -Module PowerShellGet -Syntax

Referência da ajuda online sobre cmdletsCmdlet online help reference

Set-PSRepositorySet-PSRepository

Comandos de exemploExample commands

PS C:\> Register-PSRepository -Name myRepository -SourceLocation "https://www.myget.org/F/powershellgetdemo/api/v2" -InstallationPolicy Trusted
PS C:\> Get-PSRepository
Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
myRepository              Trusted              https://www.myget.org/F/powershellgetdemo/api/v2

# Set installation Policy for a repository
PS C:\> Set-PSRepository -Name myRepository -InstallationPolicy Untrusted
PS C:\> Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
myRepository              Untrusted            https://www.myget.org/F/powershellgetdemo/api/v2

Cmdlet Set-PSRepository com suporte de compartilhamento de scriptSet-PSRepository cmdlet with script sharing support

Use o cmdlet Set-PSRepository para adicionar ScriptSourceLocation e ScriptPublishLocation ao PSRepository.Use Set-PSRepository cmdlets to add the ScriptSourceLocation and ScriptPublishLocation to the PSRepository.

# Add script sharing locations to an existing PSRepository using Set-PSRepository object.
Set-PSRepository -Name MyGallery `
                 -ScriptSourceLocation https://MyGallery.com/api/v2/items/psscript/ `
                 -ScriptPublishLocation https://MyGallery.com/api/v2/package/

Get-PSRepository -Name GalleryINT | Format-List * -Force

Name : GalleryINT
SourceLocation : https://MyGallery.com/api/v2/
Trusted : True
Registered : True
InstallationPolicy : Trusted
PackageManagementProvider : NuGet
PublishLocation : https://MyGallery.com/api/v2/package/
ScriptSourceLocation : https://MyGallery.com/api/v2/items/psscript/
ScriptPublishLocation : https://MyGallery.com/api/v2/package/
ProviderOptions : {}