Skip to content

Add-AzDoVariableGroupVariable#

SYNOPSIS#

This script adds variables to variable groups in a given project.

SYNTAX#

Add-AzDoVariableGroupVariable [-CollectionUri] <String> [-ProjectName] <String> [-VariableGroupName] <String>
 [-Variables] <Hashtable> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION#

This script adds variables to variable groups in a given project. When used in a pipeline, you can use the pre defined CollectionUri, ProjectName and AccessToken (PAT) variables.

EXAMPLES#

EXAMPLE 1#

$splat = @{
    CollectionUri     = 'https://dev.azure.com/ChristianPiet0452/'
    ProjectName       = 'Ditproject'
    VariableGroupName = @('Group1', 'Group2')
    Variables         = @{
        test = @{
            value = 'test'
        }
        kaas = @{
            value = 'kaas'
        }
    }
}

Add-AzDoVariableGroupVariable @splat

This example creates a new Variable Group with a variable "test = test".

EXAMPLE 2#

$splat = @{
    CollectionUri     = 'https://dev.azure.com/ChristianPiet0452/'
    ProjectName       = 'Ditproject'
    VariableGroupName = @('Group1', 'Group2')
}
Get-AzDoVariableGroup @splat | Add-AzDoVariableGroupVariable -Variables @{ test = @{ value = 'test' } }

This example creates a few new Variable Groups with a variable "test = test".

PARAMETERS#

-CollectionUri#

Collection Uri of the organization

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ProjectName#

Project where the variable group has to be created

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-VariableGroupName#

Name of the variable group

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Variables#

Variable names and values

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-WhatIf#

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm#

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction#

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters#

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS#

OUTPUTS#

PSObject#

NOTES#