Initialize-ManagedModuleRepository
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>]#ProfileInitialize-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>]#ImportInitialize-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>]#RepositoryInitialize-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>]#MicrosoftArtifactRegistryDescription
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
Initialize-ManagedModuleRepository -Path .\Company.repository.json -ProfileName Company -Overwrite -InstallPrerequisitesImports 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 -InstallPrerequisitesSaves an Entra-first profile and connects the workstation in one command.
Verify profile metadata without connecting
Initialize-ManagedModuleRepository -ProfileName Company -SkipConnectReturns profile and local prerequisite readiness without registering or probing the repository.
Parameters
- -BootstrapForce SwitchParameter
- Overwrite existing bootstrap files when BootstrapPath is used.
- -BootstrapPath String
- Optional output directory for a non-secret onboarding package that imports the selected profiles and can install starter modules.
- -BootstrapProfileFileName String
- Generated profile JSON file name when BootstrapPath is used.
- -BootstrapScriptName String
- Generated bootstrap script file name when BootstrapPath is used.
- -CredentialSecret String
- Optional repository credential secret for credential-prompt fallback environments.
- -CredentialSecretFilePath String
- Optional path to a file containing the repository credential secret.
- -CredentialUserName String
- Optional repository credential username for credential-prompt fallback environments.
- -InstallModule String[]
- Optional module names written into the bootstrap script as starter managed installs.
- -InstallPrerequisites SwitchParameter
- 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
- 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
- Prompts interactively for repository credentials in credential-prompt fallback environments.
- -Scope ModuleRepositoryProfileScope
- 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
- Save/import/test the profile but do not register, connect, or probe the repository.
- -Overwrite SwitchParameter
- Replace saved profiles with matching names when importing from Path.
- -Path String
- Source JSON profile file exported with Get-ManagedModuleRepository -ExportPath.
- -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 saved in a new profile. Defaults to ExistingSession for Azure Artifacts Credential Provider login.
- Possible values:
Auto,ExistingSession,CredentialPrompt,JFrogCli - -GitHubOwner String
- GitHub user or organization namespace for GitHub Packages. Defaults from Repository when omitted.
- -JFrogBaseUri String
- JFrog Artifactory base URI, for example https://company.jfrog.io/artifactory.
- -JFrogRepository String
- JFrog NuGet repository key. Defaults from Repository when omitted.
- -Priority Int32
- Optional PSResourceGet repository priority.
- -Provider PrivateGalleryProvider
- Private gallery provider.
- Possible values:
AzureArtifacts,Azure,JFrog,NuGet,GitHubPackages,GitHub - -Repository String
- 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
- Optional local repository name override. Defaults to the profile name for new Azure Artifacts profiles.
- -RepositoryPublishUri String
- PowerShellGet publish URI for generic/JFrog feeds.
- -RepositorySourceUri String
- PowerShellGet source URI for generic/JFrog feeds.
- -RepositoryUri String
- PSResourceGet v3 repository URI for generic/JFrog feeds.
- -Tool RepositoryRegistrationTool
- Registration strategy saved in a new profile. Defaults to PSResourceGet for Entra-first Azure Artifacts use.
- Possible values:
Auto,PSResourceGet,PowerShellGet,Both - -Trusted Boolean
- When true, marks the repository as trusted during registration.
- -MicrosoftArtifactRegistry SwitchParameter
- 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.
Outputs
PSPublishModule.ModuleRepositoryOnboardingResult: Result returned by Initialize-ManagedModuleRepository for managed repository onboarding. PSPublishModule.ModuleRepositoryRegistrationResult: Result returned when registering or refreshing a private module repository.