# Initialize-ManagedModuleRepository

Performs one-command onboarding for managed module repository profiles.

Project

PSPublishModule

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

[View on GitHub](https://github.com/EvotecIT/PSPublishModule) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSPublishModule/releases/tag/v3.0.124) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSPublishModule/2.0.27)

Stars **48**

Forks **15**

Open issues **1**

PowerShell Gallery downloads **17,213**

Release **v3.0.195**

Language: C# Updated: 2026-11-25

Command 

**Module**

`PSPublishModule`

**Inputs**

`None`

**Outputs**

`PSPublishModule.ModuleRepositoryOnboardingResult` `PSPublishModule.ModuleRepositoryRegistrationResult`

Performs one-command onboarding for managed module repository profiles.

## 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>]
```

[#](#method-initialize-managedmodulerepository-switchparameter-string-string-string-string-string-string-string-switchparameter-string-switchparameter-modulerepositoryprofilescope-switchparameter)

Parameter set: `Profile`

```
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>]
```

[#](#member-21528ef271385b0971523294)

Parameter set: `Import`

```
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 <PrivateGalleryProvider>]
[-Repository <String>]
[-RepositoryName <String>]
[-RepositoryPublishUri <String>]
[-RepositorySourceUri <String>]
[-RepositoryUri <String>]
[-Scope <User|Machine|All>]
[-SkipConnect]
[-Tool <Auto|PSResourceGet|PowerShellGet|Both>]
[-Trusted <Boolean>]
[<CommonParameters>]
```

[#](#member-7d3ff5454fc9135129ca6937)

Parameter set: `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>]
```

[#](#member-029257b891af384637b99db4)

Parameter set: `MicrosoftArtifactRegistry`

## Description

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

### Onboard from a managed profile file

```powershell
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

```powershell
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

```powershell
Initialize-ManagedModuleRepository -ProfileName Company -SkipConnect
```

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

## Parameters

**-BootstrapForce SwitchParameter optional**

Overwrite existing bootstrap files when BootstrapPath is used.

**-BootstrapPath String optional**

Optional output directory for a non-secret onboarding package that imports the selected profiles and can install starter modules.

**-BootstrapProfileFileName String optional**

Generated profile JSON file name when BootstrapPath is used.

**-BootstrapScriptName String optional**

Generated bootstrap script file name when BootstrapPath is used.

**-CredentialSecret String optionalaliases: Password, Token**

Optional repository credential secret for credential-prompt fallback environments.

**-CredentialSecretFilePath String optionalaliases: CredentialPath, TokenPath**

Optional path to a file containing the repository credential secret.

**-CredentialUserName String optionalaliases: UserName**

Optional repository credential username for credential-prompt fallback environments.

**-InstallModule String[] optionalaliases: ModuleName**

Optional module names written into the bootstrap script as starter managed installs.

**-InstallPrerequisites SwitchParameter optional**

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 required in Profile, Repositoryposition: 0aliases: Name, Profilesets: Profile, Import, Repository**

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 optionalaliases: Interactive**

Prompts interactively for repository credentials in credential-prompt fallback environments.

**-Scope ModuleRepositoryProfileScope optional**

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 optional**

Save/import/test the profile but do not register, connect, or probe the repository.

**-Overwrite SwitchParameter optionalsets: Import**

Replace saved profiles with matching names when importing from Path.

**-Path String requiredposition: 0sets: Import**

Source JSON profile file exported with Get-ManagedModuleRepository -ExportPath.

**-AzureArtifactsFeed String optionalaliases: Feedsets: Repository**

Azure Artifacts feed name.

**-AzureDevOpsOrganization String optionalaliases: Organizationsets: Repository**

Azure DevOps organization name.

**-AzureDevOpsProject String optionalaliases: Projectsets: Repository**

Optional Azure DevOps project name for project-scoped feeds.

**-BootstrapMode PrivateGalleryBootstrapMode optionalaliases: Modesets: Repository**

Bootstrap/authentication mode saved in a new profile. Defaults to ExistingSession for Azure Artifacts Credential Provider login.

Possible values: `Auto`, `ExistingSession`, `CredentialPrompt`, `JFrogCli`

**-GitHubOwner String optionalaliases: Namespace, Ownersets: Repository**

GitHub user or organization namespace for GitHub Packages. Defaults from Repository when omitted.

**-JFrogBaseUri String optionalsets: Repository**

JFrog Artifactory base URI, for example https://company.jfrog.io/artifactory.

**-JFrogRepository String optionalsets: Repository**

JFrog NuGet repository key. Defaults from Repository when omitted.

**-Priority Int32 optionalsets: Repository, MicrosoftArtifactRegistry**

Optional PSResourceGet repository priority.

**-Provider PrivateGalleryProvider optionalsets: Repository**

Private gallery provider.

Possible values: `AzureArtifacts`, `Azure`, `JFrog`, `NuGet`, `GitHubPackages`, `GitHub`

**-Repository String optionalsets: Repository**

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 optionalsets: Repository, MicrosoftArtifactRegistry**

Optional local repository name override. Defaults to the profile name for new Azure Artifacts profiles.

**-RepositoryPublishUri String optionalsets: Repository**

PowerShellGet publish URI for generic/JFrog feeds.

**-RepositorySourceUri String optionalsets: Repository**

PowerShellGet source URI for generic/JFrog feeds.

**-RepositoryUri String optionalsets: Repository**

PSResourceGet v3 repository URI for generic/JFrog feeds.

**-Tool RepositoryRegistrationTool optionalsets: Repository, MicrosoftArtifactRegistry**

Registration strategy saved in a new profile. Defaults to PSResourceGet for Entra-first Azure Artifacts use.

Possible values: `Auto`, `PSResourceGet`, `PowerShellGet`, `Both`

**-Trusted Boolean optionalsets: Repository, MicrosoftArtifactRegistry**

When true, marks the repository as trusted during registration.

**-MicrosoftArtifactRegistry SwitchParameter requiredsets: MicrosoftArtifactRegistry**

Initializes the public Microsoft Artifact Registry PowerShell 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

## Outputs

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

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:CAD501844CD068D6A1D485528DA94382A6E20030C8DE4D821C5E1DB0F8D7BA10 -->
