# New-ConfigurationPublish

Provides a way to configure publishing to PowerShell Gallery, GitHub, JFrog Artifactory, or other private PowerShell module repositories.

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`

Provides a way to configure publishing to PowerShell Gallery, GitHub, JFrog Artifactory, or other private PowerShell module repositories.

## Syntax

```
New-ConfigurationPublish
[-DoNotMarkAsPreRelease]
[-Enabled]
[-EnsureRepositoryRegistered <Boolean>]
[-FilePath <String>]
[-Force]
[-GenerateReleaseNotes]
[-ID <String>]
[-OverwriteTagName <String>]
[-PublishRequiredModules]
[-ReplaceExistingAssets]
[-RepositoryApiVersion <RepositoryApiVersion>]
[-RepositoryCredentialSecret <String>]
[-RepositoryCredentialSecretEnvironmentVariable <String>]
[-RepositoryCredentialSecretFilePath <String>]
[-RepositoryCredentialUserName <String>]
[-RepositoryName <String>]
[-RepositoryPriority <Int32>]
[-RepositoryPublishUri <String>]
[-RepositorySourceUri <String>]
[-RepositoryTrusted <Boolean>]
[-RepositoryUri <String>]
[-RequiredModuleSourceRepository <String>]
[-RequiredModuleSourceRepositoryUri <String>]
[-ReuseExistingRelease]
[-Tool <Auto|PSResourceGet|PowerShellGet|ManagedModule>]
-Type <PowerShellGallery|GitHub>
[-UnregisterRepositoryAfterPublish]
[-UseAsDependencyVersionSource]
[-UserName <String>]
[<CommonParameters>]
```

[#](#member-8256171954536cf19aeb9fc4)

Parameter set: `ApiFromFile`

```
New-ConfigurationPublish
[-ApiKey <String>]
[-DoNotMarkAsPreRelease]
[-Enabled]
[-EnsureRepositoryRegistered <Boolean>]
[-Force]
[-GenerateReleaseNotes]
[-ID <String>]
[-OverwriteTagName <String>]
[-PublishRequiredModules]
[-ReplaceExistingAssets]
[-RepositoryApiVersion <RepositoryApiVersion>]
[-RepositoryCredentialSecret <String>]
[-RepositoryCredentialSecretEnvironmentVariable <String>]
[-RepositoryCredentialSecretFilePath <String>]
[-RepositoryCredentialUserName <String>]
[-RepositoryName <String>]
[-RepositoryPriority <Int32>]
[-RepositoryPublishUri <String>]
[-RepositorySourceUri <String>]
[-RepositoryTrusted <Boolean>]
[-RepositoryUri <String>]
[-RequiredModuleSourceRepository <String>]
[-RequiredModuleSourceRepositoryUri <String>]
[-ReuseExistingRelease]
[-Tool <Auto|PSResourceGet|PowerShellGet|ManagedModule>]
-Type <PowerShellGallery|GitHub>
[-UnregisterRepositoryAfterPublish]
[-UseAsDependencyVersionSource]
[-UserName <String>]
[<CommonParameters>]
```

[#](#member-cf8e5d2bb5314c32f6d78980)

Parameter set: `ApiKey`

```
New-ConfigurationPublish
[-ApiKey <String>]
[-Enabled]
[-EnsureRepositoryRegistered <Boolean>]
[-FilePath <String>]
[-Force]
[-ID <String>]
-JFrogBaseUri <String>
[-JFrogOidcProvider <String>]
[-JFrogOidcProviderType <GitHub|Azure|GenericOidc>]
[-JFrogOidcTokenId <String>]
[-JFrogOidcTokenIdEnvironmentVariable <String>]
[-JFrogPlatformUri <String>]
-JFrogRepository <String>
[-PublishRequiredModules]
[-RepositoryApiVersion <RepositoryApiVersion>]
[-RepositoryCredentialSecret <String>]
[-RepositoryCredentialSecretEnvironmentVariable <String>]
[-RepositoryCredentialSecretFilePath <String>]
[-RepositoryCredentialUserName <String>]
[-RepositoryName <String>]
[-RepositoryPriority <Int32>]
[-RepositoryPublishUri <String>]
[-RepositorySourceUri <String>]
[-RepositoryTrusted <Boolean>]
[-RepositoryUri <String>]
[-RequiredModuleSourceRepository <String>]
[-RequiredModuleSourceRepositoryUri <String>]
[-Tool <Auto|PSResourceGet|PowerShellGet|ManagedModule>]
[-Type <PowerShellGallery|GitHub>]
[-UnregisterRepositoryAfterPublish]
[-UseAsDependencyVersionSource]
[<CommonParameters>]
```

[#](#member-043c568fe30408abb748d18e)

Parameter set: `JFrog`

```
New-ConfigurationPublish
-AzureArtifactsFeed <String>
-AzureDevOpsOrganization <String>
[-AzureDevOpsProject <String>]
[-Enabled]
[-EnsureRepositoryRegistered <Boolean>]
[-Force]
[-ID <String>]
[-PublishRequiredModules]
[-RepositoryApiVersion <RepositoryApiVersion>]
[-RepositoryCredentialSecret <String>]
[-RepositoryCredentialSecretEnvironmentVariable <String>]
[-RepositoryCredentialSecretFilePath <String>]
[-RepositoryCredentialUserName <String>]
[-RepositoryName <String>]
[-RepositoryPriority <Int32>]
[-RepositoryTrusted <Boolean>]
[-RequiredModuleSourceRepository <String>]
[-RequiredModuleSourceRepositoryUri <String>]
[-Tool <Auto|PSResourceGet|PowerShellGet|ManagedModule>]
[-UnregisterRepositoryAfterPublish]
[-UseAsDependencyVersionSource]
[<CommonParameters>]
```

[#](#member-c40546d8e5dcfe68e1293dcb)

Parameter set: `AzureArtifacts`

```
New-ConfigurationPublish
[-ApiKey <String>]
[-Enabled]
[-FilePath <String>]
[-Force]
[-ID <String>]
-ProfileName <String>
[-PublishRequiredModules]
[-RepositoryCredentialSecret <String>]
[-RepositoryCredentialSecretEnvironmentVariable <String>]
[-RepositoryCredentialSecretFilePath <String>]
[-RepositoryCredentialUserName <String>]
[-RequiredModuleSourceRepository <String>]
[-RequiredModuleSourceRepositoryUri <String>]
[<CommonParameters>]
```

[#](#method-new-configurationpublish-string-switchparameter-string-switchparameter-string-string-switchparameter-string-string-string-string-string-string)

Parameter set: `Profile`

## Description

This cmdlet emits publish configuration consumed by Invoke-ModuleBuild / Build-Module. Use -Type to choose a destination. For repository publishing, -Tool selects the provider (PowerShellGet/PSResourceGet/ManagedModule/Auto).

For private repositories (for example Azure DevOps Artifacts, JFrog Artifactory, GitHub Packages, or private NuGet v3 feeds), provide repository URIs and (optionally) credentials, or use provider-specific preset parameters to resolve those URIs automatically. To avoid secrets in source control, pass API keys/tokens via -FilePath or environment-specific tooling.

JFrog Artifactory can be configured directly with -JFrogBaseUri and -JFrogRepository. For PAT/basic-auth feeds, use repository credentials only. Add -FilePath or -ApiKey only when the feed requires a separate NuGet API key for package push.

## Examples

### Publish to PowerShell Gallery (API key from file)

```powershell
New-ConfigurationPublish -Type PowerShellGallery -FilePath "$env:USERPROFILE\.secrets\psgallery.key" -Enabled
```

### Publish to GitHub Releases (token from file)

```powershell
New-ConfigurationPublish -Type GitHub -FilePath "$env:USERPROFILE\.secrets\github.token" -UserName 'EvotecIT' -RepositoryName 'MyModule' -Enabled
```

### Publish to Azure Artifacts (private feed preset)

```powershell
New-ConfigurationPublish -ProfileName 'Company' -Enabled
```

### Publish to JFrog Artifactory with PAT/basic authentication

```powershell
New-ConfigurationPublish -JFrogBaseUri 'https://company.jfrog.io/artifactory' -JFrogRepository 'powershell-virtual' -RepositoryName 'JFrogPS' -Tool PSResourceGet -RepositoryCredentialUserName 'name@company.com' -RepositoryCredentialSecretFilePath "$env:USERPROFILE\.secrets\jfrog-pat.txt" -Enabled
```

### Publish to JFrog Artifactory with a clear-text PAT for local testing

```powershell
New-ConfigurationPublish -JFrogBaseUri 'https://company.jfrog.io/artifactory' -JFrogRepository 'powershell-virtual' -RepositoryName 'JFrogPS' -Tool PSResourceGet -RepositoryCredentialUserName 'name@company.com' -RepositoryCredentialSecret 'temporary-pat' -Enabled
```

### Publish to JFrog Artifactory with a separate NuGet API key

```powershell
New-ConfigurationPublish -JFrogBaseUri 'https://company.jfrog.io/artifactory' -JFrogRepository 'powershell-virtual' -RepositoryName 'JFrogPS' -Tool PSResourceGet -FilePath "$env:USERPROFILE\.secrets\jfrog-nuget-api-key.txt" -RepositoryCredentialUserName 'name@company.com' -RepositoryCredentialSecretFilePath "$env:USERPROFILE\.secrets\jfrog-pat.txt" -Enabled
```

### Publish to JFrog Artifactory with a PAT/access token stored in an environment variable

```powershell
New-ConfigurationPublish -JFrogBaseUri 'https://company.jfrog.io/artifactory' -JFrogRepository 'powershell-virtual' -RepositoryName 'JFrogPS' -Tool PSResourceGet -RepositoryCredentialUserName 'name@company.com' -RepositoryCredentialSecretEnvironmentVariable 'JFROG_ACCESS_TOKEN' -Enabled
```

### Publish to JFrog Artifactory with CI OIDC token exchange

```powershell
New-ConfigurationPublish -JFrogBaseUri 'https://company.jfrog.io/artifactory' -JFrogRepository 'powershell-virtual' -RepositoryName 'JFrogPS' -Tool PSResourceGet -JFrogOidcProvider 'azure-oidc' -JFrogOidcProviderType Azure -JFrogOidcTokenIdEnvironmentVariable 'JFROG_CLI_OIDC_EXCHANGE_TOKEN_ID' -Enabled
```

### Publish missing RequiredModules into a private repository before publishing the module

```powershell
New-ConfigurationPublish -JFrogBaseUri 'https://company.jfrog.io/artifactory' -JFrogRepository 'powershell-virtual' -RepositoryName 'JFrogPS' -Tool PSResourceGet -RepositoryCredentialUserName 'name@company.com' -RepositoryCredentialSecretEnvironmentVariable 'JFROG_ACCESS_TOKEN' -PublishRequiredModules -RequiredModuleSourceRepository PSGallery -Enabled
```

## Parameters

**-DoNotMarkAsPreRelease SwitchParameter optionalsets: ApiFromFile, ApiKey**

Publish GitHub release as a release even if module prerelease is set.

**-Enabled SwitchParameter optional**

Enable publishing to the chosen destination.

**-EnsureRepositoryRegistered Boolean optionalsets: ApiFromFile, ApiKey, JFrog, AzureArtifacts**

When true, registers/updates the repository before publishing. Default: true.

**-FilePath String optionalsets: ApiFromFile, JFrog, Profile**

API key to be used for publishing in clear text in a file. For JFrog, use this only when the feed requires a separate NuGet API key.

**-Force SwitchParameter optional**

Allow publishing lower version of a module on a PowerShell repository.

**-GenerateReleaseNotes SwitchParameter optionalsets: ApiFromFile, ApiKey**

When set, asks GitHub to generate release notes automatically.

**-ID String optional**

Optional ID of the artefact used for publishing.

**-OverwriteTagName String optionalsets: ApiFromFile, ApiKey**

Override tag name used for GitHub publishing.

**-PublishRequiredModules SwitchParameter optional**

When set, publishes missing manifest RequiredModules to the target repository before publishing the main module.

**-ReplaceExistingAssets SwitchParameter optionalsets: ApiFromFile, ApiKey**

Replace same-name assets when deliberately reusing an existing GitHub release.

**-RepositoryApiVersion RepositoryApiVersion optionalsets: ApiFromFile, ApiKey, JFrog, AzureArtifacts**

Repository API version for PSResourceGet registration (v2/v3).

Possible values: `Auto`, `V2`, `V3`, `ContainerRegistry`, `Local`, `NugetServer`

**-RepositoryCredentialSecret String optional**

Repository credential secret (password/token) in clear text. For JFrog PAT/basic-auth flows, this is the PAT or access token.

**-RepositoryCredentialSecretEnvironmentVariable String optional**

Environment variable containing the repository credential secret (password/token). For JFrog PAT/access-token flows, this can be JFROG_ACCESS_TOKEN or a CI secret variable.

**-RepositoryCredentialSecretFilePath String optional**

Repository credential secret (password/token) in a clear-text file. For JFrog PAT/basic-auth flows, prefer this over inline token values.

**-RepositoryCredentialUserName String optional**

Repository credential username (basic auth). For JFrog PAT/basic-auth flows, this is the JFrog user name or email.

**-RepositoryName String optionalsets: ApiFromFile, ApiKey, JFrog, AzureArtifacts**

Repository name override (GitHub or PowerShell repository name).

**-RepositoryPriority Int32 optionalsets: ApiFromFile, ApiKey, JFrog, AzureArtifacts**

Repository priority for PSResourceGet (lower is higher priority).

**-RepositoryPublishUri String optionalsets: ApiFromFile, ApiKey, JFrog**

Repository publish URI (PowerShellGet PublishLocation).

**-RepositorySourceUri String optionalsets: ApiFromFile, ApiKey, JFrog**

Repository source URI (PowerShellGet SourceLocation).

**-RepositoryTrusted Boolean optionalsets: ApiFromFile, ApiKey, JFrog, AzureArtifacts**

Whether to mark the repository as trusted (avoids prompts). Default: true.

**-RepositoryUri String optionalsets: ApiFromFile, ApiKey, JFrog**

Repository base URI (used for both source and publish unless overridden).

**-RequiredModuleSourceRepository String optional**

Repository used as the source for publishing missing RequiredModules. Defaults to PSGallery.

**-RequiredModuleSourceRepositoryUri String optional**

Repository URL or local feed path used by managed publishing as the source for missing RequiredModules.

**-ReuseExistingRelease SwitchParameter optionalsets: ApiFromFile, ApiKey**

Explicitly reuse an existing GitHub release when its tag is already occupied.

**-Tool PublishTool optionalsets: ApiFromFile, ApiKey, JFrog, AzureArtifacts**

Publishing tool/provider used for repository publishing. Ignored for GitHub publishing.

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

**-Type PublishDestination required in ApiFromFile, ApiKeysets: ApiFromFile, ApiKey, JFrog**

Choose between PowerShellGallery and GitHub.

Possible values: `PowerShellGallery`, `GitHub`

**-UnregisterRepositoryAfterPublish SwitchParameter optionalsets: ApiFromFile, ApiKey, JFrog, AzureArtifacts**

When set, unregisters the repository after publish if it was created by this run.

**-UseAsDependencyVersionSource SwitchParameter optionalsets: ApiFromFile, ApiKey, JFrog, AzureArtifacts**

Use this PowerShell repository as the source for resolving Auto/Latest dependency versions.

**-UserName String optionalsets: ApiFromFile, ApiKey**

GitHub username (required for GitHub publishing).

**-ApiKey String optionalsets: ApiKey, JFrog, Profile**

API key to be used for publishing in clear text. For JFrog, use this only when the feed requires a separate NuGet API key.

**-JFrogBaseUri String requiredsets: JFrog**

JFrog Artifactory base URI, for example https://company.jfrog.io/artifactory. PowerShellGet and PSResourceGet URLs are derived automatically.

**-JFrogOidcProvider String optionalsets: JFrog**

JFrog OIDC provider name configured in Artifactory. Enables runtime token exchange through JFrog CLI.

**-JFrogOidcProviderType JFrogOidcProviderType optionalsets: JFrog**

JFrog OIDC provider implementation passed to JFrog CLI. Use Azure for Azure DevOps or Entra-backed OIDC mappings.

Possible values: `GitHub`, `Azure`, `GenericOidc`

**-JFrogOidcTokenId String optionalsets: JFrog**

CI-issued OIDC token value used by JFrog CLI token exchange. Prefer JFrogOidcTokenIdEnvironmentVariable in CI.

**-JFrogOidcTokenIdEnvironmentVariable String optionalsets: JFrog**

Environment variable containing the CI-issued OIDC token value used by JFrog CLI token exchange.

**-JFrogPlatformUri String optionalsets: JFrog**

JFrog Platform URL used for JFrog CLI OIDC token exchange. Defaults from JFrogBaseUri when omitted.

**-JFrogRepository String requiredsets: JFrog**

JFrog NuGet repository key used to derive PowerShellGet and PSResourceGet endpoints, for example powershell-virtual.

**-AzureArtifactsFeed String requiredsets: AzureArtifacts**

Azure Artifacts feed name for the private gallery preset.

**-AzureDevOpsOrganization String requiredsets: AzureArtifacts**

Azure DevOps organization name for the Azure Artifacts preset.

**-AzureDevOpsProject String optionalsets: AzureArtifacts**

Optional Azure DevOps project name for project-scoped feeds.

**-ProfileName String requiredaliases: Profilesets: Profile**

Saved private gallery profile name for Azure Artifacts publishing.

## 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).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:3427437B255F374A3DA33534A2E96EFACD05E0E644F7E8244043A67E91DC2D8E -->
