mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
35 lines
844 B
PowerShell
35 lines
844 B
PowerShell
<#
|
|
.SYNOPSIS
|
|
Get the version of an installed PowerShell Module
|
|
.DESCRIPTION
|
|
Get the version of an installed PowerShell Module
|
|
.FUNCTIONALITY
|
|
Get the version of an installed PowerShell Module
|
|
.EXAMPLE
|
|
PS>Get-IcingaPowerShellModuleVersion -ModuleName 'icinga-powershell-framework';
|
|
.EXAMPLE
|
|
PS>Get-IcingaPowerShellModuleVersion -ModuleName 'icinga-powershell-plugins';
|
|
.PARAMETER ModuleName
|
|
The PowerShell module to fetch the installed version from
|
|
.INPUTS
|
|
System.String
|
|
.OUTPUTS
|
|
System.String
|
|
.LINK
|
|
https://github.com/Icinga/icinga-powershell-framework
|
|
#>
|
|
|
|
function Get-IcingaPowerShellModuleVersion()
|
|
{
|
|
param(
|
|
$ModuleName
|
|
);
|
|
|
|
$ModuleDetails = Get-Module -ListAvailable $ModuleName;
|
|
|
|
if ($null -eq $ModuleDetails) {
|
|
return $null;
|
|
}
|
|
|
|
return $ModuleDetails.PrivateData.Version;
|
|
}
|