fix(ci): remove PSProxmoxVE.deps.json to fix assembly loading in PS 7.x

The deps.json file causes .NET's AssemblyLoadContext to conflict with
PowerShell's own runtime assembly resolution, resulting in
FileNotFoundException for System.Runtime 9.0.0.0 on all PS 7.x
platforms. Binary PS modules should not include deps.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-19 08:36:49 -05:00
parent d187b0de52
commit 8d268aee61
3 changed files with 12 additions and 0 deletions
+5
View File
@@ -44,4 +44,9 @@ if ($null -eq $moduleDll) {
throw "PSProxmoxVE.dll not found. Build the project before running Pester tests."
}
# Remove deps.json if present — it causes assembly resolution conflicts
# when loading a binary module inside PowerShell's own .NET runtime.
$depsJson = Join-Path (Split-Path $moduleDll) 'PSProxmoxVE.deps.json'
if (Test-Path $depsJson) { Remove-Item $depsJson -Force }
Import-Module $moduleDll -Force -ErrorAction Stop