Skip to content

Commit

Permalink
try and access azure var group
Browse files Browse the repository at this point in the history
  • Loading branch information
cal-nic committed Aug 19, 2024
1 parent a6e900e commit b657354
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/update_script_environment_variables.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ function GetMetadataVariables {
# $variablesFromMetadata = Invoke-RestMethod http://metadata.google.internal/computeMetadata/v1/instance/attributes/?recursive=true -Headers @{ "Metadata-Flavor" = "Google" }
# return $variablesFromMetadata | Get-Member -MemberType NoteProperty

$variableGroupName = $env:VarGroup # Get the variable group name from the pipeline parameter
$variableGroupId = $env:PARAMETERS.VarGroup.Id

$variableGroup = Get-AzDevOpsVariableGroup -Id $variableGroupId
$variableGroupName = $variableGroup.name

LogInfo("Variable group name: $variableGroupName")
# Get variable names and values from the environment variables
$variables = Get-ChildItem Env: | Where-Object { $_.Name -like "$variableGroupName.*" } | ForEach-Object {
Expand Down

0 comments on commit b657354

Please sign in to comment.