API Reference
Connect-ModuleRepository
Registers an Azure Artifacts repository if needed and validates authenticated access for the selected bootstrap mode.
Remarks
This cmdlet is the explicit "connect/login" companion to Register-ModuleRepository. It ensures the repository registration exists and then performs a lightweight authenticated probe so callers know whether the chosen bootstrap path can actually access the private feed.
Examples
Connect to an Azure Artifacts repository using the best available bootstrap mode
Connect-ModuleRepository -AzureDevOpsOrganization 'contoso' -AzureDevOpsProject 'Platform' -AzureArtifactsFeed 'Modules' -InstallPrerequisites
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Connect-ModuleRepository -AzureArtifactsFeed <String> -AzureDevOpsOrganization <String> [-AzureDevOpsProject <String>] [-BootstrapMode <Auto|ExistingSession|CredentialPrompt>] [-CredentialSecret <String>] [-CredentialSecretFilePath <String>] [-CredentialUserName <String>] [-InstallPrerequisites] [-Name <String>] [-Priority <Nullable`1>] [-PromptForCredential] [-Provider <AzureArtifacts>] [-Tool <Auto|PSResourceGet|PowerShellGet|Both>] [-Trusted <Boolean>] [<CommonParameters>]
#
All Parameter SetsParameters
- AzureArtifactsFeed String
- Azure Artifacts feed name.
- AzureDevOpsOrganization String
- Azure DevOps organization name.
- AzureDevOpsProject String
- Optional Azure DevOps project name for project-scoped feeds.
- BootstrapMode PrivateGalleryBootstrapMode
- Bootstrap/authentication mode. Auto uses supplied or prompted credentials when requested; otherwise it prefers ExistingSession when Azure Artifacts prerequisites are ready and falls back to CredentialPrompt when they are not.
- Possible values:
Auto,ExistingSession,CredentialPrompt - CredentialSecret String
- Optional repository credential secret.
- CredentialSecretFilePath String
- Optional path to a file containing the repository credential secret.
- CredentialUserName String
- Optional repository credential username.
- InstallPrerequisites SwitchParameter
- Installs missing private-gallery prerequisites such as PSResourceGet and the Azure Artifacts credential provider before connecting.
- Name String
- Optional repository name override. Defaults to the feed name.
- Priority Nullable`1
- Optional PSResourceGet repository priority.
- PromptForCredential SwitchParameter
- Prompts interactively for repository credentials.
- Provider PrivateGalleryProvider
- Private gallery provider. Currently only AzureArtifacts is supported.
- Possible values:
AzureArtifacts - Tool RepositoryRegistrationTool
- Registration strategy. Auto prefers PSResourceGet and falls back to PowerShellGet when needed.
- Possible values:
Auto,PSResourceGet,PowerShellGet,Both - Trusted Boolean
- When true, marks the repository as trusted.
Outputs
PSPublishModule.ModuleRepositoryRegistrationResult: Result returned when registering or refreshing a private module repository.