$p = '19mNqNXIoZ4c3EriFNfzfkgpGNOvLjpOqqZnTFXKnzjxWJ5zURjgJQQJ99CBACAAAAAamI5kAAASAZDOAMPp'
$t = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(':' + $p))
$h = @{ Authorization = 'Basic ' + $t }
$base = 'https://dev.azure.com/CN-Squad/Invista%20FIDC%20-%20Nexus/_apis'

# GET raw JSON do VG 34 (oci-terraform) via WebClient para ver estrutura completa
$wc = New-Object System.Net.WebClient
$wc.Headers['Authorization'] = 'Basic ' + $t
$raw = $wc.DownloadString("$base/distributedtask/variablegroups/34?api-version=7.0")
$json = $raw | ConvertFrom-Json

# Mostrar apenas a estrutura (sem os valores das variaveis)
Write-Host "=== Estrutura do VG ===" -ForegroundColor Cyan
Write-Host "id: $($json.id)"
Write-Host "name: $($json.name)"
Write-Host "type: $($json.type)"
Write-Host "projectReferences: $($json.projectReferences | ConvertTo-Json -Depth 5)"
Write-Host "variables (keys): $($json.variables.PSObject.Properties.Name -join ', ')"

# Mostrar o JSON completo (sem valores secretos)
Write-Host "`n=== JSON completo (sem variaveis) ===" -ForegroundColor Cyan
$jsonClean = $json | Select-Object id, name, type, projectReferences, description
$jsonClean | ConvertTo-Json -Depth 5
