diff --git a/plugins/geenforce/client/ShopdbEnforceClient.psm1 b/plugins/geenforce/client/ShopdbEnforceClient.psm1 index 18492d6..a84d2d5 100644 --- a/plugins/geenforce/client/ShopdbEnforceClient.psm1 +++ b/plugins/geenforce/client/ShopdbEnforceClient.psm1 @@ -58,11 +58,13 @@ function Sync-ShopdbManifest { -TimeoutSec 30 -ErrorAction Stop if ($response.StatusCode -eq 200) { [System.IO.File]::WriteAllText($manifestPath, $response.Content) - if ($response.Headers.ETag) { - Set-Content -LiteralPath $etagPath -Value $response.Headers.ETag -NoNewline + # PowerShell 7 returns header values as string arrays; 5.1 as scalars. + # @(...)[0] yields a clean scalar in both. + $etag = @($response.Headers['ETag'])[0] + if ($etag) { + Set-Content -LiteralPath $etagPath -Value $etag -NoNewline } - $version = $null - if ($response.Headers['X-Manifest-Version']) { $version = $response.Headers['X-Manifest-Version'] } + $version = @($response.Headers['X-Manifest-Version'])[0] if ($version) { Set-Content -LiteralPath (Join-Path $CacheDir "$Scope.version") -Value $version -NoNewline }