Evotec

Project

PSPublishModule

PSPublishModule is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 43
Forks 13
Open issues 1
PowerShell Gallery downloads 13,876
Release v3.0.3
Language: C# Updated: 2026-04-14

API Reference

Cmdlet

Connect-ModuleRepository

Namespace PSPublishModule
Inputs
None
Outputs
PSPublishModule.ModuleRepositoryRegistrationResult

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

Authored help example

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>]
#
Parameter set: All Parameter Sets

Parameters

AzureArtifactsFeed String requiredposition: namedpipeline: Falsealiases: Feed
Azure Artifacts feed name.
AzureDevOpsOrganization String requiredposition: namedpipeline: Falsealiases: Organization
Azure DevOps organization name.
AzureDevOpsProject String optionalposition: namedpipeline: Falsealiases: Project
Optional Azure DevOps project name for project-scoped feeds.
BootstrapMode PrivateGalleryBootstrapMode optionalposition: namedpipeline: Falsealiases: Modevalues: 3
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 optionalposition: namedpipeline: Falsealiases: Password, Token
Optional repository credential secret.
CredentialSecretFilePath String optionalposition: namedpipeline: Falsealiases: CredentialPath, TokenPath
Optional path to a file containing the repository credential secret.
CredentialUserName String optionalposition: namedpipeline: Falsealiases: UserName
Optional repository credential username.
InstallPrerequisites SwitchParameter optionalposition: namedpipeline: False
Installs missing private-gallery prerequisites such as PSResourceGet and the Azure Artifacts credential provider before connecting.
Name String optionalposition: namedpipeline: Falsealiases: Repository
Optional repository name override. Defaults to the feed name.
Priority Nullable`1 optionalposition: namedpipeline: False
Optional PSResourceGet repository priority.
PromptForCredential SwitchParameter optionalposition: namedpipeline: Falsealiases: Interactive
Prompts interactively for repository credentials.
Provider PrivateGalleryProvider optionalposition: namedpipeline: Falsevalues: 1
Private gallery provider. Currently only AzureArtifacts is supported.
Possible values: AzureArtifacts
Tool RepositoryRegistrationTool optionalposition: namedpipeline: Falsevalues: 4
Registration strategy. Auto prefers PSResourceGet and falls back to PowerShellGet when needed.
Possible values: Auto, PSResourceGet, PowerShellGet, Both
Trusted Boolean optionalposition: namedpipeline: False
When true, marks the repository as trusted.

Outputs

PSPublishModule.ModuleRepositoryRegistrationResult: Result returned when registering or refreshing a private module repository.