Set-PSRepositorySet-PSRepository

Set-PSRepository worden ingesteld voor een geregistreerde opslagplaats.Set-PSRepository sets values for a registered repository.

BeschrijvingDescription

De cmdlet Set-PSRepository worden ingesteld voor een geregistreerde module-opslagplaats.The Set-PSRepository cmdlet sets values for a registered module repository.

De syntaxis van cmdletCmdlet syntax

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

Verwijzing naar het online help van cmdletCmdlet online help reference

Set-PSRepositorySet-PSRepository

VoorbeeldopdrachtenExample 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

De cmdlet Set-PSRepository met script-ondersteuning voor delenSet-PSRepository cmdlet with script sharing support

Set-PSRepository-cmdlets gebruiken om toe te voegen de ScriptSourceLocation en ScriptPublishLocation naar de 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 : {}