Ntfy.psm1

function CheckForUpdates {

    try {
        $moduleName = "Ntfy"
        $installedModule = Get-InstalledModule -Name $moduleName
        $latestModule = Find-Module -Name $moduleName | Sort-Object -Property Version -Descending | Select-Object -First 1
        $installedVersion = [version]$installedModule.Version
        $latestVersion = [version]$latestModule.Version

        if ($latestVersion -gt $installedVersion) 
        {
            $ReleaseNotes=(Find-Module -Name "Ntfy" -Repository PSGallery).ReleaseNotes
            Write-Host "An update is available for this module;"
            Write-host "Latest version: $($latestModule.Version)" -ForegroundColor Yellow
            Write-Host "Release Notes: $ReleaseNotes" -ForegroundColor Yellow
        } 
    } 
    catch {
        #Write-Host "Error checking"
    }
}  

Import-Module $PSScriptRoot\Functions.psm1

#CheckForUpdates