Name Uri Trusted Priority
---- --- ------- --------
PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50
Example 2
This example registers the default PSGallery repository. Unlike the previous example, we can't use
the Name and Uri parameters to register the PSGallery repository. The PSGallery
repository is registered by default but can be removed. Use this command to restore the default
registration.
Name Uri Trusted Priority
---- --- ------- --------
PSGallery https://www.powershellgallery.com/api/v2 False 50
Example 3
This example registers multiple repositories at once. To do so, we use the Repository parameter
and provide an array of hashtables. Each hashtable can only have keys associated with parameters for
the NameParameterSet or the PSGalleryParameterSet.
Name Uri Trusted Priority
---- --- ------- --------
PSGallery https://www.powershellgallery.com/api/v2 True 10
Local file:///D:/PSRepoLocal/ True 20
PSGv3 https://www.powershellgallery.com/api/v3 True 50
Example 4
This example registers a repository with credential information to be retrieved from a registered
SecretManagement vault, where SecretStore is the name of the vault and TestSecret is the
name of the stored secret.
You must have the Microsoft.PowerShell.SecretManagement module installed, have a registered
vault, and stored a secret within it. If setup correctly, the command
Get-SecretInfo -Name 'TestSecret' would return the secret.
The format of the secret must match the requirements of the repository. In some instances,
TestSecret might need storing as a PSCredential object with a username and password or token.
In others it may need storing as a SecureString representing just the token.
Specifies the API version used by the repository. Valid values are:
V2 - uses the NuGet V2 API
V3 - uses the NuGet V3 API
ContainerRegistry - used for Azure Container Registry
Local - use this for file system based repositories
NugetServer - use this for NuGet.Server based repositories
The Register-PSResourceRepository cmdlet should automatically detect the API version. This
parameter allows you to change the API version after you have registered a repository.
Specifies the priority ranking of the repository. Valid priority values range from 0 to 100. Lower
values have a higher priority ranking. The default value is 50.
Repositories are sorted by priority then by name. When searching for resources across multiple
repositories, the PSResourceGet cmdlets search the repositories using this sort order and
return the first match found.
Specifies an array of hashtables that contain repository information. Use this parameter to register
multiple repositories at once. Each hashtable can only have keys associated with parameters for
the NameParameterSet or the PSGalleryParameterSet.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
Источник этого содержимого можно найти на GitHub, где также можно создавать и просматривать проблемы и запросы на вытягивание. Дополнительные сведения см. в нашем руководстве для участников.