Private/Test-GetModule.ps1
<#
.SYNOPSIS Checks, whether specified module is loaded. #> function Test-GetModule { [CmdLetBinding()] [OutputType([bool])] param ( [Parameter(Mandatory = $true, HelpMessage = "Exact name of the mmodule")] [string] $Name, [Parameter(Mandatory = $false, HelpMessage = "Minimum required module version")] [Version] $RequiredVersion ) $ErrorActionPreference = 'Stop' $module = Get-Module -Name $Name -ea SilentlyContinue; return ($null -ne $module -and ([string]::IsNullOrEmpty($RequiredVersion) -or $module.version -ge $RequiredVersion)) } |