Skip to content

Commit 2f3a2ff

Browse files
committed
fix: Enhance variable output formatting in New-AzDoVariableGroup function for improved readability
1 parent ccc53b2 commit 2f3a2ff

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

AzureDevOpsPowerShell/Public/Api/DistributedTask/VariableGroups/New-AzDoVariableGroup.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,18 @@ function New-AzDoVariableGroup {
9797
if ($PSCmdlet.ShouldProcess($ProjectName, "Create Variable Group named: $($PSStyle.Bold)$name$($PSStyle.Reset)")) {
9898
try {
9999
($body | Invoke-AzDoRestMethod @params) | ForEach-Object {
100+
$variablesObject = $_.variables | ConvertTo-Json -Depth 10 | ConvertFrom-Json -AsHashtable -Depth 10
101+
102+
$variablesOutput = @{}
103+
foreach ($item in $variablesObject.GetEnumerator()) {
104+
$variablesOutput[$item.Key] = $item.value.value
105+
}
100106
[PSCustomObject]@{
101107
CollectionURI = $CollectionUri
102108
ProjectName = $ProjectName
103109
VariableGroupName = $_.name
104110
VariableGroupId = $_.id
105-
Variables = $_.variables
111+
Variables = $variablesOutput
106112
CreatedOn = $_.createdOn
107113
IsShared = $_.isShared
108114
}

0 commit comments

Comments
 (0)