From cc344a30707e3c0e8b93e8d6c00b4f1fa04d2f55 Mon Sep 17 00:00:00 2001 From: Clint Branham Date: Thu, 19 Mar 2026 10:00:18 -0500 Subject: [PATCH] fix(test): replace null-coalescing operator for PS 5.1 compatibility PS 5.1 cannot parse the ?? operator (PS 7.0+), causing a discovery error even though integration tests are excluded by tag. Replace with if/else that works on all PS versions. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 b/tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 index f3a7796..2cb7fc5 100644 --- a/tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 +++ b/tests/PSProxmoxVE.Tests/Integration/Integration.Tests.ps1 @@ -55,7 +55,8 @@ BeforeAll { # Convenience accessors (only meaningful when SkipReason is null) $script:Host_ = [System.Environment]::GetEnvironmentVariable('PVETEST_HOST') - $script:Port = [int]([System.Environment]::GetEnvironmentVariable('PVETEST_PORT') ?? '8006') + $portEnv = [System.Environment]::GetEnvironmentVariable('PVETEST_PORT') + $script:Port = [int]$(if ($portEnv) { $portEnv } else { '8006' }) $script:ApiToken = [System.Environment]::GetEnvironmentVariable('PVETEST_APITOKEN') $script:Node = [System.Environment]::GetEnvironmentVariable('PVETEST_NODE') $script:Storage = [System.Environment]::GetEnvironmentVariable('PVETEST_STORAGE')