public/Get-OSDeployModuleVersion.ps1

function Get-OSDeployModuleVersion {
    <#
    .SYNOPSIS
        Returns the version of the OSDeploy module
 
    .DESCRIPTION
        Returns the currently loaded version of the OSDeploy module as a System.Version object.
        This is useful for version checks, logging, and compatibility validation in scripts.
 
    .EXAMPLE
        PS> Get-OSDeployModuleVersion
 
        Returns the version of the currently loaded OSDeploy module as a System.Version object.
 
    .EXAMPLE
        PS> (Get-OSDeployModuleVersion) -ge [System.Version]'26.8.0'
 
        Tests whether the currently loaded OSDeploy module is version 26.8.0 or later.
 
    .INPUTS
        None. This function does not accept pipeline input.
 
    .OUTPUTS
        System.Version. Returns the version of the OSDeploy module.
 
    .NOTES
        Author: David Segura
        Company: Recast Software
        Version: 1.0.0
        Date: 2026-08-28
 
        Requires the OSDeploy module to be loaded.
    #>

    [CmdletBinding()]
    [OutputType([System.Version])]
    param ()

    Write-HostOSDeployBanner
    $MyInvocation.MyCommand.Module.Version
}