Skip to content

Get‑ModuleVersion

viscalyxbot edited this page Feb 28, 2025 · 1 revision

SYNOPSIS

Retrieves the version of a PowerShell module.

SYNTAX

Get-ModuleVersion [-Module] <Object> [<CommonParameters>]

DESCRIPTION

The Get-ModuleVersion command retrieves the version of a PowerShell module. It accepts a module name or a PSModuleInfo object as input and returns the module version as a string.

EXAMPLES

EXAMPLE 1

Get-ModuleVersion -Module 'MyModule'

Retrieves the version of the module named "MyModule".

EXAMPLE 2

$moduleInfo = Get-Module -Name 'MyModule'
Get-ModuleVersion -Module $moduleInfo

Retrieves the version of the module specified by the PSModuleInfo object $moduleInfo.

PARAMETERS

-Module

Specifies the module for which to retrieve the version. This can be either a module name or a PSModuleInfo object.

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
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

[System.Object]

Accepts a module name or a PSModuleInfo object as input.

OUTPUTS

[System.String]

Returns the module version as a string.

NOTES

RELATED LINKS

Clone this wiki locally