Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.169
Language: C# Updated: 2026-10-13

API Reference

Command

Initialize-ManagedModuleRepository

Namespace PSPublishModule
Inputs
None
Outputs
PSPublishModule.ModuleRepositoryOnboardingResult PSPublishModule.ModuleRepositoryRegistrationResult

Performs one-command onboarding for managed module repository profiles.

Remarks

This cmdlet is the workstation or build-agent onboarding entry point for managed module repositories. It can use an existing saved profile, import a non-secret profile JSON file, or create a profile from feed details. Unless -SkipConnect is used, it then installs requested prerequisites, registers/probes native provider state where needed, and validates authenticated access through the selected bootstrap mode. It can also write a distributable non-secret bootstrap package for other machines.

Examples

Authored help example

Onboard from a managed profile file


Initialize-ManagedModuleRepository -Path .\Company.repository.json -ProfileName Company -Overwrite -InstallPrerequisites
        

Imports the non-secret profile, installs/refreshes prerequisites, registers the repository, and triggers the Azure Artifacts credential-provider login flow when needed.

Create and connect an Entra-first Azure Artifacts profile


Initialize-ManagedModuleRepository -ProfileName Company -Organization contoso -Project Platform -Feed Modules -InstallPrerequisites
        

Saves an Entra-first profile and connects the workstation in one command.

Verify profile metadata without connecting


Initialize-ManagedModuleRepository -ProfileName Company -SkipConnect
        

Returns profile and local prerequisite readiness without registering or probing the repository.

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

Initialize-ManagedModuleRepository [-BootstrapForce] [-BootstrapPath <String>] [-BootstrapProfileFileName <String>] [-BootstrapScriptName <String>] [-CredentialSecret <String>] [-CredentialSecretFilePath <String>] [-CredentialUserName <String>] [-InstallModule <String[]>] [-InstallPrerequisites] -ProfileName <String> [-PromptForCredential] [-Scope <User|Machine|All>] [-SkipConnect] [<CommonParameters>]
#
Parameter set: Profile

Parameters

BootstrapForce SwitchParameter optionalposition: namedpipeline: False
Overwrite existing bootstrap files when BootstrapPath is used.
BootstrapPath String optionalposition: namedpipeline: False
Optional output directory for a non-secret onboarding package that imports the selected profiles and can install starter modules.
BootstrapProfileFileName String optionalposition: namedpipeline: False
Generated profile JSON file name when BootstrapPath is used.
BootstrapScriptName String optionalposition: namedpipeline: False
Generated bootstrap script file name when BootstrapPath is used.
CredentialSecret String optionalposition: namedpipeline: Falsealiases: Password, Token
Optional repository credential secret for credential-prompt fallback environments.
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 for credential-prompt fallback environments.
InstallModule String[] optionalposition: namedpipeline: Falsealiases: ModuleName
Optional module names written into the bootstrap script as starter managed installs.
InstallPrerequisites SwitchParameter optionalposition: namedpipeline: False
Installs missing private-gallery prerequisites before connecting, including the PSResourceGet version required by the selected bootstrap mode and the Azure Artifacts credential provider.
ProfileName String requiredposition: 0pipeline: Falsealiases: Name, Profile
Saved repository profile name. When used with Path, selects one imported profile from the file. When used with Azure Artifacts feed details, creates that profile name.
PromptForCredential SwitchParameter optionalposition: namedpipeline: Falsealiases: Interactive
Prompts interactively for repository credentials in credential-prompt fallback environments.
Scope ModuleRepositoryProfileScope optionalposition: namedpipeline: Falsevalues: 3
Profile store scope. Existing profiles default to user-then-machine lookup; profile creation/import defaults to the current user's store unless Machine is specified.
Possible values: User, Machine, All
SkipConnect SwitchParameter optionalposition: namedpipeline: False
Save/import/test the profile but do not register, connect, or probe the repository.

Outputs

PSPublishModule.ModuleRepositoryOnboardingResult: Result returned by Initialize-ManagedModuleRepository for managed repository onboarding. PSPublishModule.ModuleRepositoryRegistrationResult: Result returned when registering or refreshing a private module repository.

Initialize-ManagedModuleRepository [-BootstrapForce] [-BootstrapPath <String>] [-BootstrapProfileFileName <String>] [-BootstrapScriptName <String>] [-CredentialSecret <String>] [-CredentialSecretFilePath <String>] [-CredentialUserName <String>] [-InstallModule <String[]>] [-InstallPrerequisites] [-Overwrite] -Path <String> [-ProfileName <String>] [-PromptForCredential] [-Scope <User|Machine|All>] [-SkipConnect] [<CommonParameters>]
#
Parameter set: Import

Parameters

BootstrapForce SwitchParameter optionalposition: namedpipeline: False
Overwrite existing bootstrap files when BootstrapPath is used.
BootstrapPath String optionalposition: namedpipeline: False
Optional output directory for a non-secret onboarding package that imports the selected profiles and can install starter modules.
BootstrapProfileFileName String optionalposition: namedpipeline: False
Generated profile JSON file name when BootstrapPath is used.
BootstrapScriptName String optionalposition: namedpipeline: False
Generated bootstrap script file name when BootstrapPath is used.
CredentialSecret String optionalposition: namedpipeline: Falsealiases: Password, Token
Optional repository credential secret for credential-prompt fallback environments.
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 for credential-prompt fallback environments.
InstallModule String[] optionalposition: namedpipeline: Falsealiases: ModuleName
Optional module names written into the bootstrap script as starter managed installs.
InstallPrerequisites SwitchParameter optionalposition: namedpipeline: False
Installs missing private-gallery prerequisites before connecting, including the PSResourceGet version required by the selected bootstrap mode and the Azure Artifacts credential provider.
Overwrite SwitchParameter optionalposition: namedpipeline: False
Replace saved profiles with matching names when importing from Path.
Path String requiredposition: 0pipeline: False
Source JSON profile file exported with Get-ManagedModuleRepository -ExportPath.
ProfileName String optionalposition: 0pipeline: Falsealiases: Name, Profile
Saved repository profile name. When used with Path, selects one imported profile from the file. When used with Azure Artifacts feed details, creates that profile name.
PromptForCredential SwitchParameter optionalposition: namedpipeline: Falsealiases: Interactive
Prompts interactively for repository credentials in credential-prompt fallback environments.
Scope ModuleRepositoryProfileScope optionalposition: namedpipeline: Falsevalues: 3
Profile store scope. Existing profiles default to user-then-machine lookup; profile creation/import defaults to the current user's store unless Machine is specified.
Possible values: User, Machine, All
SkipConnect SwitchParameter optionalposition: namedpipeline: False
Save/import/test the profile but do not register, connect, or probe the repository.

Outputs

PSPublishModule.ModuleRepositoryOnboardingResult: Result returned by Initialize-ManagedModuleRepository for managed repository onboarding. PSPublishModule.ModuleRepositoryRegistrationResult: Result returned when registering or refreshing a private module repository.

Initialize-ManagedModuleRepository [-AzureArtifactsFeed <String>] [-AzureDevOpsOrganization <String>] [-AzureDevOpsProject <String>] [-BootstrapForce] [-BootstrapMode <Auto|ExistingSession|CredentialPrompt|JFrogCli>] [-BootstrapPath <String>] [-BootstrapProfileFileName <String>] [-BootstrapScriptName <String>] [-CredentialSecret <String>] [-CredentialSecretFilePath <String>] [-CredentialUserName <String>] [-GitHubOwner <String>] [-InstallModule <String[]>] [-InstallPrerequisites] [-JFrogBaseUri <String>] [-JFrogRepository <String>] [-Priority <Int32>] -ProfileName <String> [-PromptForCredential] [-Provider <AzureArtifacts>] [-Repository <String>] [-RepositoryName <String>] [-RepositoryPublishUri <String>] [-RepositorySourceUri <String>] [-RepositoryUri <String>] [-Scope <User|Machine|All>] [-SkipConnect] [-Tool <Auto|PSResourceGet|PowerShellGet|Both>] [-Trusted <Boolean>] [<CommonParameters>]
#
Parameter set: Repository

Parameters

AzureArtifactsFeed String optionalposition: namedpipeline: Falsealiases: Feed
Azure Artifacts feed name.
AzureDevOpsOrganization String optionalposition: namedpipeline: Falsealiases: Organization
Azure DevOps organization name.
AzureDevOpsProject String optionalposition: namedpipeline: Falsealiases: Project
Optional Azure DevOps project name for project-scoped feeds.
BootstrapForce SwitchParameter optionalposition: namedpipeline: False
Overwrite existing bootstrap files when BootstrapPath is used.
BootstrapMode PrivateGalleryBootstrapMode optionalposition: namedpipeline: Falsealiases: Modevalues: 4
Bootstrap/authentication mode saved in a new profile. Defaults to ExistingSession for Azure Artifacts Credential Provider login.
Possible values: Auto, ExistingSession, CredentialPrompt, JFrogCli
BootstrapPath String optionalposition: namedpipeline: False
Optional output directory for a non-secret onboarding package that imports the selected profiles and can install starter modules.
BootstrapProfileFileName String optionalposition: namedpipeline: False
Generated profile JSON file name when BootstrapPath is used.
BootstrapScriptName String optionalposition: namedpipeline: False
Generated bootstrap script file name when BootstrapPath is used.
CredentialSecret String optionalposition: namedpipeline: Falsealiases: Password, Token
Optional repository credential secret for credential-prompt fallback environments.
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 for credential-prompt fallback environments.
GitHubOwner String optionalposition: namedpipeline: Falsealiases: Namespace, Owner
GitHub user or organization namespace for GitHub Packages. Defaults from Repository when omitted.
InstallModule String[] optionalposition: namedpipeline: Falsealiases: ModuleName
Optional module names written into the bootstrap script as starter managed installs.
InstallPrerequisites SwitchParameter optionalposition: namedpipeline: False
Installs missing private-gallery prerequisites before connecting, including the PSResourceGet version required by the selected bootstrap mode and the Azure Artifacts credential provider.
JFrogBaseUri String optionalposition: namedpipeline: False
JFrog Artifactory base URI, for example https://company.jfrog.io/artifactory.
JFrogRepository String optionalposition: namedpipeline: False
JFrog NuGet repository key. Defaults from Repository when omitted.
Priority Int32 optionalposition: namedpipeline: False
Optional PSResourceGet repository priority.
ProfileName String requiredposition: 0pipeline: Falsealiases: Name, Profile
Saved repository profile name. When used with Path, selects one imported profile from the file. When used with Azure Artifacts feed details, creates that profile name.
PromptForCredential SwitchParameter optionalposition: namedpipeline: Falsealiases: Interactive
Prompts interactively for repository credentials in credential-prompt fallback environments.
Provider PrivateGalleryProvider optionalposition: namedpipeline: Falsevalues: 6
Private gallery provider.
Possible values: AzureArtifacts, Azure, JFrog, NuGet, GitHubPackages, GitHub
Repository String optionalposition: namedpipeline: False
Provider repository/feed id. For Azure this is the feed when AzureArtifactsFeed is omitted; for JFrog this is the Artifactory NuGet repository key.
RepositoryName String optionalposition: namedpipeline: False
Optional local repository name override. Defaults to the profile name for new Azure Artifacts profiles.
RepositoryPublishUri String optionalposition: namedpipeline: False
PowerShellGet publish URI for generic/JFrog feeds.
RepositorySourceUri String optionalposition: namedpipeline: False
PowerShellGet source URI for generic/JFrog feeds.
RepositoryUri String optionalposition: namedpipeline: False
PSResourceGet v3 repository URI for generic/JFrog feeds.
Scope ModuleRepositoryProfileScope optionalposition: namedpipeline: Falsevalues: 3
Profile store scope. Existing profiles default to user-then-machine lookup; profile creation/import defaults to the current user's store unless Machine is specified.
Possible values: User, Machine, All
SkipConnect SwitchParameter optionalposition: namedpipeline: False
Save/import/test the profile but do not register, connect, or probe the repository.
Tool RepositoryRegistrationTool optionalposition: namedpipeline: Falsevalues: 4
Registration strategy saved in a new profile. Defaults to PSResourceGet for Entra-first Azure Artifacts use.
Possible values: Auto, PSResourceGet, PowerShellGet, Both
Trusted Boolean optionalposition: namedpipeline: False
When true, marks the repository as trusted during registration.

Outputs

PSPublishModule.ModuleRepositoryOnboardingResult: Result returned by Initialize-ManagedModuleRepository for managed repository onboarding. PSPublishModule.ModuleRepositoryRegistrationResult: Result returned when registering or refreshing a private module repository.

Initialize-ManagedModuleRepository [-BootstrapForce] [-BootstrapPath <String>] [-BootstrapProfileFileName <String>] [-BootstrapScriptName <String>] [-CredentialSecret <String>] [-CredentialSecretFilePath <String>] [-CredentialUserName <String>] [-InstallModule <String[]>] [-InstallPrerequisites] -MicrosoftArtifactRegistry [-Priority <Int32>] [-PromptForCredential] [-RepositoryName <String>] [-Scope <User|Machine|All>] [-SkipConnect] [-Tool <Auto|PSResourceGet|PowerShellGet|Both>] [-Trusted <Boolean>] [<CommonParameters>]
#
Parameter set: MicrosoftArtifactRegistry

Parameters

BootstrapForce SwitchParameter optionalposition: namedpipeline: False
Overwrite existing bootstrap files when BootstrapPath is used.
BootstrapPath String optionalposition: namedpipeline: False
Optional output directory for a non-secret onboarding package that imports the selected profiles and can install starter modules.
BootstrapProfileFileName String optionalposition: namedpipeline: False
Generated profile JSON file name when BootstrapPath is used.
BootstrapScriptName String optionalposition: namedpipeline: False
Generated bootstrap script file name when BootstrapPath is used.
CredentialSecret String optionalposition: namedpipeline: Falsealiases: Password, Token
Optional repository credential secret for credential-prompt fallback environments.
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 for credential-prompt fallback environments.
InstallModule String[] optionalposition: namedpipeline: Falsealiases: ModuleName
Optional module names written into the bootstrap script as starter managed installs.
InstallPrerequisites SwitchParameter optionalposition: namedpipeline: False
Installs missing private-gallery prerequisites before connecting, including the PSResourceGet version required by the selected bootstrap mode and the Azure Artifacts credential provider.
MicrosoftArtifactRegistry SwitchParameter requiredposition: namedpipeline: False
Initializes the public Microsoft Artifact Registry PowerShell repository.
Priority Int32 optionalposition: namedpipeline: False
Optional PSResourceGet repository priority.
PromptForCredential SwitchParameter optionalposition: namedpipeline: Falsealiases: Interactive
Prompts interactively for repository credentials in credential-prompt fallback environments.
RepositoryName String optionalposition: namedpipeline: False
Optional local repository name override. Defaults to the profile name for new Azure Artifacts profiles.
Scope ModuleRepositoryProfileScope optionalposition: namedpipeline: Falsevalues: 3
Profile store scope. Existing profiles default to user-then-machine lookup; profile creation/import defaults to the current user's store unless Machine is specified.
Possible values: User, Machine, All
SkipConnect SwitchParameter optionalposition: namedpipeline: False
Save/import/test the profile but do not register, connect, or probe the repository.
Tool RepositoryRegistrationTool optionalposition: namedpipeline: Falsevalues: 4
Registration strategy saved in a new profile. Defaults to PSResourceGet for Entra-first Azure Artifacts use.
Possible values: Auto, PSResourceGet, PowerShellGet, Both
Trusted Boolean optionalposition: namedpipeline: False
When true, marks the repository as trusted during registration.

Outputs

PSPublishModule.ModuleRepositoryOnboardingResult: Result returned by Initialize-ManagedModuleRepository for managed repository onboarding. PSPublishModule.ModuleRepositoryRegistrationResult: Result returned when registering or refreshing a private module repository.