Skip to content

ConvertTo-NetboxVersion

Since

v4.4.10.0

SYNOPSIS

Parses Netbox version strings to [System.Version] objects.

SYNTAX

ConvertTo-NetboxVersion [-VersionString] <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Extracts semantic version from Netbox version strings that may contain additional metadata (e.g., "4.2.9-Docker-3.2.1" -> "4.2.9").

This is a central helper function used throughout the module to ensure consistent version parsing behavior.

EXAMPLES

EXAMPLE 1

``` ConvertTo-NetboxVersion -VersionString "4.4.8"

Returns: [version]"4.4.8"

```

EXAMPLE 2

``` ConvertTo-NetboxVersion -VersionString "4.2.9-Docker-3.2.1"

Returns: [version]"4.2.9"

```

EXAMPLE 3

``` ConvertTo-NetboxVersion -VersionString "v4.4.9-dev"

Returns: [version]"4.4.9"

```

EXAMPLE 4

``` "4.4.8" | ConvertTo-NetboxVersion

Pipeline support - Returns: [version]"4.4.8"

```

PARAMETERS

-VersionString

The raw version string from Netbox API (e.g., from Get-NBVersion).

```yaml Type: String Parameter Sets: (All) Aliases:

Required: True Position: 1 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ```

-ProgressAction

{{ Fill ProgressAction Description }}

```yaml Type: ActionPreference Parameter Sets: (All) Aliases: proga

Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Version or $null if parsing fails

NOTES

AddedInVersion: v4.4.10.0 Resolves issue #111: Version detection inconsistency

Common parameters

common request params