From ee60fae4395b8df30611cc02d23b044e38da7e52 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Fri, 21 Jun 2019 01:26:23 -0500 Subject: [PATCH 01/18] Initial implementation of VariableGroups --- Source/Classes/VSTeamVersions.ps1 | 1 + Source/Private/applyTypes.ps1 | 19 ++++- Source/Public/Add-VSTeamVariableGroup.ps1 | 47 +++++++++++ Source/Public/Get-VSTeamVariableGroup.ps1 | 37 +++++++++ Source/Public/Remove-VSTeamVariableGroup.ps1 | 28 +++++++ Source/Public/Update-VSTeamVariableGroup.ps1 | 56 +++++++++++++ Source/VSTeam.psd1 | 12 ++- Source/formats/variablegroups.format.ps1xml | 82 ++++++++++++++++++++ Source/types/variablegroups.ps1xml | 17 ++++ integration/test/010_projects.Tests.ps1 | 33 ++++++++ 10 files changed, 326 insertions(+), 6 deletions(-) create mode 100644 Source/Public/Add-VSTeamVariableGroup.ps1 create mode 100644 Source/Public/Get-VSTeamVariableGroup.ps1 create mode 100644 Source/Public/Remove-VSTeamVariableGroup.ps1 create mode 100644 Source/Public/Update-VSTeamVariableGroup.ps1 create mode 100644 Source/formats/variablegroups.format.ps1xml create mode 100644 Source/types/variablegroups.ps1xml diff --git a/Source/Classes/VSTeamVersions.ps1 b/Source/Classes/VSTeamVersions.ps1 index bfb681efb..8ee76edfa 100644 --- a/Source/Classes/VSTeamVersions.ps1 +++ b/Source/Classes/VSTeamVersions.ps1 @@ -7,6 +7,7 @@ class VSTeamVersions { static [string] $Core = '3.0' static [string] $Git = '3.0' static [string] $DistributedTask = '3.0-preview' + static [string] $VariableGroups = '5.0-preview.1' static [string] $Tfvc = '3.0' static [string] $Packaging = '' static [string] $MemberEntitlementManagement = '' diff --git a/Source/Private/applyTypes.ps1 b/Source/Private/applyTypes.ps1 index 9832e2229..eecacbffd 100644 --- a/Source/Private/applyTypes.ps1 +++ b/Source/Private/applyTypes.ps1 @@ -27,8 +27,8 @@ function _applyTypesToWorkItem { function _applyTypesToUser { param( - [Parameter(Mandatory = $true)] - $item + [Parameter(Mandatory = $true)] + $item ) $item.PSObject.TypeNames.Insert(0, 'Team.UserEntitlement') @@ -199,4 +199,17 @@ function _applyTypesToServiceEndpointType { $dataSource.PSObject.TypeNames.Insert(0, 'Team.DataSource') } } -} \ No newline at end of file +} + +function _applyTypesToVariableGroup { + param($item) + + $item.PSObject.TypeNames.Insert(0, 'Team.VariableGroup') + + $item.createdBy.PSObject.TypeNames.Insert(0, 'Team.User') + $item.modifiedBy.PSObject.TypeNames.Insert(0, 'Team.User') + if ($item.PSObject.Properties.Match('providerData').count -gt 0 -and $null -ne $item.providerData) { + $item.providerData.PSObject.TypeNames.Insert(0, 'Team.ProviderData') + } + $item.variables.PSObject.TypeNames.Insert(0, 'Team.Variables') +} diff --git a/Source/Public/Add-VSTeamVariableGroup.ps1 b/Source/Public/Add-VSTeamVariableGroup.ps1 new file mode 100644 index 000000000..ffcfe19a5 --- /dev/null +++ b/Source/Public/Add-VSTeamVariableGroup.ps1 @@ -0,0 +1,47 @@ +function Add-VSTeamVariableGroup { + [CmdletBinding(DefaultParameterSetName = 'Secure')] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $variableGroupName, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [ValidateSet('Vsts', 'AzureKeyVault')] + [string] $variableGroupType, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $variableGroupDescription, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [hashtable] $variableGroupVariables, + + [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)] + [hashtable] $variableGroupProviderData = $null + ) + + DynamicParam { + _buildProjectNameDynamicParam + } + + Process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters["ProjectName"] + + $body = @{ + name = $variableGroupName + type = $variableGroupType + description = $variableGroupDescription + variables = $variableGroupVariables + } + if ($null -ne $variableGroupProviderData) { + $body.Add("providerData", $variableGroupProviderData) + } + + $body = $body | ConvertTo-Json + + # Call the REST API + $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' ` + -Method Post -ContentType 'application/json' -body $body -Version $([VSTeamVersions]::VariableGroups) + + return Get-VSTeamVariableGroup -ProjectName $ProjectName -id $resp.id + } +} \ No newline at end of file diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 new file mode 100644 index 000000000..1fa8bb75d --- /dev/null +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -0,0 +1,37 @@ +function Get-VSTeamVariableGroup { + [CmdletBinding(DefaultParameterSetName = 'List')] + param( + [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $id + ) + + DynamicParam { + _buildProjectNameDynamicParam + } + + Process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters["ProjectName"] + + if ($id) { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` + -Version $([VSTeamVersions]::DistributedTask) -Id $id + + _applyTypesToVariableGroup -item $resp + + Write-Output $resp + } else { + # Call the REST API + $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` + -Version $([VSTeamVersions]::VariableGroups) + + # Apply a Type Name so we can use custom format view and custom type extensions + foreach ($item in $resp.value) { + _applyTypesToVariableGroup -item $item + } + + return $resp.value + } + } +} \ No newline at end of file diff --git a/Source/Public/Remove-VSTeamVariableGroup.ps1 b/Source/Public/Remove-VSTeamVariableGroup.ps1 new file mode 100644 index 000000000..2536d3680 --- /dev/null +++ b/Source/Public/Remove-VSTeamVariableGroup.ps1 @@ -0,0 +1,28 @@ +function Remove-VSTeamVariableGroup { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string[]] $id, + + [switch] $Force + ) + + DynamicParam { + _buildProjectNameDynamicParam + } + + Process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters["ProjectName"] + + foreach ($item in $id) { + if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Variable Group")) { + # Call the REST API + _callAPI -projectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $item ` + -Method Delete -Version $([VSTeamVersions]::VariableGroups) | Out-Null + + Write-Output "Deleted variable group $item" + } + } + } +} \ No newline at end of file diff --git a/Source/Public/Update-VSTeamVariableGroup.ps1 b/Source/Public/Update-VSTeamVariableGroup.ps1 new file mode 100644 index 000000000..10b9ee524 --- /dev/null +++ b/Source/Public/Update-VSTeamVariableGroup.ps1 @@ -0,0 +1,56 @@ +function Update-VSTeamVariableGroup { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $id, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $variableGroupName, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [ValidateSet('Vsts', 'AzureKeyVault')] + [string] $variableGroupType, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [string] $variableGroupDescription, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [hashtable] $variableGroupVariables, + + [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)] + [hashtable] $variableGroupProviderData = $null, + + [switch] $Force + ) + + DynamicParam { + _buildProjectNameDynamicParam + } + + Process { + # Bind the parameter to a friendly variable + $ProjectName = $PSBoundParameters["ProjectName"] + + $body = @{ + name = $variableGroupName + type = $variableGroupType + description = $variableGroupDescription + variables = $variableGroupVariables + } + if ($null -ne $variableGroupProviderData) { + $body.Add("providerData", $variableGroupProviderData) + } + + $body = $body | ConvertTo-Json + + if ($Force -or $pscmdlet.ShouldProcess($id, "Update Variable Group")) { + # Call the REST API + $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $id ` + -Method Put -ContentType 'application/json' -body $body -Version $([VSTeamVersions]::VariableGroups) + + Write-Verbose $resp + + return Get-VSTeamVariableGroup -ProjectName $ProjectName -id $id + } + } +} \ No newline at end of file diff --git a/Source/VSTeam.psd1 b/Source/VSTeam.psd1 index 80f4e1a69..456154891 100644 --- a/Source/VSTeam.psd1 +++ b/Source/VSTeam.psd1 @@ -81,7 +81,8 @@ 'types\accessControlList.ps1xml', 'types\accessControlEntry.ps1xml', 'types\users.ps1xml', - 'types\classificationNode.ps1xml') + 'types\classificationNode.ps1xml', + 'types\variablegroups.ps1xml') # Format files (.ps1xml) to be loaded when importing this module FormatsToProcess = @('formats\Approvals.format.ps1xml', @@ -101,7 +102,8 @@ 'formats\accessControlList.format.ps1xml', 'formats\accessControlEntry.format.ps1xml', 'formats\users.format.ps1xml', - 'formats\classificationNode.format.ps1xml') + 'formats\classificationNode.format.ps1xml', + 'formats\variablegroups.format.ps1xml') # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() @@ -221,7 +223,11 @@ 'Add-VSTeamWorkItemAreaPermission', 'Add-VSTeamWorkItemIterationPermission', 'Get-VSTeamClassificationNode', - 'Update-VSTeamRelease') + 'Update-VSTeamRelease', + 'Add-VSTeamVariableGroup', + 'Get-VSTeamVariableGroup', + 'Remove-VSTeamVariableGroup', + 'Update-VSTeamVariableGroup') # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. # CmdletsToExport = @() diff --git a/Source/formats/variablegroups.format.ps1xml b/Source/formats/variablegroups.format.ps1xml new file mode 100644 index 000000000..b77d38a7a --- /dev/null +++ b/Source/formats/variablegroups.format.ps1xml @@ -0,0 +1,82 @@ + + + + + + Team.VariableGroup.TableView + + Team.VariableGroup + + + + + + + + + + + + + + + + + + + + + + + + id + + + name + + + type + + + createdByUser + + + modifiedByUser + + + + + + + + + Team.VariableGroup.ListView + + Team.VariableGroup + + + + + + + id + + + name + + + type + + + createdByUser + + + modifiedByUser + + + + + + + + \ No newline at end of file diff --git a/Source/types/variablegroups.ps1xml b/Source/types/variablegroups.ps1xml new file mode 100644 index 000000000..a8adea87f --- /dev/null +++ b/Source/types/variablegroups.ps1xml @@ -0,0 +1,17 @@ + + + + + Team.VariableGroup + + + createdByUser + $this.createdBy.displayName + + + modifiedByUser + $this.modifiedBy.displayName + + + + \ No newline at end of file diff --git a/integration/test/010_projects.Tests.ps1 b/integration/test/010_projects.Tests.ps1 index 8c33459dd..bf5944888 100644 --- a/integration/test/010_projects.Tests.ps1 +++ b/integration/test/010_projects.Tests.ps1 @@ -309,6 +309,39 @@ InModuleScope VSTeam { } } + Context 'Simple Variable Group' { + $newVariableGroup = $null + It 'Add-VSTeamVariableGroup Should add a variable group' { + $variables = @{ + key1 = @{ + value = "value1" + } + key2 = @{ + value = "value2" + isSecret = $true + } + } + $newVariableGroup = Add-VSTeamVariableGroup -ProjectName $newProjectName -variableGroupName "TestVariableGroup1" -variableGroupType "Vsts" -variableGroupDescription "A test variable group" -variableGroupVariables $variables + $newVariableGroup | Should Not Be $null + } + + It 'Update-VSTeamVariableGroup Should update the variable group' { + $newVariableGroup | Should Not Be $null + $variables = @{ + key3 = @{ + value = "value3" + } + } + $newVariableGroup = Update-VSTeamVariableGroup -ProjectName $newProjectName -id $newVariableGroup.id -variableGroupName "TestVariableGroup2" -variableGroupType "Vsts" -variableGroupDescription "A test variable group update" -variableGroupVariables $variables + $newVariableGroup | Should Not Be $null + } + + It 'Remove-VSTeamVariableGroup Should remove the variable group' { + $newVariableGroup | Should Not Be $null + {Remove-VSTeamVariableGroup -ProjectName $newProjectName -id $newVariableGroup.id -Force} | Should Not Throw + } + } + Context 'Service Endpoints full exercise' { It 'Add-VSTeamSonarQubeEndpoint Should add service endpoint' { { Add-VSTeamSonarQubeEndpoint -ProjectName $newProjectName -EndpointName 'TestSonarQube' ` From 14a5c05b0cb95ef1eca49d1a7cd31f99f694d6ea Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Fri, 21 Jun 2019 02:18:01 -0500 Subject: [PATCH 02/18] Added help and changelog message. --- .docs/Add-VSTeamVariableGroup.md | 138 +++ .docs/Get-VSTeamVariableGroup.md | 81 ++ .docs/Remove-VSTeamVariableGroup.md | 121 +++ .docs/Update-VSTeamVariableGroup.md | 202 ++++ .docs/synopsis/Add-VSTeamVariableGroup.md | 1 + .docs/synopsis/Get-VSTeamVariableGroup.md | 1 + .docs/synopsis/Remove-VSTeamVariableGroup.md | 1 + .docs/synopsis/Update-VSTeamVariableGroup.md | 1 + CHANGELOG.md | 9 + Source/en-US/VSTeam-Help.xml | 996 ++++++++++++++++-- docs/Add-VSTeam.md | 110 +- docs/Add-VSTeamAccessControlEntry.md | 152 +-- docs/Add-VSTeamAzureRMServiceEndpoint.md | 198 ++-- docs/Add-VSTeamBuild.md | 282 ++--- docs/Add-VSTeamBuildDefinition.md | 118 +-- docs/Add-VSTeamBuildTag.md | 78 +- docs/Add-VSTeamExtension.md | 120 +-- docs/Add-VSTeamFeed.md | 132 +-- docs/Add-VSTeamGitRepository.md | 90 +- docs/Add-VSTeamGitRepositoryPermission.md | 170 +-- docs/Add-VSTeamKubernetesEndpoint.md | 208 ++-- docs/Add-VSTeamNuGetEndpoint.md | 274 ++--- docs/Add-VSTeamPolicy.md | 154 +-- docs/Add-VSTeamProfile.md | 252 ++--- docs/Add-VSTeamProject.md | 174 +-- docs/Add-VSTeamProjectPermission.md | 128 +-- docs/Add-VSTeamRelease.md | 288 ++--- docs/Add-VSTeamReleaseDefinition.md | 110 +- docs/Add-VSTeamServiceEndpoint.md | 126 +-- docs/Add-VSTeamServiceFabricEndpoint.md | 318 +++--- docs/Add-VSTeamSonarQubeEndpoint.md | 168 +-- docs/Add-VSTeamUserEntitlement.md | 124 +-- docs/Add-VSTeamVariableGroup.md | 139 +++ docs/Add-VSTeamWorkItem.md | 238 ++--- docs/Add-VSTeamWorkItemAreaPermission.md | 156 +-- docs/Add-VSTeamWorkItemIterationPermission.md | 156 +-- docs/Clear-VSTeamDefaultProject.md | 90 +- docs/Disable-VSTeamAgent.md | 96 +- docs/Enable-VSTeamAgent.md | 96 +- docs/Get-VSTeam.md | 130 +-- docs/Get-VSTeamAccessControlList.md | 174 +-- docs/Get-VSTeamAgent.md | 110 +- docs/Get-VSTeamApproval.md | 220 ++-- docs/Get-VSTeamBuild.md | 422 ++++---- docs/Get-VSTeamBuildArtifact.md | 62 +- docs/Get-VSTeamBuildDefinition.md | 282 ++--- docs/Get-VSTeamBuildLog.md | 100 +- docs/Get-VSTeamBuildTag.md | 62 +- docs/Get-VSTeamClassificationNode.md | 118 +-- docs/Get-VSTeamCloudSubscription.md | 82 +- docs/Get-VSTeamDescriptor.md | 70 +- docs/Get-VSTeamExtension.md | 160 +-- docs/Get-VSTeamFeed.md | 86 +- docs/Get-VSTeamVariableGroup.md | 82 ++ docs/Remove-VSTeamVariableGroup.md | 122 +++ docs/Team.md | 16 + docs/Update-VSTeamVariableGroup.md | 203 ++++ docs/readme.md | 16 + 58 files changed, 5374 insertions(+), 3439 deletions(-) create mode 100644 .docs/Add-VSTeamVariableGroup.md create mode 100644 .docs/Get-VSTeamVariableGroup.md create mode 100644 .docs/Remove-VSTeamVariableGroup.md create mode 100644 .docs/Update-VSTeamVariableGroup.md create mode 100644 .docs/synopsis/Add-VSTeamVariableGroup.md create mode 100644 .docs/synopsis/Get-VSTeamVariableGroup.md create mode 100644 .docs/synopsis/Remove-VSTeamVariableGroup.md create mode 100644 .docs/synopsis/Update-VSTeamVariableGroup.md create mode 100644 docs/Add-VSTeamVariableGroup.md create mode 100644 docs/Get-VSTeamVariableGroup.md create mode 100644 docs/Remove-VSTeamVariableGroup.md create mode 100644 docs/Update-VSTeamVariableGroup.md diff --git a/.docs/Add-VSTeamVariableGroup.md b/.docs/Add-VSTeamVariableGroup.md new file mode 100644 index 000000000..18e44c48c --- /dev/null +++ b/.docs/Add-VSTeamVariableGroup.md @@ -0,0 +1,138 @@ + + +# Add-VSTeamVariableGroup + +## SYNOPSIS + + +## SYNTAX + +```powershell +Add-VSTeamVariableGroup [-variableGroupName] [-variableGroupType] + [-variableGroupDescription] [-variableGroupVariables] + [[-variableGroupProviderData] ] [-ProjectName] [] +``` + +## DESCRIPTION + + +## EXAMPLES + +## PARAMETERS + +### -ProjectName +The name of the project. +You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupDescription +The variable group description + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupName +The variable group name + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupProviderData +The variable group ProviderData. This should be $null for Vsts types. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupType +The variable group type + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: Vsts, AzureKeyVault + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupVariables +The variable group variables. Please refer to the unit test for examples. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 4 +Default value: None +Accept pipeline input: True (ByPropertyName) +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 (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String +System.Collections.Hashtable + + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) + +[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) + +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) \ No newline at end of file diff --git a/.docs/Get-VSTeamVariableGroup.md b/.docs/Get-VSTeamVariableGroup.md new file mode 100644 index 000000000..20a68e144 --- /dev/null +++ b/.docs/Get-VSTeamVariableGroup.md @@ -0,0 +1,81 @@ + + +# Get-VSTeamVariableGroup + +## SYNOPSIS + + +## SYNTAX + +### List (Default) +```powershell +Get-VSTeamVariableGroup [-ProjectName] [] +``` + +### ByID +```powershell +Get-VSTeamVariableGroup -id [-ProjectName] [] +``` + +## DESCRIPTION + +## EXAMPLES + +### Example 1 + +## PARAMETERS + +### -ProjectName +The name of the project. +You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -id +ID of the existing variable group + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +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 (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) + +[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) + +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) \ No newline at end of file diff --git a/.docs/Remove-VSTeamVariableGroup.md b/.docs/Remove-VSTeamVariableGroup.md new file mode 100644 index 000000000..14aa7988a --- /dev/null +++ b/.docs/Remove-VSTeamVariableGroup.md @@ -0,0 +1,121 @@ + + +# Remove-VSTeamVariableGroup + +## SYNOPSIS + + +## SYNTAX + +```powershell +Remove-VSTeamVariableGroup [-id] [-Force] [-WhatIf] [-Confirm] [-ProjectName] + [] +``` + +## DESCRIPTION + + +## EXAMPLES + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Does not prompt + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +The name of the project. +You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -id +ID of the existing variable group + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +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 (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String[] +System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) + +[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) + +[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) \ No newline at end of file diff --git a/.docs/Update-VSTeamVariableGroup.md b/.docs/Update-VSTeamVariableGroup.md new file mode 100644 index 000000000..42268993c --- /dev/null +++ b/.docs/Update-VSTeamVariableGroup.md @@ -0,0 +1,202 @@ + + +# Update-VSTeamVariableGroup + +## SYNOPSIS + + +## SYNTAX + +```powershell +Update-VSTeamVariableGroup [-id] [-variableGroupName] [-variableGroupType] + [-variableGroupDescription] [-variableGroupVariables] + [[-variableGroupProviderData] ] [-Force] [-WhatIf] [-Confirm] [-ProjectName] + [] +``` + +## DESCRIPTION + + +## EXAMPLES + +## PARAMETERS + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force + +Does not prompt + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName + +The name of the project. +You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -id +ID of the existing variable group + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupDescription +The variable group description + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupName +The variable group name + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupProviderData +The variable group ProviderData. This should be $null for Vsts types. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupType +The variable group type + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: Vsts, AzureKeyVault + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupVariables +The variable group variables. Please refer to the unit test for examples. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 4 +Default value: None +Accept pipeline input: True (ByPropertyName) +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 (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String +System.Collections.Hashtable + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) + +[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) + +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) \ No newline at end of file diff --git a/.docs/synopsis/Add-VSTeamVariableGroup.md b/.docs/synopsis/Add-VSTeamVariableGroup.md new file mode 100644 index 000000000..3fe6da755 --- /dev/null +++ b/.docs/synopsis/Add-VSTeamVariableGroup.md @@ -0,0 +1 @@ +Adds a variable group. \ No newline at end of file diff --git a/.docs/synopsis/Get-VSTeamVariableGroup.md b/.docs/synopsis/Get-VSTeamVariableGroup.md new file mode 100644 index 000000000..1c9e7fefa --- /dev/null +++ b/.docs/synopsis/Get-VSTeamVariableGroup.md @@ -0,0 +1 @@ +Gets a variable group \ No newline at end of file diff --git a/.docs/synopsis/Remove-VSTeamVariableGroup.md b/.docs/synopsis/Remove-VSTeamVariableGroup.md new file mode 100644 index 000000000..a522b68cf --- /dev/null +++ b/.docs/synopsis/Remove-VSTeamVariableGroup.md @@ -0,0 +1 @@ +Removes a variable group \ No newline at end of file diff --git a/.docs/synopsis/Update-VSTeamVariableGroup.md b/.docs/synopsis/Update-VSTeamVariableGroup.md new file mode 100644 index 000000000..ea0c2b466 --- /dev/null +++ b/.docs/synopsis/Update-VSTeamVariableGroup.md @@ -0,0 +1 @@ +Updates an existing variable group \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bd0bd24f..85ccfe817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 6.2.8 + +Added functions to deal with variable groups + +- Added Add-VSTeamVariableGroup to add new variable groups. +- Added Get-VSTeamVariableGroup to get variable groups. +- Added Update-VSTeamVariableGroup to update variable groups +- Added Remove-VSTeamVariableGroup to remove variable groups + ## 6.2.7 Added support for -Raw and -Json on Get-VSTeamBuildDefinition so the objects and/or JSON can be returned in Update-VSTeamBuildDefinition. diff --git a/Source/en-US/VSTeam-Help.xml b/Source/en-US/VSTeam-Help.xml index 35db262b1..ed914cbb5 100644 --- a/Source/en-US/VSTeam-Help.xml +++ b/Source/en-US/VSTeam-Help.xml @@ -4825,6 +4825,214 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo + + + Add-VSTeamVariableGroup + Add + VSTeamVariableGroup + + Adds a generic service connection + + + + Adds a generic service connection + + + + Add-VSTeamVariableGroup + + ProjectName + + The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + String + + String + + + None + + + variableGroupName + + The variable group name + + String + + String + + + None + + + variableGroupType + + The variable group type + + + Vsts + AzureKeyVault + + String + + String + + + None + + + variableGroupDescription + + The variable group description + + String + + String + + + None + + + variableGroupVariables + + The variable group variables. Please refer to the unit test for examples. + + Hashtable + + Hashtable + + + None + + + variableGroupProviderData + + The variable group ProviderData. This should be $null for Vsts types. + + Hashtable + + Hashtable + + + None + + + + + + ProjectName + + The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + String + + String + + + None + + + variableGroupDescription + + The variable group description + + String + + String + + + None + + + variableGroupName + + The variable group name + + String + + String + + + None + + + variableGroupProviderData + + The variable group ProviderData. This should be $null for Vsts types. + + Hashtable + + Hashtable + + + None + + + variableGroupType + + The variable group type + + String + + String + + + None + + + variableGroupVariables + + The variable group variables. Please refer to the unit test for examples. + + Hashtable + + Hashtable + + + None + + + + + + System.String + + + System.Collections.Hashtable + + + + + + + System.Object + + + + + + + + + + + + + + + Update-VSTeamVariableGroup + + + + Get-VSTeamVariableGroup + + + + Remove-VSTeamVariableGroup + + + + Add-VSTeamWorkItem @@ -11288,52 +11496,23 @@ ID Title Status - Get-VSTeamWorkItem + Get-VSTeamVariableGroup Get - VSTeamWorkItem + VSTeamVariableGroup - Returns one or more a work items from your project. + Gets a variable group - Returns one or more a work items from your project. + Gets a variable group - Get-VSTeamWorkItem - - Id - - The id of the work item. - - Int32 - - Int32 - - - None - - - Fields - - Comma-separated list of requested fields. - - String[] - - String[] - - - None - - - Expand + Get-VSTeamVariableGroup + + ProjectName - Comma-separated list of requested fields. The acceptable values for this parameter are: - - None - - Relations - - Fields - - Links - - All + The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. String @@ -11342,71 +11521,216 @@ ID Title Status None - - AsOf - - - - DateTime - - DateTime - - - None - - - - Get-VSTeamWorkItem - - Ids - - The id of the work item. - - Int32[] - - Int32[] - - - None - - - ErrorPolicy + + id - The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: - - Fail - - Omit + ID of the existing variable group String String - Fail - - - Fields - - Comma-separated list of requested fields. - - String[] - - String[] - - None - - Expand - - Comma-separated list of requested fields. The acceptable values for this parameter are: - - None - - Relations - - Fields - - Links - - All - - String - + + + + + ProjectName + + The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + String + + String + + + None + + + id + + ID of the existing variable group + + String + + String + + + None + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + + + + + + + + + Add-VSTeamVariableGroup + + + + Update-VSTeamVariableGroup + + + + Remove-VSTeamVariableGroup + + + + + + + Get-VSTeamWorkItem + Get + VSTeamWorkItem + + Returns one or more a work items from your project. + + + + Returns one or more a work items from your project. + + + + Get-VSTeamWorkItem + + Id + + The id of the work item. + + Int32 + + Int32 + + + None + + + Fields + + Comma-separated list of requested fields. + + String[] + + String[] + + + None + + + Expand + + Comma-separated list of requested fields. The acceptable values for this parameter are: + - None + - Relations + - Fields + - Links + - All + + String + + String + + + None + + + AsOf + + + + DateTime + + DateTime + + + None + + + + Get-VSTeamWorkItem + + Ids + + The id of the work item. + + Int32[] + + Int32[] + + + None + + + ErrorPolicy + + The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: + - Fail + - Omit + + String + + String + + + Fail + + + Fields + + Comma-separated list of requested fields. + + String[] + + String[] + + + None + + + Expand + + Comma-separated list of requested fields. The acceptable values for this parameter are: + - None + - Relations + - Fields + - Links + - All + + String + String @@ -14124,16 +14448,180 @@ ID Title Status SwitchParameter - False + False + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + + + + Remove-VSTeamVariableGroup + Remove + VSTeamVariableGroup + + Removes a variable group + + + + Removes a variable group + + + + Remove-VSTeamVariableGroup + + ProjectName + + The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + String + + String + + + None + + + id + + ID of the existing variable group + + String + + String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + SwitchParameter + + + False + + + Force + + Does not prompt + + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + Force + + Does not prompt + + SwitchParameter + + SwitchParameter + + + False + + + ProjectName + + The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + String + + String + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + False + + + id + + ID of the existing variable group + + String + + String + + + None - System.String + System.String[] - + System.String @@ -14153,7 +14641,20 @@ ID Title Status - + + + Add-VSTeamVariableGroup + + + + Get-VSTeamVariableGroup + + + + Update-VSTeamVariableGroup + + + @@ -18514,6 +19015,307 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r + + + Update-VSTeamVariableGroup + Update + VSTeamVariableGroup + + Updates an existing variable group + + + + Updates an existing variable group + + + + Update-VSTeamVariableGroup + + ProjectName + + The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + String + + String + + + None + + + id + + ID of the existing variable group + + String + + String + + + None + + + variableGroupName + + The variable group name + + String + + String + + + None + + + variableGroupType + + The variable group type + + + Vsts + AzureKeyVault + + String + + String + + + None + + + variableGroupDescription + + The variable group description + + String + + String + + + None + + + variableGroupVariables + + The variable group variables. Please refer to the unit test for examples. + + Hashtable + + Hashtable + + + None + + + variableGroupProviderData + + The variable group ProviderData. This should be $null for Vsts types. + + Hashtable + + Hashtable + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + SwitchParameter + + + False + + + Force + + Does not prompt + + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + SwitchParameter + + + False + + + Force + + Does not prompt + + SwitchParameter + + SwitchParameter + + + False + + + ProjectName + + The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + String + + String + + + None + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + SwitchParameter + + + False + + + id + + ID of the existing variable group + + String + + String + + + None + + + variableGroupDescription + + The variable group description + + String + + String + + + None + + + variableGroupName + + The variable group name + + String + + String + + + None + + + variableGroupProviderData + + The variable group ProviderData. This should be $null for Vsts types. + + Hashtable + + Hashtable + + + None + + + variableGroupType + + The variable group type + + String + + String + + + None + + + variableGroupVariables + + The variable group variables. Please refer to the unit test for examples. + + Hashtable + + Hashtable + + + None + + + + + + System.String + + + System.Collections.Hashtable + + + + + + + System.Object + + + + + + + + + + + + + + + Add-VSTeamVariableGroup + + + + Get-VSTeamVariableGroup + + + + Remove-VSTeamVariableGroup + + + + Update-VSTeamWorkItem diff --git a/docs/Add-VSTeam.md b/docs/Add-VSTeam.md index a4f8c7904..26c5ee456 100644 --- a/docs/Add-VSTeam.md +++ b/docs/Add-VSTeam.md @@ -1,22 +1,22 @@ - - -# Add-VSTeam - -## SYNOPSIS - -Adds a team to a team project. - -## SYNTAX - -## DESCRIPTION - -Adds a team to a team project. - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeam + +## SYNOPSIS + +Adds a team to a team project. + +## SYNTAX + +## DESCRIPTION + +Adds a team to a team project. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,41 +31,41 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Description - -The description of the team. - -```yaml -Type: String -Position: 1 -``` - -### -Name - -The name of the team - -```yaml -Type: String -Aliases: TeamName -Required: True -Position: 1 -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeam](Get-VSTeam.md) - -[Remove-VSTeam](Remove-VSTeam.md) - -[Show-VSTeam](Show-VSTeam.md) - -[Update-VSTeam](pda-VSTeam.md) +``` + +### -Description + +The description of the team. + +```yaml +Type: String +Position: 1 +``` + +### -Name + +The name of the team + +```yaml +Type: String +Aliases: TeamName +Required: True +Position: 1 +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Get-VSTeam](Get-VSTeam.md) + +[Remove-VSTeam](Remove-VSTeam.md) + +[Show-VSTeam](Show-VSTeam.md) + +[Update-VSTeam](pda-VSTeam.md) diff --git a/docs/Add-VSTeamAccessControlEntry.md b/docs/Add-VSTeamAccessControlEntry.md index 5f816d4d3..c33c26b0c 100644 --- a/docs/Add-VSTeamAccessControlEntry.md +++ b/docs/Add-VSTeamAccessControlEntry.md @@ -1,26 +1,26 @@ - - -# Add-VSTeamAccessControlEntry - -## SYNOPSIS - + + +# Add-VSTeamAccessControlEntry + +## SYNOPSIS + Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. -Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. - -## SYNTAX - -## DESCRIPTION - +Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. + +## SYNTAX + +## DESCRIPTION + Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. -Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. - -## EXAMPLES - -## PARAMETERS - +Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -35,8 +35,8 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - +``` + ### -SecurityNamespaceName Security Namespace Name. Valid names are: @@ -128,60 +128,60 @@ VSSPS: ```yaml Type: String Required: True -``` - -### -SecurityNamespace - -Security namespace identifier. - -```yaml -Type: VSTeamSecurityNamespace -Required: True -``` - -### -SecurityNamespaceId - -Security namespace identifier. - -```yaml -Type: String -Required: True -``` - -### -Token - -The security Token - -```yaml -Type: String -Required: True -``` - -### -AllowMask - -Bitmask for Allow Permissions - -```yaml -Type: Int -Required: True -``` - -### -DenyMask - -Bitmask for Deny Permissions - -```yaml -Type: Int -Required: True -``` - -## INPUTS - -## OUTPUTS - -### VSTeamAccessControlEntry - -## NOTES - -## RELATED LINKS +``` + +### -SecurityNamespace + +Security namespace identifier. + +```yaml +Type: VSTeamSecurityNamespace +Required: True +``` + +### -SecurityNamespaceId + +Security namespace identifier. + +```yaml +Type: String +Required: True +``` + +### -Token + +The security Token + +```yaml +Type: String +Required: True +``` + +### -AllowMask + +Bitmask for Allow Permissions + +```yaml +Type: Int +Required: True +``` + +### -DenyMask + +Bitmask for Deny Permissions + +```yaml +Type: Int +Required: True +``` + +## INPUTS + +## OUTPUTS + +### VSTeamAccessControlEntry + +## NOTES + +## RELATED LINKS diff --git a/docs/Add-VSTeamAzureRMServiceEndpoint.md b/docs/Add-VSTeamAzureRMServiceEndpoint.md index b3796510f..f5d66429e 100644 --- a/docs/Add-VSTeamAzureRMServiceEndpoint.md +++ b/docs/Add-VSTeamAzureRMServiceEndpoint.md @@ -1,22 +1,22 @@ - - -# Add-VSTeamAzureRMServiceEndpoint - -## SYNOPSIS - -Adds a new Azure Resource Manager service endpoint. - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new connection between TFS/VSTS and Azure using the Azure Resource Manager connection type. - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamAzureRMServiceEndpoint + +## SYNOPSIS + +Adds a new Azure Resource Manager service endpoint. + +## SYNTAX + +## DESCRIPTION + +The cmdlet adds a new connection between TFS/VSTS and Azure using the Azure Resource Manager connection type. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,85 +31,85 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -SubscriptionName - -The name of the Azure Subscription. - -```yaml -Type: String -Aliases: displayName -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -SubscriptionId - -The id of the Azure subscription to use. - -```yaml -Type: String -Required: True -Position: 2 -Accept pipeline input: true (ByPropertyName) -``` - -### -SubscriptionTenantId - -The id of the Azure tenant to use. - -```yaml -Type: String -Required: True -Position: 3 -Accept pipeline input: true (ByPropertyName) -``` - -### -ServicePrincipalId - -The ID of the Azure Service Principal to use with this service endpoint. - -```yaml -Type: String -Parameter Sets: Manual -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -ServicePrincipalKey - -The key of the Azure Service Principal to use with this service endpoint. - -```yaml -Type: String -Parameter Sets: Manual -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -EndpointName - -The name displayed on the services page. -In VSTS this is the Connection Name. - -```yaml -Type: String -Position: 4 -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) +``` + +### -SubscriptionName + +The name of the Azure Subscription. + +```yaml +Type: String +Aliases: displayName +Required: True +Position: 1 +Accept pipeline input: true (ByPropertyName) +``` + +### -SubscriptionId + +The id of the Azure subscription to use. + +```yaml +Type: String +Required: True +Position: 2 +Accept pipeline input: true (ByPropertyName) +``` + +### -SubscriptionTenantId + +The id of the Azure tenant to use. + +```yaml +Type: String +Required: True +Position: 3 +Accept pipeline input: true (ByPropertyName) +``` + +### -ServicePrincipalId + +The ID of the Azure Service Principal to use with this service endpoint. + +```yaml +Type: String +Parameter Sets: Manual +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -ServicePrincipalKey + +The key of the Azure Service Principal to use with this service endpoint. + +```yaml +Type: String +Parameter Sets: Manual +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -EndpointName + +The name displayed on the services page. +In VSTS this is the Connection Name. + +```yaml +Type: String +Position: 4 +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) + +[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) + +[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) diff --git a/docs/Add-VSTeamBuild.md b/docs/Add-VSTeamBuild.md index 84566d704..46779a22b 100644 --- a/docs/Add-VSTeamBuild.md +++ b/docs/Add-VSTeamBuild.md @@ -1,65 +1,65 @@ - - -# Add-VSTeamBuild - -## SYNOPSIS - -Queues a new build. - -## SYNTAX - -## DESCRIPTION - -Add-VSTeamBuild will queue a new build. - -You can override the queue in the build definition by using the QueueName parameter. You can override the default source branch by using the SourceBranch parameter. You can also set specific build parameters by using the BuildParameters parameter. - -To have the BuildDefinition and QueueNames tab complete you must set a default project by calling Set-VSTeamDefaultProject before you call Add-VSTeamBuild. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted -``` - -This example sets the default project so you can tab complete the BuildDefinition parameter. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -SourceBranch refs/heads/develop - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted -``` - -This example queues the build for the 'develop' branch, overriding the default branch in the build definition. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -BuildParameters @{msg="hello world!"; 'system.debug'='true'} - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted -``` - -This example queues the build and sets the system.debug variable to true and msg to 'hello world!'. - -## PARAMETERS - + + +# Add-VSTeamBuild + +## SYNOPSIS + +Queues a new build. + +## SYNTAX + +## DESCRIPTION + +Add-VSTeamBuild will queue a new build. + +You can override the queue in the build definition by using the QueueName parameter. You can override the default source branch by using the SourceBranch parameter. You can also set specific build parameters by using the BuildParameters parameter. + +To have the BuildDefinition and QueueNames tab complete you must set a default project by calling Set-VSTeamDefaultProject before you call Add-VSTeamBuild. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI + +Build Definition Build Number Status Result +---------------- ------------ ------ ------ +Demo-CI Demo-CI-45 notStarted +``` + +This example sets the default project so you can tab complete the BuildDefinition parameter. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -SourceBranch refs/heads/develop + +Build Definition Build Number Status Result +---------------- ------------ ------ ------ +Demo-CI Demo-CI-45 notStarted +``` + +This example queues the build for the 'develop' branch, overriding the default branch in the build definition. + +### -------------------------- EXAMPLE 3 -------------------------- + +```PowerShell +PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -BuildParameters @{msg="hello world!"; 'system.debug'='true'} + +Build Definition Build Number Status Result +---------------- ------------ ------ ------ +Demo-CI Demo-CI-45 notStarted +``` + +This example queues the build and sets the system.debug variable to true and msg to 'hello world!'. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -74,84 +74,84 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -BuildDefinitionName - -The name of the build definition to use to queue to build. - -```yaml -Type: String -Parameter Sets: ByName -Aliases: BuildDefinition -Accept pipeline input: true (ByPropertyName) -``` - -### -QueueName - -The name of the queue to use for this build. - -```yaml -Type: String -Accept pipeline input: true (ByPropertyName) -``` - -### -BuildDefinitionId - -The Id of the build definition to use to queue to build. - -```yaml -Type: Int32 -Parameter Sets: ByID -Aliases: Id -Accept pipeline input: true (ByPropertyName) -``` - -### -SourceBranch - -Which source branch to use for this build. Overrides default branch in build definition. - -```yaml -Type: String -``` - -### -BuildParameters - -A hashtable with build parameters. - -```yaml -Type: System.Collection.Hashtable -``` - -## INPUTS - -### System.String - -ProjectName - -BuildDefinitionName - -QueueName - -SourceBranch - -### System.Int32 - -BuildDefinitionId - -### System.Collections.Hashtable - -Build Parameters - -## OUTPUTS - -### Team.Build - -## NOTES - -BuildDefinition and QueueName are dynamic parameters and use the default project value to query their validate set. - -If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamBuild you will have to type in the names. - -## RELATED LINKS +``` + +### -BuildDefinitionName + +The name of the build definition to use to queue to build. + +```yaml +Type: String +Parameter Sets: ByName +Aliases: BuildDefinition +Accept pipeline input: true (ByPropertyName) +``` + +### -QueueName + +The name of the queue to use for this build. + +```yaml +Type: String +Accept pipeline input: true (ByPropertyName) +``` + +### -BuildDefinitionId + +The Id of the build definition to use to queue to build. + +```yaml +Type: Int32 +Parameter Sets: ByID +Aliases: Id +Accept pipeline input: true (ByPropertyName) +``` + +### -SourceBranch + +Which source branch to use for this build. Overrides default branch in build definition. + +```yaml +Type: String +``` + +### -BuildParameters + +A hashtable with build parameters. + +```yaml +Type: System.Collection.Hashtable +``` + +## INPUTS + +### System.String + +ProjectName + +BuildDefinitionName + +QueueName + +SourceBranch + +### System.Int32 + +BuildDefinitionId + +### System.Collections.Hashtable + +Build Parameters + +## OUTPUTS + +### Team.Build + +## NOTES + +BuildDefinition and QueueName are dynamic parameters and use the default project value to query their validate set. + +If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamBuild you will have to type in the names. + +## RELATED LINKS diff --git a/docs/Add-VSTeamBuildDefinition.md b/docs/Add-VSTeamBuildDefinition.md index 7755e43fc..e2946141f 100644 --- a/docs/Add-VSTeamBuildDefinition.md +++ b/docs/Add-VSTeamBuildDefinition.md @@ -1,33 +1,33 @@ - - -# Add-VSTeamBuildDefinition - -## SYNOPSIS - -Creates a new build definition from a JSON file. - -## SYNTAX - -## DESCRIPTION - -Reads a JSON file off disk and uses that file to create a new build definition in the provided project. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamBuildDefinition -ProjectName Demo -InFile build.json -``` - -This command reads build.json and creates a new build definition from it -on the demo team project. - -## PARAMETERS - + + +# Add-VSTeamBuildDefinition + +## SYNOPSIS + +Creates a new build definition from a JSON file. + +## SYNTAX + +## DESCRIPTION + +Reads a JSON file off disk and uses that file to create a new build definition in the provided project. + +You must call Set-VSTeamAccount before calling this function. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamBuildDefinition -ProjectName Demo -InFile build.json +``` + +This command reads build.json and creates a new build definition from it +on the demo team project. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -42,34 +42,34 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -InFile - -Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. - -```yaml -Type: String -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the -project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have -to pass the ProjectName with each call. - -## RELATED LINKS +``` + +### -InFile + +Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. + +```yaml +Type: String +Required: True +Position: 1 +Accept pipeline input: true (ByPropertyName) +``` + +## INPUTS + +### System.String + +## OUTPUTS + +## NOTES + +This function has a Dynamic Parameter for ProjectName that specifies the +project for which this function gets build definitions. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so you do not have +to pass the ProjectName with each call. + +## RELATED LINKS diff --git a/docs/Add-VSTeamBuildTag.md b/docs/Add-VSTeamBuildTag.md index aaeba4e6f..0fb018014 100644 --- a/docs/Add-VSTeamBuildTag.md +++ b/docs/Add-VSTeamBuildTag.md @@ -1,22 +1,22 @@ - - -# Add-VSTeamBuildTag - -## SYNOPSIS - -Adds a tag to a build. - -## SYNTAX - -## DESCRIPTION - -Adds a tag to a build. - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamBuildTag + +## SYNOPSIS + +Adds a tag to a build. + +## SYNTAX + +## DESCRIPTION + +Adds a tag to a build. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,8 +31,8 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - +``` + ### -Id Specifies one or more builds by ID. @@ -45,8 +45,8 @@ To find the ID of a build, type Get-VSTeamBuild. Type: Int32[] Aliases: BuildID Accept pipeline input: true (ByPropertyName, ByValue) -``` - +``` + ### -Tags One or more tags. To specify multiple, use commas to separate. @@ -56,8 +56,8 @@ Type: String[] Required: True Position: 1 Accept pipeline input: true (ByPropertyName, ByValue) -``` - +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -65,16 +65,16 @@ Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter Aliases: cf -``` - +``` + ### -Force Forces the command without confirmation ```yaml Type: SwitchParameter -``` - +``` + ### -WhatIf Shows what would happen if the cmdlet runs. @@ -83,15 +83,15 @@ The cmdlet is not run. ```yaml Type: SwitchParameter Aliases: wi -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Add-VSTeamExtension.md b/docs/Add-VSTeamExtension.md index 42036e365..9d9aa12c0 100644 --- a/docs/Add-VSTeamExtension.md +++ b/docs/Add-VSTeamExtension.md @@ -1,62 +1,62 @@ - - -# Add-VSTeamExtension - -## SYNOPSIS - -Install the specified extension into the account / project collection. - -## SYNTAX - -## DESCRIPTION - -Install the specified extension into the account / project collection. - -## EXAMPLES - -## PARAMETERS - -### -PublisherId - -The id of the publisher. - -```yaml -Type: String -Required: True -``` - -### -ExtensionId - -The id of the extension. - -```yaml -Type: String -Required: True -``` - -### -Version - -The version of the extension. Example: "0.1.35". - -```yaml -Type: String -Required: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamExtension](Add-VSTeamExtension.md) - -[Get-VSTeamExtension](Get-VSTeamExtension.md) - -[Remove-VSTeamExtension](Remove-VSTeamExtension.md) - -[Update-VSTeamExtension](Update-VSTeamExtension.md) + + +# Add-VSTeamExtension + +## SYNOPSIS + +Install the specified extension into the account / project collection. + +## SYNTAX + +## DESCRIPTION + +Install the specified extension into the account / project collection. + +## EXAMPLES + +## PARAMETERS + +### -PublisherId + +The id of the publisher. + +```yaml +Type: String +Required: True +``` + +### -ExtensionId + +The id of the extension. + +```yaml +Type: String +Required: True +``` + +### -Version + +The version of the extension. Example: "0.1.35". + +```yaml +Type: String +Required: False +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Add-VSTeamExtension](Add-VSTeamExtension.md) + +[Get-VSTeamExtension](Get-VSTeamExtension.md) + +[Remove-VSTeamExtension](Remove-VSTeamExtension.md) + +[Update-VSTeamExtension](Update-VSTeamExtension.md) diff --git a/docs/Add-VSTeamFeed.md b/docs/Add-VSTeamFeed.md index 2ce130950..f98f65197 100644 --- a/docs/Add-VSTeamFeed.md +++ b/docs/Add-VSTeamFeed.md @@ -1,68 +1,68 @@ - - -# Add-VSTeamFeed - -## SYNOPSIS - -Adds a new feed to package management. - -## SYNTAX - -## DESCRIPTION - -Adds a new feed to package management. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamFeed -Name test -Description 'Test Description' -``` - -This command adds a new package feed to the account. - -## PARAMETERS - -### -Name - -Name of the feed - -```yaml -Type: string -Accept pipeline input: true (ByPropertyName) -``` - -### -Description - -Description of the feed - -```yaml -Type: string -``` - -### -EnableUpstreamSources - -Enables npm and nuget upstream sources for the feed - -```yaml -Type: SwitchParameter -``` - -### -showDeletedPackageVersions - -The feed will show deleted version in the feed - -```yaml -Type: SwitchParameter -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS + + +# Add-VSTeamFeed + +## SYNOPSIS + +Adds a new feed to package management. + +## SYNTAX + +## DESCRIPTION + +Adds a new feed to package management. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamFeed -Name test -Description 'Test Description' +``` + +This command adds a new package feed to the account. + +## PARAMETERS + +### -Name + +Name of the feed + +```yaml +Type: string +Accept pipeline input: true (ByPropertyName) +``` + +### -Description + +Description of the feed + +```yaml +Type: string +``` + +### -EnableUpstreamSources + +Enables npm and nuget upstream sources for the feed + +```yaml +Type: SwitchParameter +``` + +### -showDeletedPackageVersions + +The feed will show deleted version in the feed + +```yaml +Type: SwitchParameter +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Add-VSTeamGitRepository.md b/docs/Add-VSTeamGitRepository.md index c3dd01406..a4dfd4d4d 100644 --- a/docs/Add-VSTeamGitRepository.md +++ b/docs/Add-VSTeamGitRepository.md @@ -1,30 +1,30 @@ - - -# Add-VSTeamGitRepository - -## SYNOPSIS - -Adds a Git repository to your Visual Studio Team Services or Team Foundation Server account. - -## SYNTAX - -## DESCRIPTION - -Add-VSTeamGitRepository adds a Git repository to your Visual Studio Team Services or Team Foundation Server account. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamGitRepository -ProjectName Demo -Name Temp -``` - -This command adds a new repository named Temp to the Demo project. - -## PARAMETERS - + + +# Add-VSTeamGitRepository + +## SYNOPSIS + +Adds a Git repository to your Visual Studio Team Services or Team Foundation Server account. + +## SYNTAX + +## DESCRIPTION + +Add-VSTeamGitRepository adds a Git repository to your Visual Studio Team Services or Team Foundation Server account. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamGitRepository -ProjectName Demo -Name Temp +``` + +This command adds a new repository named Temp to the Demo project. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -39,23 +39,23 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Name - -Specifies the name of the repository. - -```yaml -Type: System.String -Aliases: RepositoryID -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS +``` + +### -Name + +Specifies the name of the repository. + +```yaml +Type: System.String +Aliases: RepositoryID +Accept pipeline input: true (ByPropertyName) +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Add-VSTeamGitRepositoryPermission.md b/docs/Add-VSTeamGitRepositoryPermission.md index 683653a34..cf0eb7dfa 100644 --- a/docs/Add-VSTeamGitRepositoryPermission.md +++ b/docs/Add-VSTeamGitRepositoryPermission.md @@ -1,22 +1,22 @@ - - -# Add-VSTeamGitRepositoryPermission - -## SYNOPSIS - -Add permissions to a git repository, all repositories in a project, or a specific branch - -## SYNTAX - -## DESCRIPTION - -Add permissions to a git repository, all repositories in a project, or a specific branch - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamGitRepositoryPermission + +## SYNOPSIS + +Add permissions to a git repository, all repositories in a project, or a specific branch + +## SYNTAX + +## DESCRIPTION + +Add permissions to a git repository, all repositories in a project, or a specific branch + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,71 +31,71 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -RepositoryId - -```yaml -Type: String -Required: True -``` - -### -RepositoryName - -```yaml -Type: String -Required: True -``` - -### -BranchName - -```yaml -Type: String -Required: True -``` - -### -Descriptor - -```yaml -Type: String -Required: True -``` - -### -User - -```yaml -Type: VSTeamUser -Required: True -``` - -### -Group - -```yaml -Type: VSTeamGroup -Required: True -``` - -### -Allow - -```yaml -Type: VSTeamGitRepositoryPermissions -Required: True -``` - -### -Deny - -```yaml -Type: VSTeamGitRepositoryPermissions -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +### -RepositoryId + +```yaml +Type: String +Required: True +``` + +### -RepositoryName + +```yaml +Type: String +Required: True +``` + +### -BranchName + +```yaml +Type: String +Required: True +``` + +### -Descriptor + +```yaml +Type: String +Required: True +``` + +### -User + +```yaml +Type: VSTeamUser +Required: True +``` + +### -Group + +```yaml +Type: VSTeamGroup +Required: True +``` + +### -Allow + +```yaml +Type: VSTeamGitRepositoryPermissions +Required: True +``` + +### -Deny + +```yaml +Type: VSTeamGitRepositoryPermissions +Required: True +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Add-VSTeamKubernetesEndpoint.md b/docs/Add-VSTeamKubernetesEndpoint.md index 3772b824e..15c47c30e 100644 --- a/docs/Add-VSTeamKubernetesEndpoint.md +++ b/docs/Add-VSTeamKubernetesEndpoint.md @@ -1,24 +1,24 @@ - - -# Add-VSTeamKubernetesEndpoint - -## SYNOPSIS - -Adds connections to Kubernetes clusters - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new connection between TFS/VSTS and a Kubernetes cluster using kubeconfig json. - -This is only used when using the Kubernetes tasks. - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamKubernetesEndpoint + +## SYNOPSIS + +Adds connections to Kubernetes clusters + +## SYNTAX + +## DESCRIPTION + +The cmdlet adds a new connection between TFS/VSTS and a Kubernetes cluster using kubeconfig json. + +This is only used when using the Kubernetes tasks. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -33,88 +33,88 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Kubeconfig - -kubeconfig as JSON string - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -KubernetesUrl - -URL of Kubernetes cluster - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -EndpointName - -The name displayed on the services page. -In VSTS this is the Connection Name. - -```yaml -Type: String -Position: 3 -``` - -### -ClientCertificateData - -Client certificate from Kubeconfig - -```yaml -Type: String -Required: True -``` - -### -ClientKeyData - -Client private key from Kubeconfig - -```yaml -Type: String -Parameter Sets: Plain -Required: True -``` - -### -AcceptUntrustedCerts - -Accept untrusted certificates for cluster - -```yaml -Type: Switch -``` - -### -GeneratePfx - -Generate pfx file - -```yaml -Type: Switch -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) +``` + +### -Kubeconfig + +kubeconfig as JSON string + +```yaml +Type: String +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -KubernetesUrl + +URL of Kubernetes cluster + +```yaml +Type: String +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -EndpointName + +The name displayed on the services page. +In VSTS this is the Connection Name. + +```yaml +Type: String +Position: 3 +``` + +### -ClientCertificateData + +Client certificate from Kubeconfig + +```yaml +Type: String +Required: True +``` + +### -ClientKeyData + +Client private key from Kubeconfig + +```yaml +Type: String +Parameter Sets: Plain +Required: True +``` + +### -AcceptUntrustedCerts + +Accept untrusted certificates for cluster + +```yaml +Type: Switch +``` + +### -GeneratePfx + +Generate pfx file + +```yaml +Type: Switch +``` + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) + +[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) + +[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) diff --git a/docs/Add-VSTeamNuGetEndpoint.md b/docs/Add-VSTeamNuGetEndpoint.md index 40ab09c31..60912547d 100644 --- a/docs/Add-VSTeamNuGetEndpoint.md +++ b/docs/Add-VSTeamNuGetEndpoint.md @@ -1,35 +1,35 @@ - - -# Add-VSTeamNuGetEndpoint - -## SYNOPSIS - -Adds a new NuGet service endpoint. - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new connection between TFS/VSTS and a NuGet server using the NuGet connection type. - -This is only used when using the NuGet tasks. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> $apikey = Read-Host -Prompt 'ApiKey' -AsSecureString -ApiKey: ************************************ -PS C:\> Add-NuGetEndpoint -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -SecureApiKey $apikey -``` - -This will add a project name MyProject with no description using the Scrum process -template and Git source control. - -## PARAMETERS - + + +# Add-VSTeamNuGetEndpoint + +## SYNOPSIS + +Adds a new NuGet service endpoint. + +## SYNTAX + +## DESCRIPTION + +The cmdlet adds a new connection between TFS/VSTS and a NuGet server using the NuGet connection type. + +This is only used when using the NuGet tasks. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> $apikey = Read-Host -Prompt 'ApiKey' -AsSecureString +ApiKey: ************************************ +PS C:\> Add-NuGetEndpoint -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -SecureApiKey $apikey +``` + +This will add a project name MyProject with no description using the Scrum process +template and Git source control. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -44,110 +44,110 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -NuGetUrl - -URL of the NuGet server. - -```yaml -Type: String -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -PersonalAccessToken - -Authentication Token generated by NuGet. - -```yaml -Type: String -Parameter Sets: ClearToken -Required: True -Position: Named -Accept pipeline input: true (ByPropertyName) -``` - -### -ApiKey - -Authentication ApiKey generated by NuGet. - -```yaml -Type: String -Parameter Sets: ClearApiKey -Required: True -Position: Named -Accept pipeline input: true (ByPropertyName) -``` - -### -Username - -Username to use with basic authentication. - -```yaml -Type: String -Parameter Sets: SecurePassword -Position: Named -``` - -### -EndpointName - -The name displayed on the services page. -In VSTS this is the Connection Name. - -```yaml -Type: String -Position: Named -``` - -### -SecureApiKey - -A secured string to capture your sensitive information. - -This will allow you to provide your information without displaying it in plain text. - -```yaml -Type: SecureString -Parameter Sets: SecureApiKey -Required: True -``` - -### -SecurePersonalAccessToken - -A secured string to capture your sensitive information. - -You must provide on the command line. You will not be prompted for this value. - -You can use $p = Read-Host -AsSecureString to capture to pass in as parameter. - -```yaml -Type: SecureString -Parameter Sets: SecureToken -Required: True -``` - -### -SecurePassword - -A secured string to capture your sensitive information. - -```yaml -Type: SecureString -Parameter Sets: SecurePassword -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) +``` + +### -NuGetUrl + +URL of the NuGet server. + +```yaml +Type: String +Required: True +Position: 1 +Accept pipeline input: true (ByPropertyName) +``` + +### -PersonalAccessToken + +Authentication Token generated by NuGet. + +```yaml +Type: String +Parameter Sets: ClearToken +Required: True +Position: Named +Accept pipeline input: true (ByPropertyName) +``` + +### -ApiKey + +Authentication ApiKey generated by NuGet. + +```yaml +Type: String +Parameter Sets: ClearApiKey +Required: True +Position: Named +Accept pipeline input: true (ByPropertyName) +``` + +### -Username + +Username to use with basic authentication. + +```yaml +Type: String +Parameter Sets: SecurePassword +Position: Named +``` + +### -EndpointName + +The name displayed on the services page. +In VSTS this is the Connection Name. + +```yaml +Type: String +Position: Named +``` + +### -SecureApiKey + +A secured string to capture your sensitive information. + +This will allow you to provide your information without displaying it in plain text. + +```yaml +Type: SecureString +Parameter Sets: SecureApiKey +Required: True +``` + +### -SecurePersonalAccessToken + +A secured string to capture your sensitive information. + +You must provide on the command line. You will not be prompted for this value. + +You can use $p = Read-Host -AsSecureString to capture to pass in as parameter. + +```yaml +Type: SecureString +Parameter Sets: SecureToken +Required: True +``` + +### -SecurePassword + +A secured string to capture your sensitive information. + +```yaml +Type: SecureString +Parameter Sets: SecurePassword +Required: True +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) + +[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) + +[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) diff --git a/docs/Add-VSTeamPolicy.md b/docs/Add-VSTeamPolicy.md index b087b4101..92a25c196 100644 --- a/docs/Add-VSTeamPolicy.md +++ b/docs/Add-VSTeamPolicy.md @@ -1,30 +1,30 @@ - - -# Add-VSTeamPolicy - -## SYNOPSIS - -Adds a new policy to the specified project. - -## SYNTAX - -## DESCRIPTION - -Adds a new policy to the specified project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamPolicy -ProjectName Demo -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} -``` - -This command adds a new policy to the Demo project's repository specified. The policy added requires a minimum number of reviewers and applies to the master branch. Specifying `-blocking` will block pushes to master directly. - -## PARAMETERS - + + +# Add-VSTeamPolicy + +## SYNOPSIS + +Adds a new policy to the specified project. + +## SYNTAX + +## DESCRIPTION + +Adds a new policy to the specified project. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamPolicy -ProjectName Demo -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} +``` + +This command adds a new policy to the Demo project's repository specified. The policy added requires a minimum number of reviewers and applies to the master branch. Specifying `-blocking` will block pushes to master directly. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -39,55 +39,55 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -type - -Specifies the id of the type of policy to be created. - -```yaml -Type: Guid -Required: True -``` - -### -enabled - -Enables the policy - -```yaml -Type: Switch -``` - -### -blocking - -Determines if the policy will block pushes to the branch if the policy is not adhered to. - -```yaml -Type: Switch -``` - -### -settings - -The settings for the policy. - -Each policy type has it's own settings that will need to be set. - -```yaml -Type: Hashtable -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamPolicy](Get-VSTeamPolicy.md) - -[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md) +``` + +### -type + +Specifies the id of the type of policy to be created. + +```yaml +Type: Guid +Required: True +``` + +### -enabled + +Enables the policy + +```yaml +Type: Switch +``` + +### -blocking + +Determines if the policy will block pushes to the branch if the policy is not adhered to. + +```yaml +Type: Switch +``` + +### -settings + +The settings for the policy. + +Each policy type has it's own settings that will need to be set. + +```yaml +Type: Hashtable +Required: True +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Get-VSTeamPolicy](Get-VSTeamPolicy.md) + +[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) + +[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md) diff --git a/docs/Add-VSTeamProfile.md b/docs/Add-VSTeamProfile.md index 7c3979e11..53d31773c 100644 --- a/docs/Add-VSTeamProfile.md +++ b/docs/Add-VSTeamProfile.md @@ -1,118 +1,118 @@ - - -# Add-VSTeamProfile - -## SYNOPSIS - + + +# Add-VSTeamProfile + +## SYNOPSIS + Stores your account name and personal access token as a profile for use with -the Add-TeamAccount function in this module. - -## SYNTAX - -## DESCRIPTION - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProfile -``` - -You will be prompted for the account name and personal access token. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProfile -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Version TFS2018 -``` - -Allows you to provide all the information on the command line. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProfile -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication -``` - -On Windows, allows you use to use Windows authentication against a local TFS server. - -## PARAMETERS - -### -Account - -The Visual Studio Team Services (VSTS) account name to use. -DO NOT enter the entire URL. - -Just the portion after dev.azure.com. For example in the -following url mydemos is the account name. - -or -The full Team Foundation Server (TFS) url including the collection. - - -```yaml -Type: String -Parameter Sets: Secure, Plain, Windows -Required: True -Position: 1 -``` - -### -PAT - -A secured string to capture your personal access token. - -This will allow you to provide your personal access token -without displaying it in plain text. - -To use pat simply omit it from the Add-VSTeamProfile command. - -```yaml -Type: SecureString -Parameter Sets: Secure -Required: True -``` - -### -PersonalAccessToken - -The personal access token from VSTS/TFS to use to access this account. - -```yaml -Type: String -Parameter Sets: Plain -Required: True -Position: 2 -``` - -### -UseWindowsAuthentication - -Allows the use of the current user's Windows credentials to authenticate against a local TFS. - -```yaml -Type: SwitchParameter -Parameter Sets: Windows -``` - -### -UseBearerToken - -Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - -```yaml -Type: SwitchParameter -Parameter Sets: Secure, Plain -``` - -### -Name - -Optional name for the profile. If this parameter is not provided the account will also serve as the name. - -```yaml -Type: String -Required: True -Position: 3 -``` - +the Add-TeamAccount function in this module. + +## SYNTAX + +## DESCRIPTION + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamProfile +``` + +You will be prompted for the account name and personal access token. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamProfile -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Version TFS2018 +``` + +Allows you to provide all the information on the command line. + +### -------------------------- EXAMPLE 3 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamProfile -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication +``` + +On Windows, allows you use to use Windows authentication against a local TFS server. + +## PARAMETERS + +### -Account + +The Visual Studio Team Services (VSTS) account name to use. +DO NOT enter the entire URL. + +Just the portion after dev.azure.com. For example in the +following url mydemos is the account name. + +or +The full Team Foundation Server (TFS) url including the collection. + + +```yaml +Type: String +Parameter Sets: Secure, Plain, Windows +Required: True +Position: 1 +``` + +### -PAT + +A secured string to capture your personal access token. + +This will allow you to provide your personal access token +without displaying it in plain text. + +To use pat simply omit it from the Add-VSTeamProfile command. + +```yaml +Type: SecureString +Parameter Sets: Secure +Required: True +``` + +### -PersonalAccessToken + +The personal access token from VSTS/TFS to use to access this account. + +```yaml +Type: String +Parameter Sets: Plain +Required: True +Position: 2 +``` + +### -UseWindowsAuthentication + +Allows the use of the current user's Windows credentials to authenticate against a local TFS. + +```yaml +Type: SwitchParameter +Parameter Sets: Windows +``` + +### -UseBearerToken + +Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. + +```yaml +Type: SwitchParameter +Parameter Sets: Secure, Plain +``` + +### -Name + +Optional name for the profile. If this parameter is not provided the account will also serve as the name. + +```yaml +Type: String +Required: True +Position: 3 +``` + ### -Version Specifies the version to use. The acceptable values for this parameter are: @@ -130,17 +130,17 @@ Parameter Sets: Secure, Plain, Windows Required: True Position: 3 Default value: TFS2017 for TFS and AzD for AzD -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Set-VSTeamAccount](Set-VSTeamAccount.md) + +[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) diff --git a/docs/Add-VSTeamProject.md b/docs/Add-VSTeamProject.md index 72e932338..72e31afb4 100644 --- a/docs/Add-VSTeamProject.md +++ b/docs/Add-VSTeamProject.md @@ -1,89 +1,89 @@ - - -# Add-VSTeamProject - -## SYNOPSIS - -Adds a Team Project to your account. - -## SYNTAX - -## DESCRIPTION - -This will create a new Team Project in your Team Foundation Server or Team Services account. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProject 'MyProject' -``` - -This will add a project name MyProject with no description using the Scrum process -template and Git source control. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProject 'MyProject' -TFVC -ProcessTemplate Agile -``` - -This will add a project name MyProject with no description using the Agile process -template and TFVC source control. - -## PARAMETERS - -### -ProjectName - -The name of the project to create. - -```yaml -Type: String -Aliases: Name -Required: True -Position: 0 -``` - -### -ProcessTemplate - -The name of the process template to use for the project. - -You can tab complete from a list of available projects. - -```yaml -Type: String -Default value: Scrum -``` - -### -Description - -The description of the team project. - -```yaml -Type: String -``` - -### -TFVC - -Switches the source control from Git to TFVC. - -```yaml -Type: SwitchParameter -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Remove-VSTeamProject](Remove-VSTeamProject.md) - -[Get-VSTeamProcess](Get-VSTeamProcess.md) + + +# Add-VSTeamProject + +## SYNOPSIS + +Adds a Team Project to your account. + +## SYNTAX + +## DESCRIPTION + +This will create a new Team Project in your Team Foundation Server or Team Services account. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamProject 'MyProject' +``` + +This will add a project name MyProject with no description using the Scrum process +template and Git source control. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamProject 'MyProject' -TFVC -ProcessTemplate Agile +``` + +This will add a project name MyProject with no description using the Agile process +template and TFVC source control. + +## PARAMETERS + +### -ProjectName + +The name of the project to create. + +```yaml +Type: String +Aliases: Name +Required: True +Position: 0 +``` + +### -ProcessTemplate + +The name of the process template to use for the project. + +You can tab complete from a list of available projects. + +```yaml +Type: String +Default value: Scrum +``` + +### -Description + +The description of the team project. + +```yaml +Type: String +``` + +### -TFVC + +Switches the source control from Git to TFVC. + +```yaml +Type: SwitchParameter +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Set-VSTeamAccount](Set-VSTeamAccount.md) + +[Remove-VSTeamProject](Remove-VSTeamProject.md) + +[Get-VSTeamProcess](Get-VSTeamProcess.md) diff --git a/docs/Add-VSTeamProjectPermission.md b/docs/Add-VSTeamProjectPermission.md index 7ea4e5f26..eb8db39ce 100644 --- a/docs/Add-VSTeamProjectPermission.md +++ b/docs/Add-VSTeamProjectPermission.md @@ -1,22 +1,22 @@ - - -# Add-VSTeamProjectPermission - -## SYNOPSIS - -Add Permissions on Project Level - -## SYNTAX - -## DESCRIPTION - -Add Permissions on Project Level - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamProjectPermission + +## SYNOPSIS + +Add Permissions on Project Level + +## SYNTAX + +## DESCRIPTION + +Add Permissions on Project Level + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,50 +31,50 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Descriptor - -```yaml -Type: String -Required: True -``` - -### -User - -```yaml -Type: VSTeamUser -Required: True -``` - -### -Group - -```yaml -Type: VSTeamGroup -Required: True -``` - -### -Allow - -```yaml -Type: VSTeamProjectPermissions -Required: True -``` - -### -Deny - -```yaml -Type: VSTeamProjectPermissions -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +### -Descriptor + +```yaml +Type: String +Required: True +``` + +### -User + +```yaml +Type: VSTeamUser +Required: True +``` + +### -Group + +```yaml +Type: VSTeamGroup +Required: True +``` + +### -Allow + +```yaml +Type: VSTeamProjectPermissions +Required: True +``` + +### -Deny + +```yaml +Type: VSTeamProjectPermissions +Required: True +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Add-VSTeamRelease.md b/docs/Add-VSTeamRelease.md index 7a7e459c0..59a22820b 100644 --- a/docs/Add-VSTeamRelease.md +++ b/docs/Add-VSTeamRelease.md @@ -1,56 +1,56 @@ - - -# Add-VSTeamRelease - -## SYNOPSIS - -Queues a new release - -## SYNTAX - -## DESCRIPTION - -Add-VSTeamRelease will queue a new release. - -The environments will deploy according to how the release definition is configured in the Triggers tab. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild | ft id,name - -id name --- ---- -44 Demo-CI-44 - -PS C:\> Get-VSTeamReleaseDefinition -Expand artifacts | ft id,name,@{l='Alias';e={$_.artifacts[0].alias}} - -id name Alias --- ---- ----- - 1 Demo-CD Demo-CI - -PS C:\> Add-VSTeamRelease -DefinitionId 1 -Description Test -ArtifactAlias Demo-CI -BuildId 44 -``` - -This example shows how to find the Build ID, Artifact Alias, and Release definition ID required to start a release. If you call Set-VSTeamDefaultProject you can use Example 2 which is much easier. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamRelease -DefinitionName Demo-CD -Description Test -BuildNumber Demo-CI-44 -``` - -This command starts a new release using the Demo-CD release definition and the build with build number Demo-CI-44. - -You must set a default project to tab complete DefinitionName and BuildNumber. - -## PARAMETERS - + + +# Add-VSTeamRelease + +## SYNOPSIS + +Queues a new release + +## SYNTAX + +## DESCRIPTION + +Add-VSTeamRelease will queue a new release. + +The environments will deploy according to how the release definition is configured in the Triggers tab. + +You must call Set-VSTeamAccount before calling this function. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuild | ft id,name + +id name +-- ---- +44 Demo-CI-44 + +PS C:\> Get-VSTeamReleaseDefinition -Expand artifacts | ft id,name,@{l='Alias';e={$_.artifacts[0].alias}} + +id name Alias +-- ---- ----- + 1 Demo-CD Demo-CI + +PS C:\> Add-VSTeamRelease -DefinitionId 1 -Description Test -ArtifactAlias Demo-CI -BuildId 44 +``` + +This example shows how to find the Build ID, Artifact Alias, and Release definition ID required to start a release. If you call Set-VSTeamDefaultProject you can use Example 2 which is much easier. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamRelease -DefinitionName Demo-CD -Description Test -BuildNumber Demo-CI-44 +``` + +This command starts a new release using the Demo-CD release definition and the build with build number Demo-CI-44. + +You must set a default project to tab complete DefinitionName and BuildNumber. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -65,102 +65,102 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -DefinitionId - -The id of the release definition to use. - -```yaml -Type: Int32 -Parameter Sets: ById -Required: True -``` - -### -Description - -The description to use on the release. - -```yaml -Type: String -Required: True -``` - -### -ArtifactAlias - -The alias of the artifact to use with this release. - -```yaml -Type: String -Parameter Sets: ById -Required: True -``` - -### -Name - -The name of this release. - -```yaml -Type: String -``` - -### -BuildId - -The id of the build to use with this release. - -```yaml -Type: String -Parameter Sets: ById -Required: True -``` - -### -DefinitionName - -The name of the release definition to use. - -```yaml -Type: String -Parameter Sets: ByName -Accept pipeline input: true (ByPropertyName) -``` - -### -SourceBranch - -The branch of the artifact - -```yaml -Type: String -``` - -### -BuildNumber - -The number of the build to use. - -```yaml -Type: String -Parameter Sets: ByName -Accept pipeline input: true (ByPropertyName) -``` - +``` + +### -DefinitionId + +The id of the release definition to use. + +```yaml +Type: Int32 +Parameter Sets: ById +Required: True +``` + +### -Description + +The description to use on the release. + +```yaml +Type: String +Required: True +``` + +### -ArtifactAlias + +The alias of the artifact to use with this release. + +```yaml +Type: String +Parameter Sets: ById +Required: True +``` + +### -Name + +The name of this release. + +```yaml +Type: String +``` + +### -BuildId + +The id of the build to use with this release. + +```yaml +Type: String +Parameter Sets: ById +Required: True +``` + +### -DefinitionName + +The name of the release definition to use. + +```yaml +Type: String +Parameter Sets: ByName +Accept pipeline input: true (ByPropertyName) +``` + +### -SourceBranch + +The branch of the artifact + +```yaml +Type: String +``` + +### -BuildNumber + +The number of the build to use. + +```yaml +Type: String +Parameter Sets: ByName +Accept pipeline input: true (ByPropertyName) +``` + ### -Force Forces the command without confirmation ```yaml Type: SwitchParameter -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -## RELATED LINKS +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + +## RELATED LINKS diff --git a/docs/Add-VSTeamReleaseDefinition.md b/docs/Add-VSTeamReleaseDefinition.md index 2696d6d4c..22f282804 100644 --- a/docs/Add-VSTeamReleaseDefinition.md +++ b/docs/Add-VSTeamReleaseDefinition.md @@ -1,32 +1,32 @@ - - -# Add-VSTeamReleaseDefinition - -## SYNOPSIS - -Creates a new release definition from a JSON file. - -## SYNTAX - -## DESCRIPTION - -Reads a JSON file off disk and uses that file to create a new release definition in the provided project. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamReleaseDefinition -ProjectName demo -inFile release.json -``` - -This command reads release.json and creates a new release definition from it on the demo team project. - -## PARAMETERS - + + +# Add-VSTeamReleaseDefinition + +## SYNOPSIS + +Creates a new release definition from a JSON file. + +## SYNTAX + +## DESCRIPTION + +Reads a JSON file off disk and uses that file to create a new release definition in the provided project. + +You must call Set-VSTeamAccount before calling this function. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamReleaseDefinition -ProjectName demo -inFile release.json +``` + +This command reads release.json and creates a new release definition from it on the demo team project. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -41,31 +41,31 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -InFile - -Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## RELATED LINKS - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. +``` + +### -InFile + +Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. + +```yaml +Type: String +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +## INPUTS + +### System.String + +## OUTPUTS + +## RELATED LINKS + +## NOTES + +This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. diff --git a/docs/Add-VSTeamServiceEndpoint.md b/docs/Add-VSTeamServiceEndpoint.md index 5576b71da..63abb37c0 100644 --- a/docs/Add-VSTeamServiceEndpoint.md +++ b/docs/Add-VSTeamServiceEndpoint.md @@ -1,22 +1,22 @@ - - -# Add-VSTeamServiceEndpoint - -## SYNOPSIS - -Adds a generic service connection - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new generic connection between TFS/VSTS and a third party service (see VSTS for available connections). - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamServiceEndpoint + +## SYNOPSIS + +Adds a generic service connection + +## SYNTAX + +## DESCRIPTION + +The cmdlet adds a new generic connection between TFS/VSTS and a third party service (see VSTS for available connections). + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,49 +31,49 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Object - -Hashtable of Payload for REST call - -```yaml -Type: Hashtable -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -EndpointName - -The name displayed on the services page. In VSTS this is the Connection Name. - -```yaml -Type: String -Position: 2 -``` - -### -EndpointType - -Type of endpoint (eg. `kubernetes`, `sonarqube`). See VSTS service page for supported endpoints. - -```yaml -Type: String -Position: 3 -``` - -## INPUTS - -## OUTPUTS - -### Team.ServiceEndpoint - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) +``` + +### -Object + +Hashtable of Payload for REST call + +```yaml +Type: Hashtable +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -EndpointName + +The name displayed on the services page. In VSTS this is the Connection Name. + +```yaml +Type: String +Position: 2 +``` + +### -EndpointType + +Type of endpoint (eg. `kubernetes`, `sonarqube`). See VSTS service page for supported endpoints. + +```yaml +Type: String +Position: 3 +``` + +## INPUTS + +## OUTPUTS + +### Team.ServiceEndpoint + +## NOTES + +## RELATED LINKS + +[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) + +[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) + +[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) diff --git a/docs/Add-VSTeamServiceFabricEndpoint.md b/docs/Add-VSTeamServiceFabricEndpoint.md index 3270f4fee..373d58da7 100644 --- a/docs/Add-VSTeamServiceFabricEndpoint.md +++ b/docs/Add-VSTeamServiceFabricEndpoint.md @@ -1,50 +1,50 @@ - - -# Add-VSTeamServiceFabricEndpoint - -## SYNOPSIS - -Adds a new Service Fabric service endpoint. - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new Service Fabric service endpoint to an existing project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "NoAuthTest" -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false -``` - -Adds a Service Fabric Endpoint for a non-secure cluster - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "AzureAdAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -username "someUser@someplace.com" -password $password -``` - -Adds a Service Fabric Endpoint for an Azure AD secured cluster. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force -PS C:\> $pathToPFX = "C:\someFolder\theCertificateFile.pfx" -PS C:\> $base64Cert = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes($pathToPFX)) -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "CertificateAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -certificate $base64Cert -certificatePassword $password -``` - -Adds a Service Fabric Endpoint for a certificate secured cluster. - -## PARAMETERS - + + +# Add-VSTeamServiceFabricEndpoint + +## SYNOPSIS + +Adds a new Service Fabric service endpoint. + +## SYNTAX + +## DESCRIPTION + +The cmdlet adds a new Service Fabric service endpoint to an existing project. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "NoAuthTest" -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false +``` + +Adds a Service Fabric Endpoint for a non-secure cluster + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force +PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "AzureAdAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -username "someUser@someplace.com" -password $password +``` + +Adds a Service Fabric Endpoint for an Azure AD secured cluster. + +### -------------------------- EXAMPLE 3 -------------------------- + +```PowerShell +PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force +PS C:\> $pathToPFX = "C:\someFolder\theCertificateFile.pfx" +PS C:\> $base64Cert = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes($pathToPFX)) +PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "CertificateAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -certificate $base64Cert -certificatePassword $password +``` + +Adds a Service Fabric Endpoint for a certificate secured cluster. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -59,117 +59,117 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -url - -The url of the Service Fabric management endpoint. - -```yaml -Type: String -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -useWindowsSecurity - -If windows integrated authentication should be enabled. If set to false, all authentication is disabled. - -```yaml -Type: Boolean -Position: 2 -Accept pipeline input: true (ByPropertyName) -``` - -### -clusterSpn - -Specify the cluster service principal name, for use with windows integrated authentication. - -```yaml -Type: String -Accept pipeline input: true (ByPropertyName) -``` - -### -serverCertThumbprint - -The server certificate thumbprint, used for communicating with the Service Fabric cluster. - -```yaml -Type: String -Parameter Sets: AzureAd, Certificate -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -username - -The Azure AD Username, used for communicating with the Service Fabric cluster. - -```yaml -Type: String -Parameter Sets: AzureAd -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -password - -The Password for the Azure AD User, used for communicating with the Service Fabric cluster. - -```yaml -Type: SecureString -Parameter Sets: AzureAd -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -certificate - -The certificate used for communicating with the Service Fabric cluster. - -```yaml -Type: String -Parameter Sets: Certificate -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -certificatePassword - -The Password for the certificate used for communicating with the Service Fabric cluster. - -```yaml -Type: SecureString -Parameter Sets: Certificate -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -endpointName - -The name displayed on the services page. In VSTS this is the Connection Name. - -```yaml -Type: String -Aliases: displayName -Position: 3 -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.ServiceEndpoint - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) +``` + +### -url + +The url of the Service Fabric management endpoint. + +```yaml +Type: String +Required: True +Position: 1 +Accept pipeline input: true (ByPropertyName) +``` + +### -useWindowsSecurity + +If windows integrated authentication should be enabled. If set to false, all authentication is disabled. + +```yaml +Type: Boolean +Position: 2 +Accept pipeline input: true (ByPropertyName) +``` + +### -clusterSpn + +Specify the cluster service principal name, for use with windows integrated authentication. + +```yaml +Type: String +Accept pipeline input: true (ByPropertyName) +``` + +### -serverCertThumbprint + +The server certificate thumbprint, used for communicating with the Service Fabric cluster. + +```yaml +Type: String +Parameter Sets: AzureAd, Certificate +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -username + +The Azure AD Username, used for communicating with the Service Fabric cluster. + +```yaml +Type: String +Parameter Sets: AzureAd +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -password + +The Password for the Azure AD User, used for communicating with the Service Fabric cluster. + +```yaml +Type: SecureString +Parameter Sets: AzureAd +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -certificate + +The certificate used for communicating with the Service Fabric cluster. + +```yaml +Type: String +Parameter Sets: Certificate +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -certificatePassword + +The Password for the certificate used for communicating with the Service Fabric cluster. + +```yaml +Type: SecureString +Parameter Sets: Certificate +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -endpointName + +The name displayed on the services page. In VSTS this is the Connection Name. + +```yaml +Type: String +Aliases: displayName +Position: 3 +Accept pipeline input: true (ByPropertyName) +``` + +## INPUTS + +## OUTPUTS + +### Team.ServiceEndpoint + +## NOTES + +## RELATED LINKS + +[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) + +[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) + +[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) diff --git a/docs/Add-VSTeamSonarQubeEndpoint.md b/docs/Add-VSTeamSonarQubeEndpoint.md index 8081dd77c..214f8287f 100644 --- a/docs/Add-VSTeamSonarQubeEndpoint.md +++ b/docs/Add-VSTeamSonarQubeEndpoint.md @@ -1,26 +1,26 @@ - - -# Add-VSTeamSonarQubeEndpoint - -## SYNOPSIS - -Adds a new SonarQube service endpoint. - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new connection between TFS/VSTS and a SonarQube server using the SonarQube connection type. - -This is only used when using the SonarQube tasks. - -Using SonarQube with the Maven tasks uses a Generic Connection type. - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamSonarQubeEndpoint + +## SYNOPSIS + +Adds a new SonarQube service endpoint. + +## SYNTAX + +## DESCRIPTION + +The cmdlet adds a new connection between TFS/VSTS and a SonarQube server using the SonarQube connection type. + +This is only used when using the SonarQube tasks. + +Using SonarQube with the Maven tasks uses a Generic Connection type. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -35,66 +35,66 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -SonarQubeUrl - -URL of the sonarqube server. - -```yaml -Type: String -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -PersonalAccessToken - -Authentication Token generated by SonarQube. - -```yaml -Type: String -Parameter Sets: Plain -Required: True -Position: 2 -Accept pipeline input: true (ByPropertyName) -``` - -### -EndpointName - -The name displayed on the services page. -In VSTS this is the Connection Name. - -```yaml -Type: String -Position: 3 -``` - -### -SecurePersonalAccessToken - -A secured string to capture your personal access token. - -This will allow you to provide your personal access token without displaying it in plain text. - -To use pat simply omit it from the Set-VSTeamAccount command. - -```yaml -Type: SecureString -Parameter Sets: Secure -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) +``` + +### -SonarQubeUrl + +URL of the sonarqube server. + +```yaml +Type: String +Required: True +Position: 1 +Accept pipeline input: true (ByPropertyName) +``` + +### -PersonalAccessToken + +Authentication Token generated by SonarQube. + +```yaml +Type: String +Parameter Sets: Plain +Required: True +Position: 2 +Accept pipeline input: true (ByPropertyName) +``` + +### -EndpointName + +The name displayed on the services page. +In VSTS this is the Connection Name. + +```yaml +Type: String +Position: 3 +``` + +### -SecurePersonalAccessToken + +A secured string to capture your personal access token. + +This will allow you to provide your personal access token without displaying it in plain text. + +To use pat simply omit it from the Set-VSTeamAccount command. + +```yaml +Type: SecureString +Parameter Sets: Secure +Required: True +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) + +[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) + +[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) diff --git a/docs/Add-VSTeamUserEntitlement.md b/docs/Add-VSTeamUserEntitlement.md index dabc75bb1..5b1bf8126 100644 --- a/docs/Add-VSTeamUserEntitlement.md +++ b/docs/Add-VSTeamUserEntitlement.md @@ -1,22 +1,22 @@ - - -# Add-VSTeamUserEntitlement - -## SYNOPSIS - -Add a user, assign license and extensions and make them a member of a project group in an account. - -## SYNTAX - -## DESCRIPTION - -Add a user, assign license and extensions and make them a member of a project group in an account. - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamUserEntitlement + +## SYNOPSIS + +Add a user, assign license and extensions and make them a member of a project group in an account. + +## SYNTAX + +## DESCRIPTION + +Add a user, assign license and extensions and make them a member of a project group in an account. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,48 +31,48 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -License - -Type of Account License. The acceptable values for this parameter are: - -- Advanced -- EarlyAdopter -- Express -- None -- Professional -- StakeHolder - -```yaml -Type: String -Required: True -Default value: EarlyAdopter -``` - -### -Group - -The acceptable values for this parameter are: - -- Custom -- ProjectAdministrator -- ProjectContributor -- ProjectReader -- ProjectStakeholder - -```yaml -Type: String -Required: True -Default value: ProjectContributor -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +### -License + +Type of Account License. The acceptable values for this parameter are: + +- Advanced +- EarlyAdopter +- Express +- None +- Professional +- StakeHolder + +```yaml +Type: String +Required: True +Default value: EarlyAdopter +``` + +### -Group + +The acceptable values for this parameter are: + +- Custom +- ProjectAdministrator +- ProjectContributor +- ProjectReader +- ProjectStakeholder + +```yaml +Type: String +Required: True +Default value: ProjectContributor +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Add-VSTeamVariableGroup.md b/docs/Add-VSTeamVariableGroup.md new file mode 100644 index 000000000..da20ed814 --- /dev/null +++ b/docs/Add-VSTeamVariableGroup.md @@ -0,0 +1,139 @@ + + + +# Add-VSTeamVariableGroup + +## SYNOPSIS +Adds a generic service connection + +## SYNTAX + +```powershell +Add-VSTeamVariableGroup [-variableGroupName] [-variableGroupType] + [-variableGroupDescription] [-variableGroupVariables] + [[-variableGroupProviderData] ] [-ProjectName] [] +``` + +## DESCRIPTION +Adds a generic service connection + +## EXAMPLES + +## PARAMETERS + +### -ProjectName +The name of the project. +You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupDescription +The variable group description + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupName +The variable group name + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupProviderData +The variable group ProviderData. This should be $null for Vsts types. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupType +The variable group type + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: Vsts, AzureKeyVault + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupVariables +The variable group variables. Please refer to the unit test for examples. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 4 +Default value: None +Accept pipeline input: True (ByPropertyName) +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 (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String +System.Collections.Hashtable + + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) + +[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) + +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) diff --git a/docs/Add-VSTeamWorkItem.md b/docs/Add-VSTeamWorkItem.md index bd8fcd848..092e536d8 100644 --- a/docs/Add-VSTeamWorkItem.md +++ b/docs/Add-VSTeamWorkItem.md @@ -1,44 +1,44 @@ - - -# Add-VSTeamWorkItem - -## SYNOPSIS - -Adds a work item to your project. - -## SYNTAX - -## DESCRIPTION - -Add-VSTeamWorkItem will add a new work item to your project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task - -ID Title Status --- ----- ------ -6 New Work Item To Do -``` - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" - -ID Title Status --- ----- ------ -6 New Work Item To Do -``` - -## PARAMETERS - + + +# Add-VSTeamWorkItem + +## SYNOPSIS + +Adds a work item to your project. + +## SYNTAX + +## DESCRIPTION + +Add-VSTeamWorkItem will add a new work item to your project. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task + +ID Title Status +-- ----- ------ +6 New Work Item To Do +``` + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" + +ID Title Status +-- ----- ------ +6 New Work Item To Do +``` + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -53,83 +53,83 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Title - -The title of the work item - -```yaml -Type: String -Required: True -``` - -### -Description - -The Description of the work item - -```yaml -Type: String -Required: False -``` - -### -IterationPath - -The IterationPath of the work item - -```yaml -Type: String -Required: False -``` - -### -AssignedTo - -The email address of the user this work item will be assigned to. - -```yaml -Type: String -Required: False -``` - -### -WorkItemType - -The type of work item to add. - -You can tab complete from a list of available work item types. - -You must use Set-VSTeamDefaultProject to set a default project to enable the tab completion. - -```yaml -Type: String -Required: True -``` - -### -ParentId - -The Id of the parent work item that this work item will be related to. - -```yaml -Type: Int -Required: False -``` - -## INPUTS - -### System.String - -ProjectName - -WorkItemType - -## OUTPUTS - -## NOTES - -WorkItemType is a dynamic parameter and use the default -project value to query their validate set. - -If you do not set the default project by called Set-VSTeamDefaultProject before -calling Add-VSTeamWorkItem you will have to type in the names. - -## RELATED LINKS +``` + +### -Title + +The title of the work item + +```yaml +Type: String +Required: True +``` + +### -Description + +The Description of the work item + +```yaml +Type: String +Required: False +``` + +### -IterationPath + +The IterationPath of the work item + +```yaml +Type: String +Required: False +``` + +### -AssignedTo + +The email address of the user this work item will be assigned to. + +```yaml +Type: String +Required: False +``` + +### -WorkItemType + +The type of work item to add. + +You can tab complete from a list of available work item types. + +You must use Set-VSTeamDefaultProject to set a default project to enable the tab completion. + +```yaml +Type: String +Required: True +``` + +### -ParentId + +The Id of the parent work item that this work item will be related to. + +```yaml +Type: Int +Required: False +``` + +## INPUTS + +### System.String + +ProjectName + +WorkItemType + +## OUTPUTS + +## NOTES + +WorkItemType is a dynamic parameter and use the default +project value to query their validate set. + +If you do not set the default project by called Set-VSTeamDefaultProject before +calling Add-VSTeamWorkItem you will have to type in the names. + +## RELATED LINKS diff --git a/docs/Add-VSTeamWorkItemAreaPermission.md b/docs/Add-VSTeamWorkItemAreaPermission.md index 0d7aefe81..d4513c639 100644 --- a/docs/Add-VSTeamWorkItemAreaPermission.md +++ b/docs/Add-VSTeamWorkItemAreaPermission.md @@ -1,22 +1,22 @@ - - -# Add-VSTeamWorkItemAreaPermission - -## SYNOPSIS - -Add Permissions to a Work Item Area - -## SYNTAX - -## DESCRIPTION - -Add Permissions to a Work Item Area - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamWorkItemAreaPermission + +## SYNOPSIS + +Add Permissions to a Work Item Area + +## SYNTAX + +## DESCRIPTION + +Add Permissions to a Work Item Area + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,64 +31,64 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -AreaID - -```yaml -Type: Int32 -Required: True -``` - -### -AreaPath - -```yaml -Type: String -Required: True -``` - -### -Descriptor - -```yaml -Type: String -Required: True -``` - -### -User - -```yaml -Type: VSTeamUser -Required: True -``` - -### -Group - -```yaml -Type: VSTeamGroup -Required: True -``` - -### -Allow - -```yaml -Type: VSTeamWorkItemAreaPermissions -Required: True -``` - -### -Deny - -```yaml -Type: VSTeamWorkItemAreaPermissions -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +### -AreaID + +```yaml +Type: Int32 +Required: True +``` + +### -AreaPath + +```yaml +Type: String +Required: True +``` + +### -Descriptor + +```yaml +Type: String +Required: True +``` + +### -User + +```yaml +Type: VSTeamUser +Required: True +``` + +### -Group + +```yaml +Type: VSTeamGroup +Required: True +``` + +### -Allow + +```yaml +Type: VSTeamWorkItemAreaPermissions +Required: True +``` + +### -Deny + +```yaml +Type: VSTeamWorkItemAreaPermissions +Required: True +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Add-VSTeamWorkItemIterationPermission.md b/docs/Add-VSTeamWorkItemIterationPermission.md index 9515946db..ccfd3ad95 100644 --- a/docs/Add-VSTeamWorkItemIterationPermission.md +++ b/docs/Add-VSTeamWorkItemIterationPermission.md @@ -1,22 +1,22 @@ - - -# Add-VSTeamWorkItemIterationPermission - -## SYNOPSIS - -Add Permissions to an Iteration - -## SYNTAX - -## DESCRIPTION - -Add Permissions to an Iteration - -## EXAMPLES - -## PARAMETERS - + + +# Add-VSTeamWorkItemIterationPermission + +## SYNOPSIS + +Add Permissions to an Iteration + +## SYNTAX + +## DESCRIPTION + +Add Permissions to an Iteration + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,64 +31,64 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -IterationID - -```yaml -Type: Int32 -Required: True -``` - -### -IterationPath - -```yaml -Type: String -Required: True -``` - -### -Descriptor - -```yaml -Type: String -Required: True -``` - -### -User - -```yaml -Type: VSTeamUser -Required: True -``` - -### -Group - -```yaml -Type: VSTeamGroup -Required: True -``` - -### -Allow - -```yaml -Type: VSTeamWorkItemIterationPermissions -Required: True -``` - -### -Deny - -```yaml -Type: VSTeamWorkItemIterationPermissions -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +### -IterationID + +```yaml +Type: Int32 +Required: True +``` + +### -IterationPath + +```yaml +Type: String +Required: True +``` + +### -Descriptor + +```yaml +Type: String +Required: True +``` + +### -User + +```yaml +Type: VSTeamUser +Required: True +``` + +### -Group + +```yaml +Type: VSTeamGroup +Required: True +``` + +### -Allow + +```yaml +Type: VSTeamWorkItemIterationPermissions +Required: True +``` + +### -Deny + +```yaml +Type: VSTeamWorkItemIterationPermissions +Required: True +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Clear-VSTeamDefaultProject.md b/docs/Clear-VSTeamDefaultProject.md index 75daed071..f2bf216a2 100644 --- a/docs/Clear-VSTeamDefaultProject.md +++ b/docs/Clear-VSTeamDefaultProject.md @@ -1,47 +1,47 @@ - - -# Clear-VSTeamDefaultProject - -## SYNOPSIS - -Clears the value stored in the default project parameter value. - -## SYNTAX - -## DESCRIPTION - -Clears the value stored in the default project parameter value. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Clear-Project -``` - -This will clear the default project parameter value. You will now have to provide a project for any functions that require a project. - -## PARAMETERS - -### -Level - -On Windows allows you to clear your default project at the Process, User or Machine levels. - -```yaml -Type: String -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Set-VSTeamAccount](Set-VSTeamAccount.md) + + +# Clear-VSTeamDefaultProject + +## SYNOPSIS + +Clears the value stored in the default project parameter value. + +## SYNTAX + +## DESCRIPTION + +Clears the value stored in the default project parameter value. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Clear-Project +``` + +This will clear the default project parameter value. You will now have to provide a project for any functions that require a project. + +## PARAMETERS + +### -Level + +On Windows allows you to clear your default project at the Process, User or Machine levels. + +```yaml +Type: String +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + +[Set-VSTeamAccount](Set-VSTeamAccount.md) diff --git a/docs/Disable-VSTeamAgent.md b/docs/Disable-VSTeamAgent.md index 345c35140..8a0535b79 100644 --- a/docs/Disable-VSTeamAgent.md +++ b/docs/Disable-VSTeamAgent.md @@ -1,50 +1,50 @@ - - -# Disable-VSTeamAgent - -## SYNOPSIS - -Disables an agent in a pool. - -## SYNTAX - -## DESCRIPTION - -Disables an agent in a pool. - -## EXAMPLES - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: int -Required: True -Accept pipeline input: true (ByValue) -``` - -### -Id - -Id of the agent to disable. - -```yaml -Type: int[] -Aliases: AgentID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## NOTES - -## RELATED LINKS + + +# Disable-VSTeamAgent + +## SYNOPSIS + +Disables an agent in a pool. + +## SYNTAX + +## DESCRIPTION + +Disables an agent in a pool. + +## EXAMPLES + +## PARAMETERS + +### -PoolId + +Id of the pool. + +```yaml +Type: int +Required: True +Accept pipeline input: true (ByValue) +``` + +### -Id + +Id of the agent to disable. + +```yaml +Type: int[] +Aliases: AgentID +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +## INPUTS + +### System.String + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Enable-VSTeamAgent.md b/docs/Enable-VSTeamAgent.md index 5eb2ae8c0..79e0800de 100644 --- a/docs/Enable-VSTeamAgent.md +++ b/docs/Enable-VSTeamAgent.md @@ -1,50 +1,50 @@ - - -# Enable-VSTeamAgent - -## SYNOPSIS - -Enables an agent in a pool. - -## SYNTAX - -## DESCRIPTION - -Enables an agent in a pool. - -## EXAMPLES - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: int -Required: True -Accept pipeline input: true (ByValue) -``` - -### -Id - -Id of the agent to enable. - -```yaml -Type: int[] -Aliases: AgentID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## NOTES - -## RELATED LINKS + + +# Enable-VSTeamAgent + +## SYNOPSIS + +Enables an agent in a pool. + +## SYNTAX + +## DESCRIPTION + +Enables an agent in a pool. + +## EXAMPLES + +## PARAMETERS + +### -PoolId + +Id of the pool. + +```yaml +Type: int +Required: True +Accept pipeline input: true (ByValue) +``` + +### -Id + +Id of the agent to enable. + +```yaml +Type: int[] +Aliases: AgentID +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +## INPUTS + +### System.String + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeam.md b/docs/Get-VSTeam.md index 950c0a8bf..dc8335611 100644 --- a/docs/Get-VSTeam.md +++ b/docs/Get-VSTeam.md @@ -1,22 +1,22 @@ - - -# Get-VSTeam - -## SYNOPSIS - -Returns a team. - -## SYNTAX - -## DESCRIPTION - -Returns a team. - -## EXAMPLES - -## PARAMETERS - + + +# Get-VSTeam + +## SYNOPSIS + +Returns a team. + +## SYNTAX + +## DESCRIPTION + +Returns a team. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,51 +31,51 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Skip - -The number of items to skip. - -```yaml -Type: Int32 -Parameter Sets: List -``` - -### -TeamId - -The id of the team to retrieve. - -```yaml -Type: String[] -Parameter Sets: ByID -``` - -### -Top - -Specifies the maximum number to return. - -```yaml -Type: Int32 -Parameter Sets: List -``` - -### -Name - -The name of the team to retrieve. - -```yaml -Type: String[] -Parameter Sets: ByName -``` - -## INPUTS - -## OUTPUTS - -### Team.Team - -## NOTES - -## RELATED LINKS +``` + +### -Skip + +The number of items to skip. + +```yaml +Type: Int32 +Parameter Sets: List +``` + +### -TeamId + +The id of the team to retrieve. + +```yaml +Type: String[] +Parameter Sets: ByID +``` + +### -Top + +Specifies the maximum number to return. + +```yaml +Type: Int32 +Parameter Sets: List +``` + +### -Name + +The name of the team to retrieve. + +```yaml +Type: String[] +Parameter Sets: ByName +``` + +## INPUTS + +## OUTPUTS + +### Team.Team + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeamAccessControlList.md b/docs/Get-VSTeamAccessControlList.md index 7ea27dff3..cb3fe4746 100644 --- a/docs/Get-VSTeamAccessControlList.md +++ b/docs/Get-VSTeamAccessControlList.md @@ -1,89 +1,89 @@ - - -# Get-VSTeamAccessControlList - -## SYNOPSIS - -Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. - -## SYNTAX - -## DESCRIPTION - -Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList -``` - -## PARAMETERS - -### -SecurityNamespace - -Security namespace identifier. - -```yaml -Type: VSTeamSecurityNamespace -Required: True -``` - -### -SecurityNamespaceId - -Security namespace identifier. - -```yaml -Type: String -Required: True -``` - -### -Token - -Security token - -```yaml -Type: String -Required: True -``` - -### -Descriptors - -An optional filter string containing a list of identity descriptors whose ACEs should be retrieved. If this is not set entire ACLs will be returned. - -```yaml -Type: String -Required: True -``` - -### -IncludeExtendedInfo - -If set, populate the extended information properties for the access control entries contained in the returned lists. - -```yaml -Type: Switch -Required: True -``` - -### -Recurse - -If true and this is a hierarchical namespace, return child ACLs of the specified token. - -```yaml -Type: Switch -Required: True -``` - -## INPUTS - -## OUTPUTS - -### VSTeamAccessControlList - -## NOTES - -## RELATED LINKS + + +# Get-VSTeamAccessControlList + +## SYNOPSIS + +Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. + +## SYNTAX + +## DESCRIPTION + +Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList +``` + +## PARAMETERS + +### -SecurityNamespace + +Security namespace identifier. + +```yaml +Type: VSTeamSecurityNamespace +Required: True +``` + +### -SecurityNamespaceId + +Security namespace identifier. + +```yaml +Type: String +Required: True +``` + +### -Token + +Security token + +```yaml +Type: String +Required: True +``` + +### -Descriptors + +An optional filter string containing a list of identity descriptors whose ACEs should be retrieved. If this is not set entire ACLs will be returned. + +```yaml +Type: String +Required: True +``` + +### -IncludeExtendedInfo + +If set, populate the extended information properties for the access control entries contained in the returned lists. + +```yaml +Type: Switch +Required: True +``` + +### -Recurse + +If true and this is a hierarchical namespace, return child ACLs of the specified token. + +```yaml +Type: Switch +Required: True +``` + +## INPUTS + +## OUTPUTS + +### VSTeamAccessControlList + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeamAgent.md b/docs/Get-VSTeamAgent.md index 30d0870ef..a297ed556 100644 --- a/docs/Get-VSTeamAgent.md +++ b/docs/Get-VSTeamAgent.md @@ -1,57 +1,57 @@ - - -# Get-VSTeamAgent - -## SYNOPSIS - -Returns the agents in a pool. - -## SYNTAX - -## DESCRIPTION - -Returns the agents in a pool. - -## EXAMPLES - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByValue) -``` - -### -Id - -Id of the agent to return. - -```yaml -Type: String -Parameter Sets: ByID -Aliases: AgentID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -To read system capabilities that contain dots you have to use the PSObject Properties property. - -(Get-VSTeamAgent 1 91).systemCapabilities.PSObject.Properties['Agent.OS'].Value - -## RELATED LINKS + + +# Get-VSTeamAgent + +## SYNOPSIS + +Returns the agents in a pool. + +## SYNTAX + +## DESCRIPTION + +Returns the agents in a pool. + +## EXAMPLES + +## PARAMETERS + +### -PoolId + +Id of the pool. + +```yaml +Type: String +Required: True +Accept pipeline input: true (ByValue) +``` + +### -Id + +Id of the agent to return. + +```yaml +Type: String +Parameter Sets: ByID +Aliases: AgentID +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object + +## NOTES + +To read system capabilities that contain dots you have to use the PSObject Properties property. + +(Get-VSTeamAgent 1 91).systemCapabilities.PSObject.Properties['Agent.OS'].Value + +## RELATED LINKS diff --git a/docs/Get-VSTeamApproval.md b/docs/Get-VSTeamApproval.md index 241b965e3..7505418e7 100644 --- a/docs/Get-VSTeamApproval.md +++ b/docs/Get-VSTeamApproval.md @@ -1,58 +1,58 @@ - - -# Get-VSTeamApproval - -## SYNOPSIS - -Gets a list of approvals for all releases for a team project. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamApproval function gets the approvals for all releases for a team project. - -With just a project name, this function gets all of the pending approvals for that team project. - -When using with VSTS "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter is not empty. - -When using with TFS "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter, Release Id Filter are not empty and Status Filter equals Pending. - -The Team.Approval type has three custom table formats: - -- Pending: ID, Status, Release Name, Environment, Type, Approver Name, Release Definitions -- Approved: Release Name, Environment, Is Automated, Approval Type, Approver Name, Release Definitions, Comments -- Rejected: Release Name, Environment, Approval Type, Approver Name, Release Definition, Comments - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo -``` - -This command gets a list of all pending approvals. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo -StatusFilter Approved | Format-Table -View Approved -``` - -This command gets a list of all approved approvals using a custom table format. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo -AssignedToFilter Administrator -StatusFilter Rejected | FT -View Rejected -``` - -This command gets a list of all approvals rejected by Administrator using a custom table format. - -## PARAMETERS - + + +# Get-VSTeamApproval + +## SYNOPSIS + +Gets a list of approvals for all releases for a team project. + +## SYNTAX + +## DESCRIPTION + +The Get-VSTeamApproval function gets the approvals for all releases for a team project. + +With just a project name, this function gets all of the pending approvals for that team project. + +When using with VSTS "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter is not empty. + +When using with TFS "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter, Release Id Filter are not empty and Status Filter equals Pending. + +The Team.Approval type has three custom table formats: + +- Pending: ID, Status, Release Name, Environment, Type, Approver Name, Release Definitions +- Approved: Release Name, Environment, Is Automated, Approval Type, Approver Name, Release Definitions, Comments +- Rejected: Release Name, Environment, Approval Type, Approver Name, Release Definition, Comments + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamApproval -ProjectName Demo +``` + +This command gets a list of all pending approvals. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamApproval -ProjectName Demo -StatusFilter Approved | Format-Table -View Approved +``` + +This command gets a list of all approved approvals using a custom table format. + +### -------------------------- EXAMPLE 3 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamApproval -ProjectName Demo -AssignedToFilter Administrator -StatusFilter Rejected | FT -View Rejected +``` + +This command gets a list of all approvals rejected by Administrator using a custom table format. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -67,60 +67,60 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -StatusFilter - -By default the function returns Pending approvals. - -Using this filter you can return Approved, ReAssigned or Rejected approvals. - -There is a custom table view for each status. - -```yaml -Type: String -``` - -### -ReleaseIdsFilter - -Only approvals for the release ids provided will be returned. - -```yaml -Type: Int32[] -Aliases: ReleaseIdFilter -``` - -### -AssignedToFilter - -Approvals are filtered to only those assigned to this user. - -```yaml -Type: String -``` - -## INPUTS - -## OUTPUTS - -### Team.BuildDefinition - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe build definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -[Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) +``` + +### -StatusFilter + +By default the function returns Pending approvals. + +Using this filter you can return Approved, ReAssigned or Rejected approvals. + +There is a custom table view for each status. + +```yaml +Type: String +``` + +### -ReleaseIdsFilter + +Only approvals for the release ids provided will be returned. + +```yaml +Type: Int32[] +Aliases: ReleaseIdFilter +``` + +### -AssignedToFilter + +Approvals are filtered to only those assigned to this user. + +```yaml +Type: String +``` + +## INPUTS + +## OUTPUTS + +### Team.BuildDefinition + +## NOTES + +This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + +You can pipe build definition IDs to this function. + +## RELATED LINKS + +[Set-VSTeamAccount](Set-VSTeamAccount.md) + +[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + +[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) + +[Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) diff --git a/docs/Get-VSTeamBuild.md b/docs/Get-VSTeamBuild.md index 2eb5ea2a7..b37c2bebb 100644 --- a/docs/Get-VSTeamBuild.md +++ b/docs/Get-VSTeamBuild.md @@ -1,69 +1,69 @@ - - -# Get-VSTeamBuild - -## SYNOPSIS - -Gets the builds for a team project. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamBuild function gets the builds for a team project. - -With just a project name, this function gets all of the builds for that team project. - -You can also specify a particular build by ID. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo | Format-List * -``` - -This command gets a list of all builds in the demo project. - -The pipeline operator (|) passes the data to the Format-List cmdlet, which -displays all available properties (*) of the build objects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -top 5 -resultFilter failed -``` - -This command gets a list of 5 failed builds in the demo project. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> 1203,1204 | Get-VSTeamBuild -ProjectName demo -``` - -This command gets builds with IDs 1203 and 1204 by using the pipeline. - -### -------------------------- EXAMPLE 4 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203,1204 -``` - -This command gets builds with IDs 1203 and 1204 by using the ID parameter. - -### -------------------------- EXAMPLE 5 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203 -Raw -``` - -This command returns the raw object returned from the server. - -## PARAMETERS - + + +# Get-VSTeamBuild + +## SYNOPSIS + +Gets the builds for a team project. + +## SYNTAX + +## DESCRIPTION + +The Get-VSTeamBuild function gets the builds for a team project. + +With just a project name, this function gets all of the builds for that team project. + +You can also specify a particular build by ID. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuild -ProjectName demo | Format-List * +``` + +This command gets a list of all builds in the demo project. + +The pipeline operator (|) passes the data to the Format-List cmdlet, which +displays all available properties (*) of the build objects. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuild -ProjectName demo -top 5 -resultFilter failed +``` + +This command gets a list of 5 failed builds in the demo project. + +### -------------------------- EXAMPLE 3 -------------------------- + +```PowerShell +PS C:\> 1203,1204 | Get-VSTeamBuild -ProjectName demo +``` + +This command gets builds with IDs 1203 and 1204 by using the pipeline. + +### -------------------------- EXAMPLE 4 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203,1204 +``` + +This command gets builds with IDs 1203 and 1204 by using the ID parameter. + +### -------------------------- EXAMPLE 5 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203 -Raw +``` + +This command returns the raw object returned from the server. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -78,105 +78,105 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Top - -Specifies the maximum number to return. - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 0 -``` - -### -ResultFilter - -Specifies the result of the builds to return Succeeded, PartiallySucceeded, Failed, or Canceled. - -```yaml -Type: String -Parameter Sets: List -``` - -### -ReasonFilter - -Specifies the reason the build was created of the builds to return Manual, IndividualCI, BatchedCI, Schedule, UserCreated, ValidateShelveSet, CheckInShelveSet, Triggered, or All. - -```yaml -Type: String -Parameter Sets: List -``` - -### -StatusFilter - -Specifies the status of the builds to return InProgress, Completed, Cancelling, Postponed, NotStarted, or All. - -```yaml -Type: String -Parameter Sets: List -``` - -### -Queues - -A comma-delimited list of queue IDs that specifies the builds to return. - -```yaml -Type: Int32[] -Parameter Sets: List -``` - -### -Definitions - -A comma-delimited list of build definition IDs that specifies the builds to return. - -```yaml -Type: Int32[] -Parameter Sets: List -``` - -### -BuildNumber - -Returns the build with this build number. - -You can also use * for a starts with search. -For example: 2015* -Will return all build numbers that start with 2015. - -```yaml -Type: String -Parameter Sets: List -``` - -### -Type - -The type of builds to retrieve. - -```yaml -Type: String -Parameter Sets: List -``` - -### -MaxBuildsPerDefinition - -The maximum number of builds to retrieve for each definition. - -This is only valid when definitions is also specified. - -```yaml -Type: Int32 -Parameter Sets: List -``` - -### -Properties - -A comma-delimited list of extended properties to retrieve. - -```yaml -Type: String[] -Parameter Sets: List -``` - +``` + +### -Top + +Specifies the maximum number to return. + +```yaml +Type: Int32 +Parameter Sets: List +Default value: 0 +``` + +### -ResultFilter + +Specifies the result of the builds to return Succeeded, PartiallySucceeded, Failed, or Canceled. + +```yaml +Type: String +Parameter Sets: List +``` + +### -ReasonFilter + +Specifies the reason the build was created of the builds to return Manual, IndividualCI, BatchedCI, Schedule, UserCreated, ValidateShelveSet, CheckInShelveSet, Triggered, or All. + +```yaml +Type: String +Parameter Sets: List +``` + +### -StatusFilter + +Specifies the status of the builds to return InProgress, Completed, Cancelling, Postponed, NotStarted, or All. + +```yaml +Type: String +Parameter Sets: List +``` + +### -Queues + +A comma-delimited list of queue IDs that specifies the builds to return. + +```yaml +Type: Int32[] +Parameter Sets: List +``` + +### -Definitions + +A comma-delimited list of build definition IDs that specifies the builds to return. + +```yaml +Type: Int32[] +Parameter Sets: List +``` + +### -BuildNumber + +Returns the build with this build number. + +You can also use * for a starts with search. +For example: 2015* +Will return all build numbers that start with 2015. + +```yaml +Type: String +Parameter Sets: List +``` + +### -Type + +The type of builds to retrieve. + +```yaml +Type: String +Parameter Sets: List +``` + +### -MaxBuildsPerDefinition + +The maximum number of builds to retrieve for each definition. + +This is only valid when definitions is also specified. + +```yaml +Type: Int32 +Parameter Sets: List +``` + +### -Properties + +A comma-delimited list of extended properties to retrieve. + +```yaml +Type: String[] +Parameter Sets: List +``` + ### -Id Specifies one or more builds by ID. @@ -189,51 +189,51 @@ To find the ID of a build, type Get-VSTeamBuild. Type: Int32[] Aliases: BuildID Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -JSON - -Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDJson -``` - -### -Raw - -Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDRaw -``` - -## INPUTS - -## OUTPUTS - -### Team.Build - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe build IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuild](Add-VSTeamBuild.md) - -[Remove-VSTeamBuild](Remove-VSTeamBuild.md) +``` + +### -JSON + +Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. + +```yaml +Type: Switch +Required: True +Parameter Sets: ByIDJson +``` + +### -Raw + +Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + +```yaml +Type: Switch +Required: True +Parameter Sets: ByIDRaw +``` + +## INPUTS + +## OUTPUTS + +### Team.Build + +## NOTES + +This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + +You can pipe build IDs to this function. + +## RELATED LINKS + +[Set-VSTeamAccount](Set-VSTeamAccount.md) + +[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + +[Add-VSTeamBuild](Add-VSTeamBuild.md) + +[Remove-VSTeamBuild](Remove-VSTeamBuild.md) diff --git a/docs/Get-VSTeamBuildArtifact.md b/docs/Get-VSTeamBuildArtifact.md index 3fd8ef0fb..a0fd44e11 100644 --- a/docs/Get-VSTeamBuildArtifact.md +++ b/docs/Get-VSTeamBuildArtifact.md @@ -1,22 +1,22 @@ - - -# Get-VSTeamBuildArtifact - -## SYNOPSIS - -Returns the artifacts of a build. - -## SYNTAX - -## DESCRIPTION - -Returns the artifacts of a build. - -## EXAMPLES - -## PARAMETERS - + + +# Get-VSTeamBuildArtifact + +## SYNOPSIS + +Returns the artifacts of a build. + +## SYNTAX + +## DESCRIPTION + +Returns the artifacts of a build. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,8 +31,8 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - +``` + ### -Id The id of the build. @@ -42,15 +42,15 @@ Type: Int32 Aliases: BuildID Required: True Accept pipeline input: true (ByPropertyName, ByValue) -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeamBuildDefinition.md b/docs/Get-VSTeamBuildDefinition.md index 3a47103a8..d974e5b44 100644 --- a/docs/Get-VSTeamBuildDefinition.md +++ b/docs/Get-VSTeamBuildDefinition.md @@ -1,54 +1,54 @@ - - -# Get-VSTeamBuildDefinition - -## SYNOPSIS - -Gets the build definitions for a team project. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamBuildDefinition function gets the build definitions for a team project. - -The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - -With just a project name, this function gets all of the build definitions for that team project. - -You can also specify a particular build definition by ID. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo | Format-List * -``` - -This command gets a list of all build definitions in the demo project. - -The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the build definition objects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Json -``` - -This command returns the raw object returned from the server formatted as a JSON string. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Raw -``` - -This command returns the raw object returned from the server. - -## PARAMETERS - + + +# Get-VSTeamBuildDefinition + +## SYNOPSIS + +Gets the build definitions for a team project. + +## SYNTAX + +## DESCRIPTION + +The Get-VSTeamBuildDefinition function gets the build definitions for a team project. + +The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. + +With just a project name, this function gets all of the build definitions for that team project. + +You can also specify a particular build definition by ID. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo | Format-List * +``` + +This command gets a list of all build definitions in the demo project. + +The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the build definition objects. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Json +``` + +This command returns the raw object returned from the server formatted as a JSON string. + +### -------------------------- EXAMPLE 3 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Raw +``` + +This command returns the raw object returned from the server. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -63,95 +63,95 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -Filter - -Filters to definitions whose names equal this value. Append a * to filter to definitions whose names start with this value. -For example: MS* - -```yaml -Type: String -Parameter Sets: List -``` - -### -Type - -The type of the build definitions to retrieve. The acceptable values for this parameter are: - -- build -- xaml -- All - -```yaml -Type: String -Parameter Sets: List -Default value: All -``` - -### -Id - -Specifies one or more build definitions by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build definition, type Get-VSTeamBuildDefinition. - -```yaml -Type: Int32[] -Parameter Sets: ByID -Aliases: BuildDefinitionID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Revision - -Specifies the specific revision number of the definition to retrieve. - -```yaml -Type: Int32 -Parameter Sets: ByID -Default value: -1 -``` - -### -JSON - -Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDJson -``` - -### -Raw - -Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDRaw -``` - -## INPUTS - -## OUTPUTS - -### Team.BuildDefinition - -## NOTES - -You can pipe build definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -[Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) +``` + +### -Filter + +Filters to definitions whose names equal this value. Append a * to filter to definitions whose names start with this value. +For example: MS* + +```yaml +Type: String +Parameter Sets: List +``` + +### -Type + +The type of the build definitions to retrieve. The acceptable values for this parameter are: + +- build +- xaml +- All + +```yaml +Type: String +Parameter Sets: List +Default value: All +``` + +### -Id + +Specifies one or more build definitions by ID. + +To specify multiple IDs, use commas to separate the IDs. + +To find the ID of a build definition, type Get-VSTeamBuildDefinition. + +```yaml +Type: Int32[] +Parameter Sets: ByID +Aliases: BuildDefinitionID +Required: True +Accept pipeline input: true (ByPropertyName) +``` + +### -Revision + +Specifies the specific revision number of the definition to retrieve. + +```yaml +Type: Int32 +Parameter Sets: ByID +Default value: -1 +``` + +### -JSON + +Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. + +```yaml +Type: Switch +Required: True +Parameter Sets: ByIDJson +``` + +### -Raw + +Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. + +```yaml +Type: Switch +Required: True +Parameter Sets: ByIDRaw +``` + +## INPUTS + +## OUTPUTS + +### Team.BuildDefinition + +## NOTES + +You can pipe build definition IDs to this function. + +## RELATED LINKS + +[Set-VSTeamAccount](Set-VSTeamAccount.md) + +[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + +[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) + +[Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) diff --git a/docs/Get-VSTeamBuildLog.md b/docs/Get-VSTeamBuildLog.md index 33e9f716a..00bcc9547 100644 --- a/docs/Get-VSTeamBuildLog.md +++ b/docs/Get-VSTeamBuildLog.md @@ -1,33 +1,33 @@ - - -# Get-VSTeamBuildLog - -## SYNOPSIS - -Displays the logs for the build. - -## SYNTAX - -## DESCRIPTION - -Displays the logs for the build. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -Top 1 | Get-VSTeamBuildLog -``` - -This command displays the logs of the first build. - -The pipeline operator (|) passes the build id to the Get-VSTeamBuildLog cmdlet, which -displays the logs. - -## PARAMETERS - + + +# Get-VSTeamBuildLog + +## SYNOPSIS + +Displays the logs for the build. + +## SYNTAX + +## DESCRIPTION + +Displays the logs for the build. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamBuild -Top 1 | Get-VSTeamBuildLog +``` + +This command displays the logs of the first build. + +The pipeline operator (|) passes the build id to the Get-VSTeamBuildLog cmdlet, which +displays the logs. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -42,8 +42,8 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - +``` + ### -Id Specifies one or more builds by ID. @@ -56,23 +56,23 @@ To find the ID of a build, type Get-VSTeamBuild. Type: Int32[] Aliases: BuildID Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Index - -Each task stores its logs in an array. If you know the index of a specific task you can return just its logs. If you do not provide a value all the logs are displayed. - -```yaml -Type: Int32 -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +### -Index + +Each task stores its logs in an array. If you know the index of a specific task you can return just its logs. If you do not provide a value all the logs are displayed. + +```yaml +Type: Int32 +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeamBuildTag.md b/docs/Get-VSTeamBuildTag.md index 2b58e6fc3..acd4b4d21 100644 --- a/docs/Get-VSTeamBuildTag.md +++ b/docs/Get-VSTeamBuildTag.md @@ -1,22 +1,22 @@ - - -# Get-VSTeamBuildTag - -## SYNOPSIS - -Returns all the tags of a build. - -## SYNTAX - -## DESCRIPTION - -Returns all the tags of a build. - -## EXAMPLES - -## PARAMETERS - + + +# Get-VSTeamBuildTag + +## SYNOPSIS + +Returns all the tags of a build. + +## SYNTAX + +## DESCRIPTION + +Returns all the tags of a build. + +## EXAMPLES + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -31,8 +31,8 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - +``` + ### -Id The id of the build. @@ -42,15 +42,15 @@ Type: Int32 Aliases: BuildID Required: True Accept pipeline input: true (ByPropertyName, ByValue) -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeamClassificationNode.md b/docs/Get-VSTeamClassificationNode.md index c5cff3186..cd23ebe33 100644 --- a/docs/Get-VSTeamClassificationNode.md +++ b/docs/Get-VSTeamClassificationNode.md @@ -1,20 +1,20 @@ - - -# Get-VSTeamClassificationNode - -## SYNOPSIS - -Gets the classification node for a given node path. - -## SYNTAX - -## DESCRIPTION - -Gets the classification node for a given node path. - -## PARAMETERS - + + +# Get-VSTeamClassificationNode + +## SYNOPSIS + +Gets the classification node for a given node path. + +## SYNTAX + +## DESCRIPTION + +Gets the classification node for a given node path. + +## PARAMETERS + ### -ProjectName Specifies the team project for which this function operates. @@ -29,47 +29,47 @@ Type: String Position: 0 Required: True Accept pipeline input: true (ByPropertyName) -``` - -### -StructureGroup - -Structure group of the classification node, area or iteration. - -```yaml -Type: string -``` - -### -Depth - -Depth of children to fetch. - -```yaml -Type: int32 -``` - -### -Path - -Path of the classification node. - -```yaml -Type: string -``` - -### -Ids - -Integer classification nodes ids. - -```yaml -Type: int32[] -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS +``` + +### -StructureGroup + +Structure group of the classification node, area or iteration. + +```yaml +Type: string +``` + +### -Depth + +Depth of children to fetch. + +```yaml +Type: int32 +``` + +### -Path + +Path of the classification node. + +```yaml +Type: string +``` + +### -Ids + +Integer classification nodes ids. + +```yaml +Type: int32[] +``` + +## INPUTS + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeamCloudSubscription.md b/docs/Get-VSTeamCloudSubscription.md index 1ce4fd032..9b2107949 100644 --- a/docs/Get-VSTeamCloudSubscription.md +++ b/docs/Get-VSTeamCloudSubscription.md @@ -1,43 +1,43 @@ - - -# Get-VSTeamCloudSubscription - -## SYNOPSIS - -Gets the Azure subscriptions associated with the Team Services account. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamCloudSubscription function gets the Azure subscriptions associated with the Team Services account. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamCloudSubscription -``` - -This command gets a list of all Azure subscriptions associated with the Team Services account. - -## PARAMETERS - -## INPUTS - -### None - -## OUTPUTS - -### Team.AzureSubscription - -## NOTES - -This function currently is not supported in TFS. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) + + +# Get-VSTeamCloudSubscription + +## SYNOPSIS + +Gets the Azure subscriptions associated with the Team Services account. + +## SYNTAX + +## DESCRIPTION + +The Get-VSTeamCloudSubscription function gets the Azure subscriptions associated with the Team Services account. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamCloudSubscription +``` + +This command gets a list of all Azure subscriptions associated with the Team Services account. + +## PARAMETERS + +## INPUTS + +### None + +## OUTPUTS + +### Team.AzureSubscription + +## NOTES + +This function currently is not supported in TFS. + +## RELATED LINKS + +[Set-VSTeamAccount](Set-VSTeamAccount.md) diff --git a/docs/Get-VSTeamDescriptor.md b/docs/Get-VSTeamDescriptor.md index 50b691016..5dd7ce05e 100644 --- a/docs/Get-VSTeamDescriptor.md +++ b/docs/Get-VSTeamDescriptor.md @@ -1,37 +1,37 @@ - - -# Get-VSTeamDescriptor - -## SYNOPSIS - -Resolve a storage key to a descriptor. - -## SYNTAX - -## DESCRIPTION - -Resolve a storage key to a descriptor. - -## EXAMPLES - -## PARAMETERS - -### -StorageKey - -Storage key of the subject (user, group, scope, etc.) to resolve - -```yaml -Type: String -Required: True -Parameter Sets: ByStorageKey -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS + + +# Get-VSTeamDescriptor + +## SYNOPSIS + +Resolve a storage key to a descriptor. + +## SYNTAX + +## DESCRIPTION + +Resolve a storage key to a descriptor. + +## EXAMPLES + +## PARAMETERS + +### -StorageKey + +Storage key of the subject (user, group, scope, etc.) to resolve + +```yaml +Type: String +Required: True +Parameter Sets: ByStorageKey +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeamExtension.md b/docs/Get-VSTeamExtension.md index 4132aa500..f44c95b00 100644 --- a/docs/Get-VSTeamExtension.md +++ b/docs/Get-VSTeamExtension.md @@ -1,82 +1,82 @@ - - -# Get-VSTeamExtension - -## SYNOPSIS - -Get the installed extensions in the specified Visual Studio Team Services or Team Foundation Server project. - -## SYNTAX - -## DESCRIPTION - -Get the installed extensions in the specified Visual Studio Team Services or Team Foundation Server project. - -## EXAMPLES - -## PARAMETERS - -### -PublisherId - -The id of the publisher. - -```yaml -Type: String -Required: True -Parameter Sets: GetById -``` - -### -ExtensionId - -The id of the extension. - -```yaml -Type: String -Required: True -Parameter Sets: GetById -``` - -### -IncludeInstallationIssues - -If true (the default), include installed extensions with issues. - -```yaml -Type: Switch -Parameter Sets: List -``` - -### -IncludeDisabledExtensions - -If true (the default), include disabled extensions in the results. - -```yaml -Type: Switch -Parameter Sets: List -``` - -### -IncludeErrors - -If true, include installed extensions with errors. - -```yaml -Type: Switch -Parameter Sets: List -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamExtension](Add-VSTeamExtension.md) - -[Get-VSTeamExtension](Get-VSTeamExtension.md) - -[Remove-VSTeamExtension](Remove-VSTeamExtension.md) - -[Update-VSTeamExtension](Update-VSTeamExtension.md) + + +# Get-VSTeamExtension + +## SYNOPSIS + +Get the installed extensions in the specified Visual Studio Team Services or Team Foundation Server project. + +## SYNTAX + +## DESCRIPTION + +Get the installed extensions in the specified Visual Studio Team Services or Team Foundation Server project. + +## EXAMPLES + +## PARAMETERS + +### -PublisherId + +The id of the publisher. + +```yaml +Type: String +Required: True +Parameter Sets: GetById +``` + +### -ExtensionId + +The id of the extension. + +```yaml +Type: String +Required: True +Parameter Sets: GetById +``` + +### -IncludeInstallationIssues + +If true (the default), include installed extensions with issues. + +```yaml +Type: Switch +Parameter Sets: List +``` + +### -IncludeDisabledExtensions + +If true (the default), include disabled extensions in the results. + +```yaml +Type: Switch +Parameter Sets: List +``` + +### -IncludeErrors + +If true, include installed extensions with errors. + +```yaml +Type: Switch +Parameter Sets: List +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Add-VSTeamExtension](Add-VSTeamExtension.md) + +[Get-VSTeamExtension](Get-VSTeamExtension.md) + +[Remove-VSTeamExtension](Remove-VSTeamExtension.md) + +[Update-VSTeamExtension](Update-VSTeamExtension.md) diff --git a/docs/Get-VSTeamFeed.md b/docs/Get-VSTeamFeed.md index 63b1604d4..b5e691cde 100644 --- a/docs/Get-VSTeamFeed.md +++ b/docs/Get-VSTeamFeed.md @@ -1,45 +1,45 @@ - - -# Get-VSTeamFeed - -## SYNOPSIS - -Returns a list of package feeds for the account. - -## SYNTAX - -## DESCRIPTION - -Get-VSTeamFeed gets all the feeds for the account - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamFeed -``` - -This command returns all the package feeds for the account. - -## PARAMETERS - -### -FeedId - -Specifies the ID of the feed. - -```yaml -Type: Guid -Aliases: ID -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS + + +# Get-VSTeamFeed + +## SYNOPSIS + +Returns a list of package feeds for the account. + +## SYNTAX + +## DESCRIPTION + +Get-VSTeamFeed gets all the feeds for the account + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamFeed +``` + +This command returns all the package feeds for the account. + +## PARAMETERS + +### -FeedId + +Specifies the ID of the feed. + +```yaml +Type: Guid +Aliases: ID +Accept pipeline input: true (ByPropertyName) +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-VSTeamVariableGroup.md b/docs/Get-VSTeamVariableGroup.md new file mode 100644 index 000000000..197f8986f --- /dev/null +++ b/docs/Get-VSTeamVariableGroup.md @@ -0,0 +1,82 @@ + + + +# Get-VSTeamVariableGroup + +## SYNOPSIS +Gets a variable group + +## SYNTAX + +### List (Default) +```powershell +Get-VSTeamVariableGroup [-ProjectName] [] +``` + +### ByID +```powershell +Get-VSTeamVariableGroup -id [-ProjectName] [] +``` + +## DESCRIPTION +Gets a variable group +## EXAMPLES + +### Example 1 + +## PARAMETERS + +### -ProjectName +The name of the project. +You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -id +ID of the existing variable group + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +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 (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) + +[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) + +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) diff --git a/docs/Remove-VSTeamVariableGroup.md b/docs/Remove-VSTeamVariableGroup.md new file mode 100644 index 000000000..9c66dd40b --- /dev/null +++ b/docs/Remove-VSTeamVariableGroup.md @@ -0,0 +1,122 @@ + + + +# Remove-VSTeamVariableGroup + +## SYNOPSIS +Removes a variable group + +## SYNTAX + +```powershell +Remove-VSTeamVariableGroup [-id] [-Force] [-WhatIf] [-Confirm] [-ProjectName] + [] +``` + +## DESCRIPTION +Removes a variable group + +## EXAMPLES + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Does not prompt + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName +The name of the project. +You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -id +ID of the existing variable group + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +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 (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String[] +System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) + +[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) + +[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) diff --git a/docs/Team.md b/docs/Team.md index b3d4b3a4b..5e1cbe6bb 100644 --- a/docs/Team.md +++ b/docs/Team.md @@ -104,6 +104,10 @@ Adds a new SonarQube service endpoint. Add a user, assign license and extensions and make them a member of a project group in an account. +### [Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) + +Adds a variable group. + ### [Add-VSTeamWorkItem](Add-VSTeamWorkItem.md) Adds a work item to your project. @@ -280,6 +284,10 @@ Returns a list of users for the account. Get User Entitlement for a user. +### [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) + +Gets a variable group + ### [Get-VSTeamWorkItem](Get-VSTeamWorkItem.md) Returns one or more a work items from your project. @@ -362,6 +370,10 @@ Delete a user from the account. The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. +### [Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) + +Removes a variable group + ### [Set-VSTeamAccount](Set-VSTeamAccount.md) Stores your account name and personal access token for use with the other @@ -475,6 +487,10 @@ Updates an existing service connection Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. +### [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) + +Updates an existing variable group + ### [Update-VSTeamWorkItem](Update-VSTeamWorkItem.md) Update a work item in your project. diff --git a/docs/Update-VSTeamVariableGroup.md b/docs/Update-VSTeamVariableGroup.md new file mode 100644 index 000000000..faca8ee14 --- /dev/null +++ b/docs/Update-VSTeamVariableGroup.md @@ -0,0 +1,203 @@ + + + +# Update-VSTeamVariableGroup + +## SYNOPSIS +Updates an existing variable group + +## SYNTAX + +```powershell +Update-VSTeamVariableGroup [-id] [-variableGroupName] [-variableGroupType] + [-variableGroupDescription] [-variableGroupVariables] + [[-variableGroupProviderData] ] [-Force] [-WhatIf] [-Confirm] [-ProjectName] + [] +``` + +## DESCRIPTION +Updates an existing variable group + +## EXAMPLES + +## PARAMETERS + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force + +Does not prompt + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProjectName + +The name of the project. +You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -id +ID of the existing variable group + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupDescription +The variable group description + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupName +The variable group name + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupProviderData +The variable group ProviderData. This should be $null for Vsts types. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupType +The variable group type + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: Vsts, AzureKeyVault + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -variableGroupVariables +The variable group variables. Please refer to the unit test for examples. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 4 +Default value: None +Accept pipeline input: True (ByPropertyName) +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 (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String +System.Collections.Hashtable + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) + +[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) + +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) diff --git a/docs/readme.md b/docs/readme.md index 4d83c9c0f..892426236 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -109,6 +109,10 @@ Adds a new SonarQube service endpoint. Add a user, assign license and extensions and make them a member of a project group in an account. +### [Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) + +Adds a variable group. + ### [Add-VSTeamWorkItem](Add-VSTeamWorkItem.md) Adds a work item to your project. @@ -285,6 +289,10 @@ Returns a list of users for the account. Get User Entitlement for a user. +### [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) + +Gets a variable group + ### [Get-VSTeamWorkItem](Get-VSTeamWorkItem.md) Returns one or more a work items from your project. @@ -367,6 +375,10 @@ Delete a user from the account. The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. +### [Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) + +Removes a variable group + ### [Set-VSTeamAccount](Set-VSTeamAccount.md) Stores your account name and personal access token for use with the other @@ -480,6 +492,10 @@ Updates an existing service connection Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. +### [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) + +Updates an existing variable group + ### [Update-VSTeamWorkItem](Update-VSTeamWorkItem.md) Update a work item in your project. From 3bc918214bfdecbe0bc26b9946d5662f934d93bc Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sat, 22 Jun 2019 16:53:17 -0500 Subject: [PATCH 03/18] - Fixed help typos and md warnings. - Added help examples. --- .docs/Add-VSTeamVariableGroup.md | 91 +++++++---- .docs/Get-VSTeamVariableGroup.md | 53 +++--- .docs/Remove-VSTeamVariableGroup.md | 62 ++++--- .docs/Update-VSTeamVariableGroup.md | 89 ++++++---- Source/en-US/VSTeam-Help.xml | 244 +++++++++++++++++++++++++--- docs/Add-VSTeamVariableGroup.md | 104 ++++++++---- docs/Get-VSTeamVariableGroup.md | 64 +++++--- docs/Remove-VSTeamVariableGroup.md | 73 ++++++--- docs/Update-VSTeamVariableGroup.md | 100 ++++++++---- 9 files changed, 634 insertions(+), 246 deletions(-) diff --git a/.docs/Add-VSTeamVariableGroup.md b/.docs/Add-VSTeamVariableGroup.md index 18e44c48c..06a4aac5b 100644 --- a/.docs/Add-VSTeamVariableGroup.md +++ b/.docs/Add-VSTeamVariableGroup.md @@ -3,46 +3,76 @@ # Add-VSTeamVariableGroup ## SYNOPSIS - -## SYNTAX + -```powershell -Add-VSTeamVariableGroup [-variableGroupName] [-variableGroupType] - [-variableGroupDescription] [-variableGroupVariables] - [[-variableGroupProviderData] ] [-ProjectName] [] -``` +## SYNTAX ## DESCRIPTION - + + ## EXAMPLES -## PARAMETERS +### -------------------------- EXAMPLE 1 -------------------------- -### -ProjectName -The name of the project. -You can tab complete from the projects in your Team Services or TFS account when passed on the command line. +```powershell -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Accepted values: +$methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + } + key2 = @{ + value = "value2" + isSecret = $true + } + } +} + +Add-VSTeamVariableGroup @methodParameters +``` -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +### -------------------------- EXAMPLE 2 -------------------------- + +```powershell + +$methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "AzureRMServiceEndpointGuid" + vault = "name_of_existing_key_vault" + } +} + +Add-VSTeamVariableGroup @methodParameters ``` +## PARAMETERS + + + ### -variableGroupDescription + The variable group description ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -53,11 +83,11 @@ Accept wildcard characters: False ``` ### -variableGroupName + The variable group name ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -68,11 +98,11 @@ Accept wildcard characters: False ``` ### -variableGroupProviderData + The variable group ProviderData. This should be $null for Vsts types. ```yaml Type: Hashtable -Parameter Sets: (All) Aliases: Required: False @@ -83,11 +113,11 @@ Accept wildcard characters: False ``` ### -variableGroupType + The variable group type ```yaml Type: String -Parameter Sets: (All) Aliases: Accepted values: Vsts, AzureKeyVault @@ -99,11 +129,11 @@ Accept wildcard characters: False ``` ### -variableGroupVariables -The variable group variables. Please refer to the unit test for examples. + +The variable group variables. ```yaml Type: Hashtable -Parameter Sets: (All) Aliases: Required: True @@ -114,14 +144,15 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.String -System.Collections.Hashtable +System.Collections.Hashtable ## OUTPUTS @@ -135,4 +166,4 @@ System.Collections.Hashtable [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) -[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) \ No newline at end of file +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) diff --git a/.docs/Get-VSTeamVariableGroup.md b/.docs/Get-VSTeamVariableGroup.md index 20a68e144..75b1d4ef6 100644 --- a/.docs/Get-VSTeamVariableGroup.md +++ b/.docs/Get-VSTeamVariableGroup.md @@ -3,51 +3,52 @@ # Get-VSTeamVariableGroup ## SYNOPSIS + ## SYNTAX -### List (Default) +## DESCRIPTION + + + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + ```powershell -Get-VSTeamVariableGroup [-ProjectName] [] + +$methodParameters = @{ + ProjectName = "some_project_name" +} + +Get-VSTeamVariableGroup @methodParameters ``` -### ByID +### -------------------------- EXAMPLE 2 -------------------------- + ```powershell -Get-VSTeamVariableGroup -id [-ProjectName] [] -``` -## DESCRIPTION - -## EXAMPLES +$methodParameters = @{ + ProjectName = "some_project_name" + id = "variable_group_id" +} -### Example 1 +Get-VSTeamVariableGroup @methodParameters +``` ## PARAMETERS ### -ProjectName -The name of the project. -You can tab complete from the projects in your Team Services or TFS account when passed on the command line. -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Accepted values: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` + ### -id + ID of the existing variable group ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -58,6 +59,7 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216). @@ -65,7 +67,6 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ### System.String - ## OUTPUTS ### System.Object @@ -78,4 +79,4 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) -[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) \ No newline at end of file +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) diff --git a/.docs/Remove-VSTeamVariableGroup.md b/.docs/Remove-VSTeamVariableGroup.md index 14aa7988a..420f2761d 100644 --- a/.docs/Remove-VSTeamVariableGroup.md +++ b/.docs/Remove-VSTeamVariableGroup.md @@ -3,28 +3,53 @@ # Remove-VSTeamVariableGroup ## SYNOPSIS + ## SYNTAX -```powershell -Remove-VSTeamVariableGroup [-id] [-Force] [-WhatIf] [-Confirm] [-ProjectName] - [] -``` - ## DESCRIPTION + ## EXAMPLES +### -------------------------- EXAMPLE 1 -------------------------- + +```powershell + +$methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + isSecret = $true + } + } +} + +$newVariableGroup = Add-VSTeamVariableGroup @methodParameters + +$methodParameters = @{ + id = $newVariableGroup.id + ProjectName = "some_project_name" + Force = $true +} + +Remove-VSTeamVariableGroup @methodParameters +``` + ## PARAMETERS ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: cf Required: False @@ -35,11 +60,11 @@ Accept wildcard characters: False ``` ### -Force + Does not prompt ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: Required: False @@ -50,29 +75,16 @@ Accept wildcard characters: False ``` ### -ProjectName -The name of the project. -You can tab complete from the projects in your Team Services or TFS account when passed on the command line. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Accepted values: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` + ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: wi Required: False @@ -83,11 +95,11 @@ Accept wildcard characters: False ``` ### -id + ID of the existing variable group ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -98,12 +110,14 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.String[] + System.String ## OUTPUTS @@ -118,4 +132,4 @@ System.String [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) -[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) \ No newline at end of file +[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) diff --git a/.docs/Update-VSTeamVariableGroup.md b/.docs/Update-VSTeamVariableGroup.md index 42268993c..536908db8 100644 --- a/.docs/Update-VSTeamVariableGroup.md +++ b/.docs/Update-VSTeamVariableGroup.md @@ -3,22 +3,59 @@ # Update-VSTeamVariableGroup ## SYNOPSIS + ## SYNTAX -```powershell -Update-VSTeamVariableGroup [-id] [-variableGroupName] [-variableGroupType] - [-variableGroupDescription] [-variableGroupVariables] - [[-variableGroupProviderData] ] [-Force] [-WhatIf] [-Confirm] [-ProjectName] - [] -``` - ## DESCRIPTION + ## EXAMPLES +### -------------------------- EXAMPLE 1 -------------------------- + +```powershell + +$methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + isSecret = $true + } + } +} + +$newVariableGroup = Add-VSTeamVariableGroup @methodParameters + +$methodParameters = @{ + id = $newVariableGroup.id + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "AzureRMServiceEndpointGuid" + vault = "name_of_existing_key_vault" + } +} + +Update-VSTeamVariableGroup @methodParameters +``` + ## PARAMETERS ### -Confirm @@ -27,7 +64,6 @@ Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: cf Required: False @@ -43,7 +79,6 @@ Does not prompt ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: Required: False @@ -55,29 +90,15 @@ Accept wildcard characters: False ### -ProjectName -The name of the project. -You can tab complete from the projects in your Team Services or TFS account when passed on the command line. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Accepted values: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` + ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: wi Required: False @@ -88,11 +109,11 @@ Accept wildcard characters: False ``` ### -id + ID of the existing variable group ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -103,11 +124,11 @@ Accept wildcard characters: False ``` ### -variableGroupDescription + The variable group description ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -118,11 +139,11 @@ Accept wildcard characters: False ``` ### -variableGroupName + The variable group name ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -133,11 +154,11 @@ Accept wildcard characters: False ``` ### -variableGroupProviderData + The variable group ProviderData. This should be $null for Vsts types. ```yaml Type: Hashtable -Parameter Sets: (All) Aliases: Required: False @@ -148,11 +169,11 @@ Accept wildcard characters: False ``` ### -variableGroupType + The variable group type ```yaml Type: String -Parameter Sets: (All) Aliases: Accepted values: Vsts, AzureKeyVault @@ -164,11 +185,11 @@ Accept wildcard characters: False ``` ### -variableGroupVariables -The variable group variables. Please refer to the unit test for examples. + +The variable group variables. ```yaml Type: Hashtable -Parameter Sets: (All) Aliases: Required: True @@ -179,12 +200,14 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.String + System.Collections.Hashtable ## OUTPUTS @@ -199,4 +222,4 @@ System.Collections.Hashtable [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) -[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) \ No newline at end of file +[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) diff --git a/Source/en-US/VSTeam-Help.xml b/Source/en-US/VSTeam-Help.xml index ed914cbb5..f23d5bad4 100644 --- a/Source/en-US/VSTeam-Help.xml +++ b/Source/en-US/VSTeam-Help.xml @@ -4831,19 +4831,21 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo Add VSTeamVariableGroup - Adds a generic service connection + Adds a variable group. - Adds a generic service connection + Adds a variable group. Add-VSTeamVariableGroup - + ProjectName - The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -4895,7 +4897,7 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo variableGroupVariables - The variable group variables. Please refer to the unit test for examples. + The variable group variables. Hashtable @@ -4919,10 +4921,12 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo - + ProjectName - The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -4982,7 +4986,7 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo variableGroupVariables - The variable group variables. Please refer to the unit test for examples. + The variable group variables. Hashtable @@ -5017,7 +5021,57 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo - + + + -------------------------- EXAMPLE 1 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + } + key2 = @{ + value = "value2" + isSecret = $true + } + } +} + +Add-VSTeamVariableGroup @methodParameters + + + + + + -------------------------- EXAMPLE 2 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "AzureRMServiceEndpointGuid" + vault = "name_of_existing_key_vault" + } +} + +Add-VSTeamVariableGroup @methodParameters + + + + + Update-VSTeamVariableGroup @@ -11509,10 +11563,12 @@ ID Title Status Get-VSTeamVariableGroup - + ProjectName - The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -11536,10 +11592,24 @@ ID Title Status - + ProjectName - The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + + + + + + + None + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -11588,8 +11658,24 @@ ID Title Status - -------------------------- Example 1 -------------------------- - + -------------------------- EXAMPLE 1 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" +} + +Get-VSTeamVariableGroup @methodParameters + + + + + + -------------------------- EXAMPLE 2 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" + id = "variable_group_id" +} + +Get-VSTeamVariableGroup @methodParameters @@ -14494,10 +14580,12 @@ ID Title Status Remove-VSTeamVariableGroup - + ProjectName - The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -14578,10 +14666,24 @@ ID Title Status False - + ProjectName - The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + + + + + + + + None + + + ProjectName + + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -14640,7 +14742,36 @@ ID Title Status - + + + -------------------------- EXAMPLE 1 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + isSecret = $true + } + } +} + +$newVariableGroup = Add-VSTeamVariableGroup @methodParameters + +$methodParameters = @{ + id = $newVariableGroup.id + ProjectName = "some_project_name" + Force = $true +} + +Remove-VSTeamVariableGroup @methodParameters + + + + + Add-VSTeamVariableGroup @@ -19030,10 +19161,12 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r Update-VSTeamVariableGroup - + ProjectName - The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -19097,7 +19230,7 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r variableGroupVariables - The variable group variables. Please refer to the unit test for examples. + The variable group variables. Hashtable @@ -19178,10 +19311,24 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r False - + + ProjectName + + + + + + + + + None + + ProjectName - The name of the project. You can tab complete from the projects in your Team Services or TFS account when passed on the command line. + Specifies the team project for which this function operates. + You can tab complete from a list of available projects. + You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. String @@ -19265,7 +19412,7 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r variableGroupVariables - The variable group variables. Please refer to the unit test for examples. + The variable group variables. Hashtable @@ -19300,7 +19447,50 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r - + + + -------------------------- EXAMPLE 1 -------------------------- + $methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + isSecret = $true + } + } +} + +$newVariableGroup = Add-VSTeamVariableGroup @methodParameters + +$methodParameters = @{ + id = $newVariableGroup.id + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "AzureRMServiceEndpointGuid" + vault = "name_of_existing_key_vault" + } +} + +Update-VSTeamVariableGroup @methodParameters + + + + + Add-VSTeamVariableGroup diff --git a/docs/Add-VSTeamVariableGroup.md b/docs/Add-VSTeamVariableGroup.md index da20ed814..bfd644b86 100644 --- a/docs/Add-VSTeamVariableGroup.md +++ b/docs/Add-VSTeamVariableGroup.md @@ -4,46 +4,90 @@ # Add-VSTeamVariableGroup ## SYNOPSIS -Adds a generic service connection -## SYNTAX +Adds a variable group. -```powershell -Add-VSTeamVariableGroup [-variableGroupName] [-variableGroupType] - [-variableGroupDescription] [-variableGroupVariables] - [[-variableGroupProviderData] ] [-ProjectName] [] -``` +## SYNTAX ## DESCRIPTION -Adds a generic service connection + +Adds a variable group. ## EXAMPLES -## PARAMETERS +### -------------------------- EXAMPLE 1 -------------------------- -### -ProjectName -The name of the project. -You can tab complete from the projects in your Team Services or TFS account when passed on the command line. +```powershell -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Accepted values: +$methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + } + key2 = @{ + value = "value2" + isSecret = $true + } + } +} + +Add-VSTeamVariableGroup @methodParameters +``` -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +### -------------------------- EXAMPLE 2 -------------------------- + +```powershell + +$methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "AzureRMServiceEndpointGuid" + vault = "name_of_existing_key_vault" + } +} + +Add-VSTeamVariableGroup @methodParameters +``` + +## PARAMETERS + +### -ProjectName + +Specifies the team project for which this function operates. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so +you do not have to pass the ProjectName with each call. + +```yaml +Type: String +Position: 0 +Required: True +Accept pipeline input: true (ByPropertyName) ``` ### -variableGroupDescription + The variable group description ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -54,11 +98,11 @@ Accept wildcard characters: False ``` ### -variableGroupName + The variable group name ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -69,11 +113,11 @@ Accept wildcard characters: False ``` ### -variableGroupProviderData + The variable group ProviderData. This should be $null for Vsts types. ```yaml Type: Hashtable -Parameter Sets: (All) Aliases: Required: False @@ -84,11 +128,11 @@ Accept wildcard characters: False ``` ### -variableGroupType + The variable group type ```yaml Type: String -Parameter Sets: (All) Aliases: Accepted values: Vsts, AzureKeyVault @@ -100,11 +144,11 @@ Accept wildcard characters: False ``` ### -variableGroupVariables -The variable group variables. Please refer to the unit test for examples. + +The variable group variables. ```yaml Type: Hashtable -Parameter Sets: (All) Aliases: Required: True @@ -115,14 +159,15 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.String -System.Collections.Hashtable +System.Collections.Hashtable ## OUTPUTS @@ -137,3 +182,4 @@ System.Collections.Hashtable [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) [Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) + diff --git a/docs/Get-VSTeamVariableGroup.md b/docs/Get-VSTeamVariableGroup.md index 197f8986f..a78da8032 100644 --- a/docs/Get-VSTeamVariableGroup.md +++ b/docs/Get-VSTeamVariableGroup.md @@ -4,51 +4,66 @@ # Get-VSTeamVariableGroup ## SYNOPSIS + Gets a variable group ## SYNTAX -### List (Default) +## DESCRIPTION + +Gets a variable group + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + ```powershell -Get-VSTeamVariableGroup [-ProjectName] [] + +$methodParameters = @{ + ProjectName = "some_project_name" +} + +Get-VSTeamVariableGroup @methodParameters ``` -### ByID +### -------------------------- EXAMPLE 2 -------------------------- + ```powershell -Get-VSTeamVariableGroup -id [-ProjectName] [] -``` -## DESCRIPTION -Gets a variable group -## EXAMPLES +$methodParameters = @{ + ProjectName = "some_project_name" + id = "variable_group_id" +} -### Example 1 +Get-VSTeamVariableGroup @methodParameters +``` ## PARAMETERS ### -ProjectName -The name of the project. -You can tab complete from the projects in your Team Services or TFS account when passed on the command line. -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Accepted values: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +### -ProjectName + +Specifies the team project for which this function operates. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so +you do not have to pass the ProjectName with each call. + +```yaml +Type: String +Position: 0 +Required: True +Accept pipeline input: true (ByPropertyName) ``` ### -id + ID of the existing variable group ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -59,6 +74,7 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216). @@ -66,7 +82,6 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ### System.String - ## OUTPUTS ### System.Object @@ -80,3 +95,4 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) [Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) + diff --git a/docs/Remove-VSTeamVariableGroup.md b/docs/Remove-VSTeamVariableGroup.md index 9c66dd40b..04fe958c0 100644 --- a/docs/Remove-VSTeamVariableGroup.md +++ b/docs/Remove-VSTeamVariableGroup.md @@ -4,28 +4,53 @@ # Remove-VSTeamVariableGroup ## SYNOPSIS + Removes a variable group ## SYNTAX -```powershell -Remove-VSTeamVariableGroup [-id] [-Force] [-WhatIf] [-Confirm] [-ProjectName] - [] -``` - ## DESCRIPTION + Removes a variable group ## EXAMPLES +### -------------------------- EXAMPLE 1 -------------------------- + +```powershell + +$methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + isSecret = $true + } + } +} + +$newVariableGroup = Add-VSTeamVariableGroup @methodParameters + +$methodParameters = @{ + id = $newVariableGroup.id + ProjectName = "some_project_name" + Force = $true +} + +Remove-VSTeamVariableGroup @methodParameters +``` + ## PARAMETERS ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: cf Required: False @@ -36,11 +61,11 @@ Accept wildcard characters: False ``` ### -Force + Does not prompt ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: Required: False @@ -51,29 +76,30 @@ Accept wildcard characters: False ``` ### -ProjectName -The name of the project. -You can tab complete from the projects in your Team Services or TFS account when passed on the command line. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Accepted values: -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +### -ProjectName + +Specifies the team project for which this function operates. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so +you do not have to pass the ProjectName with each call. + +```yaml +Type: String +Position: 0 +Required: True +Accept pipeline input: true (ByPropertyName) ``` ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: wi Required: False @@ -84,11 +110,11 @@ Accept wildcard characters: False ``` ### -id + ID of the existing variable group ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -99,12 +125,14 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.String[] + System.String ## OUTPUTS @@ -120,3 +148,4 @@ System.String [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) + diff --git a/docs/Update-VSTeamVariableGroup.md b/docs/Update-VSTeamVariableGroup.md index faca8ee14..105da2b69 100644 --- a/docs/Update-VSTeamVariableGroup.md +++ b/docs/Update-VSTeamVariableGroup.md @@ -4,22 +4,59 @@ # Update-VSTeamVariableGroup ## SYNOPSIS + Updates an existing variable group ## SYNTAX -```powershell -Update-VSTeamVariableGroup [-id] [-variableGroupName] [-variableGroupType] - [-variableGroupDescription] [-variableGroupVariables] - [[-variableGroupProviderData] ] [-Force] [-WhatIf] [-Confirm] [-ProjectName] - [] -``` - ## DESCRIPTION + Updates an existing variable group ## EXAMPLES +### -------------------------- EXAMPLE 1 -------------------------- + +```powershell + +$methodParameters = @{ + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "Vsts" + variableGroupVariables = @{ + key1 = @{ + value = "value1" + isSecret = $true + } + } +} + +$newVariableGroup = Add-VSTeamVariableGroup @methodParameters + +$methodParameters = @{ + id = $newVariableGroup.id + ProjectName = "some_project_name" + variableGroupName = "new_variable_group" + variableGroupDescription = "Describe the Variable Group" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "AzureRMServiceEndpointGuid" + vault = "name_of_existing_key_vault" + } +} + +Update-VSTeamVariableGroup @methodParameters +``` + ## PARAMETERS ### -Confirm @@ -28,7 +65,6 @@ Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: cf Required: False @@ -44,7 +80,6 @@ Does not prompt ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: Required: False @@ -56,29 +91,29 @@ Accept wildcard characters: False ### -ProjectName -The name of the project. -You can tab complete from the projects in your Team Services or TFS account when passed on the command line. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Accepted values: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +### -ProjectName + +Specifies the team project for which this function operates. + +You can tab complete from a list of available projects. + +You can use Set-VSTeamDefaultProject to set a default project so +you do not have to pass the ProjectName with each call. + +```yaml +Type: String +Position: 0 +Required: True +Accept pipeline input: true (ByPropertyName) ``` ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter -Parameter Sets: (All) Aliases: wi Required: False @@ -89,11 +124,11 @@ Accept wildcard characters: False ``` ### -id + ID of the existing variable group ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -104,11 +139,11 @@ Accept wildcard characters: False ``` ### -variableGroupDescription + The variable group description ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -119,11 +154,11 @@ Accept wildcard characters: False ``` ### -variableGroupName + The variable group name ```yaml Type: String -Parameter Sets: (All) Aliases: Required: True @@ -134,11 +169,11 @@ Accept wildcard characters: False ``` ### -variableGroupProviderData + The variable group ProviderData. This should be $null for Vsts types. ```yaml Type: Hashtable -Parameter Sets: (All) Aliases: Required: False @@ -149,11 +184,11 @@ Accept wildcard characters: False ``` ### -variableGroupType + The variable group type ```yaml Type: String -Parameter Sets: (All) Aliases: Accepted values: Vsts, AzureKeyVault @@ -165,11 +200,11 @@ Accept wildcard characters: False ``` ### -variableGroupVariables -The variable group variables. Please refer to the unit test for examples. + +The variable group variables. ```yaml Type: Hashtable -Parameter Sets: (All) Aliases: Required: True @@ -180,12 +215,14 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.String + System.Collections.Hashtable ## OUTPUTS @@ -201,3 +238,4 @@ System.Collections.Hashtable [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) [Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) + From 351083f354b63cd2e0cb74a73ca3ac338ee1afb2 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sat, 22 Jun 2019 16:59:07 -0500 Subject: [PATCH 04/18] Removed unnecessary ParameterSet decoration. --- Source/Public/Add-VSTeamVariableGroup.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Public/Add-VSTeamVariableGroup.ps1 b/Source/Public/Add-VSTeamVariableGroup.ps1 index ffcfe19a5..37a6bcc8e 100644 --- a/Source/Public/Add-VSTeamVariableGroup.ps1 +++ b/Source/Public/Add-VSTeamVariableGroup.ps1 @@ -1,5 +1,4 @@ function Add-VSTeamVariableGroup { - [CmdletBinding(DefaultParameterSetName = 'Secure')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $variableGroupName, From a0f6e625305451df6d55c3c9a7a963f2d03ae775 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sat, 22 Jun 2019 17:06:37 -0500 Subject: [PATCH 05/18] Updated Get-VSTeamVariableGroup function params --- Source/Public/Get-VSTeamVariableGroup.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 index 1fa8bb75d..4e54392b0 100644 --- a/Source/Public/Get-VSTeamVariableGroup.ps1 +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -1,12 +1,12 @@ function Get-VSTeamVariableGroup { [CmdletBinding(DefaultParameterSetName = 'List')] param( - [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [Parameter(Position = 0, ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $id ) DynamicParam { - _buildProjectNameDynamicParam + _buildProjectNameDynamicParam -Position 1 } Process { From 2dbafe79ef12447c7483aa0b94ebbc31e61c9ed7 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sat, 22 Jun 2019 17:12:55 -0500 Subject: [PATCH 06/18] Added integration tests for Get- function. --- integration/test/010_projects.Tests.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/integration/test/010_projects.Tests.ps1 b/integration/test/010_projects.Tests.ps1 index bf5944888..566c43d4e 100644 --- a/integration/test/010_projects.Tests.ps1 +++ b/integration/test/010_projects.Tests.ps1 @@ -325,6 +325,14 @@ InModuleScope VSTeam { $newVariableGroup | Should Not Be $null } + It 'Get-VSTeamVariableGroup Should get the variable group created first by list then by id' { + $existingVariableGroups = Get-VSTeamVariableGroup -ProjectName $newProjectName + $existingVariableGroups.Count | Should Not BeGreaterThan 0 + + $existingVariableGroup = Get-VSTeamVariableGroup -ProjectName $newProjectName -id $newVariableGroup.id + $existingVariableGroup | Should Not Be $null + } + It 'Update-VSTeamVariableGroup Should update the variable group' { $newVariableGroup | Should Not Be $null $variables = @{ From 587fcbe1d064a5f101b7fe636ba6cbe261d70b6a Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sat, 22 Jun 2019 17:34:49 -0500 Subject: [PATCH 07/18] Added exception for TFS 2017 Set defaults for TFS 2018 and Azure DevOps --- Source/Classes/VSTeamVersions.ps1 | 2 +- Source/Private/common.ps1 | 6 ++++++ Source/Public/Add-VSTeamVariableGroup.ps1 | 3 +++ Source/Public/Get-VSTeamAPIVersion.ps1 | 1 + Source/Public/Get-VSTeamVariableGroup.ps1 | 3 +++ Source/Public/Remove-VSTeamVariableGroup.ps1 | 3 +++ Source/Public/Set-VSTeamAPIVersion.ps1 | 9 ++++++++- Source/Public/Update-VSTeamVariableGroup.ps1 | 3 +++ 8 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Source/Classes/VSTeamVersions.ps1 b/Source/Classes/VSTeamVersions.ps1 index 8ee76edfa..da1295a12 100644 --- a/Source/Classes/VSTeamVersions.ps1 +++ b/Source/Classes/VSTeamVersions.ps1 @@ -7,7 +7,7 @@ class VSTeamVersions { static [string] $Core = '3.0' static [string] $Git = '3.0' static [string] $DistributedTask = '3.0-preview' - static [string] $VariableGroups = '5.0-preview.1' + static [string] $VariableGroups = '' static [string] $Tfvc = '3.0' static [string] $Packaging = '' static [string] $MemberEntitlementManagement = '' diff --git a/Source/Private/common.ps1 b/Source/Private/common.ps1 index 120b2ab58..fb5a7cd21 100644 --- a/Source/Private/common.ps1 +++ b/Source/Private/common.ps1 @@ -716,6 +716,12 @@ function _trackServiceEndpointProgress { } } +function _supportsVariableGroups { + if (-not [VSTeamVersions]::VariableGroups) { + throw 'This account does not support Variable Group endpoints.' + } +} + function _supportsServiceFabricEndpoint { if (-not [VSTeamVersions]::ServiceFabricEndpoint) { throw 'This account does not support Service Fabric endpoints.' diff --git a/Source/Public/Add-VSTeamVariableGroup.ps1 b/Source/Public/Add-VSTeamVariableGroup.ps1 index 37a6bcc8e..85d75130f 100644 --- a/Source/Public/Add-VSTeamVariableGroup.ps1 +++ b/Source/Public/Add-VSTeamVariableGroup.ps1 @@ -22,6 +22,9 @@ function Add-VSTeamVariableGroup { } Process { + # This will throw if this account does not support Variable Groups + _supportsVariableGroups + # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] diff --git a/Source/Public/Get-VSTeamAPIVersion.ps1 b/Source/Public/Get-VSTeamAPIVersion.ps1 index 72bf049d7..3daf5d266 100644 --- a/Source/Public/Get-VSTeamAPIVersion.ps1 +++ b/Source/Public/Get-VSTeamAPIVersion.ps1 @@ -9,6 +9,7 @@ function Get-VSTeamAPIVersion { Core = $([VSTeamVersions]::Core) Git = $([VSTeamVersions]::Git) DistributedTask = $([VSTeamVersions]::DistributedTask) + VariableGroups = $([VSTeamVersions]::VariableGroups) Tfvc = $([VSTeamVersions]::Tfvc) Packaging = $([VSTeamVersions]::Packaging) MemberEntitlementManagement = $([VSTeamVersions]::MemberEntitlementManagement) diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 index 4e54392b0..4191906b7 100644 --- a/Source/Public/Get-VSTeamVariableGroup.ps1 +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -10,6 +10,9 @@ function Get-VSTeamVariableGroup { } Process { + # This will throw if this account does not support Variable Groups + _supportsVariableGroups + # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] diff --git a/Source/Public/Remove-VSTeamVariableGroup.ps1 b/Source/Public/Remove-VSTeamVariableGroup.ps1 index 2536d3680..1fcfed44a 100644 --- a/Source/Public/Remove-VSTeamVariableGroup.ps1 +++ b/Source/Public/Remove-VSTeamVariableGroup.ps1 @@ -12,6 +12,9 @@ function Remove-VSTeamVariableGroup { } Process { + # This will throw if this account does not support Variable Groups + _supportsVariableGroups + # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] diff --git a/Source/Public/Set-VSTeamAPIVersion.ps1 b/Source/Public/Set-VSTeamAPIVersion.ps1 index 632369f26..aec7c0936 100644 --- a/Source/Public/Set-VSTeamAPIVersion.ps1 +++ b/Source/Public/Set-VSTeamAPIVersion.ps1 @@ -6,7 +6,7 @@ function Set-VSTeamAPIVersion { [string] $Target = 'TFS2017', [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 0)] - [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceFabricEndpoint', 'Graph')] + [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceFabricEndpoint', 'Graph')] [string] $Service, [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 1)] @@ -33,6 +33,9 @@ function Set-VSTeamAPIVersion { 'DistributedTask' { [VSTeamVersions]::DistributedTask = $Version } + 'VariableGroups' { + [VSTeamVersions]::VariableGroups = $Version + } 'Tfvc' { [VSTeamVersions]::Tfvc = $Version } @@ -62,6 +65,7 @@ function Set-VSTeamAPIVersion { [VSTeamVersions]::Build = '3.2' [VSTeamVersions]::Release = '4.0-preview' [VSTeamVersions]::DistributedTask = '4.0-preview' + [VSTeamVersions]::VariableGroups = '4.1-preview.1' [VSTeamVersions]::Tfvc = '3.2' [VSTeamVersions]::Packaging = '' [VSTeamVersions]::MemberEntitlementManagement = '' @@ -76,6 +80,7 @@ function Set-VSTeamAPIVersion { [VSTeamVersions]::Build = '3.0' [VSTeamVersions]::Release = '3.0-preview' [VSTeamVersions]::DistributedTask = '3.0-preview' + [VSTeamVersions]::VariableGroups = '' [VSTeamVersions]::Tfvc = '3.0' [VSTeamVersions]::Packaging = '' [VSTeamVersions]::MemberEntitlementManagement = '' @@ -90,6 +95,7 @@ function Set-VSTeamAPIVersion { [VSTeamVersions]::Build = '5.0' [VSTeamVersions]::Release = '5.1-preview' [VSTeamVersions]::DistributedTask = '5.0-preview' + [VSTeamVersions]::VariableGroups = '5.0-preview.1' [VSTeamVersions]::Tfvc = '5.0' [VSTeamVersions]::Packaging = '5.1-preview' [VSTeamVersions]::MemberEntitlementManagement = '5.1-preview' @@ -110,6 +116,7 @@ function Set-VSTeamAPIVersion { Write-Verbose "Build: $([VSTeamVersions]::Build)" Write-Verbose "Release: $([VSTeamVersions]::Release)" Write-Verbose "DistributedTask: $([VSTeamVersions]::DistributedTask)" + Write-Verbose "VariableGroups: $([VSTeamVersions]::VariableGroups)" Write-Verbose "Tfvc: $([VSTeamVersions]::Tfvc)" Write-Verbose "Packaging: $([VSTeamVersions]::Packaging)" Write-Verbose "MemberEntitlementManagement: $([VSTeamVersions]::MemberEntitlementManagement)" diff --git a/Source/Public/Update-VSTeamVariableGroup.ps1 b/Source/Public/Update-VSTeamVariableGroup.ps1 index 10b9ee524..d3a094fb3 100644 --- a/Source/Public/Update-VSTeamVariableGroup.ps1 +++ b/Source/Public/Update-VSTeamVariableGroup.ps1 @@ -28,6 +28,9 @@ function Update-VSTeamVariableGroup { } Process { + # This will throw if this account does not support Variable Groups + _supportsVariableGroups + # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] From 289594f1ea4e5f17950692f967a3b12a152e6ba9 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sun, 23 Jun 2019 14:08:13 -0500 Subject: [PATCH 08/18] Added unit tests Updated integration tests Fixed bug in Get- --- Source/Public/Get-VSTeamVariableGroup.ps1 | 2 +- integration/test/010_projects.Tests.ps1 | 2 +- unit/test/variableGroups.Tests.ps1 | 252 ++++++++++++++++++++++ 3 files changed, 254 insertions(+), 2 deletions(-) create mode 100644 unit/test/variableGroups.Tests.ps1 diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 index 4191906b7..b8b0b7a7b 100644 --- a/Source/Public/Get-VSTeamVariableGroup.ps1 +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -19,7 +19,7 @@ function Get-VSTeamVariableGroup { if ($id) { # Call the REST API $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` - -Version $([VSTeamVersions]::DistributedTask) -Id $id + -Version $([VSTeamVersions]::VariableGroups) -Id $id _applyTypesToVariableGroup -item $resp diff --git a/integration/test/010_projects.Tests.ps1 b/integration/test/010_projects.Tests.ps1 index 566c43d4e..9410c375c 100644 --- a/integration/test/010_projects.Tests.ps1 +++ b/integration/test/010_projects.Tests.ps1 @@ -327,7 +327,7 @@ InModuleScope VSTeam { It 'Get-VSTeamVariableGroup Should get the variable group created first by list then by id' { $existingVariableGroups = Get-VSTeamVariableGroup -ProjectName $newProjectName - $existingVariableGroups.Count | Should Not BeGreaterThan 0 + $existingVariableGroups.Count | Should BeGreaterThan 0 $existingVariableGroup = Get-VSTeamVariableGroup -ProjectName $newProjectName -id $newVariableGroup.id $existingVariableGroup | Should Not Be $null diff --git a/unit/test/variableGroups.Tests.ps1 b/unit/test/variableGroups.Tests.ps1 new file mode 100644 index 000000000..0f524eb0b --- /dev/null +++ b/unit/test/variableGroups.Tests.ps1 @@ -0,0 +1,252 @@ +Set-StrictMode -Version Latest + +InModuleScope VSTeam { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + [VSTeamVersions]::Account = 'https://dev.azure.com/test' + + # Variable Groups are not supported on TFS 2017 + Describe "Variable Groups TFS 2017 Errors" { + Context 'Get-VSTeamVariableGroup' { + Mock _callAPI { throw 'Should not be called' } -Verifiable + + It 'Should throw' { + Set-VSTeamAPIVersion TFS2017 + + { Get-VSTeamVariableGroup -projectName project } | Should Throw + } + + It '_callAPI should be called once to get projects' { + Assert-MockCalled _callAPI -Exactly 1 + } + } + + Context 'Remove-VSTeamVariableGroup' { + Mock _callAPI { throw 'Should not be called' } -Verifiable + + It 'Should throw' { + Set-VSTeamAPIVersion TFS2017 + + { Remove-VSTeamVariableGroup -projectName project -id 5 } | Should Throw + } + } + + Context 'Add-VSTeamVariableGroup' { + Mock _callAPI { throw 'Should not be called' } -Verifiable + + It 'Should throw' { + Set-VSTeamAPIVersion TFS2017 + $testParameters = @{ + ProjectName = "project" + variableGroupName = "az-keyvault" + variableGroupDescription = "description" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "1cda0ec8-8f46-4a38-8b06-16068b8c47fc" + vault = "az-keyvault" + } + } + + { Add-VSTeamVariableGroup @testParameters } | Should Throw + } + } + + Context 'Update-VSTeamVariableGroup' { + Mock _callAPI { throw 'Should not be called' } -Verifiable + + It 'Should throw' { + Set-VSTeamAPIVersion TFS2017 + $testParameters = @{ + ProjectName = "project" + id = 5 + variableGroupName = "az-keyvault" + variableGroupDescription = "description" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + name_of_second_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "1cda0ec8-8f46-4a38-8b06-16068b8c47fc" + vault = "az-keyvault" + } + } + + { Update-VSTeamVariableGroup @testParameters } | Should Throw + } + } + } + + Describe 'Variable Groups VSTS' { + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/project*" + } + + . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + + [VSTeamVersions]::VariableGroups = '5.0-preview.1' + + Context 'Get-VSTeamVariableGroup list' { + Mock Invoke-RestMethod { + return [PSCustomObject]@{ + value = [PSCustomObject]@{ + id = 5 + type = "AzureKeyVault" + name = "az-keyvault" + createdBy = [PSCustomObject]@{} + modifiedBy = [PSCustomObject]@{} + providerData = [PSCustomObject]@{} + variables = [PSCustomObject]@{} + } + } + } + + It 'Should return all variable groups' { + Get-VSTeamVariableGroup -projectName project + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/?api-version=$([VSTeamVersions]::VariableGroups)" + } + } + } + + Context 'Get-VSTeamVariableGroup id' { + Mock Invoke-RestMethod { + return [PSCustomObject]@{ + id = 5 + type = "AzureKeyVault" + name = "az-keyvault" + createdBy = [PSCustomObject]@{} + modifiedBy = [PSCustomObject]@{} + providerData = [PSCustomObject]@{} + variables = [PSCustomObject]@{} + } + } + + It 'Should return one variable group' { + Get-VSTeamVariableGroup -projectName project -id 5 + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/5?api-version=$([VSTeamVersions]::VariableGroups)" + } + } + } + + Context 'Remove-VSTeamVariableGroup' { + Mock Invoke-RestMethod + + It 'should delete service endpoint' { + Remove-VSTeamVariableGroup -projectName project -id 5 -Force + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/5?api-version=$([VSTeamVersions]::VariableGroups)" -and + $Method -eq 'Delete' + } + } + } + + Context 'Add-VSTeamVariableGroup' { + Mock Invoke-RestMethod { + return [PSCustomObject]@{ + id = 5 + type = "AzureKeyVault" + name = "az-keyvault" + createdBy = [PSCustomObject]@{} + modifiedBy = [PSCustomObject]@{} + providerData = [PSCustomObject]@{} + variables = [PSCustomObject]@{} + } + } -Verifiable + + It 'should create a new AzureRM Key Vault Variable Group' { + $testParameters = @{ + ProjectName = "project" + variableGroupName = "az-keyvault" + variableGroupDescription = "description" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "1cda0ec8-8f46-4a38-8b06-16068b8c47fc" + vault = "az-keyvault" + } + } + + Add-VSTeamVariableGroup @testParameters + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } + } + } + + Context 'Update-VSTeamVariableGroup' { + Mock Invoke-RestMethod { + return [PSCustomObject]@{ + id = 5 + type = "AzureKeyVault" + name = "az-keyvault" + createdBy = [PSCustomObject]@{} + modifiedBy = [PSCustomObject]@{} + providerData = [PSCustomObject]@{} + variables = [PSCustomObject]@{} + } + } -Verifiable + + It 'should update an exisiting Variable Group' { + $testParameters = @{ + ProjectName = "project" + id = 5 + variableGroupName = "az-keyvault" + variableGroupDescription = "description" + variableGroupType = "AzureKeyVault" + variableGroupVariables = @{ + name_of_existing_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + name_of_second_secret = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + variableGroupProviderData = @{ + serviceEndpointId = "1cda0ec8-8f46-4a38-8b06-16068b8c47fc" + vault = "az-keyvault" + } + } + + Update-VSTeamVariableGroup @testParameters + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Put' } + } + } + } +} From 04e70dbcb36044e664a39389c30c347e8304ebd2 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sun, 23 Jun 2019 14:13:40 -0500 Subject: [PATCH 09/18] Uncomplicate TFS2017 tests --- unit/test/variableGroups.Tests.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/unit/test/variableGroups.Tests.ps1 b/unit/test/variableGroups.Tests.ps1 index 0f524eb0b..431a6d3a9 100644 --- a/unit/test/variableGroups.Tests.ps1 +++ b/unit/test/variableGroups.Tests.ps1 @@ -8,17 +8,11 @@ InModuleScope VSTeam { # Variable Groups are not supported on TFS 2017 Describe "Variable Groups TFS 2017 Errors" { Context 'Get-VSTeamVariableGroup' { - Mock _callAPI { throw 'Should not be called' } -Verifiable - It 'Should throw' { Set-VSTeamAPIVersion TFS2017 { Get-VSTeamVariableGroup -projectName project } | Should Throw } - - It '_callAPI should be called once to get projects' { - Assert-MockCalled _callAPI -Exactly 1 - } } Context 'Remove-VSTeamVariableGroup' { From 7685a0e5b8bc259419e1557edfc4c43e6944600d Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sun, 23 Jun 2019 14:18:54 -0500 Subject: [PATCH 10/18] Removed extra mocks Removed git format warnings --- Source/Public/Add-VSTeamVariableGroup.ps1 | 2 +- Source/Public/Get-VSTeamVariableGroup.ps1 | 2 +- Source/Public/Remove-VSTeamVariableGroup.ps1 | 2 +- Source/Public/Update-VSTeamVariableGroup.ps1 | 2 +- unit/test/variableGroups.Tests.ps1 | 6 ------ 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Source/Public/Add-VSTeamVariableGroup.ps1 b/Source/Public/Add-VSTeamVariableGroup.ps1 index 85d75130f..5b00f87bd 100644 --- a/Source/Public/Add-VSTeamVariableGroup.ps1 +++ b/Source/Public/Add-VSTeamVariableGroup.ps1 @@ -46,4 +46,4 @@ function Add-VSTeamVariableGroup { return Get-VSTeamVariableGroup -ProjectName $ProjectName -id $resp.id } -} \ No newline at end of file +} diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 index b8b0b7a7b..dea033b48 100644 --- a/Source/Public/Get-VSTeamVariableGroup.ps1 +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -37,4 +37,4 @@ function Get-VSTeamVariableGroup { return $resp.value } } -} \ No newline at end of file +} diff --git a/Source/Public/Remove-VSTeamVariableGroup.ps1 b/Source/Public/Remove-VSTeamVariableGroup.ps1 index 1fcfed44a..6ce64df01 100644 --- a/Source/Public/Remove-VSTeamVariableGroup.ps1 +++ b/Source/Public/Remove-VSTeamVariableGroup.ps1 @@ -28,4 +28,4 @@ function Remove-VSTeamVariableGroup { } } } -} \ No newline at end of file +} diff --git a/Source/Public/Update-VSTeamVariableGroup.ps1 b/Source/Public/Update-VSTeamVariableGroup.ps1 index d3a094fb3..fe188d962 100644 --- a/Source/Public/Update-VSTeamVariableGroup.ps1 +++ b/Source/Public/Update-VSTeamVariableGroup.ps1 @@ -56,4 +56,4 @@ function Update-VSTeamVariableGroup { return Get-VSTeamVariableGroup -ProjectName $ProjectName -id $id } } -} \ No newline at end of file +} diff --git a/unit/test/variableGroups.Tests.ps1 b/unit/test/variableGroups.Tests.ps1 index 431a6d3a9..53b8fa2d3 100644 --- a/unit/test/variableGroups.Tests.ps1 +++ b/unit/test/variableGroups.Tests.ps1 @@ -16,8 +16,6 @@ InModuleScope VSTeam { } Context 'Remove-VSTeamVariableGroup' { - Mock _callAPI { throw 'Should not be called' } -Verifiable - It 'Should throw' { Set-VSTeamAPIVersion TFS2017 @@ -26,8 +24,6 @@ InModuleScope VSTeam { } Context 'Add-VSTeamVariableGroup' { - Mock _callAPI { throw 'Should not be called' } -Verifiable - It 'Should throw' { Set-VSTeamAPIVersion TFS2017 $testParameters = @{ @@ -54,8 +50,6 @@ InModuleScope VSTeam { } Context 'Update-VSTeamVariableGroup' { - Mock _callAPI { throw 'Should not be called' } -Verifiable - It 'Should throw' { Set-VSTeamAPIVersion TFS2017 $testParameters = @{ From b701b78f71f86825a52d9653c95c87640207bf5e Mon Sep 17 00:00:00 2001 From: Donovan Brown Date: Tue, 25 Jun 2019 08:57:50 -0500 Subject: [PATCH 11/18] Added version to TFS2017 for VariableGroups --- Source/Public/Set-VSTeamAPIVersion.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Public/Set-VSTeamAPIVersion.ps1 b/Source/Public/Set-VSTeamAPIVersion.ps1 index aec7c0936..6a8961d07 100644 --- a/Source/Public/Set-VSTeamAPIVersion.ps1 +++ b/Source/Public/Set-VSTeamAPIVersion.ps1 @@ -80,7 +80,7 @@ function Set-VSTeamAPIVersion { [VSTeamVersions]::Build = '3.0' [VSTeamVersions]::Release = '3.0-preview' [VSTeamVersions]::DistributedTask = '3.0-preview' - [VSTeamVersions]::VariableGroups = '' + [VSTeamVersions]::VariableGroups = '3.2-preview.1' [VSTeamVersions]::Tfvc = '3.0' [VSTeamVersions]::Packaging = '' [VSTeamVersions]::MemberEntitlementManagement = '' From e60581a40a2f9533ba2454a268687f79a604df9e Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Fri, 28 Jun 2019 17:17:41 -0500 Subject: [PATCH 12/18] - Added VSTS and AzureKeyVault JSON samples - Updated VSTS unit tests to use JSON sample - Updated unit tests to stub 2017 functionality - Set default VariableGroup version to TFS 2017 - Removed _supportsVariableGroups check --- Source/Classes/VSTeamVersions.ps1 | 2 +- Source/Private/common.ps1 | 6 - Source/Public/Add-VSTeamVariableGroup.ps1 | 3 - Source/Public/Get-VSTeamVariableGroup.ps1 | 3 - Source/Public/Remove-VSTeamVariableGroup.ps1 | 3 - Source/Public/Update-VSTeamVariableGroup.ps1 | 3 - .../sampleFiles/variableGroupSamples.json | 64 ++++++ unit/test/variableGroups.Tests.ps1 | 215 ++++++++++-------- 8 files changed, 183 insertions(+), 116 deletions(-) create mode 100644 unit/test/sampleFiles/variableGroupSamples.json diff --git a/Source/Classes/VSTeamVersions.ps1 b/Source/Classes/VSTeamVersions.ps1 index da1295a12..1213c423c 100644 --- a/Source/Classes/VSTeamVersions.ps1 +++ b/Source/Classes/VSTeamVersions.ps1 @@ -7,7 +7,7 @@ class VSTeamVersions { static [string] $Core = '3.0' static [string] $Git = '3.0' static [string] $DistributedTask = '3.0-preview' - static [string] $VariableGroups = '' + static [string] $VariableGroups = '3.2-preview.1' static [string] $Tfvc = '3.0' static [string] $Packaging = '' static [string] $MemberEntitlementManagement = '' diff --git a/Source/Private/common.ps1 b/Source/Private/common.ps1 index fb5a7cd21..120b2ab58 100644 --- a/Source/Private/common.ps1 +++ b/Source/Private/common.ps1 @@ -716,12 +716,6 @@ function _trackServiceEndpointProgress { } } -function _supportsVariableGroups { - if (-not [VSTeamVersions]::VariableGroups) { - throw 'This account does not support Variable Group endpoints.' - } -} - function _supportsServiceFabricEndpoint { if (-not [VSTeamVersions]::ServiceFabricEndpoint) { throw 'This account does not support Service Fabric endpoints.' diff --git a/Source/Public/Add-VSTeamVariableGroup.ps1 b/Source/Public/Add-VSTeamVariableGroup.ps1 index 5b00f87bd..e363b1ebe 100644 --- a/Source/Public/Add-VSTeamVariableGroup.ps1 +++ b/Source/Public/Add-VSTeamVariableGroup.ps1 @@ -22,9 +22,6 @@ function Add-VSTeamVariableGroup { } Process { - # This will throw if this account does not support Variable Groups - _supportsVariableGroups - # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 index dea033b48..a9929f46f 100644 --- a/Source/Public/Get-VSTeamVariableGroup.ps1 +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -10,9 +10,6 @@ function Get-VSTeamVariableGroup { } Process { - # This will throw if this account does not support Variable Groups - _supportsVariableGroups - # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] diff --git a/Source/Public/Remove-VSTeamVariableGroup.ps1 b/Source/Public/Remove-VSTeamVariableGroup.ps1 index 6ce64df01..609f24fa3 100644 --- a/Source/Public/Remove-VSTeamVariableGroup.ps1 +++ b/Source/Public/Remove-VSTeamVariableGroup.ps1 @@ -12,9 +12,6 @@ function Remove-VSTeamVariableGroup { } Process { - # This will throw if this account does not support Variable Groups - _supportsVariableGroups - # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] diff --git a/Source/Public/Update-VSTeamVariableGroup.ps1 b/Source/Public/Update-VSTeamVariableGroup.ps1 index fe188d962..e07c736e1 100644 --- a/Source/Public/Update-VSTeamVariableGroup.ps1 +++ b/Source/Public/Update-VSTeamVariableGroup.ps1 @@ -28,9 +28,6 @@ function Update-VSTeamVariableGroup { } Process { - # This will throw if this account does not support Variable Groups - _supportsVariableGroups - # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] diff --git a/unit/test/sampleFiles/variableGroupSamples.json b/unit/test/sampleFiles/variableGroupSamples.json new file mode 100644 index 000000000..24ea0d8f8 --- /dev/null +++ b/unit/test/sampleFiles/variableGroupSamples.json @@ -0,0 +1,64 @@ +{ + "count": 2, + "value": [ + { + "variables": { + "key1": { + "value": "value1" + }, + "key2": { + "value": null, + "isSecret": true + } + }, + "id": 1, + "type": "Vsts", + "name": "TestVariableGroup1", + "description": "A test variable group", + "createdBy": { + "displayName": "Test User", + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "uniqueName": "test.user@the.cloud" + }, + "createdOn": "2019-06-28T21:04:30.56Z", + "modifiedBy": { + "displayName": "Test User", + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "uniqueName": "test.user@the.cloud" + }, + "modifiedOn": "2019-06-28T21:04:30.56Z", + "isShared": false + }, + { + "variables": { + "key3": { + "enabled": true, + "contentType": "", + "value": null, + "isSecret": true + } + }, + "id": 2, + "type": "AzureKeyVault", + "name": "TestVariableGroup2", + "description": "A test variable group linked to an Azure KeyVault", + "providerData": { + "serviceEndpointId": "0228e842-65a7-4c64-90f7-0f07f3aa4e10", + "vault": "keyVaultName" + }, + "createdBy": { + "displayName": "Test User", + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "uniqueName": "test.user@the.cloud" + }, + "createdOn": "2019-06-21T05:51:23.8866667Z", + "modifiedBy": { + "displayName": "Test User", + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "uniqueName": "test.user@the.cloud" + }, + "modifiedOn": "2019-06-21T05:51:24.5666667Z", + "isShared": false + } + ] +} \ No newline at end of file diff --git a/unit/test/variableGroups.Tests.ps1 b/unit/test/variableGroups.Tests.ps1 index 53b8fa2d3..7f7429533 100644 --- a/unit/test/variableGroups.Tests.ps1 +++ b/unit/test/variableGroups.Tests.ps1 @@ -5,34 +5,82 @@ InModuleScope VSTeam { # using the Set-VSTeamAccount function. [VSTeamVersions]::Account = 'https://dev.azure.com/test' - # Variable Groups are not supported on TFS 2017 - Describe "Variable Groups TFS 2017 Errors" { - Context 'Get-VSTeamVariableGroup' { - It 'Should throw' { - Set-VSTeamAPIVersion TFS2017 + $sampleFile2017 = "$PSScriptRoot\sampleFiles\variableGroupSamples.json" + Describe 'Variable Groups 2017' { + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*_apis/project*" + } + + . "$PSScriptRoot\mocks\mockProjectNameDynamicParamNoPSet.ps1" + + [VSTeamVersions]::VariableGroups = '3.2-preview.1' + + BeforeAll { + Set-VSTeamAPIVersion -Target TFS2017 + } + + Context 'Get-VSTeamVariableGroup list' { + Mock Invoke-RestMethod { + return Get-Content $sampleFile2017 | ConvertFrom-Json + } + + It 'Should return all variable groups' { + Get-VSTeamVariableGroup -projectName project + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/?api-version=$([VSTeamVersions]::VariableGroups)" + } + } + } + + Context 'Get-VSTeamVariableGroup id' { + Mock Invoke-RestMethod { + #Write-Host $args - { Get-VSTeamVariableGroup -projectName project } | Should Throw + $collection = Get-Content $sampleFile2017 | ConvertFrom-Json + return $collection.value | Where-Object {$_.id -eq 1} + } + + It 'Should return one variable group' { + $projectID = 1 + Get-VSTeamVariableGroup -projectName project -id $projectID + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$([VSTeamVersions]::VariableGroups)" + } } } Context 'Remove-VSTeamVariableGroup' { - It 'Should throw' { - Set-VSTeamAPIVersion TFS2017 + Mock Invoke-RestMethod - { Remove-VSTeamVariableGroup -projectName project -id 5 } | Should Throw + It 'should delete service endpoint' { + Remove-VSTeamVariableGroup -projectName project -id 5 -Force + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/5?api-version=$([VSTeamVersions]::VariableGroups)" -and + $Method -eq 'Delete' + } } } Context 'Add-VSTeamVariableGroup' { - It 'Should throw' { - Set-VSTeamAPIVersion TFS2017 + Mock Invoke-RestMethod { + #Write-Host $args + + $collection = Get-Content $sampleFile2017 | ConvertFrom-Json + return $collection.value | Where-Object {$_.id -eq 2} + } -Verifiable + + It 'should create a new AzureRM Key Vault Variable Group' { $testParameters = @{ ProjectName = "project" - variableGroupName = "az-keyvault" - variableGroupDescription = "description" + variableGroupName = "TestVariableGroup2" + variableGroupDescription = "A test variable group linked to an Azure KeyVault" variableGroupType = "AzureKeyVault" variableGroupVariables = @{ - name_of_existing_secret = @{ + key3 = @{ enabled = $true contentType = "" value = "" @@ -40,49 +88,51 @@ InModuleScope VSTeam { } } variableGroupProviderData = @{ - serviceEndpointId = "1cda0ec8-8f46-4a38-8b06-16068b8c47fc" - vault = "az-keyvault" + serviceEndpointId = "0228e842-65a7-4c64-90f7-0f07f3aa4e10" + vault = "keyVaultName" } } - { Add-VSTeamVariableGroup @testParameters } | Should Throw + Add-VSTeamVariableGroup @testParameters + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } } } Context 'Update-VSTeamVariableGroup' { - It 'Should throw' { - Set-VSTeamAPIVersion TFS2017 + Mock Invoke-RestMethod { + #Write-Host $args + + $collection = Get-Content $sampleFile2017 | ConvertFrom-Json + return $collection.value | Where-Object {$_.id -eq 1} + } -Verifiable + + It 'should update an exisiting Variable Group' { $testParameters = @{ ProjectName = "project" - id = 5 - variableGroupName = "az-keyvault" - variableGroupDescription = "description" - variableGroupType = "AzureKeyVault" + id = 1 + variableGroupName = "TestVariableGroup1" + variableGroupDescription = "A test variable group" + variableGroupType = "Vsts" variableGroupVariables = @{ - name_of_existing_secret = @{ - enabled = $true - contentType = "" - value = "" - isSecret = $true + key1 = @{ + value = "value" } - name_of_second_secret = @{ - enabled = $true - contentType = "" + key2 = @{ value = "" isSecret = $true } } - variableGroupProviderData = @{ - serviceEndpointId = "1cda0ec8-8f46-4a38-8b06-16068b8c47fc" - vault = "az-keyvault" - } } - { Update-VSTeamVariableGroup @testParameters } | Should Throw + Update-VSTeamVariableGroup @testParameters + + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Put' } } } } + $sampleFileVSTS = "$PSScriptRoot\sampleFiles\variableGroupSamples.json" Describe 'Variable Groups VSTS' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { @@ -93,19 +143,13 @@ InModuleScope VSTeam { [VSTeamVersions]::VariableGroups = '5.0-preview.1' + BeforeAll { + Set-VSTeamAPIVersion -Target VSTS + } + Context 'Get-VSTeamVariableGroup list' { Mock Invoke-RestMethod { - return [PSCustomObject]@{ - value = [PSCustomObject]@{ - id = 5 - type = "AzureKeyVault" - name = "az-keyvault" - createdBy = [PSCustomObject]@{} - modifiedBy = [PSCustomObject]@{} - providerData = [PSCustomObject]@{} - variables = [PSCustomObject]@{} - } - } + return Get-Content $sampleFileVSTS | ConvertFrom-Json } It 'Should return all variable groups' { @@ -119,22 +163,18 @@ InModuleScope VSTeam { Context 'Get-VSTeamVariableGroup id' { Mock Invoke-RestMethod { - return [PSCustomObject]@{ - id = 5 - type = "AzureKeyVault" - name = "az-keyvault" - createdBy = [PSCustomObject]@{} - modifiedBy = [PSCustomObject]@{} - providerData = [PSCustomObject]@{} - variables = [PSCustomObject]@{} - } + #Write-Host $args + + $collection = Get-Content $sampleFileVSTS | ConvertFrom-Json + return $collection.value | Where-Object {$_.id -eq 1} } It 'Should return one variable group' { - Get-VSTeamVariableGroup -projectName project -id 5 + $projectID = 1 + Get-VSTeamVariableGroup -projectName project -id $projectID Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/5?api-version=$([VSTeamVersions]::VariableGroups)" + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$([VSTeamVersions]::VariableGroups)" } } } @@ -154,25 +194,20 @@ InModuleScope VSTeam { Context 'Add-VSTeamVariableGroup' { Mock Invoke-RestMethod { - return [PSCustomObject]@{ - id = 5 - type = "AzureKeyVault" - name = "az-keyvault" - createdBy = [PSCustomObject]@{} - modifiedBy = [PSCustomObject]@{} - providerData = [PSCustomObject]@{} - variables = [PSCustomObject]@{} - } + #Write-Host $args + + $collection = Get-Content $sampleFileVSTS | ConvertFrom-Json + return $collection.value | Where-Object {$_.id -eq 2} } -Verifiable It 'should create a new AzureRM Key Vault Variable Group' { $testParameters = @{ ProjectName = "project" - variableGroupName = "az-keyvault" - variableGroupDescription = "description" + variableGroupName = "TestVariableGroup2" + variableGroupDescription = "A test variable group linked to an Azure KeyVault" variableGroupType = "AzureKeyVault" variableGroupVariables = @{ - name_of_existing_secret = @{ + key3 = @{ enabled = $true contentType = "" value = "" @@ -180,8 +215,8 @@ InModuleScope VSTeam { } } variableGroupProviderData = @{ - serviceEndpointId = "1cda0ec8-8f46-4a38-8b06-16068b8c47fc" - vault = "az-keyvault" + serviceEndpointId = "0228e842-65a7-4c64-90f7-0f07f3aa4e10" + vault = "keyVaultName" } } @@ -193,42 +228,28 @@ InModuleScope VSTeam { Context 'Update-VSTeamVariableGroup' { Mock Invoke-RestMethod { - return [PSCustomObject]@{ - id = 5 - type = "AzureKeyVault" - name = "az-keyvault" - createdBy = [PSCustomObject]@{} - modifiedBy = [PSCustomObject]@{} - providerData = [PSCustomObject]@{} - variables = [PSCustomObject]@{} - } + #Write-Host $args + + $collection = Get-Content $sampleFileVSTS | ConvertFrom-Json + return $collection.value | Where-Object {$_.id -eq 1} } -Verifiable It 'should update an exisiting Variable Group' { $testParameters = @{ ProjectName = "project" - id = 5 - variableGroupName = "az-keyvault" - variableGroupDescription = "description" - variableGroupType = "AzureKeyVault" + id = 1 + variableGroupName = "TestVariableGroup1" + variableGroupDescription = "A test variable group" + variableGroupType = "Vsts" variableGroupVariables = @{ - name_of_existing_secret = @{ - enabled = $true - contentType = "" - value = "" - isSecret = $true + key1 = @{ + value = "value" } - name_of_second_secret = @{ - enabled = $true - contentType = "" + key2 = @{ value = "" isSecret = $true } } - variableGroupProviderData = @{ - serviceEndpointId = "1cda0ec8-8f46-4a38-8b06-16068b8c47fc" - vault = "az-keyvault" - } } Update-VSTeamVariableGroup @testParameters From 20a769fff1db501804d656b18c1d3cacb91a4993 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Sat, 29 Jun 2019 14:03:03 -0500 Subject: [PATCH 13/18] Added TFS2017 sample for variable group unit test --- Source/formats/variablegroups.format.ps1xml | 11 +- .../sampleFiles/variableGroupSamples2017.json | 31 ++++++ unit/test/variableGroups.Tests.ps1 | 103 +++++++++--------- 3 files changed, 83 insertions(+), 62 deletions(-) create mode 100644 unit/test/sampleFiles/variableGroupSamples2017.json diff --git a/Source/formats/variablegroups.format.ps1xml b/Source/formats/variablegroups.format.ps1xml index b77d38a7a..c3a6fbf72 100644 --- a/Source/formats/variablegroups.format.ps1xml +++ b/Source/formats/variablegroups.format.ps1xml @@ -15,9 +15,6 @@ - - - @@ -34,9 +31,6 @@ name - - type - createdByUser @@ -64,9 +58,6 @@ name - - type - createdByUser @@ -79,4 +70,4 @@ - \ No newline at end of file + diff --git a/unit/test/sampleFiles/variableGroupSamples2017.json b/unit/test/sampleFiles/variableGroupSamples2017.json new file mode 100644 index 000000000..32698d0d1 --- /dev/null +++ b/unit/test/sampleFiles/variableGroupSamples2017.json @@ -0,0 +1,31 @@ +{ + "count": 1, + "value": [ + { + "variables": { + "key1": { + "value": "value1" + }, + "key2": { + "value": null, + "isSecret": true + } + }, + "id": 1, + "name": "TestVariableGroup1", + "description": "A test variable group", + "createdBy": { + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "displayName": "tuser", + "uniqueName": "LOCAL\\tuser" + }, + "createdOn": "2019-06-25T13:49:52.3966667Z", + "modifiedBy": { + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "displayName": "tuser", + "uniqueName": "LOCAL\\tuser" + }, + "modifiedOn": "2019-06-25T13:49:52.3966667Z" + } + ] +} \ No newline at end of file diff --git a/unit/test/variableGroups.Tests.ps1 b/unit/test/variableGroups.Tests.ps1 index 7f7429533..b12db7034 100644 --- a/unit/test/variableGroups.Tests.ps1 +++ b/unit/test/variableGroups.Tests.ps1 @@ -5,7 +5,7 @@ InModuleScope VSTeam { # using the Set-VSTeamAccount function. [VSTeamVersions]::Account = 'https://dev.azure.com/test' - $sampleFile2017 = "$PSScriptRoot\sampleFiles\variableGroupSamples.json" + $sampleFile2017 = "$PSScriptRoot\sampleFiles\variableGroupSamples2017.json" Describe 'Variable Groups 2017' { # Mock the call to Get-Projects by the dynamic parameter for ProjectName Mock Invoke-RestMethod { return @() } -ParameterFilter { @@ -34,7 +34,7 @@ InModuleScope VSTeam { } } - Context 'Get-VSTeamVariableGroup id' { + Context 'Get-VSTeamVariableGroup Id' { Mock Invoke-RestMethod { #Write-Host $args @@ -55,11 +55,12 @@ InModuleScope VSTeam { Context 'Remove-VSTeamVariableGroup' { Mock Invoke-RestMethod - It 'should delete service endpoint' { - Remove-VSTeamVariableGroup -projectName project -id 5 -Force + It 'should delete variable group' { + $projectID = 1 + Remove-VSTeamVariableGroup -projectName project -id $projectID -Force Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/5?api-version=$([VSTeamVersions]::VariableGroups)" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$([VSTeamVersions]::VariableGroups)" -and $Method -eq 'Delete' } } @@ -70,27 +71,19 @@ InModuleScope VSTeam { #Write-Host $args $collection = Get-Content $sampleFile2017 | ConvertFrom-Json - return $collection.value | Where-Object {$_.id -eq 2} + return $collection.value | Where-Object {$_.id -eq 1} } -Verifiable - It 'should create a new AzureRM Key Vault Variable Group' { + It 'should create a new Variable Group' { $testParameters = @{ - ProjectName = "project" - variableGroupName = "TestVariableGroup2" - variableGroupDescription = "A test variable group linked to an Azure KeyVault" - variableGroupType = "AzureKeyVault" - variableGroupVariables = @{ - key3 = @{ - enabled = $true - contentType = "" - value = "" - isSecret = $true + ProjectName = "project" + Name = "TestVariableGroup2" + Description = "A test variable group linked to an Azure KeyVault" + Variables = @{ + key1 = @{ + value = "value" } } - variableGroupProviderData = @{ - serviceEndpointId = "0228e842-65a7-4c64-90f7-0f07f3aa4e10" - vault = "keyVaultName" - } } Add-VSTeamVariableGroup @testParameters @@ -109,25 +102,27 @@ InModuleScope VSTeam { It 'should update an exisiting Variable Group' { $testParameters = @{ - ProjectName = "project" - id = 1 - variableGroupName = "TestVariableGroup1" - variableGroupDescription = "A test variable group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + ProjectName = "project" + id = 1 + Name = "TestVariableGroup1" + Description = "A test variable group" + Variables = @{ key1 = @{ - value = "value" + value = "value" } - key2 = @{ - value = "" - isSecret = $true + key2 = @{ + value = "" + isSecret = $true } } } Update-VSTeamVariableGroup @testParameters - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Put' } + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($testParameters.id)?api-version=$([VSTeamVersions]::VariableGroups)" -and + $Method -eq 'Put' + } } } } @@ -161,7 +156,7 @@ InModuleScope VSTeam { } } - Context 'Get-VSTeamVariableGroup id' { + Context 'Get-VSTeamVariableGroup Id' { Mock Invoke-RestMethod { #Write-Host $args @@ -182,11 +177,12 @@ InModuleScope VSTeam { Context 'Remove-VSTeamVariableGroup' { Mock Invoke-RestMethod - It 'should delete service endpoint' { - Remove-VSTeamVariableGroup -projectName project -id 5 -Force + It 'should delete variable group' { + $projectID = 1 + Remove-VSTeamVariableGroup -projectName project -Id $projectID -Force Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/5?api-version=$([VSTeamVersions]::VariableGroups)" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$([VSTeamVersions]::VariableGroups)" -and $Method -eq 'Delete' } } @@ -203,10 +199,10 @@ InModuleScope VSTeam { It 'should create a new AzureRM Key Vault Variable Group' { $testParameters = @{ ProjectName = "project" - variableGroupName = "TestVariableGroup2" - variableGroupDescription = "A test variable group linked to an Azure KeyVault" - variableGroupType = "AzureKeyVault" - variableGroupVariables = @{ + Name = "TestVariableGroup2" + Description = "A test variable group linked to an Azure KeyVault" + Type = "AzureKeyVault" + Variables = @{ key3 = @{ enabled = $true contentType = "" @@ -214,7 +210,7 @@ InModuleScope VSTeam { isSecret = $true } } - variableGroupProviderData = @{ + ProviderData = @{ serviceEndpointId = "0228e842-65a7-4c64-90f7-0f07f3aa4e10" vault = "keyVaultName" } @@ -236,25 +232,28 @@ InModuleScope VSTeam { It 'should update an exisiting Variable Group' { $testParameters = @{ - ProjectName = "project" - id = 1 - variableGroupName = "TestVariableGroup1" - variableGroupDescription = "A test variable group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + ProjectName = "project" + Id = 1 + Name = "TestVariableGroup1" + Description = "A test variable group" + Type = "Vsts" + Variables = @{ key1 = @{ - value = "value" + value = "value" } - key2 = @{ - value = "" - isSecret = $true + key2 = @{ + value = "" + isSecret = $true } } } Update-VSTeamVariableGroup @testParameters - Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Put' } + Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($testParameters.id)?api-version=$([VSTeamVersions]::VariableGroups)" -and + $Method -eq 'Put' + } } } } From 37ace8fd5116f529c4a517b7ec85bc2f43c72f1e Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Mon, 1 Jul 2019 14:00:31 -0500 Subject: [PATCH 14/18] Updated the help --- .docs/Add-VSTeamVariableGroup.md | 42 ++--- .docs/Get-VSTeamVariableGroup.md | 6 +- .docs/Remove-VSTeamVariableGroup.md | 14 +- .docs/Update-VSTeamVariableGroup.md | 46 ++--- Source/en-US/VSTeam-Help.xml | 282 ++++++++++++++-------------- docs/Add-VSTeamVariableGroup.md | 42 ++--- docs/Get-VSTeamVariableGroup.md | 6 +- docs/Remove-VSTeamVariableGroup.md | 14 +- docs/Update-VSTeamVariableGroup.md | 46 ++--- 9 files changed, 249 insertions(+), 249 deletions(-) diff --git a/.docs/Add-VSTeamVariableGroup.md b/.docs/Add-VSTeamVariableGroup.md index 06a4aac5b..e5e9d74fa 100644 --- a/.docs/Add-VSTeamVariableGroup.md +++ b/.docs/Add-VSTeamVariableGroup.md @@ -20,10 +20,10 @@ $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" } @@ -43,10 +43,10 @@ Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "AzureKeyVault" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "AzureKeyVault" + Variables = @{ name_of_existing_secret = @{ enabled = $true contentType = "" @@ -54,7 +54,7 @@ $methodParameters = @{ isSecret = $true } } - variableGroupProviderData = @{ + ProviderData = @{ serviceEndpointId = "AzureRMServiceEndpointGuid" vault = "name_of_existing_key_vault" } @@ -67,7 +67,7 @@ Add-VSTeamVariableGroup @methodParameters -### -variableGroupDescription +### -Description The variable group description @@ -76,13 +76,13 @@ Type: String Aliases: Required: True -Position: 3 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupName +### -Name The variable group name @@ -91,30 +91,30 @@ Type: String Aliases: Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupProviderData +### -ProviderData -The variable group ProviderData. This should be $null for Vsts types. +The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. ```yaml Type: Hashtable Aliases: Required: False -Position: 5 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupType +### -Type -The variable group type +The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. ```yaml Type: String @@ -122,13 +122,13 @@ Aliases: Accepted values: Vsts, AzureKeyVault Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupVariables +### -Variables The variable group variables. @@ -137,7 +137,7 @@ Type: Hashtable Aliases: Required: True -Position: 4 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/.docs/Get-VSTeamVariableGroup.md b/.docs/Get-VSTeamVariableGroup.md index 75b1d4ef6..87e137f5f 100644 --- a/.docs/Get-VSTeamVariableGroup.md +++ b/.docs/Get-VSTeamVariableGroup.md @@ -31,7 +31,7 @@ Get-VSTeamVariableGroup @methodParameters $methodParameters = @{ ProjectName = "some_project_name" - id = "variable_group_id" + Id = "variable_group_id" } Get-VSTeamVariableGroup @methodParameters @@ -43,7 +43,7 @@ Get-VSTeamVariableGroup @methodParameters -### -id +### -Id ID of the existing variable group @@ -52,7 +52,7 @@ Type: String Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/.docs/Remove-VSTeamVariableGroup.md b/.docs/Remove-VSTeamVariableGroup.md index 420f2761d..2157ca50b 100644 --- a/.docs/Remove-VSTeamVariableGroup.md +++ b/.docs/Remove-VSTeamVariableGroup.md @@ -20,10 +20,10 @@ $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" isSecret = $true @@ -34,7 +34,7 @@ $methodParameters = @{ $newVariableGroup = Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ - id = $newVariableGroup.id + Id = $newVariableGroup.id ProjectName = "some_project_name" Force = $true } @@ -94,7 +94,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -id +### -Id ID of the existing variable group @@ -103,7 +103,7 @@ Type: String Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/.docs/Update-VSTeamVariableGroup.md b/.docs/Update-VSTeamVariableGroup.md index 536908db8..f5f523030 100644 --- a/.docs/Update-VSTeamVariableGroup.md +++ b/.docs/Update-VSTeamVariableGroup.md @@ -20,10 +20,10 @@ $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" isSecret = $true @@ -36,10 +36,10 @@ $newVariableGroup = Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ id = $newVariableGroup.id ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "AzureKeyVault" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "AzureKeyVault" + Variables = @{ name_of_existing_secret = @{ enabled = $true contentType = "" @@ -47,7 +47,7 @@ $methodParameters = @{ isSecret = $true } } - variableGroupProviderData = @{ + ProviderData = @{ serviceEndpointId = "AzureRMServiceEndpointGuid" vault = "name_of_existing_key_vault" } @@ -108,7 +108,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -id +### -Id ID of the existing variable group @@ -117,13 +117,13 @@ Type: String Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupDescription +### -Description The variable group description @@ -132,13 +132,13 @@ Type: String Aliases: Required: True -Position: 3 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupName +### -Name The variable group name @@ -147,30 +147,30 @@ Type: String Aliases: Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupProviderData +### -ProviderData -The variable group ProviderData. This should be $null for Vsts types. +The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. ```yaml Type: Hashtable Aliases: Required: False -Position: 5 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupType +### -Type -The variable group type +The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. ```yaml Type: String @@ -178,13 +178,13 @@ Aliases: Accepted values: Vsts, AzureKeyVault Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupVariables +### -Variables The variable group variables. @@ -193,7 +193,7 @@ Type: Hashtable Aliases: Required: True -Position: 4 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/Source/en-US/VSTeam-Help.xml b/Source/en-US/VSTeam-Help.xml index f23d5bad4..66648934c 100644 --- a/Source/en-US/VSTeam-Help.xml +++ b/Source/en-US/VSTeam-Help.xml @@ -4854,10 +4854,10 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo None - - variableGroupName + + Description - The variable group name + The variable group description String @@ -4866,15 +4866,11 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo None - - variableGroupType + + Name - The variable group type + The variable group name - - Vsts - AzureKeyVault - String String @@ -4882,34 +4878,38 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo None - - variableGroupDescription + + ProviderData - The variable group description + The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. - String + Hashtable - String + Hashtable None - - variableGroupVariables + + Type - The variable group variables. + The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. - Hashtable + + Vsts + AzureKeyVault + + String - Hashtable + String None - - variableGroupProviderData + + Variables - The variable group ProviderData. This should be $null for Vsts types. + The variable group variables. Hashtable @@ -4935,8 +4935,8 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo None - - variableGroupDescription + + Description The variable group description @@ -4947,8 +4947,8 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo None - - variableGroupName + + Name The variable group name @@ -4959,10 +4959,10 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo None - - variableGroupProviderData + + ProviderData - The variable group ProviderData. This should be $null for Vsts types. + The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. Hashtable @@ -4971,10 +4971,10 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo None - - variableGroupType + + Type - The variable group type + The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. String @@ -4983,8 +4983,8 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo None - - variableGroupVariables + + Variables The variable group variables. @@ -5026,10 +5026,10 @@ PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpo -------------------------- EXAMPLE 1 -------------------------- $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" } @@ -5049,10 +5049,10 @@ Add-VSTeamVariableGroup @methodParameters -------------------------- EXAMPLE 2 -------------------------- $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "AzureKeyVault" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "AzureKeyVault" + Variables = @{ name_of_existing_secret = @{ enabled = $true contentType = "" @@ -5060,7 +5060,7 @@ Add-VSTeamVariableGroup @methodParameters isSecret = $true } } - variableGroupProviderData = @{ + ProviderData = @{ serviceEndpointId = "AzureRMServiceEndpointGuid" vault = "name_of_existing_key_vault" } @@ -11577,8 +11577,8 @@ ID Title Status None - - id + + Id ID of the existing variable group @@ -11618,8 +11618,8 @@ ID Title Status None - - id + + Id ID of the existing variable group @@ -11672,7 +11672,7 @@ Get-VSTeamVariableGroup @methodParameters -------------------------- EXAMPLE 2 -------------------------- $methodParameters = @{ ProjectName = "some_project_name" - id = "variable_group_id" + Id = "variable_group_id" } Get-VSTeamVariableGroup @methodParameters @@ -14594,18 +14594,6 @@ Get-VSTeamVariableGroup @methodParameters None - - id - - ID of the existing variable group - - String - - String - - - None - Confirm @@ -14639,6 +14627,18 @@ Get-VSTeamVariableGroup @methodParameters False + + Id + + ID of the existing variable group + + String + + String + + + None + @@ -14704,8 +14704,8 @@ Get-VSTeamVariableGroup @methodParameters False - - id + + Id ID of the existing variable group @@ -14747,10 +14747,10 @@ Get-VSTeamVariableGroup @methodParameters -------------------------- EXAMPLE 1 -------------------------- $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" isSecret = $true @@ -14761,7 +14761,7 @@ Get-VSTeamVariableGroup @methodParameters $newVariableGroup = Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ - id = $newVariableGroup.id + Id = $newVariableGroup.id ProjectName = "some_project_name" Force = $true } @@ -19175,50 +19175,43 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r None - - id + + Confirm - ID of the existing variable group + Prompts you for confirmation before running the cmdlet. - String - String + SwitchParameter - None + False - - variableGroupName + + Force - The variable group name + Does not prompt - String - String + SwitchParameter - None + False - - variableGroupType + + WhatIf - The variable group type + Shows what would happen if the cmdlet runs. The cmdlet is not run. - - Vsts - AzureKeyVault - - String - String + SwitchParameter - None + False - - variableGroupDescription + + Id - The variable group description + ID of the existing variable group String @@ -19227,62 +19220,69 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r None - - variableGroupVariables + + Description - The variable group variables. + The variable group description - Hashtable + String - Hashtable + String None - - variableGroupProviderData + + Name - The variable group ProviderData. This should be $null for Vsts types. + The variable group name - Hashtable + String - Hashtable + String None - - Confirm + + ProviderData - Prompts you for confirmation before running the cmdlet. + The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. + Hashtable - SwitchParameter + Hashtable - False + None - - Force + + Type - Does not prompt + The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. + + Vsts + AzureKeyVault + + String - SwitchParameter + String - False + None - - WhatIf + + Variables - Shows what would happen if the cmdlet runs. The cmdlet is not run. + The variable group variables. + Hashtable - SwitchParameter + Hashtable - False + None @@ -19349,8 +19349,8 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r False - - id + + Id ID of the existing variable group @@ -19361,8 +19361,8 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r None - - variableGroupDescription + + Description The variable group description @@ -19373,8 +19373,8 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r None - - variableGroupName + + Name The variable group name @@ -19385,10 +19385,10 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r None - - variableGroupProviderData + + ProviderData - The variable group ProviderData. This should be $null for Vsts types. + The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. Hashtable @@ -19397,10 +19397,10 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r None - - variableGroupType + + Type - The variable group type + The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. String @@ -19409,8 +19409,8 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r None - - variableGroupVariables + + Variables The variable group variables. @@ -19452,10 +19452,10 @@ PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r-------------------------- EXAMPLE 1 -------------------------- $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" isSecret = $true @@ -19468,10 +19468,10 @@ $newVariableGroup = Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ id = $newVariableGroup.id ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "AzureKeyVault" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "AzureKeyVault" + Variables = @{ name_of_existing_secret = @{ enabled = $true contentType = "" @@ -19479,7 +19479,7 @@ $methodParameters = @{ isSecret = $true } } - variableGroupProviderData = @{ + ProviderData = @{ serviceEndpointId = "AzureRMServiceEndpointGuid" vault = "name_of_existing_key_vault" } diff --git a/docs/Add-VSTeamVariableGroup.md b/docs/Add-VSTeamVariableGroup.md index bfd644b86..2d23933aa 100644 --- a/docs/Add-VSTeamVariableGroup.md +++ b/docs/Add-VSTeamVariableGroup.md @@ -21,10 +21,10 @@ Adds a variable group. $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" } @@ -44,10 +44,10 @@ Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "AzureKeyVault" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "AzureKeyVault" + Variables = @{ name_of_existing_secret = @{ enabled = $true contentType = "" @@ -55,7 +55,7 @@ $methodParameters = @{ isSecret = $true } } - variableGroupProviderData = @{ + ProviderData = @{ serviceEndpointId = "AzureRMServiceEndpointGuid" vault = "name_of_existing_key_vault" } @@ -82,7 +82,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -variableGroupDescription +### -Description The variable group description @@ -91,13 +91,13 @@ Type: String Aliases: Required: True -Position: 3 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupName +### -Name The variable group name @@ -106,30 +106,30 @@ Type: String Aliases: Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupProviderData +### -ProviderData -The variable group ProviderData. This should be $null for Vsts types. +The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. ```yaml Type: Hashtable Aliases: Required: False -Position: 5 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupType +### -Type -The variable group type +The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. ```yaml Type: String @@ -137,13 +137,13 @@ Aliases: Accepted values: Vsts, AzureKeyVault Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupVariables +### -Variables The variable group variables. @@ -152,7 +152,7 @@ Type: Hashtable Aliases: Required: True -Position: 4 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/docs/Get-VSTeamVariableGroup.md b/docs/Get-VSTeamVariableGroup.md index a78da8032..2daef5cca 100644 --- a/docs/Get-VSTeamVariableGroup.md +++ b/docs/Get-VSTeamVariableGroup.md @@ -32,7 +32,7 @@ Get-VSTeamVariableGroup @methodParameters $methodParameters = @{ ProjectName = "some_project_name" - id = "variable_group_id" + Id = "variable_group_id" } Get-VSTeamVariableGroup @methodParameters @@ -58,7 +58,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -id +### -Id ID of the existing variable group @@ -67,7 +67,7 @@ Type: String Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/docs/Remove-VSTeamVariableGroup.md b/docs/Remove-VSTeamVariableGroup.md index 04fe958c0..9a84f78e8 100644 --- a/docs/Remove-VSTeamVariableGroup.md +++ b/docs/Remove-VSTeamVariableGroup.md @@ -21,10 +21,10 @@ Removes a variable group $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" isSecret = $true @@ -35,7 +35,7 @@ $methodParameters = @{ $newVariableGroup = Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ - id = $newVariableGroup.id + Id = $newVariableGroup.id ProjectName = "some_project_name" Force = $true } @@ -109,7 +109,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -id +### -Id ID of the existing variable group @@ -118,7 +118,7 @@ Type: String Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/docs/Update-VSTeamVariableGroup.md b/docs/Update-VSTeamVariableGroup.md index 105da2b69..388a15885 100644 --- a/docs/Update-VSTeamVariableGroup.md +++ b/docs/Update-VSTeamVariableGroup.md @@ -21,10 +21,10 @@ Updates an existing variable group $methodParameters = @{ ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "Vsts" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "Vsts" + Variables = @{ key1 = @{ value = "value1" isSecret = $true @@ -37,10 +37,10 @@ $newVariableGroup = Add-VSTeamVariableGroup @methodParameters $methodParameters = @{ id = $newVariableGroup.id ProjectName = "some_project_name" - variableGroupName = "new_variable_group" - variableGroupDescription = "Describe the Variable Group" - variableGroupType = "AzureKeyVault" - variableGroupVariables = @{ + Name = "new_variable_group" + Description = "Describe the Variable Group" + Type = "AzureKeyVault" + Variables = @{ name_of_existing_secret = @{ enabled = $true contentType = "" @@ -48,7 +48,7 @@ $methodParameters = @{ isSecret = $true } } - variableGroupProviderData = @{ + ProviderData = @{ serviceEndpointId = "AzureRMServiceEndpointGuid" vault = "name_of_existing_key_vault" } @@ -123,7 +123,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -id +### -Id ID of the existing variable group @@ -132,13 +132,13 @@ Type: String Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupDescription +### -Description The variable group description @@ -147,13 +147,13 @@ Type: String Aliases: Required: True -Position: 3 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupName +### -Name The variable group name @@ -162,30 +162,30 @@ Type: String Aliases: Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupProviderData +### -ProviderData -The variable group ProviderData. This should be $null for Vsts types. +The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. ```yaml Type: Hashtable Aliases: Required: False -Position: 5 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupType +### -Type -The variable group type +The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. ```yaml Type: String @@ -193,13 +193,13 @@ Aliases: Accepted values: Vsts, AzureKeyVault Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -variableGroupVariables +### -Variables The variable group variables. @@ -208,7 +208,7 @@ Type: Hashtable Aliases: Required: True -Position: 4 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False From a142b2bdaffcf6cf49169e40ba075d60ae7be191 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Mon, 1 Jul 2019 14:00:59 -0500 Subject: [PATCH 15/18] Unit test for common refactor --- unit/test/common.Tests.ps1 | 85 +++++++++++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 5 deletions(-) diff --git a/unit/test/common.Tests.ps1 b/unit/test/common.Tests.ps1 index cf34cacee..dc0d6d3ae 100644 --- a/unit/test/common.Tests.ps1 +++ b/unit/test/common.Tests.ps1 @@ -73,6 +73,81 @@ InModuleScope VSTeam { } } + Context '_buildDynamicParam no defaults' { + Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } + + $testParams = @{ + ParameterName = 'TestParam' + arrSet = @(@{A = 'A'}, @{B = 'B'}) + Mandatory = $true + ParameterSetName = "NewTest" + Position = 0 + ParameterType = ([hashtable]) + ValueFromPipelineByPropertyName = $false + AliasName = "TestAlieas" + HelpMessage = "Test Help Message" + } + $param = (_buildDynamicParam @testParams) + + It 'should return dynamic parameter' { + $param | Should Not BeNullOrEmpty + } + + It 'should return dynamic parameter name' { + $param.Name | Should Be $testParams.ParameterName + } + + It 'should return dynamic parameter type' { + $param.ParameterType.FullName | Should Be $testParams.ParameterType.FullName + } + + It 'Should set the basic attributes of the dynamic parameter' { + $param.Attributes[0].Position | Should Be $testParams.Position + $param.Attributes[0].Mandatory | Should Be $testParams.Mandatory + $param.Attributes[0].ParameterSetName | Should Be $testParams.ParameterSetName + $param.Attributes[0].ValueFromPipelineByPropertyName | Should Be $testParams.ValueFromPipelineByPropertyName + $param.Attributes[0].HelpMessage | Should Be $testParams.HelpMessage + } + + It 'Should set the alias attributes of the dynamic parameter' { + $param.Attributes[1].AliasNames | Should Be $testParams.AliasName + } + + It 'Should set the possible vaule attributes of the dynamic parameter' { + (Compare-Object -ReferenceObject $param.Attributes[2].ValidValues -DifferenceObject $testParams.arrSet) | Should BeNullOrEmpty + } + } + + Context '_buildDynamicParam defaults' { + Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } + + $param = (_buildDynamicParam) + + It 'should return dynamic parameter' { + $param | Should Not BeNullOrEmpty + } + + It 'should return dynamic parameter name' { + $param.Name | Should Be 'QueueName' + } + + It 'should return dynamic parameter type' { + $param.ParameterType.FullName | Should Be ([string]).FullName + } + + It 'Should set the basic attributes of the dynamic parameter' { + ($param.Attributes[0].Position -lt 0) | Should Be ($true) + $param.Attributes[0].Mandatory | Should Be $false + $param.Attributes[0].ParameterSetName | Should Be '__AllParameterSets' + $param.Attributes[0].ValueFromPipelineByPropertyName | Should Be $true + $param.Attributes[0].HelpMessage | Should BeNullOrEmpty + } + + It 'Should have no additoinal attributes of the dynamic parameter' { + $param.Attributes.Count | Should Be 1 + } + } + Context '_getWorkItemTypes' { [VSTeamVersions]::Account = $null @@ -82,9 +157,9 @@ InModuleScope VSTeam { } Context '_handleException' { - # Build a proper error + # Build a proper error $obj = "{Value: {Message: 'Top Message'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '401'}}}" - + if ($PSVersionTable.PSEdition -ne 'Core') { $r = [System.Net.HttpWebResponse]::new() $e = [System.Net.WebException]::new("Test Exception", $null, [System.Net.WebExceptionStatus]::ProtocolError, $r) @@ -117,9 +192,9 @@ InModuleScope VSTeam { } Context '_handleException message only' { - # Build a proper error + # Build a proper error $obj = "{Value: {Message: 'Test Exception'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '400'}}}" - + if ($PSVersionTable.PSEdition -ne 'Core') { $e = [System.Net.WebException]::new("Test Exception", $null) } @@ -127,7 +202,7 @@ InModuleScope VSTeam { $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::BadRequest) $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) } - + $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) From 823c004edf8227bf7ce9ac0f8da2537d85d516e3 Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Mon, 1 Jul 2019 14:01:15 -0500 Subject: [PATCH 16/18] Update failing unit tests --- Source/Private/common.ps1 | 49 +++++++----------- Source/Public/Add-VSTeamVariableGroup.ps1 | 44 ++++++++++------- Source/Public/Get-VSTeamVariableGroup.ps1 | 6 +-- Source/Public/Set-VSTeamAccount.ps1 | 2 +- Source/Public/Update-VSTeamVariableGroup.ps1 | 52 ++++++++++++-------- 5 files changed, 80 insertions(+), 73 deletions(-) diff --git a/Source/Private/common.ps1 b/Source/Private/common.ps1 index 120b2ab58..7888de419 100644 --- a/Source/Private/common.ps1 +++ b/Source/Private/common.ps1 @@ -494,7 +494,11 @@ function _buildDynamicParam { [array] $arrSet, [bool] $Mandatory = $false, [string] $ParameterSetName, - [int] $Position = -1 + [int] $Position = -1, + [type] $ParameterType = [string], + [bool] $ValueFromPipelineByPropertyName = $true, + [string] $AliasName, + [string] $HelpMessage ) # Create the collection of attributes $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] @@ -502,7 +506,7 @@ function _buildDynamicParam { # Create and set the parameters' attributes $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.ValueFromPipelineByPropertyName = $true + $ParameterAttribute.ValueFromPipelineByPropertyName = $ValueFromPipelineByPropertyName if ($Position -ne -1) { $ParameterAttribute.Position = $Position @@ -512,9 +516,18 @@ function _buildDynamicParam { $ParameterAttribute.ParameterSetName = $ParameterSetName } + if ($HelpMessage) { + $ParameterAttribute.HelpMessage = $HelpMessage + } + # Add the attributes to the attributes collection $AttributeCollection.Add($ParameterAttribute) + if ($AliasName) { + $AliasAttribute = New-Object System.Management.Automation.AliasAttribute(@($AliasName)) + $AttributeCollection.Add($AliasAttribute) + } + if ($arrSet) { # Generate and set the ValidateSet $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) @@ -524,33 +537,7 @@ function _buildDynamicParam { } # Create and return the dynamic parameter - return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) -} - -function _buildDynamicSwitchParam { - param( - [string] $ParameterName = 'QueueName', - [array] $arrSet, - [bool] $Mandatory = $false, - [string] $ParameterSetName - ) - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - - if ($ParameterSetName) { - $ParameterAttribute.ParameterSetName = $ParameterSetName - } - - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - - # Create and return the dynamic parameter - return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [switch], $AttributeCollection) + return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, $ParameterType, $AttributeCollection) } function _convertSecureStringTo_PlainText { @@ -631,7 +618,7 @@ function _callAPI { Write-Verbose "return type: $($resp.gettype())" Write-Verbose $resp } - + return $resp } catch { @@ -799,7 +786,7 @@ function _getVSTeamIdFromDescriptor { $identifier = $Descriptor.Split('.')[1] # We need to Pad the string for FromBase64String to work reliably (AzD Descriptors are not padded) - $ModulusValue = ($identifier.length % 4) + $ModulusValue = ($identifier.length % 4) Switch ($ModulusValue) { '0' { $Padded = $identifier } '1' { $Padded = $identifier.Substring(0, $identifier.Length - 1) } diff --git a/Source/Public/Add-VSTeamVariableGroup.ps1 b/Source/Public/Add-VSTeamVariableGroup.ps1 index e363b1ebe..0a6e4be1e 100644 --- a/Source/Public/Add-VSTeamVariableGroup.ps1 +++ b/Source/Public/Add-VSTeamVariableGroup.ps1 @@ -1,24 +1,29 @@ function Add-VSTeamVariableGroup { param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $variableGroupName, + [string] $Name, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [ValidateSet('Vsts', 'AzureKeyVault')] - [string] $variableGroupType, + [string] $Description, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $variableGroupDescription, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [hashtable] $variableGroupVariables, - - [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)] - [hashtable] $variableGroupProviderData = $null + [hashtable] $Variables ) DynamicParam { - _buildProjectNameDynamicParam + $dp = _buildProjectNameDynamicParam + + if ([VSTeamVersions]::Version -ne "TFS2017") { + $ParameterName = 'Type' + $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet ('Vsts', 'AzureKeyVault') -Mandatory $true + $dp.Add($ParameterName, $rp) + + $ParameterName = 'ProviderData' + $rp = _buildDynamicParam -ParameterName $ParameterName -Mandatory $false -ParameterType ([hashtable]) + $dp.Add($ParameterName, $rp) + } + + return $dp } Process { @@ -26,13 +31,18 @@ function Add-VSTeamVariableGroup { $ProjectName = $PSBoundParameters["ProjectName"] $body = @{ - name = $variableGroupName - type = $variableGroupType - description = $variableGroupDescription - variables = $variableGroupVariables + name = $Name + description = $Description + variables = $Variables } - if ($null -ne $variableGroupProviderData) { - $body.Add("providerData", $variableGroupProviderData) + if ([VSTeamVersions]::Version -ne "TFS2017") { + $Type = $PSBoundParameters['Type'] + $body.Add("type", $Type) + + $ProviderData = $PSBoundParameters['ProviderData'] + if ($null -ne $ProviderData) { + $body.Add("providerData", $ProviderData) + } } $body = $body | ConvertTo-Json diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 index a9929f46f..ec65c233f 100644 --- a/Source/Public/Get-VSTeamVariableGroup.ps1 +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -2,7 +2,7 @@ function Get-VSTeamVariableGroup { [CmdletBinding(DefaultParameterSetName = 'List')] param( [Parameter(Position = 0, ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $id + [string] $Id ) DynamicParam { @@ -13,10 +13,10 @@ function Get-VSTeamVariableGroup { # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["ProjectName"] - if ($id) { + if ($Id) { # Call the REST API $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` - -Version $([VSTeamVersions]::VariableGroups) -Id $id + -Version $([VSTeamVersions]::VariableGroups) -Id $Id _applyTypesToVariableGroup -item $resp diff --git a/Source/Public/Set-VSTeamAccount.ps1 b/Source/Public/Set-VSTeamAccount.ps1 index 732e6a5ce..8c46efd93 100644 --- a/Source/Public/Set-VSTeamAccount.ps1 +++ b/Source/Public/Set-VSTeamAccount.ps1 @@ -56,7 +56,7 @@ function Set-VSTeamAccount { $levelParam = _buildDynamicParam -ParameterName 'Level' -arrSet $arrSet $RuntimeParameterDictionary.Add('Level', $levelParam) - $winAuthParam = _buildDynamicSwitchParam -ParameterName 'UseWindowsAuthentication' -Mandatory $true -ParameterSetName 'Windows' + $winAuthParam = _buildDynamicParam -ParameterName 'UseWindowsAuthentication' -Mandatory $true -ParameterSetName 'Windows' -ParameterType ([switch]) $RuntimeParameterDictionary.Add('UseWindowsAuthentication', $winAuthParam) } diff --git a/Source/Public/Update-VSTeamVariableGroup.ps1 b/Source/Public/Update-VSTeamVariableGroup.ps1 index e07c736e1..e14f0dd34 100644 --- a/Source/Public/Update-VSTeamVariableGroup.ps1 +++ b/Source/Public/Update-VSTeamVariableGroup.ps1 @@ -2,29 +2,34 @@ function Update-VSTeamVariableGroup { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $id, + [string] $Id, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $variableGroupName, + [string] $Name, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [ValidateSet('Vsts', 'AzureKeyVault')] - [string] $variableGroupType, + [string] $Description, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [string] $variableGroupDescription, - - [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] - [hashtable] $variableGroupVariables, - - [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)] - [hashtable] $variableGroupProviderData = $null, + [hashtable] $Variables, [switch] $Force ) DynamicParam { - _buildProjectNameDynamicParam + $dp = _buildProjectNameDynamicParam + + if ([VSTeamVersions]::Version -ne "TFS2017") { + $ParameterName = 'Type' + $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet ('Vsts', 'AzureKeyVault') -Mandatory $true + $dp.Add($ParameterName, $rp) + + $ParameterName = 'ProviderData' + $rp = _buildDynamicParam -ParameterName $ParameterName -Mandatory $false -ParameterType ([hashtable]) + $dp.Add($ParameterName, $rp) + } + + return $dp } Process { @@ -32,25 +37,30 @@ function Update-VSTeamVariableGroup { $ProjectName = $PSBoundParameters["ProjectName"] $body = @{ - name = $variableGroupName - type = $variableGroupType - description = $variableGroupDescription - variables = $variableGroupVariables + name = $Name + description = $Description + variables = $Variables } - if ($null -ne $variableGroupProviderData) { - $body.Add("providerData", $variableGroupProviderData) + if ([VSTeamVersions]::Version -ne "TFS2017") { + $Type = $PSBoundParameters['Type'] + $body.Add("type", $Type) + + $ProviderData = $PSBoundParameters['ProviderData'] + if ($null -ne $ProviderData) { + $body.Add("providerData", $ProviderData) + } } $body = $body | ConvertTo-Json - if ($Force -or $pscmdlet.ShouldProcess($id, "Update Variable Group")) { + if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Variable Group")) { # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $id ` + $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $Id ` -Method Put -ContentType 'application/json' -body $body -Version $([VSTeamVersions]::VariableGroups) Write-Verbose $resp - return Get-VSTeamVariableGroup -ProjectName $ProjectName -id $id + return Get-VSTeamVariableGroup -ProjectName $ProjectName -Id $Id } } } From 7ac30fa0a61131d9668f9ff8c8c029f6ad2faa6f Mon Sep 17 00:00:00 2001 From: Ignacio Galarza Date: Tue, 2 Jul 2019 11:24:48 -0500 Subject: [PATCH 17/18] - Updated integration tests - Fixed TFS2018 version --- Source/Public/Set-VSTeamAPIVersion.ps1 | 2 +- integration/test/010_projects.Tests.ps1 | 62 ++++++++++++++++++------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/Source/Public/Set-VSTeamAPIVersion.ps1 b/Source/Public/Set-VSTeamAPIVersion.ps1 index 6a8961d07..71bc79f5b 100644 --- a/Source/Public/Set-VSTeamAPIVersion.ps1 +++ b/Source/Public/Set-VSTeamAPIVersion.ps1 @@ -65,7 +65,7 @@ function Set-VSTeamAPIVersion { [VSTeamVersions]::Build = '3.2' [VSTeamVersions]::Release = '4.0-preview' [VSTeamVersions]::DistributedTask = '4.0-preview' - [VSTeamVersions]::VariableGroups = '4.1-preview.1' + [VSTeamVersions]::VariableGroups = '4.0-preview' [VSTeamVersions]::Tfvc = '3.2' [VSTeamVersions]::Packaging = '' [VSTeamVersions]::MemberEntitlementManagement = '' diff --git a/integration/test/010_projects.Tests.ps1 b/integration/test/010_projects.Tests.ps1 index 9410c375c..564baffc4 100644 --- a/integration/test/010_projects.Tests.ps1 +++ b/integration/test/010_projects.Tests.ps1 @@ -310,43 +310,69 @@ InModuleScope VSTeam { } Context 'Simple Variable Group' { - $newVariableGroup = $null + $variableGroupName = "TestVariableGroup1" + $variableGroupUpdatedName = "TestVariableGroup2" It 'Add-VSTeamVariableGroup Should add a variable group' { - $variables = @{ - key1 = @{ - value = "value1" - } - key2 = @{ - value = "value2" - isSecret = $true + $parameters = @{ + ProjectName = $newProjectName + Name = $variableGroupName + Description = "A test variable group" + Variables = @{ + key1 = @{ + value = "value1" + } + key2 = @{ + value = "value2" + isSecret = $true + } } } - $newVariableGroup = Add-VSTeamVariableGroup -ProjectName $newProjectName -variableGroupName "TestVariableGroup1" -variableGroupType "Vsts" -variableGroupDescription "A test variable group" -variableGroupVariables $variables + if ($api -ne 'TFS2017') { + $parameters.Add("Type", "Vsts") + } + + $newVariableGroup = Add-VSTeamVariableGroup @parameters $newVariableGroup | Should Not Be $null } It 'Get-VSTeamVariableGroup Should get the variable group created first by list then by id' { - $existingVariableGroups = Get-VSTeamVariableGroup -ProjectName $newProjectName + $existingVariableGroups = ,(Get-VSTeamVariableGroup -ProjectName $newProjectName) $existingVariableGroups.Count | Should BeGreaterThan 0 - $existingVariableGroup = Get-VSTeamVariableGroup -ProjectName $newProjectName -id $newVariableGroup.id + $newVariableGroup = ($existingVariableGroups | Where-Object { $_.Name -eq $variableGroupName }) + $newVariableGroup | Should Not Be $null + + $existingVariableGroup = Get-VSTeamVariableGroup -ProjectName $newProjectName -Id $newVariableGroup.Id $existingVariableGroup | Should Not Be $null } It 'Update-VSTeamVariableGroup Should update the variable group' { + $newVariableGroup = (Get-VSTeamVariableGroup -ProjectName $newProjectName | Where-Object { $_.Name -eq $variableGroupName }) $newVariableGroup | Should Not Be $null - $variables = @{ - key3 = @{ - value = "value3" + + $parameters = @{ + ProjectName = $newProjectName + Id = $newVariableGroup.Id + Name = $variableGroupUpdatedName + Description = "A test variable group update" + Variables = @{ + key3 = @{ + value = "value3" + } } } - $newVariableGroup = Update-VSTeamVariableGroup -ProjectName $newProjectName -id $newVariableGroup.id -variableGroupName "TestVariableGroup2" -variableGroupType "Vsts" -variableGroupDescription "A test variable group update" -variableGroupVariables $variables - $newVariableGroup | Should Not Be $null + if ($api -ne 'TFS2017') { + $parameters.Add("Type", "Vsts") + } + + $updatedVariableGroup = Update-VSTeamVariableGroup @parameters + $updatedVariableGroup | Should Not Be $null } It 'Remove-VSTeamVariableGroup Should remove the variable group' { - $newVariableGroup | Should Not Be $null - {Remove-VSTeamVariableGroup -ProjectName $newProjectName -id $newVariableGroup.id -Force} | Should Not Throw + $updatedVariableGroup = (Get-VSTeamVariableGroup -ProjectName $newProjectName | Where-Object { $_.Name -eq $variableGroupUpdatedName }) + $updatedVariableGroup | Should Not Be $null + {Remove-VSTeamVariableGroup -ProjectName $newProjectName -Id $updatedVariableGroup.Id -Force} | Should Not Throw } } From 3efc6e220c28391992aff66008e3651164da9b75 Mon Sep 17 00:00:00 2001 From: Donovan Brown Date: Tue, 2 Jul 2019 14:16:38 -0500 Subject: [PATCH 18/18] Updating change log --- CHANGELOG.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ccfe817..d66f629c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,5 @@ # Changelog -## 6.2.8 - -Added functions to deal with variable groups - -- Added Add-VSTeamVariableGroup to add new variable groups. -- Added Get-VSTeamVariableGroup to get variable groups. -- Added Update-VSTeamVariableGroup to update variable groups -- Added Remove-VSTeamVariableGroup to remove variable groups - ## 6.2.7 Added support for -Raw and -Json on Get-VSTeamBuildDefinition so the objects and/or JSON can be returned in Update-VSTeamBuildDefinition. @@ -20,6 +11,15 @@ $b = Get-VSTeamBuildDefinition 12 -Raw Add-VSTeamBuildDefinition -InFile $b ``` +Also merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/170) from [Ignacio Galarza, Jr.](https://github.com/ignatz42) which included the following: + +Added functions to deal with variable groups + +- Added Add-VSTeamVariableGroup to add new variable groups. +- Added Get-VSTeamVariableGroup to get variable groups. +- Added Update-VSTeamVariableGroup to update variable groups +- Added Remove-VSTeamVariableGroup to remove variable groups + ## 6.2.6 Added Update-VSTeamRelease.