PSYeelight.psm1

# script:variable
$script:PSModuleRoot = $PSScriptRoot
$script:LibraryPath = Join-Path -Path $script:PSModuleRoot -ChildPath 'lib'
$script:BinaryPath = Join-Path -Path $script:PSModuleRoot -ChildPath 'bin'

# load YeelightAPI
# Add-Type -Path (Join-Path -Path $script:LibraryPath -ChildPath '\netstandard2.0\YeelightAPI.dll')
$Path = (Join-Path -Path $script:LibraryPath -ChildPath '\netstandard2.0\YeelightAPI.dll')
[System.Reflection.Assembly]::LoadFile($Path)

# array to all connections
$script:connections = New-Object System.Collections.ArrayList

# load function
Get-ChildItem "$PSScriptRoot\public\*.ps1" | ForEach-Object {
    . $_.FullName
}

Get-ChildItem "$PSScriptRoot\private\*.ps1" | ForEach-Object {
    . $_.FullName
}