File tree Expand file tree Collapse file tree
AzureDevOpsPowerShell/Public/Api
DistributedTask/VariableGroups Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,13 @@ function Get-AzDoVariableGroup {
6060 } catch {
6161 $PSCmdlet.ThrowTerminatingError ((Write-AzDoError - Message " Failed to get variable groups from $ProjectName in $CollectionUri Error: $_ " ))
6262 }
63- $variableGroups | Where-Object { -not $VariableGroupName -or $_.Name -in $VariableGroupName } | ForEach-Object {
63+ $filteredGroups = if ($VariableGroupName ) {
64+ $variableGroups | Where-Object { $_.Name -in $VariableGroupName }
65+ } else {
66+ $variableGroups
67+ }
68+
69+ $filteredGroups | ForEach-Object {
6470 $variablesObject = $_.variables | ConvertTo-Json - Depth 10 | ConvertFrom-Json - AsHashtable - Depth 10
6571
6672 $variablesOutput = @ {}
@@ -71,11 +77,11 @@ function Get-AzDoVariableGroup {
7177 [PSCustomObject ]@ {
7278 CollectionURI = $CollectionUri
7379 ProjectName = $ProjectName
74- VariableGroupName = $_.name
75- VariableGroupId = $_.id
80+ VariableGroupName = $_.Name
81+ VariableGroupId = $_.Id
7682 Variables = $variablesOutput
77- CreatedOn = $_.createdOn
78- IsShared = $_.isShared
83+ CreatedOn = $_.CreatedOn
84+ IsShared = $_.IsShared
7985 }
8086 }
8187 } else {
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ function Set-AzDoWorkItem {
5151 [string ]
5252 $ProjectName ,
5353
54+ # Work item to update
5455 [Parameter (Mandatory , ValueFromPipelineByPropertyName )]
5556 [object []]
5657 $WorkItem
You can’t perform that action at this time.
0 commit comments