# Step-Version

Steps a version based on an expected version pattern (supports the legacy X placeholder).

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

`System.String` `PowerForge.ModuleVersionStepResult`

Steps a version based on an expected version pattern (supports the legacy X placeholder).

## Syntax

```
Step-Version
[-Advanced]
-ExpectedVersion <String>
[-LocalPSD1 <String>]
[-Module <String>]
[<CommonParameters>]
```

[#](#method-step-version-switchparameter-string-string-string)

Parameter set: `All Parameter Sets`

## Description

This cmdlet supports two common workflows:

When -ExpectedVersion contains an X placeholder (e.g. 1.2.X), the cmdlet resolves the next patch version. When an exact version is provided, it is returned as-is.

## Examples

### Step a version using a local module manifest

```powershell
Step-Version -ExpectedVersion '1.0.X' -LocalPSD1 'C:\Git\MyModule\MyModule.psd1'
```

Reads the current version from the PSD1 and returns the next patch version.

### Return the full step result object

```powershell
Step-Version -ExpectedVersion '1.0.X' -LocalPSD1 '.\MyModule.psd1' -Advanced
```

Returns a structured object that includes whether auto-versioning was used.

### Step based on the latest published module

```powershell
Step-Version -ExpectedVersion '1.0.X' -Module 'MyModule'
```

Resolves the next patch version by looking up the current version of the module.

## Parameters

**-Advanced SwitchParameter optional**

When set, returns a typed result instead of only the version string.

**-ExpectedVersion String required**

Expected version (exact or pattern like 0.1.X).

**-LocalPSD1 String optional**

Optional local PSD1 path used to resolve current version.

**-Module String optional**

Optional module name used to resolve current version from PSGallery.

## 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:ADDC98CB9FF6D61DCE8F59DAC2AE00EAA3D91F8BD39894331450F435EF310427 -->
