18 lines
894 B
PowerShell
18 lines
894 B
PowerShell
$p = '19mNqNXIoZ4c3EriFNfzfkgpGNOvLjpOqqZnTFXKnzjxWJ5zURjgJQQJ99CBACAAAAAamI5kAAASAZDOAMPp'
|
|
$t = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(':' + $p))
|
|
$h = @{ Authorization = 'Basic ' + $t; 'Content-Type' = 'application/json' }
|
|
$base = 'https://dev.azure.com/CN-Squad/Invista%20FIDC%20-%20Nexus/_apis'
|
|
$repoId = 'ae7542f8-d76e-4a45-b8b2-745e18cd2f26'
|
|
|
|
$script = Invoke-RestMethod -Uri "$base/git/repositories/$repoId/items?path=/cd/scripts/oci_kubeconfig.sh`&versionDescriptor.version=main`&api-version=7.0" -Headers $h
|
|
$lines = $script -split "`n"
|
|
# Pegar as linhas que mencionam CLUSTER_ID
|
|
for ($i = 0; $i -lt $lines.Count; $i++) {
|
|
if ($lines[$i] -match 'CLUSTER_ID|oke-clusters|OKE_CLUSTER') {
|
|
$from = [Math]::Max(0, $i - 1)
|
|
$to = [Math]::Min($lines.Count - 1, $i + 3)
|
|
Write-Host "--- linha $($i+1) ---"
|
|
$lines[$from..$to] -join "`n"
|
|
Write-Host ""
|
|
}
|
|
}
|