AppVentiX.psm1

<#
    .SYNOPSIS
        This PowerShell module, named AppVentiX, provides functions for managing AppVentiX application deployment.
 
    .NOTES
        Module : AppVentiX
        Author : John Billekens
        Copyright: Copyright (c) AppVentiX
#>

#Unblock files
Get-ChildItem -Path $PSScriptRoot | Unblock-File

# Get public and private function definition files.
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction Ignore )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction Ignore )

# Dot source the files
Foreach ($import in @($Public + $Private)) {
    Try {
        . $import.fullname
    } Catch {
        Write-Error -Message "Failed to import function $($import.fullname): $_"
    }
}

#Set module specific variables
$AppVentiX = [ordered]@{
    PublishingTasksFilename     = 'AppVentiX-PublishingTasks.xml'
    PackageOptionsFilename      = 'AppVentiX-PackageOptions.xml'
    MachineGroupsFilename       = 'AppVentiX-MachineGroups.xml'
    CentralViewSettingsFilename = "${Env:PROGRAMDATA}\AppVentiX-CentralView\Settings.xml"
    ConfigShare                 = $null
    LicenseValid                = $false
}

New-Variable -Name DynDnsSession -Value $AppVentiX -Scope Script -Force

if ($Script:AppVentiX.ConfigShare = (Get-AppVentiXConfigShare).ConfigShare) {
    Test-AppVentiXIsLicensed -ConfigShare $Script:AppVentiX.ConfigShare | Out-Null
}