Fix threading issue in cmdlets

- Fixed threading issue in cmdlets that was causing 'WriteObject and WriteError methods cannot be called from outside the overrides' error
- Changed module structure to use DLL as root module instead of nested module
- Updated configuration cmdlets to properly handle async operations
This commit is contained in:
GraceSolutions
2025-04-15 09:24:51 -04:00
parent 68e6819131
commit 7535135bfd
19 changed files with 229 additions and 30 deletions
@@ -0,0 +1,13 @@
# Load the main assembly directly
$mainDllPath = Join-Path $PSScriptRoot "lib\PSOPNSenseAPI.dll"
Write-Verbose "Loading assembly from $mainDllPath"
try {
Add-Type -Path $mainDllPath
Write-Verbose "Successfully loaded assembly from $mainDllPath"
} catch {
$errorMessage = $_.Exception.Message
Write-Error "Failed to load assembly from $($mainDllPath): $($errorMessage)"
throw
}