diff --git a/.docs/Get-VSTeamAPIVersion.md b/.docs/Get-VSTeamAPIVersion.md new file mode 100644 index 000000000..222d5b305 --- /dev/null +++ b/.docs/Get-VSTeamAPIVersion.md @@ -0,0 +1,62 @@ + + +# Get-VSTeamAPIVersion + +## SYNOPSIS + + + +## SYNTAX + +## DESCRIPTION + + + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamAPIVersion +``` + +This command gets the API versions currently in use. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamAPIVersion -Service Release +``` + +This command gets the version of the Release API currently in use. + +## PARAMETERS + +### -Service + +Specifies the service to change. The acceptable values for this parameter are: + +- Build +- Release +- Core +- Git +- DistributedTask +- Tfvc +- Packaging +- MemberEntitlementManagement +- ExtensionsManagement +- ServiceEndpoints + +```yaml +Type: String +Required: True +Parameter Sets: Service +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/.docs/Get-VSTeamOption.md b/.docs/Get-VSTeamOption.md index bc9dbfda9..19264d6fb 100644 --- a/.docs/Get-VSTeamOption.md +++ b/.docs/Get-VSTeamOption.md @@ -44,6 +44,22 @@ PS C:\> Get-VSTeamOption -SubDomain vsrm This will display all the versions of supported APIs for the release management service. +### -------------------------- EXAMPLE 4 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamOption -Area core +``` + +This will display all the versions of supported APIs for the area core. + +### -------------------------- EXAMPLE 5 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamOption -Area core -Resource teams +``` + +This will display all the versions of supported APIs for resources teams under the area core. + ## PARAMETERS ### -SubDomain @@ -61,6 +77,24 @@ Type: String Required: false ``` +### -Area + +Returns options for that area's APIs. + +```yaml +Type: String +Required: false +``` + +### -Resource + +Returns options for that resource's APIs. + +```yaml +Type: String +Required: false +``` + ## INPUTS ## OUTPUTS diff --git a/.docs/Get-VSTeamProcess.md b/.docs/Get-VSTeamProcess.md index b733457e2..717d27414 100644 --- a/.docs/Get-VSTeamProcess.md +++ b/.docs/Get-VSTeamProcess.md @@ -10,9 +10,7 @@ ## DESCRIPTION -The list of Process Templates returned can be controlled by using the top and skip parameters. - -You can also get a single Process Template by name or id. +The list of Process Templates can be filtered by name (which may include Wildcard). You can also get a single Process Template by id You must call Set-VSTeamAccount before calling this function. @@ -29,10 +27,22 @@ This will return all the Process Templates ### -------------------------- EXAMPLE 2 -------------------------- ```PowerShell -PS C:\> Get-VSTeamProcess -top 5 | Format-Wide +PS C:\> Get-VSTeamProcess | Format-Wide ``` -This will return the top five Process Templates only showing their name +This will return the Process Templates only showing their name + + +### -------------------------- EXAMPLE 3 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamProcess *scrum* +``` + +This will return an process templates with names containing scrum, +in other words, the default "Scrum" template and custom ones with +names like "Custom Scrum", "Scrum for Contoso" will all be returned. + ## PARAMETERS @@ -40,7 +50,7 @@ This will return the top five Process Templates only showing their name ### -Top -Specifies the maximum number to return. +The API now disregards the SKIP and TOP query values, so this parameter is ignored and deprecated. It will be removed in a future version ```yaml Type: Int32 @@ -50,7 +60,8 @@ Default value: 100 ### -Skip -Defines the number of Process Templates to skip. The default value is 0 +The API now disregards the SKIP and TOP query values, so this parameter is ignored and deprecated. It will be removed in a future version + ```yaml Type: Int32 diff --git a/.docs/Set-VSTeamAPIVersion.md b/.docs/Set-VSTeamAPIVersion.md index 34aa0b601..549b114ab 100644 --- a/.docs/Set-VSTeamAPIVersion.md +++ b/.docs/Set-VSTeamAPIVersion.md @@ -37,8 +37,15 @@ This command sets the version of the Release calls to 5.0. Specifies the version to use. The acceptable values for this parameter are: - TFS2017 +- TFS2017U1 +- TFS2017U2 +- TFS2017U3 - TFS2018 +- TFS2018U1 +- TFS2018U2 +- TFS2018U3 - AzD2019 +- AzD2019U1 - VSTS - AzD @@ -63,7 +70,7 @@ Specifies the service to change. The acceptable values for this parameter are: - Packaging - MemberEntitlementManagement - ExtensionsManagement -- ServiceFabricEndpoint +- ServiceEndpoints ```yaml Type: String diff --git a/.docs/synopsis/Get-VSTeamAPIVersion.md b/.docs/synopsis/Get-VSTeamAPIVersion.md new file mode 100644 index 000000000..2d0111ac5 --- /dev/null +++ b/.docs/synopsis/Get-VSTeamAPIVersion.md @@ -0,0 +1 @@ +Returns the versions of APIs used. \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0fb8b7e33..17e81cfd7 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -19,10 +19,7 @@ I am truly grateful for all the support developing VSTeam. It means a lot that y ## Running Integration tests -**THESE TEST ARE DESTRUCTIVE. USE AN EMPTY ACCOUNT.** - - Install SonarQube extension -- Use an empty account to run the integration tests - Set the following Environment variables. - `$env:ACCT = VSTS` Account Name or full TFS URL including collection - `$env:API_VERSION = TFS2017` or TFS2018 / AzD2019 for on-prem versions, or VSTS for the Service variant, depending on the value used for ACCT diff --git a/.gitignore b/.gitignore index 404406a81..607fd6f25 100644 --- a/.gitignore +++ b/.gitignore @@ -24,9 +24,11 @@ Source/Classes/vsteam.classes.ps1 test-results.xml coverage.xml .editorconfig -.vscode/settings.json +.vscode/* .DS_Store ._.DS_Store **/.DS_Store **/._.DS_Store -.gdn \ No newline at end of file +.gdn +integration/fullRun.ps1 +integration/Start-PSCountdown.ps1 diff --git a/Build-Module.ps1 b/Build-Module.ps1 index 0b18405c6..eb80c2863 100644 --- a/Build-Module.ps1 +++ b/Build-Module.ps1 @@ -38,7 +38,10 @@ param( # outputs the code coverage [Parameter(ParameterSetName = "UnitTest")] - [switch]$codeCoverage + [switch]$codeCoverage, + + #If specified puts classes in the PSM1 file instead on dot sourcing them from a PS1. This can be helpful in development but is not used for release builds + [switch]$WithPublicClasses ) . ./Merge-File.ps1 @@ -83,6 +86,17 @@ if ($buildHelp.IsPresent) { Write-Output 'Publishing about help files' Copy-Item -Path ./Source/en-US -Destination "$output/" -Recurse -Force Copy-Item -Path ./Source/VSTeam.psm1 -Destination "$output/VSTeam.psm1" -Force +if ($WithPublicClasses) { + #If the classes are in vsteam.psm1 and the module is loaded with using rather than with import-module, + #then the classes are accessible from the command-line, scripts, and functions which do form part of the module + # See https://github.com/DarqueWarrior/vsteam/pull/313#issuecomment-629644064 for more information + #Currently the default not to do this, but it can make things easier in development, + #if the default changes the switch name will too and the condition will become a -not + Write-Output "Merging classes.ps1 into VSTeam.psm1" + Get-Content -Path "$output/VSTeam.psm1" | Out-File -Append -FilePath "$output/vsteam.classes.ps1" -Encoding ascii + Copy-Item -Path "$output/vsteam.classes.ps1" -Destination "$output/VSTeam.psm1" + "#empty" | Out-File -Force -FilePath "$output/vsteam.classes.ps1" -Encoding ascii +} Write-Output 'Updating Functions To Export' $newValue = ((Get-ChildItem -Path "./Source/Public" -Filter '*.ps1').BaseName | @@ -112,12 +126,12 @@ if ($runTests.IsPresent) { if ($null -eq $(Get-Module -ListAvailable Pester | Where-Object Version -like '5.*')) { Write-Output "Installing Pester 5" - Install-Module -Name Pester -Repository PSGallery -Force -AllowPrerelease -MinimumVersion '5.0.0-rc8' -Scope CurrentUser -AllowClobber -SkipPublisherCheck + Install-Module -Name Pester -Repository PSGallery -Force -AllowPrerelease -MinimumVersion '5.0.0-rc9' -Scope CurrentUser -AllowClobber -SkipPublisherCheck } $pesterArgs = [PesterConfiguration]::Default $pesterArgs.Run.Path = '.\unit' - $pesterArgs.Output.Verbosity = "Normal" + $pesterArgs.Output.Verbosity = "Minimal" $pesterArgs.TestResult.Enabled = $true $pesterArgs.TestResult.OutputPath = 'test-results.xml' @@ -132,11 +146,7 @@ if ($runTests.IsPresent) { } if ($testName) { - $pesterArgs.Filter.FullName = $testName - - #passthru must be activated according to Pester docs - $pesterArgs.Run.PassThru = $true } Invoke-Pester -Configuration $pesterArgs @@ -154,4 +164,4 @@ if ($analyzeScript.IsPresent) { $r = Invoke-ScriptAnalyzer -Path $output -Recurse $r | ForEach-Object { Write-Host "##vso[task.logissue type=$($_.Severity);sourcepath=$($_.ScriptPath);linenumber=$($_.Line);columnnumber=$($_.Column);]$($_.Message)" } Write-Output "Static code analysis complete." -} +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d387c70e..5c68b9a28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,25 @@ # Changelog -## 6.5.1 +## 6.5.0 -Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/317) from [Brittan DeYoung](https://github.com/brittandeyoung) which included the following: +Changed the completers to quote all values. -- Adds a new function Stop-VSTeamBuild which allows cancelling a build using the build id. +Added support for different releases of the Server version: +TFS2017U1, TFS2017U2, TFS2017U3, TFS2018U1, TFS2018U2, TFS2018U3 and AZD2019U1. -## 6.5.0 +The versions for Azure DevOps were also updated to 6.0-preview where supported. Requires Pester 5.x All the tests have been upgraded to use Pester 5. +Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/315) from [Jhoneill](https://github.com/jhoneill) which included the following: + +- Fix Get-VSTeamWiql [#314](https://github.com/DarqueWarrior/vsteam/issues/314) + +Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/317) from [Brittan DeYoung](https://github.com/brittandeyoung) which included the following: + +- Adds a new function Stop-VSTeamBuild which allows cancelling a build using the build id. + ## 6.4.8 You can now tab complete Area and Resource of Invoke-VSTeamRequest. diff --git a/Source/Classes/BuildCompleter.ps1 b/Source/Classes/BuildCompleter.ps1 index 96e9ba8fe..4dcca84a0 100644 --- a/Source/Classes/BuildCompleter.ps1 +++ b/Source/Classes/BuildCompleter.ps1 @@ -29,13 +29,13 @@ class BuildCompleter : IArgumentCompleter { # If there is no projectName by this point just return a empty # list. if ($projectName) { - foreach ($b in (Get-VSTeamBuild -ProjectName $projectName)) { - if ($b.buildNumber -like "$WordToComplete*") { - $results.Add([CompletionResult]::new($b.buildNumber)) + foreach ($value in (Get-VSTeamBuild -ProjectName $projectName).buildNumber) { + if ($value -like "$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } } return $results } -} +} \ No newline at end of file diff --git a/Source/Classes/BuildDefinitionCompleter.ps1 b/Source/Classes/BuildDefinitionCompleter.ps1 index 2aa76570e..d0795f3d1 100644 --- a/Source/Classes/BuildDefinitionCompleter.ps1 +++ b/Source/Classes/BuildDefinitionCompleter.ps1 @@ -29,9 +29,9 @@ class BuildDefinitionCompleter : IArgumentCompleter { # If there is no projectName by this point just return a empty # list. if ($projectName) { - foreach ($b in (Get-VSTeamBuildDefinition -ProjectName $projectName)) { - if ($b.name -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new($b.name)) + foreach ($value in (Get-VSTeamBuildDefinition -ProjectName $projectName).name) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } } diff --git a/Source/Classes/InvokeCompleter.ps1 b/Source/Classes/InvokeCompleter.ps1 index 22c3943bc..390092db4 100644 --- a/Source/Classes/InvokeCompleter.ps1 +++ b/Source/Classes/InvokeCompleter.ps1 @@ -31,18 +31,18 @@ class InvokeCompleter : IArgumentCompleter { if ($ParameterName -eq 'Area') { $areas = $(Get-VSTeamOption @p | Select-Object Area | Sort-Object -Property Area -Unique) - foreach ($a in $areas) { - if ($a.area -like "$WordToComplete*") { - $results.Add([CompletionResult]::new($a.area)) + foreach ($value in $areas.area) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } } elseif ($ParameterName -eq 'Resource' -and $area) { $resources = $(Get-VSTeamOption @p | Where-Object area -eq $area | Select-Object -Property resourceName | Sort-Object -Property resourceName -Unique) - foreach ($r in $resources) { - if ($r.resourceName -like "$WordToComplete*") { - $results.Add([CompletionResult]::new($r.resourceName)) + foreach ($value in $resources.resourceName) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } } diff --git a/Source/Classes/ProcessTemplateCompleter.ps1 b/Source/Classes/ProcessTemplateCompleter.ps1 index 63e9a3dc7..e707497cc 100644 --- a/Source/Classes/ProcessTemplateCompleter.ps1 +++ b/Source/Classes/ProcessTemplateCompleter.ps1 @@ -19,9 +19,9 @@ class ProcessTemplateCompleter : IArgumentCompleter { [VSTeamProcessCache]::timestamp = (Get-Date).Minute } - foreach ($p in [VSTeamProcessCache]::processes) { - if ($p -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new($p)) + foreach ($value in [VSTeamProcessCache]::processes) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } diff --git a/Source/Classes/ProcessValidateAttribute.ps1 b/Source/Classes/ProcessValidateAttribute.ps1 index 25f526fca..49390d126 100644 --- a/Source/Classes/ProcessValidateAttribute.ps1 +++ b/Source/Classes/ProcessValidateAttribute.ps1 @@ -4,16 +4,15 @@ class ProcessValidateAttribute : ValidateArgumentsAttribute { [void] Validate( [object] $arguments, [EngineIntrinsics] $EngineIntrinsics) { - - if (_hasProcessTemplateCacheExpired) { - [VSTeamProcessCache]::processes = _getProcesses - [VSTeamProcessCache]::timestamp = (Get-Date).Minute - } - if (($null -ne [VSTeamProcessCache]::processes) -and (-not ($arguments -in [VSTeamProcessCache]::processes))) { + #Do not fail on null or empty, leave that to other validation conditions + if ([string]::IsNullOrEmpty($arguments)) {return} + #tests count HTTP calls and expect 1 from reading the cache, but for a call on each read, so only read once! # + $CachedProcesses = [VSTeamProcessCache]::GetCurrent() + if (($CachedProcesses.count -gt 0) -and ($arguments -notin $CachedProcesses) ) { throw [ValidationMetadataException]::new( "'$arguments' is not a valid process. Valid processes are: '" + - ([VSTeamProcessCache]::processes -join "', '") + "'") + ($CachedProcesses -join "', '") + "'") } } } \ No newline at end of file diff --git a/Source/Classes/ProjectCompleter.ps1 b/Source/Classes/ProjectCompleter.ps1 index 78b7de15c..cebb23ae4 100644 --- a/Source/Classes/ProjectCompleter.ps1 +++ b/Source/Classes/ProjectCompleter.ps1 @@ -17,9 +17,9 @@ class ProjectCompleter : IArgumentCompleter { [VSTeamProjectCache]::timestamp = (Get-Date).Minute } - foreach ($p in [VSTeamProjectCache]::projects) { - if ($p -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new($p)) + foreach ($value in [VSTeamProjectCache]::projects) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } diff --git a/Source/Classes/ProjectValidateAttribute.ps1 b/Source/Classes/ProjectValidateAttribute.ps1 index f29c46a01..c853a84be 100644 --- a/Source/Classes/ProjectValidateAttribute.ps1 +++ b/Source/Classes/ProjectValidateAttribute.ps1 @@ -4,13 +4,11 @@ class ProjectValidateAttribute : ValidateArgumentsAttribute { [void] Validate( [object] $arguments, [EngineIntrinsics] $EngineIntrinsics) { - - if (_hasProjectCacheExpired) { - [VSTeamProjectCache]::projects = _getProjects - [VSTeamProjectCache]::timestamp = (Get-Date).Minute - } - if (($null -ne [VSTeamProjectCache]::projects) -and (-not ($arguments -in [VSTeamProjectCache]::projects))) { + #Do not fail on null or empty, leave that to other validation conditions + if ([string]::IsNullOrEmpty($arguments)) {return} + $list = [VSTeamProjectCache]::GetCurrent() + if ($list -and ($arguments -notin $list)) { throw [ValidationMetadataException]::new( "'$arguments' is not a valid project. Valid projects are: '" + ([VSTeamProjectCache]::projects -join "', '") + "'") diff --git a/Source/Classes/QueryCompleter.ps1 b/Source/Classes/QueryCompleter.ps1 new file mode 100644 index 000000000..4adbacaa1 --- /dev/null +++ b/Source/Classes/QueryCompleter.ps1 @@ -0,0 +1,41 @@ +using namespace System.Collections +using namespace System.Collections.Generic +using namespace System.Management.Automation + +# This class defines an attribute that allows the user the tab complete +# queries for function parameters. For this completer to work the +# users must have already provided the ProjectName parameter for the +# function or set a default project. +class QueryCompleter : IArgumentCompleter { + [IEnumerable[CompletionResult]] CompleteArgument( + [string] $CommandName, + [string] $ParameterName, + [string] $WordToComplete, + [Language.CommandAst] $CommandAst, + [IDictionary] $FakeBoundParameters) { + + $results = [List[CompletionResult]]::new() + + # If the user has explictly added the -ProjectName parameter + # to the command use that instead of the default project. + $projectName = $FakeBoundParameters['ProjectName'] + + # Only use the default project if the ProjectName parameter was + # not used + if (-not $projectName) { + $projectName = _getDefaultProject + } + + # If there is no projectName by this point just return a empty + # list. + if ($projectName) { + foreach ($value in [VSTeamQueryCache]::GetCurrent().name) { + if ($value -like "$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) + } + } + } + + return $results + } +} \ No newline at end of file diff --git a/Source/Classes/QueryTransformToIDAttribute.ps1 b/Source/Classes/QueryTransformToIDAttribute.ps1 new file mode 100644 index 000000000..3eba91807 --- /dev/null +++ b/Source/Classes/QueryTransformToIDAttribute.ps1 @@ -0,0 +1,16 @@ +using namespace System.Management.Automation + +class QueryTransformToIDAttribute : ArgumentTransformationAttribute { + [object] Transform( + [EngineIntrinsics]$EngineIntrinsics, + [object] $InputData) { + # If input data isn't empty and is not a GUID, and it is found as a name in the cache, + # then replace it with the match ID from the cache + if ($InputData -and $InputData -notmatch "[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}" -and + [VSTeamQueryCache]::queries.where( { $_.name -eq $InputData }).count) { + $InputData = [VSTeamQueryCache]::queries.where( { $_.name -eq $InputData }).id + } + + return $InputData + } +} \ No newline at end of file diff --git a/Source/Classes/ReleaseDefinitionCompleter.ps1 b/Source/Classes/ReleaseDefinitionCompleter.ps1 index d0a366445..97900e24f 100644 --- a/Source/Classes/ReleaseDefinitionCompleter.ps1 +++ b/Source/Classes/ReleaseDefinitionCompleter.ps1 @@ -25,9 +25,9 @@ class ReleaseDefinitionCompleter : IArgumentCompleter { # If there is no projectName by this point just return a empty # list. if ($projectName) { - foreach ($r in (Get-VSTeamReleaseDefinition -ProjectName $projectName)) { - if ($r.name -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new($r.name)) + foreach ($value in (Get-VSTeamReleaseDefinition -ProjectName $projectName).name) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } } diff --git a/Source/Classes/TeamQueueCompleter.ps1 b/Source/Classes/TeamQueueCompleter.ps1 index f9aebb92b..fdc6cbb32 100644 --- a/Source/Classes/TeamQueueCompleter.ps1 +++ b/Source/Classes/TeamQueueCompleter.ps1 @@ -25,9 +25,9 @@ class TeamQueueCompleter : IArgumentCompleter { # If there is no projectName by this point just return a empty # list. if ($projectName) { - foreach ($q in (Get-VSTeamQueue -ProjectName $projectName)) { - if ($q.name -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new($q.name)) + foreach ($value in (Get-VSTeamQueue -ProjectName $projectName).name) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } } diff --git a/Source/Classes/UncachedProjectCompleter.ps1 b/Source/Classes/UncachedProjectCompleter.ps1 index 0d7a6194d..69660b2e1 100644 --- a/Source/Classes/UncachedProjectCompleter.ps1 +++ b/Source/Classes/UncachedProjectCompleter.ps1 @@ -15,12 +15,9 @@ class UncachedProjectCompleter : IArgumentCompleter { [VSTeamProjectCache]::projects = _getProjects [VSTeamProjectCache]::timestamp = (Get-Date).Minute - foreach ($p in [VSTeamProjectCache]::projects) { - if ($p -like "*$WordToComplete*" -and $p -match "\s") { - $results.Add([CompletionResult]::new("'$p'")) - } - elseif ($p -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new($p)) + foreach ($value in [VSTeamProjectCache]::projects) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } diff --git a/Source/Classes/VSTeamAccount.ps1 b/Source/Classes/VSTeamAccount.ps1 index a62dd2fb2..a35a105c3 100644 --- a/Source/Classes/VSTeamAccount.ps1 +++ b/Source/Classes/VSTeamAccount.ps1 @@ -18,13 +18,10 @@ class VSTeamAccount : SHiPSDirectory { $topLevelFolders = @( [VSTeamPools]::new('Agent Pools'), [VSTeamExtensions]::new('Extensions') + [VSTeamFeeds]::new('Feeds') ) - + # Don't show directories not supported by the server - if (_testFeedSupport) { - $topLevelFolders += [VSTeamFeeds]::new('Feeds') - } - if (_testGraphSupport) { $topLevelFolders += [VSTeamPermissions]::new('Permissions') } diff --git a/Source/Classes/VSTeamProcess.ps1 b/Source/Classes/VSTeamProcess.ps1 index 37df422f6..e7aef454e 100644 --- a/Source/Classes/VSTeamProcess.ps1 +++ b/Source/Classes/VSTeamProcess.ps1 @@ -4,24 +4,46 @@ class VSTeamProcess { [string]$URL = $null [string]$Description = $null [string]$Name = $null + [string]$ReferenceName = $null + [bool]$IsEnabled = $true [bool]$IsDefault = $false [string]$Type = $null - + [string]$ProcessTemplate = $null + [string]$ParentProcessTypeId = $null VSTeamProcess ( [object]$obj ) { - $this.ID = $obj.id - $this.URL = $obj.url - $this.IsDefault = $obj.isDefault - $this.Name = $obj.name - $this.Type = $obj.type - + $this.AddTypeName('Team.Process') + $this.Name = $obj.name + $this.ProcessTemplate = $obj.name + #Allow for processes from .../process/processes with ID property, or ...work/processes with TypeID + if ($obj.PSObject.Properties['typeId']) { + $this.ID = $obj.typeId + $this.URL = (_getInstance) + "/_apis/work/processes/" + $obj.typeId + } + elseIf ($obj.PSObject.Properties['Id']) { + $this.ID = $obj.Id + $this.URL = (_getInstance) + "/_apis/work/processes/" + $obj.ID + } + if ($obj.PSObject.Properties['isEnabled']) { + $this.IsEnabled = $obj.isEnabled + } + if ($obj.PSObject.Properties['isDefault']) { + $this.IsDefault = $obj.isDefault + } + if ($obj.PSObject.Properties['referenceName']) { + $this.ReferenceName = $obj.referenceName + } + if ($obj.PSObject.Properties['customizationType']) { + $this.Type = $obj.customizationType + } # The description is not always returned so protect yourself. - if ($obj.PSObject.Properties.Match('description').count -gt 0) { - $this.Description = $obj.description + if ($obj.PSObject.Properties['description']) { + $this.Description = $obj.description + } + if ($obj.PSObject.Properties['parentProcessTypeId']) { + $this.ParentProcessTypeId = $obj.parentProcessTypeId } - - $this.AddTypeName('Team.Process') } [void] hidden AddTypeName( diff --git a/Source/Classes/VSTeamProcessCache.ps1 b/Source/Classes/VSTeamProcessCache.ps1 index eefd2c6d0..dd9cb58e4 100644 --- a/Source/Classes/VSTeamProcessCache.ps1 +++ b/Source/Classes/VSTeamProcessCache.ps1 @@ -1,7 +1,45 @@ -# Dynamic parameters get called alot. This can cause -# multiple calls to TFS/VSTS for a single function call -# so I am going to try and cache the values. +# cache process names and URLs to reduce the number of +# rest APIs calls needed for parameter completion / validation + +#Unit tests should populate cache with expected processes ideally with +# a mock for Get-VSTeamProcess which returns objects with name and (optionally) URL properties +# we let them mock the testing freshness but really they should call invalidate class VSTeamProcessCache { static [int] $timestamp = -1 - static [object] $processes = $null + static [object[]] $processes = @() + static [hashtable] $urls = @{} + #Allow the class to be updated with a list. If no list is given we'll get the one first + static [Void] Update ([object[]]$NewItems) { + #even if we get nothing back ensure processes is still an array + [VSTeamProcessCache]::processes = @() + ($NewItems | Select-Object -ExpandProperty Name | Sort-Object) + #Handle newitems being null or empty + if ($Newitems) { + $NewItems | Where-Object {$_.psobject.Properties['url']} | ForEach-Object { + [VSTeamProcessCache]::urls[$_.name] = $_.url + } + } + [VSTeamProcessCache]::timestamp = (Get-Date).Minute + } + static [Void] Update () { + [VSTeamProcessCache]::processes = @() + #Get-VSTeamProcess should call update(listOfProcesses), + #but it if doesn't (e.g. a simple mock) processes will still be empty, and we can call it + $list = Get-VSTeamProcess + if ([VSTeamProcessCache]::processes.Count -eq 0) {[VSTeamProcessCache]::Update($list) } + } + #"save current minute" refreshes on average after 30secs but not after exact hours timeOfDayTotalMinutes might be a better base + static [bool] HasExpired () { + return $([VSTeamProcessCache]::timestamp) -ne (Get-Date).Minute + } + static [object] GetCurrent () { + if ([VSTeamProcessCache]::HasExpired()) { [VSTeamProcessCache]::Update() } + return ([VSTeamProcessCache]::processes) + } + static [object] GetURl ([string]$ProcessName) { + if ([VSTeamProcessCache]::HasExpired()) { [VSTeamProcessCache]::Update() } + return ([VSTeamProcessCache]::urls[$ProcessName]) + } + static [void] Invalidate () { + [VSTeamProcessCache]::timestamp = -1 + } } \ No newline at end of file diff --git a/Source/Classes/VSTeamProject.ps1 b/Source/Classes/VSTeamProject.ps1 index 6a3809a97..aa82a6112 100644 --- a/Source/Classes/VSTeamProject.ps1 +++ b/Source/Classes/VSTeamProject.ps1 @@ -10,6 +10,7 @@ class VSTeamProject : VSTeamDirectory { [string]$State = $null [string]$Visibility = $null [string]$Description = $null + [string]$ProjectName = $null VSTeamProject ( [object]$obj @@ -20,6 +21,20 @@ class VSTeamProject : VSTeamDirectory { $this.Revision = $obj.revision $this.Visibility = $obj.visibility + # This is required so we can pipe this object to functions + # like Remove-VSTeamProject. Even though the base class has + # a name property, without it you will get an + # error stating: + # + # The input object cannot be bound to any parameters for the + # command either because the command does not take pipeline + # input or the input and its properties do not match any of + # the parameters that take pipeline input. + # + # Adding this property has it match the ProjectName alias for + # name on Remove-VSTeamProject. + $this.ProjectName = $obj.name + # The description is not always returned so protect yourself. if ($obj.PSObject.Properties.Match('description').count -gt 0) { $this.Description = $obj.description diff --git a/Source/Classes/VSTeamProjectCache.ps1 b/Source/Classes/VSTeamProjectCache.ps1 index d56bf5ed9..0a14f4fa0 100644 --- a/Source/Classes/VSTeamProjectCache.ps1 +++ b/Source/Classes/VSTeamProjectCache.ps1 @@ -4,4 +4,17 @@ class VSTeamProjectCache { static [int] $timestamp = -1 static [object] $projects = $null + static [Void] Update () { + #Allow unit tests to mock returning the project list and testing freshness + [VSTeamProjectCache]::projects = _getProjects + [VSTeamProjectCache]::timestamp = (Get-Date).Minute + # "save current minute" refreshes on average after 30secs but not after exact hours timeOfDayTotalMinutes might be a better base + } + static [void] Invalidate () { + [VSTeamProjectCache]::timestamp = -1 + } + static [object] GetCurrent () { + if (_hasProjectCacheExpired) { [VSTeamProjectCache]::Update() } + return ([VSTeamProjectCache]::projects) + } } \ No newline at end of file diff --git a/Source/Classes/VSTeamQueryCache.ps1 b/Source/Classes/VSTeamQueryCache.ps1 new file mode 100644 index 000000000..8a3cc2d1f --- /dev/null +++ b/Source/Classes/VSTeamQueryCache.ps1 @@ -0,0 +1,31 @@ +class VSTeamQueryCache { + static [int] $timestamp = -1 + static [object] $queries = $null + + static [Void] Update () { + $projectName = (_getDefaultProject) + + if ($projectName) { + [VSTeamQueryCache]::queries = $(_callAPi -ProjectName $projectName ` + -Area wit -Resource queries -QueryString @{'$depth' = 1 } -version $(_getApiVersion core)).value.children | + Where-Object -Property isfolder -ne "True" | + Select-Object Name, ID | + Sort-Object Name + + [VSTeamQueryCache]::timestamp = (Get-Date).TimeOfDay.TotalMinutes + } + } + + static [void] Invalidate () { + [VSTeamQueryCache]::timestamp = -1 + } + + static [object] GetCurrent () { + if ([VSTeamQueryCache]::timestamp -lt 0 -or + [VSTeamQueryCache]::timestamp -lt [datetime]::Now.TimeOfDay.TotalMinutes - 5) { + [VSTeamQueryCache]::Update() + } + + return ([VSTeamQueryCache]::queries) + } +} \ No newline at end of file diff --git a/Source/Classes/VSTeamVersions.ps1 b/Source/Classes/VSTeamVersions.ps1 index c7e1ac984..ea29095b5 100644 --- a/Source/Classes/VSTeamVersions.ps1 +++ b/Source/Classes/VSTeamVersions.ps1 @@ -2,19 +2,20 @@ class VSTeamVersions { static [string] $Account = $env:TEAM_ACCT static [string] $DefaultProject = $env:TEAM_PROJECT static [string] $Version = $(If ($env:TEAM_VERSION) { $env:TEAM_VERSION } Else { "TFS2017" }) + static [string] $Git = '3.0' + static [string] $Core = '3.0' static [string] $Build = '3.0' static [string] $Release = '3.0-preview' - static [string] $Core = '3.0' - static [string] $Git = '3.0' static [string] $DistributedTask = '3.0-preview' - static [string] $VariableGroups = '3.2-preview.1' - static [string] $TaskGroups = '3.2-preview.1' + static [string] $VariableGroups = '' + static [string] $TaskGroups = '3.0-preview' static [string] $Tfvc = '3.0' - static [string] $Packaging = '' + static [string] $Packaging = '3.0-preview' static [string] $MemberEntitlementManagement = '' static [string] $ExtensionsManagement = '' - static [string] $ServiceFabricEndpoint = '' + static [string] $ServiceEndpoints = '3.0-preview' static [string] $ModuleVersion = $null static [string] $Graph = '' - static [string] $Policy = '' + static [string] $Policy = '3.0' + static [string] $ProcessDefinition = '' } \ No newline at end of file diff --git a/Source/Classes/WorkItemTypeCompleter.ps1 b/Source/Classes/WorkItemTypeCompleter.ps1 index 05da1032c..447086ab3 100644 --- a/Source/Classes/WorkItemTypeCompleter.ps1 +++ b/Source/Classes/WorkItemTypeCompleter.ps1 @@ -25,9 +25,9 @@ class WorkItemTypeCompleter : IArgumentCompleter { # If there is no projectName by this point just return a empty # list. if ($projectName) { - foreach ($w in (_getWorkItemTypes -ProjectName $projectName)) { - if ($w -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new($w)) + foreach ($value in (_getWorkItemTypes -ProjectName $projectName)) { + if ($value -like "*$WordToComplete*") { + $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) } } } diff --git a/Source/Classes/_classes.json b/Source/Classes/_classes.json index 6194da4c3..888ad2982 100644 --- a/Source/Classes/_classes.json +++ b/Source/Classes/_classes.json @@ -11,13 +11,16 @@ "TeamQueueCompleter.ps1", "UncachedProjectCompleter.ps1", "WorkItemTypeCompleter.ps1", + "WorkItemTypeValidateAttribute.ps1", "ProcessValidateAttribute.ps1", "ProjectValidateAttribute.ps1", + "QueryCompleter.ps1", + "QueryTransformToIDAttribute.ps1", "UncachedProjectValidateAttribute.ps1", - "WorkItemTypeValidateAttribute.ps1", "VSTeamVersions.ps1", "VSTeamProjectCache.ps1", "VSTeamProcessCache.ps1", + "VSTeamQueryCache.ps1", "VSTeamDirectory.ps1", "VSTeamLeaf.ps1", "VSTeamPools.ps1", diff --git a/Source/Private/common.ps1 b/Source/Private/common.ps1 index 820487f71..32ed0fc6e 100644 --- a/Source/Private/common.ps1 +++ b/Source/Private/common.ps1 @@ -115,17 +115,6 @@ function _testGraphSupport { (_getApiVersion Graph) -as [boolean] } -function _supportsFeeds { - _hasAccount - if ($false -eq $(_testFeedSupport)) { - throw 'This account does not support packages.' - } -} - -function _testFeedSupport { - (_getApiVersion Packaging) -as [boolean] -} - function _supportsSecurityNamespace { _hasAccount if (([VSTeamVersions]::Version -ne "VSTS") -and ([VSTeamVersions]::Version -ne "AzD")) { @@ -154,7 +143,7 @@ function _getApiVersion { [CmdletBinding(DefaultParameterSetName = 'Service')] param ( [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 0)] - [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceFabricEndpoint', 'Graph', 'TaskGroups', 'Policy')] + [ValidateScript({$_ -in ([VSTeamVersions] | Get-Member -Static -MemberType Property).name})] [string] $Service, [parameter(ParameterSetName = 'Target')] @@ -162,55 +151,10 @@ function _getApiVersion { ) if ($Target.IsPresent) { - return [VSTeamVersions]::Version + return [VSTeamVersions]::Version } - else { + else {return [VSTeamVersions]::$Service } - switch ($Service) { - 'Build' { - return [VSTeamVersions]::Build - } - 'Release' { - return [VSTeamVersions]::Release - } - 'Core' { - return [VSTeamVersions]::Core - } - 'Git' { - return [VSTeamVersions]::Git - } - 'DistributedTask' { - return [VSTeamVersions]::DistributedTask - } - 'VariableGroups' { - return [VSTeamVersions]::VariableGroups - } - 'Tfvc' { - return [VSTeamVersions]::Tfvc - } - 'Packaging' { - return [VSTeamVersions]::Packaging - } - 'MemberEntitlementManagement' { - return [VSTeamVersions]::MemberEntitlementManagement - } - 'ExtensionsManagement' { - return [VSTeamVersions]::ExtensionsManagement - } - 'ServiceFabricEndpoint' { - return [VSTeamVersions]::ServiceFabricEndpoint - } - 'Graph' { - return [VSTeamVersions]::Graph - } - 'TaskGroups' { - return [VSTeamVersions]::TaskGroups - } - 'Policy' { - return [VSTeamVersions]::Policy - } - } - } } function _getInstance { @@ -826,7 +770,7 @@ function _trackServiceEndpointProgress { # Track status while (-not $isReady) { $statusTracking = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $resp.id ` - -Version $(_getApiVersion DistributedTask) + -Version $(_getApiVersion ServiceEndpoints) $isReady = $statusTracking.isReady; @@ -848,12 +792,6 @@ function _trackServiceEndpointProgress { } } -function _supportsServiceFabricEndpoint { - if (-not $(_getApiVersion ServiceFabricEndpoint)) { - throw 'This account does not support Service Fabric endpoints.' - } -} - function _getModuleVersion { # Read the version from the psd1 file. # $content = (Get-Content -Raw "./VSTeam.psd1" | Out-String) diff --git a/Source/Public/Add-VSTeamBuild.ps1 b/Source/Public/Add-VSTeamBuild.ps1 index cf1716841..903605808 100644 --- a/Source/Public/Add-VSTeamBuild.ps1 +++ b/Source/Public/Add-VSTeamBuild.ps1 @@ -33,7 +33,7 @@ function Add-VSTeamBuild { # Find the BuildDefinition id from the name $id = (Get-VSTeamBuildDefinition -ProjectName "$ProjectName" -Filter $BuildDefinitionName -Type All).id if (-not $id) { - throw "'$BuildDefinitionName' is not a valid build definition. Use Get-VSTeamBuildDefinition to get a list of build names" ; return + throw "'$BuildDefinitionName' is not a valid build definition. Use Get-VSTeamBuildDefinition to get a list of build names" ; return } $body = @{ definition = @{ @@ -45,7 +45,7 @@ function Add-VSTeamBuild { if ($QueueName) { $queueId = (Get-VSTeamQueue -ProjectName "$ProjectName" -queueName "$QueueName").id - if (-not ($env:Testing -or $queueId)) { + if (-not $queueId) { throw "'$QueueName' is not a valid Queue. Use Get-VSTeamQueue to get a list of queues" ; return } else { $body["queue"] = @{id = $queueId } } diff --git a/Source/Public/Add-VSTeamFeed.ps1 b/Source/Public/Add-VSTeamFeed.ps1 index 7096c2870..4e5d97d84 100644 --- a/Source/Public/Add-VSTeamFeed.ps1 +++ b/Source/Public/Add-VSTeamFeed.ps1 @@ -13,9 +13,6 @@ function Add-VSTeamFeed { ) process { - # This will throw if this account does not support feeds - _supportsFeeds - $body = @{ name = $Name description = $Description diff --git a/Source/Public/Add-VSTeamProfile.ps1 b/Source/Public/Add-VSTeamProfile.ps1 index 66a283ce3..be0425e5f 100644 --- a/Source/Public/Add-VSTeamProfile.ps1 +++ b/Source/Public/Add-VSTeamProfile.ps1 @@ -14,7 +14,7 @@ function Add-VSTeamProfile { [string] $Name, - [ValidateSet('TFS2017', 'TFS2018', 'AzD2019', 'VSTS')] + [ValidateSet('TFS2017', 'TFS2018', 'AzD2019', 'VSTS', 'AzD', 'TFS2017U1', 'TFS2017U2', 'TFS2017U3', 'TFS2018U1', 'TFS2018U2', 'TFS2018U3', 'AzD2019U1')] [string] $Version, [switch] $UseBearerToken diff --git a/Source/Public/Add-VSTeamServiceEndpoint.ps1 b/Source/Public/Add-VSTeamServiceEndpoint.ps1 index aba543848..2114b115e 100644 --- a/Source/Public/Add-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Add-VSTeamServiceEndpoint.ps1 @@ -23,7 +23,7 @@ function Add-VSTeamServiceEndpoint { # Call the REST API $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' ` - -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion DistributedTask) + -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion ServiceEndpoints) _trackServiceEndpointProgress -projectName $projectName -resp $resp -title 'Creating Service Endpoint' -msg "Creating $endpointName" diff --git a/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 b/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 index acc1e4543..59e53102e 100644 --- a/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 +++ b/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 @@ -37,9 +37,6 @@ function Add-VSTeamServiceFabricEndpoint { ) process { - # This will throw if this account does not support ServiceFabricEndpoint - _supportsServiceFabricEndpoint - switch ($PSCmdlet.ParameterSetName) { "Certificate" { # copied securestring usage from Set-VSTeamAccount diff --git a/Source/Public/Get-VSTeamAPIVersion.ps1 b/Source/Public/Get-VSTeamAPIVersion.ps1 index 1bcce407a..9499ae7e7 100644 --- a/Source/Public/Get-VSTeamAPIVersion.ps1 +++ b/Source/Public/Get-VSTeamAPIVersion.ps1 @@ -1,23 +1,32 @@ function Get-VSTeamAPIVersion { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] - param() + param( + [Parameter(Mandatory = $false, Position = 0)] + [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceEndpoints', 'Graph', 'TaskGroups', 'Policy')] + [string] $Service + ) - return @{ - Version = $(_getApiVersion -Target) - Build = $(_getApiVersion Build) - Release = $(_getApiVersion Release) - Core = $(_getApiVersion Core) - Git = $(_getApiVersion Git) - DistributedTask = $(_getApiVersion DistributedTask) - VariableGroups = $(_getApiVersion VariableGroups) - Tfvc = $(_getApiVersion Tfvc) - Packaging = $(_getApiVersion Packaging) - TaskGroups = $(_getApiVersion TaskGroups) - MemberEntitlementManagement = $(_getApiVersion MemberEntitlementManagement) - ExtensionsManagement = $(_getApiVersion ExtensionsManagement) - ServiceFabricEndpoint = $(_getApiVersion ServiceFabricEndpoint) - Graph = $(_getApiVersion Graph) - Policy = $(_getApiVersion Policy) + if ($Service) { + return $(_getApiVersion $Service) + } + else { + return @{ + Version = $(_getApiVersion -Target) + Build = $(_getApiVersion Build) + Release = $(_getApiVersion Release) + Core = $(_getApiVersion Core) + Git = $(_getApiVersion Git) + DistributedTask = $(_getApiVersion DistributedTask) + VariableGroups = $(_getApiVersion VariableGroups) + Tfvc = $(_getApiVersion Tfvc) + Packaging = $(_getApiVersion Packaging) + TaskGroups = $(_getApiVersion TaskGroups) + MemberEntitlementManagement = $(_getApiVersion MemberEntitlementManagement) + ExtensionsManagement = $(_getApiVersion ExtensionsManagement) + ServiceEndpoints = $(_getApiVersion ServiceEndpoints) + Graph = $(_getApiVersion Graph) + Policy = $(_getApiVersion Policy) + } } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamBuild.ps1 b/Source/Public/Get-VSTeamBuild.ps1 index 223ee846e..59df86cb2 100644 --- a/Source/Public/Get-VSTeamBuild.ps1 +++ b/Source/Public/Get-VSTeamBuild.ps1 @@ -22,6 +22,7 @@ function Get-VSTeamBuild { [Parameter(ParameterSetName = 'List')] [int[]] $Definitions, + [ArgumentCompleter([BuildCompleter])] [Parameter(ParameterSetName = 'List')] [string] $BuildNumber, diff --git a/Source/Public/Get-VSTeamExtension.ps1 b/Source/Public/Get-VSTeamExtension.ps1 index 90e02d8df..69e59198f 100644 --- a/Source/Public/Get-VSTeamExtension.ps1 +++ b/Source/Public/Get-VSTeamExtension.ps1 @@ -19,9 +19,13 @@ function Get-VSTeamExtension { Process { if ($PublisherId -and $ExtensionId) { - $resource = "extensionmanagement/installedextensionsbyname/$PublisherId/$ExtensionId" + $id = "$PublisherId/$ExtensionId" - $resp = _callAPI -SubDomain 'extmgmt' -Resource $resource -Version $(_getApiVersion ExtensionsManagement) + $resp = _callAPI -SubDomain 'extmgmt' ` + -Area 'extensionmanagement' ` + -Resource 'installedextensionsbyname' ` + -Id $id ` + -Version $(_getApiVersion ExtensionsManagement) $item = [VSTeamExtension]::new($resp) @@ -41,7 +45,11 @@ function Get-VSTeamExtension { $queryString.includeErrors = $true } - $resp = _callAPI -SubDomain 'extmgmt' -Resource 'extensionmanagement/installedextensions' -QueryString $queryString -Version $(_getApiVersion ExtensionsManagement) + $resp = _callAPI -SubDomain 'extmgmt' ` + -Area 'extensionmanagement' ` + -Resource 'installedextensions' ` + -QueryString $queryString ` + -Version $(_getApiVersion ExtensionsManagement) $objs = @() diff --git a/Source/Public/Get-VSTeamFeed.ps1 b/Source/Public/Get-VSTeamFeed.ps1 index 9fde66284..c6ef5dc74 100644 --- a/Source/Public/Get-VSTeamFeed.ps1 +++ b/Source/Public/Get-VSTeamFeed.ps1 @@ -7,9 +7,6 @@ function Get-VSTeamFeed { ) process { - # Thi swill throw if this account does not support feeds - _supportsFeeds - if ($id) { foreach ($item in $id) { $resp = _callAPI -NoProject -subDomain feeds -Id $item -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) diff --git a/Source/Public/Get-VSTeamOption.ps1 b/Source/Public/Get-VSTeamOption.ps1 index 3bb0aab0a..1ce45fada 100644 --- a/Source/Public/Get-VSTeamOption.ps1 +++ b/Source/Public/Get-VSTeamOption.ps1 @@ -1,14 +1,31 @@ function Get-VSTeamOption { [CmdletBinding()] - param([string] $subDomain) + param( + [string] $subDomain, + + [Parameter(Position = 0)] + [Alias("Service")] + [string] $area, + + [Parameter(Position = 1)] + [string] $resource + ) # Build the url to list the projects - $params = @{"Method" = "Options"} + $params = @{ "Method" = "Options" } if ($subDomain) { $params.Add("SubDomain", $subDomain) } + if ($area) { + $params.Add("Area", $area) + } + + if ($resource) { + $params.Add("Resource", $resource) + } + # Call the REST API $resp = _callAPI @params diff --git a/Source/Public/Get-VSTeamProcess.ps1 b/Source/Public/Get-VSTeamProcess.ps1 index d9f670137..caf7d627e 100644 --- a/Source/Public/Get-VSTeamProcess.ps1 +++ b/Source/Public/Get-VSTeamProcess.ps1 @@ -1,56 +1,40 @@ function Get-VSTeamProcess { [CmdletBinding(DefaultParameterSetName = 'List')] + # [OutputType([vsteamprocess])] param( - [Parameter(ParameterSetName = 'List')] + [Parameter(ParameterSetName = 'ByName', Position=0)] + [ArgumentCompleter([ProcessTemplateCompleter])] + [Alias('ProcessName','ProcessTemplate')] + $Name = '*', + + [Parameter(DontShow=$true, ParameterSetName = 'List')] [int] $Top = 100, - [Parameter(ParameterSetName = 'List')] + [Parameter(DontShow=$true, ParameterSetName = 'List')] [int] $Skip = 0, [Parameter(ParameterSetName = 'ByID')] [Alias('ProcessTemplateID')] - [string] $Id, - - [Parameter(ParameterSetName = 'ByName', Mandatory = $true)] - [ProcessValidateAttribute()] - [ArgumentCompleter([ProcessTemplateCompleter])] - [string] $Name + [string] $Id ) process { + # The REST API ignores Top and Skip but allows them to be specified & the function does the same. + if ($PSBoundParameters['Top','Skip'] -gt 0) { + Write-Warning "You specified -Top $Top , -Skip $Skip These parameters are ignored and will be removed in future" + } + # Return either a single proces by ID or a list of processes if ($id) { - $queryString = @{ } - - # Call the REST API - $resp = _callAPI -area 'process' -resource 'processes' -id $id ` - -Version $(_getApiVersion Core) ` - -QueryString $queryString -NoProject + # Call the REST API with an ID + $resp = _callAPI -NoProject -area 'work' -resource 'processes' -id $id -Version $(_getApiVersion ProcessDefinition) - $project = [VSTeamProcess]::new($resp) - - Write-Output $project - } - elseif ($Name) { - # Lookup Process ID by Name - Get-VSTeamProcess | where-object { $_.name -eq $Name } + if ($resp) { + return [VSTeamProcess]::new($resp) + } } else { - # Return list of processes try { # Call the REST API - $resp = _callAPI -area 'process' -resource 'processes' ` - -Version $(_getApiVersion Core) -NoProject ` - -QueryString @{ - '$top' = $top - '$skip' = $skip - } - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamProcess]::new($item) - } - - Write-Output $objs + $resp = _callAPI -NoProject -Area 'work' -resource 'processes' -Version (_getApiVersion ProcessDefinition) } catch { # I catch because using -ErrorAction Stop on the Invoke-RestMethod @@ -58,6 +42,13 @@ function Get-VSTeamProcess { # This casuses the first error to terminate this execution. _handleException $_ } + #we just fetched all the processes so let's update the cache. Also, cache the URLS for processes + [VSTeamProcessCache]::processes = $resp.value.name | Sort-Object + [VSTeamProcessCache]::timestamp = (Get-Date).Minute + $resp.value | ForEach-Object { + [VSTeamProcessCache]::urls[$_.name] = (_getInstance) + "/_apis/work/processes/" + $_.TypeId + [VSTeamProcess]::new($_) + } | Where-Object {$_.name -like $Name} | Sort-Object -Property Name } } } diff --git a/Source/Public/Get-VSTeamServiceEndpoint.ps1 b/Source/Public/Get-VSTeamServiceEndpoint.ps1 index 89b99124b..7b43b1f71 100644 --- a/Source/Public/Get-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Get-VSTeamServiceEndpoint.ps1 @@ -13,7 +13,7 @@ function Get-VSTeamServiceEndpoint { if ($id) { # Call the REST API $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpoints' -Id $id ` - -Version $(_getApiVersion DistributedTask) -ProjectName $ProjectName + -Version $(_getApiVersion ServiceEndpoints) -ProjectName $ProjectName _applyTypesToServiceEndpoint -item $resp @@ -22,7 +22,7 @@ function Get-VSTeamServiceEndpoint { else { # Call the REST API $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'serviceendpoints' ` - -Version $(_getApiVersion DistributedTask) + -Version $(_getApiVersion ServiceEndpoints) # Apply a Type Name so we can use custom format view and custom type extensions foreach ($item in $resp.value) { diff --git a/Source/Public/Get-VSTeamServiceEndpointType.ps1 b/Source/Public/Get-VSTeamServiceEndpointType.ps1 index 0d58d0fc5..78d6abb59 100644 --- a/Source/Public/Get-VSTeamServiceEndpointType.ps1 +++ b/Source/Public/Get-VSTeamServiceEndpointType.ps1 @@ -31,12 +31,12 @@ function Get-VSTeamServiceEndpointType { # Call the REST API $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointtypes' ` - -Version $(_getApiVersion DistributedTask) -body $body + -Version $(_getApiVersion ServiceEndpoints) -body $body } else { # Call the REST API $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointtypes' ` - -Version $(_getApiVersion DistributedTask) + -Version $(_getApiVersion ServiceEndpoints) } diff --git a/Source/Public/Get-VSTeamWiql.ps1 b/Source/Public/Get-VSTeamWiql.ps1 index 00b34dd02..d7f5fee41 100644 --- a/Source/Public/Get-VSTeamWiql.ps1 +++ b/Source/Public/Get-VSTeamWiql.ps1 @@ -1,75 +1,75 @@ function Get-VSTeamWiql { [CmdletBinding(DefaultParameterSetName = 'ByID')] param( + [QueryTransformToIDAttribute()] + [ArgumentCompleter([QueryCompleter])] [Parameter(ParameterSetName = 'ByID', Mandatory = $true, Position = 0)] [string] $Id, - [Parameter(ParameterSetName = 'ByQuery', Mandatory = $true, Position = 0)] + [Parameter(ParameterSetName = 'ByQuery', Mandatory = $true)] [string] $Query, - [Parameter(Mandatory = $true, Position = 1)] [string] $Team, - [int] $Top = 100, + [Parameter(Position = 2)] + [ProjectValidateAttribute()] + [ArgumentCompleter([ProjectCompleter])] + $ProjectName, + [int] $Top = 100, [Switch] $TimePrecision, - [Switch] $Expand ) - DynamicParam { - #$arrSet = Get-VSTeamProject | Select-Object -ExpandProperty Name - _buildProjectNameDynamicParam -mandatory $true #-arrSet $arrSet - } - - Process { - - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - $QueryString = @{ - '$top' = $Top - timePrecision = $TimePrecision + process { + # build paramters for _callAPI + $params = @{ + ProjectName = $ProjectName + Area = 'wit' + Resource = 'wiql' + Version = [VSTeamVersions]::Core + QueryString = @{ + '$top' = $Top + timePrecision = $TimePrecision + } } - # Call the REST API if ($Query) { - - $body = (@{ - query = $Query - }) | ConvertTo-Json - - $resp = _callAPI -ProjectName $ProjectName -Team $Team -Area 'wit' -Resource 'wiql' ` - -method "POST" -ContentType "application/json" ` - -Version $(_getApiVersion Core) ` - -Querystring $QueryString ` - -Body $body + $params['body'] = @{query = $Query } | ConvertTo-Json + $params['method'] = 'POST' + $params['ContentType'] = 'application/json' } else { - $resp = _callAPI -ProjectName $ProjectName -Team $Team -Area 'wit' -Resource 'wiql' ` - -Version $(_getApiVersion Core) -id "$Id" ` - -Querystring $QueryString + $params['id'] = $Id + } + + if ($Team) { + $params['Team'] = $Team } + + $resp = _callAPI @params if ($Expand) { + # Handle queries for work item links also allow for the tests not Setting the query result type. + if ($resp.psobject.Properties['queryResultType'] -and $resp.queryResultType -eq 'workItemLink') { + Add-Member -InputObject $resp -MemberType NoteProperty -Name Workitems -Value @() + $Ids = $resp.workItemRelations.Target.id + } + else { + $Ids = $resp.workItems.id + } - [array]$Ids = $resp.workItems.id - $Fields = $resp.columns.referenceName - - $resp.workItems = @() - #splitting id array by 200, since a maximum of 200 ids are allowed per call + # splitting id array by 200, since a maximum of 200 ids are allowed per call $countIds = $Ids.Count $resp.workItems = for ($beginRange = 0; $beginRange -lt $countIds; $beginRange += 200) { - - $endRange = ($beginRange + 199) - - if ($endRange -gt $countIds) { - $idArray = $Ids[$beginRange..($countIds - 1)] + # in case strict mode is on,pick lesser of 0..199 and 0..count-1 + $endRange = [math]::Min(($beginRange + 199), ($countIds - 1)) + # if query contains "*" don't specify fields, otherwise use fields returned. + if ($Query -match "\*") { + Get-VSTeamWorkItem -Id $Ids[$beginRange..$endRange] } else { - $idArray = $Ids[$beginRange..($endRange)] + Get-VSTeamWorkItem -Id $Ids[$beginRange..$endRange] -Fields $resp.columns.referenceName } - - (Get-VSTeamWorkItem -Fields $Fields -Id $idArray).value } } diff --git a/Source/Public/Remove-VSTeamFeed.ps1 b/Source/Public/Remove-VSTeamFeed.ps1 index f9c3cf2e0..75ed061a6 100644 --- a/Source/Public/Remove-VSTeamFeed.ps1 +++ b/Source/Public/Remove-VSTeamFeed.ps1 @@ -8,9 +8,6 @@ function Remove-VSTeamFeed { [switch] $Force ) process { - # This will throw if this account does not support feeds - _supportsFeeds - foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Package Feed")) { # Call the REST API diff --git a/Source/Public/Remove-VSTeamServiceEndpoint.ps1 b/Source/Public/Remove-VSTeamServiceEndpoint.ps1 index f278c8857..7309e663e 100644 --- a/Source/Public/Remove-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Remove-VSTeamServiceEndpoint.ps1 @@ -17,7 +17,7 @@ function Remove-VSTeamServiceEndpoint { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Service Endpoint")) { # Call the REST API _callAPI -projectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $item ` - -Method Delete -Version $(_getApiVersion DistributedTask) | Out-Null + -Method Delete -Version $(_getApiVersion ServiceEndpoints) | Out-Null Write-Output "Deleted service endpoint $item" } diff --git a/Source/Public/Set-VSTeamAPIVersion.ps1 b/Source/Public/Set-VSTeamAPIVersion.ps1 index 4175a6ace..5a83847f1 100644 --- a/Source/Public/Set-VSTeamAPIVersion.ps1 +++ b/Source/Public/Set-VSTeamAPIVersion.ps1 @@ -2,11 +2,11 @@ function Set-VSTeamAPIVersion { [CmdletBinding(DefaultParameterSetName = 'Target', SupportsShouldProcess = $true, ConfirmImpact = "Low")] param( [parameter(ParameterSetName = 'Target', Mandatory = $false, Position = 0)] - [ValidateSet('TFS2017', 'TFS2018', 'AzD2019', 'VSTS', 'AzD')] + [ValidateSet('TFS2017', 'TFS2018', 'AzD2019', 'VSTS', 'AzD', 'TFS2017U1', 'TFS2017U2', 'TFS2017U3', 'TFS2018U1', 'TFS2018U2', 'TFS2018U3', 'AzD2019U1')] [string] $Target = 'TFS2017', [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 0)] - [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceFabricEndpoint', 'Graph', 'TaskGroups', 'Policy')] + [ValidateScript({$_ -in ([VSTeamVersions] | Get-Member -Static -MemberType Property).name})] [string] $Service, [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 1)] @@ -17,52 +17,10 @@ function Set-VSTeamAPIVersion { if ($Force -or $pscmdlet.ShouldProcess($Target, "Set-VSTeamAPIVersion")) { if ($PSCmdlet.ParameterSetName -eq 'Service') { - switch ($Service) { - 'Build' { - [VSTeamVersions]::Build = $Version - } - 'Release' { - [VSTeamVersions]::Release = $Version - } - 'Core' { - [VSTeamVersions]::Core = $Version - } - 'Git' { - [VSTeamVersions]::Git = $Version - } - 'DistributedTask' { - [VSTeamVersions]::DistributedTask = $Version - } - 'VariableGroups' { - [VSTeamVersions]::VariableGroups = $Version - } - 'Tfvc' { - [VSTeamVersions]::Tfvc = $Version - } - 'Packaging' { - [VSTeamVersions]::Packaging = $Version - } - 'MemberEntitlementManagement' { - [VSTeamVersions]::MemberEntitlementManagement = $Version - } - 'ExtensionsManagement' { - [VSTeamVersions]::ExtensionsManagement = $Version - } - 'ServiceFabricEndpoint' { - [VSTeamVersions]::ServiceFabricEndpoint = $Version - } - 'Graph' { - [VSTeamVersions]::Graph = $Version - } - 'TaskGroups' { - [VSTeamVersions]::TaskGroups = $Version - } - 'Policy' { - [VSTeamVersions]::Policy = $Version - } - } + [VSTeamVersions]::$Service = $Version } else { + # https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.1#api-and-tfs-version-mapping switch ($Target) { 'AzD2019' { [VSTeamVersions]::Version = 'AzD2019' @@ -70,32 +28,72 @@ function Set-VSTeamAPIVersion { [VSTeamVersions]::Core = '5.0' [VSTeamVersions]::Build = '5.0' [VSTeamVersions]::Release = '5.0' - [VSTeamVersions]::DistributedTask = '5.0' - [VSTeamVersions]::VariableGroups = '5.0' + [VSTeamVersions]::DistributedTask = '5.0-preview' + [VSTeamVersions]::VariableGroups = '5.0-preview' [VSTeamVersions]::Tfvc = '5.0' - [VSTeamVersions]::Packaging = '' + [VSTeamVersions]::Packaging = '5.0-preview' + [VSTeamVersions]::TaskGroups = '5.0-preview' [VSTeamVersions]::MemberEntitlementManagement = '' - [VSTeamVersions]::ServiceFabricEndpoint = '5.0' - [VSTeamVersions]::ExtensionsManagement = '5.0' + [VSTeamVersions]::ServiceEndpoints = '5.0-preview' + [VSTeamVersions]::ExtensionsManagement = '5.0-preview' [VSTeamVersions]::Graph = '' [VSTeamVersions]::Policy = '5.0' + [VSTeamVersions]::ProcessDefinition = '5.1-preview' } - 'TFS2018' { + 'AzD2019U1' { + [VSTeamVersions]::Version = 'AzD2019' + [VSTeamVersions]::Git = '5.1' + [VSTeamVersions]::Core = '5.1' + [VSTeamVersions]::Build = '5.1' + [VSTeamVersions]::Release = '5.1' + [VSTeamVersions]::DistributedTask = '5.1-preview' + [VSTeamVersions]::VariableGroups = '5.1-preview' + [VSTeamVersions]::Tfvc = '5.1' + [VSTeamVersions]::Packaging = '5.1-preview' + [VSTeamVersions]::TaskGroups = '5.1-preview' + [VSTeamVersions]::MemberEntitlementManagement = '' + [VSTeamVersions]::ServiceEndpoints = '5.1-preview' + [VSTeamVersions]::ExtensionsManagement = '5.1-preview' + [VSTeamVersions]::Graph = '' + [VSTeamVersions]::Policy = '5.1' + [VSTeamVersions]::ProcessDefinition = '5.1-preview' + + } + { $_ -eq 'TFS2018' -or $_ -eq 'TFS2018U1' } { [VSTeamVersions]::Version = 'TFS2018' - [VSTeamVersions]::Git = '3.2' - [VSTeamVersions]::Core = '3.2' - [VSTeamVersions]::Build = '3.2' + [VSTeamVersions]::Git = '4.0' + [VSTeamVersions]::Core = '4.0' + [VSTeamVersions]::Build = '4.0' [VSTeamVersions]::Release = '4.0-preview' [VSTeamVersions]::DistributedTask = '4.0-preview' [VSTeamVersions]::VariableGroups = '4.0-preview' - [VSTeamVersions]::Tfvc = '3.2' - [VSTeamVersions]::Packaging = '' + [VSTeamVersions]::Tfvc = '4.0' + [VSTeamVersions]::Packaging = '4.0-preview' [VSTeamVersions]::TaskGroups = '4.0-preview' [VSTeamVersions]::MemberEntitlementManagement = '' - [VSTeamVersions]::ServiceFabricEndpoint = '3.2' - [VSTeamVersions]::ExtensionsManagement = '3.2-preview' + [VSTeamVersions]::ServiceEndpoints = '4.0-preview' + [VSTeamVersions]::ExtensionsManagement = '4.0-preview' [VSTeamVersions]::Graph = '' - [VSTeamVersions]::Policy = '' + [VSTeamVersions]::Policy = '4.0' + [VSTeamVersions]::ProcessDefinition = '4.0-preview' + } + { $_ -eq 'TFS2018U2' -or $_ -eq 'TFS2018U3' } { + [VSTeamVersions]::Version = 'TFS2018' + [VSTeamVersions]::Git = '4.1' + [VSTeamVersions]::Core = '4.1' + [VSTeamVersions]::Build = '4.1' + [VSTeamVersions]::Release = '4.1-preview' + [VSTeamVersions]::DistributedTask = '4.1-preview' + [VSTeamVersions]::VariableGroups = '4.1-preview' + [VSTeamVersions]::Tfvc = '4.1' + [VSTeamVersions]::Packaging = '4.1-preview' + [VSTeamVersions]::TaskGroups = '4.1-preview' + [VSTeamVersions]::MemberEntitlementManagement = '' + [VSTeamVersions]::ServiceEndpoints = '4.1-preview' + [VSTeamVersions]::ExtensionsManagement = '4.1-preview' + [VSTeamVersions]::Graph = '' + [VSTeamVersions]::Policy = '4.1' + [VSTeamVersions]::ProcessDefinition = '4.1-preview' } 'TFS2017' { [VSTeamVersions]::Version = 'TFS2017' @@ -104,35 +102,75 @@ function Set-VSTeamAPIVersion { [VSTeamVersions]::Build = '3.0' [VSTeamVersions]::Release = '3.0-preview' [VSTeamVersions]::DistributedTask = '3.0-preview' - [VSTeamVersions]::VariableGroups = '3.2-preview.1' + [VSTeamVersions]::VariableGroups = '' # Was introduced in Update 1 + [VSTeamVersions]::TaskGroups = '3.0-preview' + [VSTeamVersions]::ServiceEndpoints = '3.0-preview' [VSTeamVersions]::Tfvc = '3.0' - [VSTeamVersions]::Packaging = '' - [VSTeamVersions]::TaskGroups = '3.2-preview.1' + [VSTeamVersions]::Packaging = '3.0-preview' [VSTeamVersions]::MemberEntitlementManagement = '' - [VSTeamVersions]::ServiceFabricEndpoint = '' [VSTeamVersions]::ExtensionsManagement = '3.0-preview' [VSTeamVersions]::Graph = '' - [VSTeamVersions]::Policy = '' + [VSTeamVersions]::Policy = '3.0' + [VSTeamVersions]::ProcessDefinition = '3.0-preview' } + 'TFS2017U1' { + [VSTeamVersions]::Version = 'TFS2017' + [VSTeamVersions]::Git = '3.1' + [VSTeamVersions]::Core = '3.1' + [VSTeamVersions]::Build = '3.1' + [VSTeamVersions]::Release = '3.1-preview' + [VSTeamVersions]::DistributedTask = '3.1-preview' + [VSTeamVersions]::VariableGroups = '3.1-preview' # Resource of DistributedTask area + [VSTeamVersions]::TaskGroups = '3.1-preview' # Resource of DistributedTask area + [VSTeamVersions]::ServiceEndpoints = '3.1-preview' # The serviceendpoints resource of DistributedTask area + [VSTeamVersions]::Tfvc = '3.1' + [VSTeamVersions]::Packaging = '3.1-preview' + [VSTeamVersions]::MemberEntitlementManagement = '' # SubDomain vsaex + [VSTeamVersions]::ExtensionsManagement = '3.1-preview' # Actual area is extensionmanagement + [VSTeamVersions]::Graph = '' # SubDomain vssps + [VSTeamVersions]::Policy = '3.1' + [VSTeamVersions]::ProcessDefinition = '3.1-preview' + } + # Update 3 of TFS 2017 did not introduce a new API Version + { $_ -eq 'TFS2017U2' -or $_ -eq 'TFS2017U3' } { + [VSTeamVersions]::Version = 'TFS2017' + [VSTeamVersions]::Git = '3.2' + [VSTeamVersions]::Core = '3.2' + [VSTeamVersions]::Build = '3.2' + [VSTeamVersions]::Release = '3.2-preview' + [VSTeamVersions]::DistributedTask = '3.2-preview' + [VSTeamVersions]::VariableGroups = '3.2-preview' # Resource of DistributedTask area + [VSTeamVersions]::TaskGroups = '3.2-preview' # Resource of DistributedTask area + [VSTeamVersions]::ServiceEndpoints = '3.2-preview' # The serviceendpoints resource of DistributedTask area + [VSTeamVersions]::Tfvc = '3.2' + [VSTeamVersions]::Packaging = '3.2-preview' + [VSTeamVersions]::MemberEntitlementManagement = '' # SubDomain vsaex + [VSTeamVersions]::ExtensionsManagement = '3.2-preview' # Actual area is extensionmanagement + [VSTeamVersions]::Graph = '' # SubDomain vssps + [VSTeamVersions]::Policy = '3.2' + [VSTeamVersions]::ProcessDefinition = '3.2-preview' + } + # AZD, VSTS Default { [VSTeamVersions]::Version = $Target - [VSTeamVersions]::Git = '5.1-preview' - [VSTeamVersions]::Core = '5.0' - [VSTeamVersions]::Build = '5.1-preview' - [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]::TaskGroups = '5.1-preview.1' - [VSTeamVersions]::MemberEntitlementManagement = '5.1-preview' + [VSTeamVersions]::Git = '5.1' + [VSTeamVersions]::Core = '5.1' + [VSTeamVersions]::Build = '5.1' + [VSTeamVersions]::Release = '5.1' + [VSTeamVersions]::DistributedTask = '6.0-preview' + [VSTeamVersions]::VariableGroups = '6.0-preview' + [VSTeamVersions]::TaskGroups = '6.0-preview' + [VSTeamVersions]::Tfvc = '5.1' + [VSTeamVersions]::Packaging = '6.0-preview' # SubDoman feeds + [VSTeamVersions]::MemberEntitlementManagement = '6.0-preview' # This version is never passed to the API but is used to evaluate # if Service Fabric is enabled for the account. Just set it to # match Distributed Task for AzD - [VSTeamVersions]::ServiceFabricEndpoint = '5.0-preview' - [VSTeamVersions]::ExtensionsManagement = '5.1-preview' - [VSTeamVersions]::Graph = '5.1-preview' + [VSTeamVersions]::ServiceEndpoints = '5.0-preview' + [VSTeamVersions]::ExtensionsManagement = '6.0-preview' # SubDomain extmgmt + [VSTeamVersions]::Graph = '6.0-preview' # SubDomain vssps [VSTeamVersions]::Policy = '5.1' + [VSTeamVersions]::ProcessDefinition = '5.1-preview' #This may be valid for AzD2019 } } } @@ -149,8 +187,9 @@ function Set-VSTeamAPIVersion { Write-Verbose "Packaging: $(_getApiVersion Packaging)" Write-Verbose "TaskGroups: $([VSTeamVersions]::TaskGroups)" Write-Verbose "MemberEntitlementManagement: $([VSTeamVersions]::MemberEntitlementManagement)" - Write-Verbose "ServiceFabricEndpoint: $([VSTeamVersions]::ServiceFabricEndpoint)" + Write-Verbose "ServiceEndpoints: $([VSTeamVersions]::ServiceEndpoints)" Write-Verbose "ExtensionsManagement: $([VSTeamVersions]::ExtensionsManagement)" Write-Verbose "Graph: $([VSTeamVersions]::Graph)" Write-Verbose "Policy: $([VSTeamVersions]::Policy)" + Write-Verbose "ProcessDefinition: $([VSTeamVersions]::ProcessDefinition)" } \ No newline at end of file diff --git a/Source/Public/Set-VSTeamAccount.ps1 b/Source/Public/Set-VSTeamAccount.ps1 index 9b64192fa..779b17697 100644 --- a/Source/Public/Set-VSTeamAccount.ps1 +++ b/Source/Public/Set-VSTeamAccount.ps1 @@ -17,7 +17,7 @@ function Set-VSTeamAccount { [parameter(ParameterSetName = 'Windows')] [parameter(ParameterSetName = 'Secure')] [Parameter(ParameterSetName = 'Plain')] - [ValidateSet('TFS2017', 'TFS2018', 'AzD2019', 'VSTS', 'AzD')] + [ValidateSet('TFS2017', 'TFS2018', 'AzD2019', 'VSTS', 'AzD', 'TFS2017U1', 'TFS2017U2', 'TFS2017U3', 'TFS2018U1', 'TFS2018U2', 'TFS2018U3', 'AzD2019U1')] [string] $Version, [string] $Drive, diff --git a/Source/Public/Update-VSTeamExtension.ps1 b/Source/Public/Update-VSTeamExtension.ps1 index 348859e33..1105851f1 100644 --- a/Source/Public/Update-VSTeamExtension.ps1 +++ b/Source/Public/Update-VSTeamExtension.ps1 @@ -25,7 +25,7 @@ function Update-VSTeamExtension { $body = $obj | ConvertTo-Json - $resp = _callAPI -Method Patch -body $body -SubDomain 'extmgmt' -Resource 'extensionmanagement/installedextensions' -Version $(_getApiVersion ExtensionsManagement) -ContentType "application/json" + $resp = _callAPI -Method Patch -body $body -SubDomain 'extmgmt' -Area 'extensionmanagement' -Resource 'installedextensions' -Version $(_getApiVersion ExtensionsManagement) -ContentType "application/json" $item = [VSTeamExtension]::new($resp) diff --git a/Source/Public/Update-VSTeamServiceEndpoint.ps1 b/Source/Public/Update-VSTeamServiceEndpoint.ps1 index 3151f09a8..2a2c5e792 100644 --- a/Source/Public/Update-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Update-VSTeamServiceEndpoint.ps1 @@ -21,7 +21,7 @@ function Update-VSTeamServiceEndpoint { if ($Force -or $pscmdlet.ShouldProcess($id, "Update Service Endpoint")) { # Call the REST API $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' -Id $id ` - -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion DistributedTask) + -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion ServiceEndpoints) _trackServiceEndpointProgress -projectName $projectName -resp $resp -title 'Updating Service Endpoint' -msg "Updating $id" diff --git a/Source/VSTeam.psd1 b/Source/VSTeam.psd1 index 6ba33bf42..642b4e65b 100644 --- a/Source/VSTeam.psd1 +++ b/Source/VSTeam.psd1 @@ -12,7 +12,7 @@ RootModule = 'VSTeam.psm1' # Version number of this module. - ModuleVersion = '6.4.8' + ModuleVersion = '6.5.0' # Supported PSEditions CompatiblePSEditions = @('Core', 'Desktop') diff --git a/Source/VSTeam.psm1 b/Source/VSTeam.psm1 index d722c188b..14d09d904 100644 --- a/Source/VSTeam.psm1 +++ b/Source/VSTeam.psm1 @@ -10,16 +10,16 @@ . "$PSScriptRoot\vsteam.classes.ps1" . "$PSScriptRoot\vsteam.functions.ps1" +# Set the module version +[VSTeamVersions]::ModuleVersion = _getModuleVersion + +# Load the correct version of the environment variable +Set-VSTeamAPIVersion -Target $([VSTeamVersions]::Version) + # Check to see if the user stored the default project in an environment variable if ($null -ne $env:TEAM_PROJECT) { # Make sure the value in the environment variable still exisits. if (Get-VSTeamProject | Where-Object ProjectName -eq $env:TEAM_PROJECT) { Set-VSTeamDefaultProject -Project $env:TEAM_PROJECT } -} - -# Set the module version -[VSTeamVersions]::ModuleVersion = _getModuleVersion - -# Load the correct version of the environment variable -Set-VSTeamAPIVersion -Target $([VSTeamVersions]::Version) \ No newline at end of file +} \ No newline at end of file diff --git a/Source/en-US/VSTeam-Help.xml b/Source/en-US/VSTeam-Help.xml index 44aa3f17a..1f75d8958 100644 --- a/Source/en-US/VSTeam-Help.xml +++ b/Source/en-US/VSTeam-Help.xml @@ -7847,6 +7847,94 @@ ID Title Status + + + Get-VSTeamAPIVersion + Get + VSTeamAPIVersion + + Returns the versions of APIs used. + + + + Returns the versions of APIs used. + + + + Get-VSTeamAPIVersion + + Service + + Specifies the service to change. The acceptable values for this parameter are: + - Build + - Release + - Core + - Git + - DistributedTask + - Tfvc + - Packaging + - MemberEntitlementManagement + - ExtensionsManagement + - ServiceEndpoints + + String + + String + + + None + + + + + + Service + + Specifies the service to change. The acceptable values for this parameter are: + - Build + - Release + - Core + - Git + - DistributedTask + - Tfvc + - Packaging + - MemberEntitlementManagement + - ExtensionsManagement + - ServiceEndpoints + + String + + String + + + None + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Get-VSTeamAPIVersion + + This command gets the API versions currently in use. + + + + -------------------------- EXAMPLE 2 -------------------------- + PS C:\> Get-VSTeamAPIVersion -Service Release + + This command gets the version of the Release API currently in use. + + + + + Get-VSTeamApproval @@ -12625,6 +12713,30 @@ ID Title Status None + + Area + + Returns options for that area's APIs. + + String + + String + + + None + + + Resource + + Returns options for that resource's APIs. + + String + + String + + + None + @@ -12645,6 +12757,30 @@ ID Title Status None + + Area + + Returns options for that area's APIs. + + String + + String + + + None + + + Resource + + Returns options for that resource's APIs. + + String + + String + + + None + @@ -12675,6 +12811,20 @@ ID Title Status This will display all the versions of supported APIs for the release management service. + + -------------------------- EXAMPLE 4 -------------------------- + PS C:\> Get-VSTeamOption -Area core + + This will display all the versions of supported APIs for the area core. + + + + -------------------------- EXAMPLE 5 -------------------------- + PS C:\> Get-VSTeamOption -Area core -Resource teams + + This will display all the versions of supported APIs for resources teams under the area core. + + @@ -21373,8 +21523,15 @@ PS demo:\> Get-ChildItem Specifies the version to use. The acceptable values for this parameter are: - TFS2017 + - TFS2017U1 + - TFS2017U2 + - TFS2017U3 - TFS2018 + - TFS2018U1 + - TFS2018U2 + - TFS2018U3 - AzD2019 + - AzD2019U1 - VSTS - AzD @@ -21412,7 +21569,7 @@ PS demo:\> Get-ChildItem - Packaging - MemberEntitlementManagement - ExtensionsManagement - - ServiceFabricEndpoint + - ServiceEndpoints String @@ -21452,8 +21609,15 @@ PS demo:\> Get-ChildItem Specifies the version to use. The acceptable values for this parameter are: - TFS2017 + - TFS2017U1 + - TFS2017U2 + - TFS2017U3 - TFS2018 + - TFS2018U1 + - TFS2018U2 + - TFS2018U3 - AzD2019 + - AzD2019U1 - VSTS - AzD @@ -21477,7 +21641,7 @@ PS demo:\> Get-ChildItem - Packaging - MemberEntitlementManagement - ExtensionsManagement - - ServiceFabricEndpoint + - ServiceEndpoints String @@ -23482,6 +23646,168 @@ PS demo:\> Get-ChildItem + + + Stop-VSTeamBuild + Stop + VSTeamBuild + + Allows you to cancel a running build. + + + + Stop-VSTeamBuild will cancel a build using the build id. + + + + Stop-VSTeamBuild + + 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 + + String + + + None + + + Id + + The id of the build. + + Int32 + + Int32 + + + None + + + Confirm + + Prompts you for confirmation before running the function. + + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the function runs. The function is not run. + + + SwitchParameter + + + 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. + + String + + String + + + None + + + Id + + The id of the build. + + Int32 + + Int32 + + + None + + + Confirm + + Prompts you for confirmation before running the function. + + SwitchParameter + + SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the function runs. The function is not run. + + SwitchParameter + + SwitchParameter + + + False + + + + + + System.String + + + ProjectName + + + + + System.Int32 + + + BuildId + + + + + + + + + + + + -------------------------- EXAMPLE 1 -------------------------- + PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> Stop-VSTeamBuild -id 1 + + This example cancels the build with build id 1. + + + + -------------------------- EXAMPLE 3 -------------------------- + PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> $buildsToCancel = Get-VSTeamBuild -StatusFilter "inProgress" | where-object definitionName -eq Build-Defenition-Name +PS C:\> ForEach($build in $buildsToCancel) { Stop-VSTeamBuild -id $build.id } + + This example will find all builds with a status of "inProgress" and a defenitionName of "Build-Defenition-Name" and then cancel each of these builds. + + + + + Test-VSTeamMembership diff --git a/Source/en-US/about_vsteam.help.txt b/Source/en-US/about_vsteam.help.txt index 557da9c15..0c1fc9c43 100644 --- a/Source/en-US/about_vsteam.help.txt +++ b/Source/en-US/about_vsteam.help.txt @@ -3,7 +3,7 @@ TOPIC SHORT DESCRIPTION Provides access to your Azure DevOps (AzD) and Team - Foundation Server (TFS) from Mac, Linux and PC. + Foundation Server (TFS) from macOS, Linux and Windows. LONG DESCRIPTION Add an account using Set-VSTeamAccount and then you can call the rest of the @@ -18,48 +18,32 @@ LONG DESCRIPTION PS C:\> Get-VSTeamAPIVersion - Name Value - ---- ----- - Account https://dev.azure.com/test - DefaultProject - Version TFS2017 - Build 3.0 - Core 3.0 - Release 3.0-Preview - Git 3.0 - DistributedTask 3.0-Preview + Name Value + ---- ----- + ExtensionsManagement 3.0-preview + Git 3.0 + Version TFS2017 + Tfvc 3.0 + Policy 3.0 MemberEntitlementManagement - Packaging - - The following list shows the version name and where it is used. - · Build - · Build - · Build Definitions - · Core - · Processes - · Projects - · Team Members - · Teams - · DistributedTask - · Pools - · Queues - · Service Endpoints - · Git - · Git - · Release - · Approvals - · Release - · Release Definitions - + ServiceEndpoints 3.0-preview + DistributedTask 3.0-preview + Build 3.0 + Release 3.0-preview + Core 3.0 + Graph + VariableGroups + Packaging 3.0-preview + TaskGroups 3.0-preview To use different API versions you can update the version in the version table. PS C:\> Set-VSTeamAPIVersion -Service Build -Version '4.0' You can also use Set-VSTeamAPIVersion to set all the API versions for either - TFS2017, TFS2018, AzD2019 or AzD. TFS2017 is the default. + TFS2017, TFS2017U1, TFS2017U2, TFS2017U3, TFS2018, TFS2018U1, TFS2018U2, TFS2018U3, AzD2019, AzD2019U1 or AzD. TFS2017 is the default. - PS C:\> Set-VSTeamAPIVersion TFS2018 + PS C:\> Set-VSTeamAPIVersion TFS2018U3 EXAMPLES diff --git a/Source/formats/Team.Build.TableView.ps1xml b/Source/formats/Team.Build.TableView.ps1xml index 14a9fa177..a2c4465aa 100644 --- a/Source/formats/Team.Build.TableView.ps1xml +++ b/Source/formats/Team.Build.TableView.ps1xml @@ -6,7 +6,7 @@ Microsoft.PowerShell.SHiPS.SHiPSDirectory Team.Account - Team.Pool + Team.Provider.Pool Team.Queues Team.Pools Team.Provider.Pools diff --git a/Source/formats/Team.Option.TableView.ps1xml b/Source/formats/Team.Option.TableView.ps1xml index 1ad68f122..490030be3 100644 --- a/Source/formats/Team.Option.TableView.ps1xml +++ b/Source/formats/Team.Option.TableView.ps1xml @@ -7,15 +7,15 @@ Team.Option - - - - + + + + - + @@ -24,14 +24,14 @@ - - resourceName - area + + resourceName + - maxVersion + releasedVersion routeTemplate diff --git a/Source/formats/Team.Option.Versions.TableView.ps1xml b/Source/formats/Team.Option.Versions.TableView.ps1xml index 442343850..80c8ad08e 100644 --- a/Source/formats/Team.Option.Versions.TableView.ps1xml +++ b/Source/formats/Team.Option.Versions.TableView.ps1xml @@ -1,57 +1,57 @@ - - - Team.Option.Versions.TableView - - Team.Option - - - - - - - - - - - - - - - - - - - - - - - - - - - resourceName - - - area - - - minVersion - - - maxVersion - - - releasedVersion - - - resourceVersion - - - - - - - + + + Versions + + Team.Option + + + + + + + + + + + + + + + + + + + + + + + + + + + area + + + resourceName + + + releasedVersion + + + minVersion + + + maxVersion + + + resourceVersion + + + + + + + diff --git a/Source/formats/Team.Process.ListView.ps1xml b/Source/formats/Team.Process.ListView.ps1xml index 724665469..021d723e5 100644 --- a/Source/formats/Team.Process.ListView.ps1xml +++ b/Source/formats/Team.Process.ListView.ps1xml @@ -21,6 +21,12 @@ Description + + IsEnabled + + + IsDefault + diff --git a/Source/formats/Team.Process.TableView.ps1xml b/Source/formats/Team.Process.TableView.ps1xml index fe80c501a..164b018f8 100644 --- a/Source/formats/Team.Process.TableView.ps1xml +++ b/Source/formats/Team.Process.TableView.ps1xml @@ -12,6 +12,12 @@ + + + + + + @@ -23,6 +29,12 @@ Name + + IsEnabled + + + IsDefault + Description diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 22c2ae09e..e72108f69 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,6 +9,7 @@ resources: variables: Folder: 'dist' TEAM_CIBUILD: 'true' + PESTER_VERSION: '5.0.0-rc9' stages: - stage: Build diff --git a/docs/Add-VSTeam.md b/docs/Add-VSTeam.md index 6ca10e9c3..ba0104488 100644 --- a/docs/Add-VSTeam.md +++ b/docs/Add-VSTeam.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeam diff --git a/docs/Add-VSTeamAccessControlEntry.md b/docs/Add-VSTeamAccessControlEntry.md index e332f6deb..0205fe0de 100644 --- a/docs/Add-VSTeamAccessControlEntry.md +++ b/docs/Add-VSTeamAccessControlEntry.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamAccessControlEntry diff --git a/docs/Add-VSTeamArea.md b/docs/Add-VSTeamArea.md index 314c2d931..8551d1943 100644 --- a/docs/Add-VSTeamArea.md +++ b/docs/Add-VSTeamArea.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamArea diff --git a/docs/Add-VSTeamAzureRMServiceEndpoint.md b/docs/Add-VSTeamAzureRMServiceEndpoint.md index fdcdeb6ae..47cfcd0da 100644 --- a/docs/Add-VSTeamAzureRMServiceEndpoint.md +++ b/docs/Add-VSTeamAzureRMServiceEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamAzureRMServiceEndpoint diff --git a/docs/Add-VSTeamBuild.md b/docs/Add-VSTeamBuild.md index cfc0b1a7b..300f07b00 100644 --- a/docs/Add-VSTeamBuild.md +++ b/docs/Add-VSTeamBuild.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamBuild diff --git a/docs/Add-VSTeamBuildDefinition.md b/docs/Add-VSTeamBuildDefinition.md index 3eb90646c..9e6cc2d11 100644 --- a/docs/Add-VSTeamBuildDefinition.md +++ b/docs/Add-VSTeamBuildDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamBuildDefinition diff --git a/docs/Add-VSTeamBuildTag.md b/docs/Add-VSTeamBuildTag.md index c1badb7e1..af31e3a28 100644 --- a/docs/Add-VSTeamBuildTag.md +++ b/docs/Add-VSTeamBuildTag.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamBuildTag diff --git a/docs/Add-VSTeamClassificationNode.md b/docs/Add-VSTeamClassificationNode.md index d6465a769..fdcbe6fbf 100644 --- a/docs/Add-VSTeamClassificationNode.md +++ b/docs/Add-VSTeamClassificationNode.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamClassificationNode diff --git a/docs/Add-VSTeamExtension.md b/docs/Add-VSTeamExtension.md index 9927c09b0..9d9aa12c0 100644 --- a/docs/Add-VSTeamExtension.md +++ b/docs/Add-VSTeamExtension.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamExtension diff --git a/docs/Add-VSTeamFeed.md b/docs/Add-VSTeamFeed.md index 4280aa669..f98f65197 100644 --- a/docs/Add-VSTeamFeed.md +++ b/docs/Add-VSTeamFeed.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamFeed diff --git a/docs/Add-VSTeamGitRepository.md b/docs/Add-VSTeamGitRepository.md index 2b44b65bc..e64f2ee11 100644 --- a/docs/Add-VSTeamGitRepository.md +++ b/docs/Add-VSTeamGitRepository.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamGitRepository diff --git a/docs/Add-VSTeamGitRepositoryPermission.md b/docs/Add-VSTeamGitRepositoryPermission.md index e75a6af69..515f1c935 100644 --- a/docs/Add-VSTeamGitRepositoryPermission.md +++ b/docs/Add-VSTeamGitRepositoryPermission.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamGitRepositoryPermission diff --git a/docs/Add-VSTeamIteration.md b/docs/Add-VSTeamIteration.md index fdad5e55c..4506ef9cb 100644 --- a/docs/Add-VSTeamIteration.md +++ b/docs/Add-VSTeamIteration.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamIteration diff --git a/docs/Add-VSTeamKubernetesEndpoint.md b/docs/Add-VSTeamKubernetesEndpoint.md index 49b78f8da..32ad7256d 100644 --- a/docs/Add-VSTeamKubernetesEndpoint.md +++ b/docs/Add-VSTeamKubernetesEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamKubernetesEndpoint diff --git a/docs/Add-VSTeamMembership.md b/docs/Add-VSTeamMembership.md index b74ecf531..567a3b556 100644 --- a/docs/Add-VSTeamMembership.md +++ b/docs/Add-VSTeamMembership.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamMembership diff --git a/docs/Add-VSTeamNuGetEndpoint.md b/docs/Add-VSTeamNuGetEndpoint.md index 2476591e7..88ecd2b42 100644 --- a/docs/Add-VSTeamNuGetEndpoint.md +++ b/docs/Add-VSTeamNuGetEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamNuGetEndpoint diff --git a/docs/Add-VSTeamPolicy.md b/docs/Add-VSTeamPolicy.md index 520dfecc7..3237e1b66 100644 --- a/docs/Add-VSTeamPolicy.md +++ b/docs/Add-VSTeamPolicy.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamPolicy diff --git a/docs/Add-VSTeamProfile.md b/docs/Add-VSTeamProfile.md index cf659e58f..936131373 100644 --- a/docs/Add-VSTeamProfile.md +++ b/docs/Add-VSTeamProfile.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamProfile diff --git a/docs/Add-VSTeamProject.md b/docs/Add-VSTeamProject.md index 07ef0e2c9..72e31afb4 100644 --- a/docs/Add-VSTeamProject.md +++ b/docs/Add-VSTeamProject.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamProject diff --git a/docs/Add-VSTeamProjectPermission.md b/docs/Add-VSTeamProjectPermission.md index fbd549cd6..5118180da 100644 --- a/docs/Add-VSTeamProjectPermission.md +++ b/docs/Add-VSTeamProjectPermission.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamProjectPermission diff --git a/docs/Add-VSTeamPullRequest.md b/docs/Add-VSTeamPullRequest.md index 32bdf8264..01d19f975 100644 --- a/docs/Add-VSTeamPullRequest.md +++ b/docs/Add-VSTeamPullRequest.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamPullRequest diff --git a/docs/Add-VSTeamRelease.md b/docs/Add-VSTeamRelease.md index 6cec877fc..010bb9df0 100644 --- a/docs/Add-VSTeamRelease.md +++ b/docs/Add-VSTeamRelease.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamRelease diff --git a/docs/Add-VSTeamReleaseDefinition.md b/docs/Add-VSTeamReleaseDefinition.md index 3e6b5450d..3219ada5c 100644 --- a/docs/Add-VSTeamReleaseDefinition.md +++ b/docs/Add-VSTeamReleaseDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamReleaseDefinition diff --git a/docs/Add-VSTeamServiceEndpoint.md b/docs/Add-VSTeamServiceEndpoint.md index abe65e25b..a7af1f7c0 100644 --- a/docs/Add-VSTeamServiceEndpoint.md +++ b/docs/Add-VSTeamServiceEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamServiceEndpoint diff --git a/docs/Add-VSTeamServiceFabricEndpoint.md b/docs/Add-VSTeamServiceFabricEndpoint.md index 050db7110..de25605bd 100644 --- a/docs/Add-VSTeamServiceFabricEndpoint.md +++ b/docs/Add-VSTeamServiceFabricEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamServiceFabricEndpoint diff --git a/docs/Add-VSTeamSonarQubeEndpoint.md b/docs/Add-VSTeamSonarQubeEndpoint.md index cf3f9bb2d..111a5ca7b 100644 --- a/docs/Add-VSTeamSonarQubeEndpoint.md +++ b/docs/Add-VSTeamSonarQubeEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamSonarQubeEndpoint diff --git a/docs/Add-VSTeamTaskGroup.md b/docs/Add-VSTeamTaskGroup.md index ae0a51771..02367a7a7 100644 --- a/docs/Add-VSTeamTaskGroup.md +++ b/docs/Add-VSTeamTaskGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamTaskGroup diff --git a/docs/Add-VSTeamUserEntitlement.md b/docs/Add-VSTeamUserEntitlement.md index c0006bfb1..9288d501e 100644 --- a/docs/Add-VSTeamUserEntitlement.md +++ b/docs/Add-VSTeamUserEntitlement.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamUserEntitlement diff --git a/docs/Add-VSTeamVariableGroup.md b/docs/Add-VSTeamVariableGroup.md index a93fba250..a557d8941 100644 --- a/docs/Add-VSTeamVariableGroup.md +++ b/docs/Add-VSTeamVariableGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamVariableGroup diff --git a/docs/Add-VSTeamWorkItem.md b/docs/Add-VSTeamWorkItem.md index cd7607114..b236ffb42 100644 --- a/docs/Add-VSTeamWorkItem.md +++ b/docs/Add-VSTeamWorkItem.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamWorkItem diff --git a/docs/Add-VSTeamWorkItemAreaPermission.md b/docs/Add-VSTeamWorkItemAreaPermission.md index 9813fb44e..6f72f75f9 100644 --- a/docs/Add-VSTeamWorkItemAreaPermission.md +++ b/docs/Add-VSTeamWorkItemAreaPermission.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamWorkItemAreaPermission diff --git a/docs/Add-VSTeamWorkItemIterationPermission.md b/docs/Add-VSTeamWorkItemIterationPermission.md index 7093cb1ba..2cf53e853 100644 --- a/docs/Add-VSTeamWorkItemIterationPermission.md +++ b/docs/Add-VSTeamWorkItemIterationPermission.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Add-VSTeamWorkItemIterationPermission diff --git a/docs/Clear-VSTeamDefaultProject.md b/docs/Clear-VSTeamDefaultProject.md index 4125fae79..f2bf216a2 100644 --- a/docs/Clear-VSTeamDefaultProject.md +++ b/docs/Clear-VSTeamDefaultProject.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Clear-VSTeamDefaultProject diff --git a/docs/Disable-VSTeamAgent.md b/docs/Disable-VSTeamAgent.md index acf19d159..8a0535b79 100644 --- a/docs/Disable-VSTeamAgent.md +++ b/docs/Disable-VSTeamAgent.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Disable-VSTeamAgent diff --git a/docs/Enable-VSTeamAgent.md b/docs/Enable-VSTeamAgent.md index 18afda2ec..79e0800de 100644 --- a/docs/Enable-VSTeamAgent.md +++ b/docs/Enable-VSTeamAgent.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Enable-VSTeamAgent diff --git a/docs/Get-VSTeam.md b/docs/Get-VSTeam.md index 01e095a29..254f20b77 100644 --- a/docs/Get-VSTeam.md +++ b/docs/Get-VSTeam.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeam diff --git a/docs/Get-VSTeamAPIVersion.md b/docs/Get-VSTeamAPIVersion.md new file mode 100644 index 000000000..a8a9ae55e --- /dev/null +++ b/docs/Get-VSTeamAPIVersion.md @@ -0,0 +1,64 @@ + + + +# Get-VSTeamAPIVersion + +## SYNOPSIS + +Returns the versions of APIs used. + +## SYNTAX + +## DESCRIPTION + +Returns the versions of APIs used. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamAPIVersion +``` + +This command gets the API versions currently in use. + +### -------------------------- EXAMPLE 2 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamAPIVersion -Service Release +``` + +This command gets the version of the Release API currently in use. + +## PARAMETERS + +### -Service + +Specifies the service to change. The acceptable values for this parameter are: + +- Build +- Release +- Core +- Git +- DistributedTask +- Tfvc +- Packaging +- MemberEntitlementManagement +- ExtensionsManagement +- ServiceEndpoints + +```yaml +Type: String +Required: True +Parameter Sets: Service +``` + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + diff --git a/docs/Get-VSTeamAccessControlList.md b/docs/Get-VSTeamAccessControlList.md index 9266c73f6..cb3fe4746 100644 --- a/docs/Get-VSTeamAccessControlList.md +++ b/docs/Get-VSTeamAccessControlList.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamAccessControlList diff --git a/docs/Get-VSTeamAgent.md b/docs/Get-VSTeamAgent.md index b52bb1637..a297ed556 100644 --- a/docs/Get-VSTeamAgent.md +++ b/docs/Get-VSTeamAgent.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamAgent diff --git a/docs/Get-VSTeamApproval.md b/docs/Get-VSTeamApproval.md index 820a5561a..3299fabd0 100644 --- a/docs/Get-VSTeamApproval.md +++ b/docs/Get-VSTeamApproval.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamApproval diff --git a/docs/Get-VSTeamArea.md b/docs/Get-VSTeamArea.md index 040b226cb..9b1c6f45c 100644 --- a/docs/Get-VSTeamArea.md +++ b/docs/Get-VSTeamArea.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamArea diff --git a/docs/Get-VSTeamBuild.md b/docs/Get-VSTeamBuild.md index ee42e8dd1..fa01de31b 100644 --- a/docs/Get-VSTeamBuild.md +++ b/docs/Get-VSTeamBuild.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamBuild diff --git a/docs/Get-VSTeamBuildArtifact.md b/docs/Get-VSTeamBuildArtifact.md index 08898341d..19e6b2d20 100644 --- a/docs/Get-VSTeamBuildArtifact.md +++ b/docs/Get-VSTeamBuildArtifact.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamBuildArtifact diff --git a/docs/Get-VSTeamBuildDefinition.md b/docs/Get-VSTeamBuildDefinition.md index 8a3cab894..c05a42f17 100644 --- a/docs/Get-VSTeamBuildDefinition.md +++ b/docs/Get-VSTeamBuildDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamBuildDefinition diff --git a/docs/Get-VSTeamBuildLog.md b/docs/Get-VSTeamBuildLog.md index 49ca05696..12803d43b 100644 --- a/docs/Get-VSTeamBuildLog.md +++ b/docs/Get-VSTeamBuildLog.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamBuildLog diff --git a/docs/Get-VSTeamBuildTag.md b/docs/Get-VSTeamBuildTag.md index 863da41c3..eba4df34b 100644 --- a/docs/Get-VSTeamBuildTag.md +++ b/docs/Get-VSTeamBuildTag.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamBuildTag diff --git a/docs/Get-VSTeamBuildTimeline.md b/docs/Get-VSTeamBuildTimeline.md index 7797b04fe..1551cc5cd 100644 --- a/docs/Get-VSTeamBuildTimeline.md +++ b/docs/Get-VSTeamBuildTimeline.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamBuildTimeline diff --git a/docs/Get-VSTeamClassificationNode.md b/docs/Get-VSTeamClassificationNode.md index ca5fad700..0f89069d6 100644 --- a/docs/Get-VSTeamClassificationNode.md +++ b/docs/Get-VSTeamClassificationNode.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamClassificationNode diff --git a/docs/Get-VSTeamCloudSubscription.md b/docs/Get-VSTeamCloudSubscription.md index e5090e4ba..9b2107949 100644 --- a/docs/Get-VSTeamCloudSubscription.md +++ b/docs/Get-VSTeamCloudSubscription.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamCloudSubscription diff --git a/docs/Get-VSTeamDescriptor.md b/docs/Get-VSTeamDescriptor.md index 63d700f15..5dd7ce05e 100644 --- a/docs/Get-VSTeamDescriptor.md +++ b/docs/Get-VSTeamDescriptor.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamDescriptor diff --git a/docs/Get-VSTeamExtension.md b/docs/Get-VSTeamExtension.md index c0573ca3d..19ad614e5 100644 --- a/docs/Get-VSTeamExtension.md +++ b/docs/Get-VSTeamExtension.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamExtension diff --git a/docs/Get-VSTeamFeed.md b/docs/Get-VSTeamFeed.md index d3c468d41..b5e691cde 100644 --- a/docs/Get-VSTeamFeed.md +++ b/docs/Get-VSTeamFeed.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamFeed diff --git a/docs/Get-VSTeamGitCommit.md b/docs/Get-VSTeamGitCommit.md index b7b6cc386..592227059 100644 --- a/docs/Get-VSTeamGitCommit.md +++ b/docs/Get-VSTeamGitCommit.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamGitCommit diff --git a/docs/Get-VSTeamGitRef.md b/docs/Get-VSTeamGitRef.md index 58546e4e9..028f9ab9d 100644 --- a/docs/Get-VSTeamGitRef.md +++ b/docs/Get-VSTeamGitRef.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamGitRef diff --git a/docs/Get-VSTeamGitRepository.md b/docs/Get-VSTeamGitRepository.md index ff1d15244..04f7a908b 100644 --- a/docs/Get-VSTeamGitRepository.md +++ b/docs/Get-VSTeamGitRepository.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamGitRepository diff --git a/docs/Get-VSTeamGitStat.md b/docs/Get-VSTeamGitStat.md index 6b04ad397..af10cfca1 100644 --- a/docs/Get-VSTeamGitStat.md +++ b/docs/Get-VSTeamGitStat.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamGitStat diff --git a/docs/Get-VSTeamGroup.md b/docs/Get-VSTeamGroup.md index 0607f38e8..16b175d04 100644 --- a/docs/Get-VSTeamGroup.md +++ b/docs/Get-VSTeamGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamGroup diff --git a/docs/Get-VSTeamInfo.md b/docs/Get-VSTeamInfo.md index deb75c654..8ca5b9b91 100644 --- a/docs/Get-VSTeamInfo.md +++ b/docs/Get-VSTeamInfo.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamInfo diff --git a/docs/Get-VSTeamIteration.md b/docs/Get-VSTeamIteration.md index 37b7a3d59..8d9c2e199 100644 --- a/docs/Get-VSTeamIteration.md +++ b/docs/Get-VSTeamIteration.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamIteration diff --git a/docs/Get-VSTeamJobRequest.md b/docs/Get-VSTeamJobRequest.md index 245661b6d..fc1b4f756 100644 --- a/docs/Get-VSTeamJobRequest.md +++ b/docs/Get-VSTeamJobRequest.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamJobRequest diff --git a/docs/Get-VSTeamMember.md b/docs/Get-VSTeamMember.md index 460740f36..ba726863a 100644 --- a/docs/Get-VSTeamMember.md +++ b/docs/Get-VSTeamMember.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamMember diff --git a/docs/Get-VSTeamMembership.md b/docs/Get-VSTeamMembership.md index 13e046209..d76f36ae2 100644 --- a/docs/Get-VSTeamMembership.md +++ b/docs/Get-VSTeamMembership.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamMembership diff --git a/docs/Get-VSTeamOption.md b/docs/Get-VSTeamOption.md index 807979e65..bffddc428 100644 --- a/docs/Get-VSTeamOption.md +++ b/docs/Get-VSTeamOption.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamOption @@ -49,6 +45,22 @@ PS C:\> Get-VSTeamOption -SubDomain vsrm This will display all the versions of supported APIs for the release management service. +### -------------------------- EXAMPLE 4 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamOption -Area core +``` + +This will display all the versions of supported APIs for the area core. + +### -------------------------- EXAMPLE 5 -------------------------- + +```PowerShell +PS C:\> Get-VSTeamOption -Area core -Resource teams +``` + +This will display all the versions of supported APIs for resources teams under the area core. + ## PARAMETERS ### -SubDomain @@ -66,6 +78,24 @@ Type: String Required: false ``` +### -Area + +Returns options for that area's APIs. + +```yaml +Type: String +Required: false +``` + +### -Resource + +Returns options for that resource's APIs. + +```yaml +Type: String +Required: false +``` + ## INPUTS ## OUTPUTS diff --git a/docs/Get-VSTeamPermissionInheritance.md b/docs/Get-VSTeamPermissionInheritance.md index 5ce223366..4d539f965 100644 --- a/docs/Get-VSTeamPermissionInheritance.md +++ b/docs/Get-VSTeamPermissionInheritance.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamPermissionInheritance diff --git a/docs/Get-VSTeamPolicy.md b/docs/Get-VSTeamPolicy.md index 579bed545..48df2eef0 100644 --- a/docs/Get-VSTeamPolicy.md +++ b/docs/Get-VSTeamPolicy.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamPolicy diff --git a/docs/Get-VSTeamPolicyType.md b/docs/Get-VSTeamPolicyType.md index ddd31a2b9..01912346e 100644 --- a/docs/Get-VSTeamPolicyType.md +++ b/docs/Get-VSTeamPolicyType.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamPolicyType diff --git a/docs/Get-VSTeamPool.md b/docs/Get-VSTeamPool.md index 95c36b9c3..2929aea46 100644 --- a/docs/Get-VSTeamPool.md +++ b/docs/Get-VSTeamPool.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamPool diff --git a/docs/Get-VSTeamProcess.md b/docs/Get-VSTeamProcess.md index 299f97ece..e99a8d483 100644 --- a/docs/Get-VSTeamProcess.md +++ b/docs/Get-VSTeamProcess.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamProcess diff --git a/docs/Get-VSTeamProfile.md b/docs/Get-VSTeamProfile.md index 922382794..50b532ff7 100644 --- a/docs/Get-VSTeamProfile.md +++ b/docs/Get-VSTeamProfile.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamProfile diff --git a/docs/Get-VSTeamProject.md b/docs/Get-VSTeamProject.md index d5a713e3d..871c33f10 100644 --- a/docs/Get-VSTeamProject.md +++ b/docs/Get-VSTeamProject.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamProject diff --git a/docs/Get-VSTeamPullRequest.md b/docs/Get-VSTeamPullRequest.md index e83876145..faabf6f92 100644 --- a/docs/Get-VSTeamPullRequest.md +++ b/docs/Get-VSTeamPullRequest.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamPullRequest diff --git a/docs/Get-VSTeamQueue.md b/docs/Get-VSTeamQueue.md index d3f65acd1..f4eee4816 100644 --- a/docs/Get-VSTeamQueue.md +++ b/docs/Get-VSTeamQueue.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamQueue diff --git a/docs/Get-VSTeamRelease.md b/docs/Get-VSTeamRelease.md index a0e749ed8..02f6b7e73 100644 --- a/docs/Get-VSTeamRelease.md +++ b/docs/Get-VSTeamRelease.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamRelease diff --git a/docs/Get-VSTeamReleaseDefinition.md b/docs/Get-VSTeamReleaseDefinition.md index f00a57575..03c741d36 100644 --- a/docs/Get-VSTeamReleaseDefinition.md +++ b/docs/Get-VSTeamReleaseDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamReleaseDefinition diff --git a/docs/Get-VSTeamResourceArea.md b/docs/Get-VSTeamResourceArea.md index 492e51cc2..7a0d2d149 100644 --- a/docs/Get-VSTeamResourceArea.md +++ b/docs/Get-VSTeamResourceArea.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamResourceArea diff --git a/docs/Get-VSTeamSecurityNamespace.md b/docs/Get-VSTeamSecurityNamespace.md index e49277776..e7cf9d280 100644 --- a/docs/Get-VSTeamSecurityNamespace.md +++ b/docs/Get-VSTeamSecurityNamespace.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamSecurityNamespace diff --git a/docs/Get-VSTeamServiceEndpoint.md b/docs/Get-VSTeamServiceEndpoint.md index f8a2a5e14..4d5238a1c 100644 --- a/docs/Get-VSTeamServiceEndpoint.md +++ b/docs/Get-VSTeamServiceEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamServiceEndpoint diff --git a/docs/Get-VSTeamServiceEndpointType.md b/docs/Get-VSTeamServiceEndpointType.md index 53c2fb313..863f34383 100644 --- a/docs/Get-VSTeamServiceEndpointType.md +++ b/docs/Get-VSTeamServiceEndpointType.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamServiceEndpointType diff --git a/docs/Get-VSTeamTaskGroup.md b/docs/Get-VSTeamTaskGroup.md index a1534a146..4d70e0dca 100644 --- a/docs/Get-VSTeamTaskGroup.md +++ b/docs/Get-VSTeamTaskGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamTaskGroup diff --git a/docs/Get-VSTeamTfvcBranch.md b/docs/Get-VSTeamTfvcBranch.md index 94818a1a5..503830def 100644 --- a/docs/Get-VSTeamTfvcBranch.md +++ b/docs/Get-VSTeamTfvcBranch.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamTfvcBranch diff --git a/docs/Get-VSTeamTfvcRootBranch.md b/docs/Get-VSTeamTfvcRootBranch.md index 553179763..ccfa156f9 100644 --- a/docs/Get-VSTeamTfvcRootBranch.md +++ b/docs/Get-VSTeamTfvcRootBranch.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamTfvcRootBranch diff --git a/docs/Get-VSTeamUser.md b/docs/Get-VSTeamUser.md index ac1c152f7..30c42bb24 100644 --- a/docs/Get-VSTeamUser.md +++ b/docs/Get-VSTeamUser.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamUser diff --git a/docs/Get-VSTeamUserEntitlement.md b/docs/Get-VSTeamUserEntitlement.md index f5abb1f5f..e90649013 100644 --- a/docs/Get-VSTeamUserEntitlement.md +++ b/docs/Get-VSTeamUserEntitlement.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamUserEntitlement diff --git a/docs/Get-VSTeamVariableGroup.md b/docs/Get-VSTeamVariableGroup.md index b3e9a0c34..4e4fb00d9 100644 --- a/docs/Get-VSTeamVariableGroup.md +++ b/docs/Get-VSTeamVariableGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamVariableGroup diff --git a/docs/Get-VSTeamWiql.md b/docs/Get-VSTeamWiql.md index a40369427..25a052207 100644 --- a/docs/Get-VSTeamWiql.md +++ b/docs/Get-VSTeamWiql.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamWiqlItem diff --git a/docs/Get-VSTeamWorkItem.md b/docs/Get-VSTeamWorkItem.md index 1e2ac3dc0..d211bedaf 100644 --- a/docs/Get-VSTeamWorkItem.md +++ b/docs/Get-VSTeamWorkItem.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamWorkItem diff --git a/docs/Get-VSTeamWorkItemType.md b/docs/Get-VSTeamWorkItemType.md index e648df961..9adc3fd62 100644 --- a/docs/Get-VSTeamWorkItemType.md +++ b/docs/Get-VSTeamWorkItemType.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Get-VSTeamWorkItemType diff --git a/docs/Invoke-VSTeamRequest.md b/docs/Invoke-VSTeamRequest.md index 7a09e05ed..d96b0352e 100644 --- a/docs/Invoke-VSTeamRequest.md +++ b/docs/Invoke-VSTeamRequest.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Invoke-VSTeamRequest diff --git a/docs/Remove-VSTeam.md b/docs/Remove-VSTeam.md index 39b973453..2fc68f000 100644 --- a/docs/Remove-VSTeam.md +++ b/docs/Remove-VSTeam.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeam diff --git a/docs/Remove-VSTeamAccessControlEntry.md b/docs/Remove-VSTeamAccessControlEntry.md index 5ab84657c..f01b2b264 100644 --- a/docs/Remove-VSTeamAccessControlEntry.md +++ b/docs/Remove-VSTeamAccessControlEntry.md @@ -1,10 +1,6 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamAccessControlEntry diff --git a/docs/Remove-VSTeamAccessControlList.md b/docs/Remove-VSTeamAccessControlList.md index 3dace287b..618328047 100644 --- a/docs/Remove-VSTeamAccessControlList.md +++ b/docs/Remove-VSTeamAccessControlList.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamAccessControlList diff --git a/docs/Remove-VSTeamAccount.md b/docs/Remove-VSTeamAccount.md index 7274adef0..9935e2957 100644 --- a/docs/Remove-VSTeamAccount.md +++ b/docs/Remove-VSTeamAccount.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamAccount diff --git a/docs/Remove-VSTeamAgent.md b/docs/Remove-VSTeamAgent.md index fde2254da..200da853d 100644 --- a/docs/Remove-VSTeamAgent.md +++ b/docs/Remove-VSTeamAgent.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamAgent diff --git a/docs/Remove-VSTeamArea.md b/docs/Remove-VSTeamArea.md index 50d796fb2..b718e5af1 100644 --- a/docs/Remove-VSTeamArea.md +++ b/docs/Remove-VSTeamArea.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamArea diff --git a/docs/Remove-VSTeamBuild.md b/docs/Remove-VSTeamBuild.md index 027638f53..fba9d923b 100644 --- a/docs/Remove-VSTeamBuild.md +++ b/docs/Remove-VSTeamBuild.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamBuild diff --git a/docs/Remove-VSTeamBuildDefinition.md b/docs/Remove-VSTeamBuildDefinition.md index b977c1bdf..4d5c84e08 100644 --- a/docs/Remove-VSTeamBuildDefinition.md +++ b/docs/Remove-VSTeamBuildDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamBuildDefinition diff --git a/docs/Remove-VSTeamBuildTag.md b/docs/Remove-VSTeamBuildTag.md index 4e9257d82..f26d0d858 100644 --- a/docs/Remove-VSTeamBuildTag.md +++ b/docs/Remove-VSTeamBuildTag.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamBuildTag diff --git a/docs/Remove-VSTeamClassificationNode.md b/docs/Remove-VSTeamClassificationNode.md index b9c15919a..d5e922f26 100644 --- a/docs/Remove-VSTeamClassificationNode.md +++ b/docs/Remove-VSTeamClassificationNode.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamClassificationNode diff --git a/docs/Remove-VSTeamExtension.md b/docs/Remove-VSTeamExtension.md index 8ece31b92..8a8a29af0 100644 --- a/docs/Remove-VSTeamExtension.md +++ b/docs/Remove-VSTeamExtension.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamExtension diff --git a/docs/Remove-VSTeamFeed.md b/docs/Remove-VSTeamFeed.md index 383db578e..086dd8bfd 100644 --- a/docs/Remove-VSTeamFeed.md +++ b/docs/Remove-VSTeamFeed.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamFeed diff --git a/docs/Remove-VSTeamGitRepository.md b/docs/Remove-VSTeamGitRepository.md index cf5b14243..648bab054 100644 --- a/docs/Remove-VSTeamGitRepository.md +++ b/docs/Remove-VSTeamGitRepository.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamGitRepository diff --git a/docs/Remove-VSTeamIteration.md b/docs/Remove-VSTeamIteration.md index baab50984..49b5c2c92 100644 --- a/docs/Remove-VSTeamIteration.md +++ b/docs/Remove-VSTeamIteration.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamIteration diff --git a/docs/Remove-VSTeamMembership.md b/docs/Remove-VSTeamMembership.md index 99254d56b..fc9a9fd3e 100644 --- a/docs/Remove-VSTeamMembership.md +++ b/docs/Remove-VSTeamMembership.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamMembership diff --git a/docs/Remove-VSTeamPolicy.md b/docs/Remove-VSTeamPolicy.md index 0304f6d70..c51fc3165 100644 --- a/docs/Remove-VSTeamPolicy.md +++ b/docs/Remove-VSTeamPolicy.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamPolicy diff --git a/docs/Remove-VSTeamProfile.md b/docs/Remove-VSTeamProfile.md index 4966ea339..9536ac859 100644 --- a/docs/Remove-VSTeamProfile.md +++ b/docs/Remove-VSTeamProfile.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamProfile diff --git a/docs/Remove-VSTeamProject.md b/docs/Remove-VSTeamProject.md index 03b2c809b..9b1536231 100644 --- a/docs/Remove-VSTeamProject.md +++ b/docs/Remove-VSTeamProject.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamProject diff --git a/docs/Remove-VSTeamRelease.md b/docs/Remove-VSTeamRelease.md index efd5eb638..453ced42d 100644 --- a/docs/Remove-VSTeamRelease.md +++ b/docs/Remove-VSTeamRelease.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamRelease diff --git a/docs/Remove-VSTeamReleaseDefinition.md b/docs/Remove-VSTeamReleaseDefinition.md index f2c068ae4..5c5448bfd 100644 --- a/docs/Remove-VSTeamReleaseDefinition.md +++ b/docs/Remove-VSTeamReleaseDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamReleaseDefinition diff --git a/docs/Remove-VSTeamServiceEndpoint.md b/docs/Remove-VSTeamServiceEndpoint.md index 636294704..1d8eb91f0 100644 --- a/docs/Remove-VSTeamServiceEndpoint.md +++ b/docs/Remove-VSTeamServiceEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamServiceEndpoint diff --git a/docs/Remove-VSTeamTaskGroup.md b/docs/Remove-VSTeamTaskGroup.md index 0e032e272..041cfe034 100644 --- a/docs/Remove-VSTeamTaskGroup.md +++ b/docs/Remove-VSTeamTaskGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamTaskGroup diff --git a/docs/Remove-VSTeamUserEntitlement.md b/docs/Remove-VSTeamUserEntitlement.md index 1a9be5c1f..a67e2711f 100644 --- a/docs/Remove-VSTeamUserEntitlement.md +++ b/docs/Remove-VSTeamUserEntitlement.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamUserEntitlement diff --git a/docs/Remove-VSTeamVariableGroup.md b/docs/Remove-VSTeamVariableGroup.md index 9da721311..0240967c5 100644 --- a/docs/Remove-VSTeamVariableGroup.md +++ b/docs/Remove-VSTeamVariableGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamVariableGroup diff --git a/docs/Remove-VSTeamWorkItem.md b/docs/Remove-VSTeamWorkItem.md index 780a585b5..f318f9718 100644 --- a/docs/Remove-VSTeamWorkItem.md +++ b/docs/Remove-VSTeamWorkItem.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Remove-VSTeamWorkItem diff --git a/docs/Set-VSTeamAPIVersion.md b/docs/Set-VSTeamAPIVersion.md index bf45add9b..9de444e14 100644 --- a/docs/Set-VSTeamAPIVersion.md +++ b/docs/Set-VSTeamAPIVersion.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Set-VSTeamAPIVersion @@ -42,8 +38,15 @@ This command sets the version of the Release calls to 5.0. Specifies the version to use. The acceptable values for this parameter are: - TFS2017 +- TFS2017U1 +- TFS2017U2 +- TFS2017U3 - TFS2018 +- TFS2018U1 +- TFS2018U2 +- TFS2018U3 - AzD2019 +- AzD2019U1 - VSTS - AzD @@ -68,7 +71,7 @@ Specifies the service to change. The acceptable values for this parameter are: - Packaging - MemberEntitlementManagement - ExtensionsManagement -- ServiceFabricEndpoint +- ServiceEndpoints ```yaml Type: String diff --git a/docs/Set-VSTeamAccount.md b/docs/Set-VSTeamAccount.md index fa541ab14..d738c2c62 100644 --- a/docs/Set-VSTeamAccount.md +++ b/docs/Set-VSTeamAccount.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Set-VSTeamAccount diff --git a/docs/Set-VSTeamAlias.md b/docs/Set-VSTeamAlias.md index 89bd50db9..ae026453e 100644 --- a/docs/Set-VSTeamAlias.md +++ b/docs/Set-VSTeamAlias.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Set-VSTeamAlias diff --git a/docs/Set-VSTeamApproval.md b/docs/Set-VSTeamApproval.md index e1da0b38b..78f7fd846 100644 --- a/docs/Set-VSTeamApproval.md +++ b/docs/Set-VSTeamApproval.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Set-VSTeamApproval diff --git a/docs/Set-VSTeamDefaultProject.md b/docs/Set-VSTeamDefaultProject.md index 4ce8f93a5..00a9fe1f8 100644 --- a/docs/Set-VSTeamDefaultProject.md +++ b/docs/Set-VSTeamDefaultProject.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Set-VSTeamDefaultProject diff --git a/docs/Set-VSTeamEnvironmentStatus.md b/docs/Set-VSTeamEnvironmentStatus.md index d89cc14f1..3086e1f7c 100644 --- a/docs/Set-VSTeamEnvironmentStatus.md +++ b/docs/Set-VSTeamEnvironmentStatus.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Set-VSTeamEnvironmentStatus diff --git a/docs/Set-VSTeamPermissionInheritance.md b/docs/Set-VSTeamPermissionInheritance.md index b3c682582..f3f7b6362 100644 --- a/docs/Set-VSTeamPermissionInheritance.md +++ b/docs/Set-VSTeamPermissionInheritance.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Set-VSTeamPermissionInheritance diff --git a/docs/Set-VSTeamReleaseStatus.md b/docs/Set-VSTeamReleaseStatus.md index f5f90a202..cfc05a98c 100644 --- a/docs/Set-VSTeamReleaseStatus.md +++ b/docs/Set-VSTeamReleaseStatus.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Set-VSTeamReleaseStatus diff --git a/docs/Show-VSTeam.md b/docs/Show-VSTeam.md index 8d58c1d68..76cfe9df3 100644 --- a/docs/Show-VSTeam.md +++ b/docs/Show-VSTeam.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeam diff --git a/docs/Show-VSTeamApproval.md b/docs/Show-VSTeamApproval.md index ca6539d33..a71308711 100644 --- a/docs/Show-VSTeamApproval.md +++ b/docs/Show-VSTeamApproval.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamApproval diff --git a/docs/Show-VSTeamBuild.md b/docs/Show-VSTeamBuild.md index 3a26d12bd..e797f54a3 100644 --- a/docs/Show-VSTeamBuild.md +++ b/docs/Show-VSTeamBuild.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamBuild diff --git a/docs/Show-VSTeamBuildDefinition.md b/docs/Show-VSTeamBuildDefinition.md index acdb23969..236f76e4a 100644 --- a/docs/Show-VSTeamBuildDefinition.md +++ b/docs/Show-VSTeamBuildDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamBuildDefinition diff --git a/docs/Show-VSTeamFeed.md b/docs/Show-VSTeamFeed.md index 83c7d12bc..f0ada0c09 100644 --- a/docs/Show-VSTeamFeed.md +++ b/docs/Show-VSTeamFeed.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamFeed diff --git a/docs/Show-VSTeamGitRepository.md b/docs/Show-VSTeamGitRepository.md index 53e31c100..534e3ae0a 100644 --- a/docs/Show-VSTeamGitRepository.md +++ b/docs/Show-VSTeamGitRepository.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamGitRepository diff --git a/docs/Show-VSTeamProject.md b/docs/Show-VSTeamProject.md index a9b2a822a..5d890ef8a 100644 --- a/docs/Show-VSTeamProject.md +++ b/docs/Show-VSTeamProject.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamProject diff --git a/docs/Show-VSTeamPullRequest.md b/docs/Show-VSTeamPullRequest.md index a596cd012..7f21f8bf8 100644 --- a/docs/Show-VSTeamPullRequest.md +++ b/docs/Show-VSTeamPullRequest.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamPullRequest diff --git a/docs/Show-VSTeamRelease.md b/docs/Show-VSTeamRelease.md index 146aeee5a..28ed507fa 100644 --- a/docs/Show-VSTeamRelease.md +++ b/docs/Show-VSTeamRelease.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamRelease diff --git a/docs/Show-VSTeamReleaseDefinition.md b/docs/Show-VSTeamReleaseDefinition.md index abb8653fa..ace66c307 100644 --- a/docs/Show-VSTeamReleaseDefinition.md +++ b/docs/Show-VSTeamReleaseDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamReleaseDefinition diff --git a/docs/Show-VSTeamWorkItem.md b/docs/Show-VSTeamWorkItem.md index e289f6d49..c6a067fb4 100644 --- a/docs/Show-VSTeamWorkItem.md +++ b/docs/Show-VSTeamWorkItem.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Show-VSTeamWorkItem diff --git a/docs/Stop-VSTeamBuild.md b/docs/Stop-VSTeamBuild.md new file mode 100644 index 000000000..284008a2a --- /dev/null +++ b/docs/Stop-VSTeamBuild.md @@ -0,0 +1,108 @@ + + + +# Stop-VSTeamBuild + +## SYNOPSIS + +Allows you to cancel a running build. + +## SYNTAX + +## DESCRIPTION + +Stop-VSTeamBuild will cancel a build using the build id. + +## EXAMPLES + +### -------------------------- EXAMPLE 1 -------------------------- + +```PowerShell +PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> Stop-VSTeamBuild -id 1 +``` + +This example cancels the build with build id 1. + +### -------------------------- EXAMPLE 3 -------------------------- + +```PowerShell +PS C:\> Set-VSTeamDefaultProject Demo +PS C:\> $buildsToCancel = Get-VSTeamBuild -StatusFilter "inProgress" | where-object definitionName -eq Build-Defenition-Name +PS C:\> ForEach($build in $buildsToCancel) { Stop-VSTeamBuild -id $build.id } +``` + +This example will find all builds with a status of "inProgress" and a defenitionName of "Build-Defenition-Name" and then cancel each of these builds. + +## 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) +``` + +### -Id + +The id of the build. + +```yaml +Type: Int32 +Aliases: BuildID +Required: True +Accept pipeline input: true (ByPropertyName, ByValue) +``` + +### -Confirm + +Prompts you for confirmation before running the function. + +```yaml +Type: SwitchParameter +Required: false +Position: Named +Accept pipeline input: false +Parameter Sets: (All) +Aliases: cf +``` + +### -WhatIf + +Shows what would happen if the function runs. +The function is not run. + +```yaml +Type: SwitchParameter +Required: false +Position: Named +Accept pipeline input: false +Parameter Sets: (All) +Aliases: wi +``` + +## INPUTS + +### System.String + +ProjectName + +### System.Int32 + +BuildId + +## OUTPUTS + +## NOTES + +## RELATED LINKS + diff --git a/docs/Team.md b/docs/Team.md index 4d1e5a858..84f677901 100644 --- a/docs/Team.md +++ b/docs/Team.md @@ -168,6 +168,10 @@ Return a list of access control lists for the specified security namespace and t Returns the agents in a pool. +### [Get-VSTeamAPIVersion](Get-VSTeamAPIVersion.md) + +Returns the versions of APIs used. + ### [Get-VSTeamApproval](Get-VSTeamApproval.md) Gets a list of approvals for all releases for a team project. @@ -546,6 +550,10 @@ Opens the release definitions for a team project in the default browser. Opens the work item in the default browser. +### [Stop-VSTeamBuild](Stop-VSTeamBuild.md) + +Allows you to cancel a running build. + ### [Test-VSTeamMembership](Test-VSTeamMembership.md) Tests the membership in a container. diff --git a/docs/Test-VSTeamMembership.md b/docs/Test-VSTeamMembership.md index 186835b18..ead26c43f 100644 --- a/docs/Test-VSTeamMembership.md +++ b/docs/Test-VSTeamMembership.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Test-VSTeamMembership diff --git a/docs/Test-VSTeamYamlPipeline.md b/docs/Test-VSTeamYamlPipeline.md index 8b9687596..2b39dbf6c 100644 --- a/docs/Test-VSTeamYamlPipeline.md +++ b/docs/Test-VSTeamYamlPipeline.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Test-VSTeamYamlPipeline diff --git a/docs/Update-VSTeam.md b/docs/Update-VSTeam.md index 74e99021b..1ccb48005 100644 --- a/docs/Update-VSTeam.md +++ b/docs/Update-VSTeam.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeam diff --git a/docs/Update-VSTeamAgent.md b/docs/Update-VSTeamAgent.md index 5d43c3d00..09102087e 100644 --- a/docs/Update-VSTeamAgent.md +++ b/docs/Update-VSTeamAgent.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamAgent diff --git a/docs/Update-VSTeamBuild.md b/docs/Update-VSTeamBuild.md index 7e4d97bcd..498f866e8 100644 --- a/docs/Update-VSTeamBuild.md +++ b/docs/Update-VSTeamBuild.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamBuild diff --git a/docs/Update-VSTeamBuildDefinition.md b/docs/Update-VSTeamBuildDefinition.md index 7e2b311bf..dad6bb20e 100644 --- a/docs/Update-VSTeamBuildDefinition.md +++ b/docs/Update-VSTeamBuildDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamBuildDefinition diff --git a/docs/Update-VSTeamExtension.md b/docs/Update-VSTeamExtension.md index 66bdf9b05..5a37906ce 100644 --- a/docs/Update-VSTeamExtension.md +++ b/docs/Update-VSTeamExtension.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamExtension diff --git a/docs/Update-VSTeamPolicy.md b/docs/Update-VSTeamPolicy.md index 781a16d86..9b1f5fc90 100644 --- a/docs/Update-VSTeamPolicy.md +++ b/docs/Update-VSTeamPolicy.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamPolicy diff --git a/docs/Update-VSTeamProfile.md b/docs/Update-VSTeamProfile.md index b35e8d6d5..306a93b69 100644 --- a/docs/Update-VSTeamProfile.md +++ b/docs/Update-VSTeamProfile.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamProfile diff --git a/docs/Update-VSTeamProject.md b/docs/Update-VSTeamProject.md index cbc8d197b..65b3e0627 100644 --- a/docs/Update-VSTeamProject.md +++ b/docs/Update-VSTeamProject.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamProject diff --git a/docs/Update-VSTeamPullRequest.md b/docs/Update-VSTeamPullRequest.md index eb70b51ad..eb869af82 100644 --- a/docs/Update-VSTeamPullRequest.md +++ b/docs/Update-VSTeamPullRequest.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamPullRequest diff --git a/docs/Update-VSTeamRelease.md b/docs/Update-VSTeamRelease.md index b56517f06..ac732bb78 100644 --- a/docs/Update-VSTeamRelease.md +++ b/docs/Update-VSTeamRelease.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamRelease diff --git a/docs/Update-VSTeamReleaseDefinition.md b/docs/Update-VSTeamReleaseDefinition.md index b29ca4a05..abb83a208 100644 --- a/docs/Update-VSTeamReleaseDefinition.md +++ b/docs/Update-VSTeamReleaseDefinition.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamReleaseDefinition diff --git a/docs/Update-VSTeamServiceEndpoint.md b/docs/Update-VSTeamServiceEndpoint.md index 8ebe62909..f0be7d288 100644 --- a/docs/Update-VSTeamServiceEndpoint.md +++ b/docs/Update-VSTeamServiceEndpoint.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamServiceEndpoint diff --git a/docs/Update-VSTeamTaskGroup.md b/docs/Update-VSTeamTaskGroup.md index 8912ac497..af061c3f1 100644 --- a/docs/Update-VSTeamTaskGroup.md +++ b/docs/Update-VSTeamTaskGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamTaskGroup diff --git a/docs/Update-VSTeamUserEntitlement.md b/docs/Update-VSTeamUserEntitlement.md index 212131ebb..18e18ef06 100644 --- a/docs/Update-VSTeamUserEntitlement.md +++ b/docs/Update-VSTeamUserEntitlement.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamUserEntitlement diff --git a/docs/Update-VSTeamVariableGroup.md b/docs/Update-VSTeamVariableGroup.md index 1b329a9c2..bd21279cb 100644 --- a/docs/Update-VSTeamVariableGroup.md +++ b/docs/Update-VSTeamVariableGroup.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamVariableGroup diff --git a/docs/Update-VSTeamWorkItem.md b/docs/Update-VSTeamWorkItem.md index c9e3c7413..8bee49818 100644 --- a/docs/Update-VSTeamWorkItem.md +++ b/docs/Update-VSTeamWorkItem.md @@ -1,9 +1,5 @@ ---- -external help file: VSTeam-Help.xml -Module Name: VSTeam -online version: -schema: 2.0.0 ---- + + # Update-VSTeamWorkItem diff --git a/docs/readme.md b/docs/readme.md index ce5f5a335..27767ca7c 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -173,6 +173,10 @@ Return a list of access control lists for the specified security namespace and t Returns the agents in a pool. +### [Get-VSTeamAPIVersion](Get-VSTeamAPIVersion.md) + +Returns the versions of APIs used. + ### [Get-VSTeamApproval](Get-VSTeamApproval.md) Gets a list of approvals for all releases for a team project. @@ -551,6 +555,10 @@ Opens the release definitions for a team project in the default browser. Opens the work item in the default browser. +### [Stop-VSTeamBuild](Stop-VSTeamBuild.md) + +Allows you to cancel a running build. + ### [Test-VSTeamMembership](Test-VSTeamMembership.md) Tests the membership in a container. diff --git a/integration/README.md b/integration/README.md index de10d8b31..da7adb804 100644 --- a/integration/README.md +++ b/integration/README.md @@ -1,9 +1,8 @@ # Running Integration tests -**THESE TEST ARE DESTRUCTIVE. USE AN EMPTY ACCOUNT.** +Many of the tests require a project to run. The naming of the files is used to ensure the tests that create the project can be run before the others. Nevertheless, in the BeforeAll of each file you can search for an existing project with 'Project for VSTeam integration testing.' as the description. If you find it you can use that project. If you don't your tests should create it's own project with that description. - Install SonarQube extension -- Use an empty account to run the integration tests - Set the following Environment variables. - `$env:ACCT = VSTS` Account Name or full TFS URL including collection - `$env:API_VERSION = TFS2017` or TFS2018 / AzD2019 for on-prem versions, or VSTS for the Service variant, depending on the value used for ACCT diff --git a/integration/test/000_team.Tests.ps1 b/integration/test/000_team.Tests.ps1 index 49923e578..e4df8211d 100644 --- a/integration/test/000_team.Tests.ps1 +++ b/integration/test/000_team.Tests.ps1 @@ -1,33 +1,44 @@ Set-StrictMode -Version Latest -############################################################## -# THESE TEST ARE DESTRUCTIVE. USE AN EMPTY ACCOUNT. # -############################################################## -# Before running these tests you must set the following # -# Environment variables. # -# $env:API_VERSION = TFS2017, TFS2018, AzD2019 or VSTS # -# depending on the value used for ACCT # -# $env:EMAIL = Email of user to remove and re-add to account # -# $env:ACCT = VSTS Account Name or full TFS URL including # -# collection # -# $env:PAT = Personal Access token of ACCT # -############################################################## -# THESE TEST ARE DESTRUCTIVE. USE AN EMPTY ACCOUNT. # -############################################################## - - Describe 'Team' -Tag 'integration' { BeforeAll { - Set-VSTeamAPIVersion -Target $env:API_VERSION $pat = $env:PAT $acct = $env:ACCT $api = $env:API_VERSION + + Set-VSTeamAPIVersion -Target $env:API_VERSION Set-VSTeamAccount -a $acct -pe $pat -version $api - ############################################################## - # THIS DELETES ALL EXISTING TEAM PROJECTS!!!! # - ############################################################## - Get-VSTeamProject | Remove-VSTeamProject -Force + # See if there are any existing projects. If so use the + # first one as the expected project name. If there are none + # simply use MyProject + $expectedProjectName = Get-VSTeamProject | Select-Object -First 1 -ExpandProperty Name + + if (-not $expectedProjectName) { + $expectedProjectName = 'MyProject' + } + } + + Context 'Set-VSTeamDefaultProject' { + It 'should set default project' { + Set-VSTeamDefaultProject -Project $expectedProjectName + + $info = Get-VSTeamInfo + + $info.DefaultProject | Should -Be $expectedProjectName + } + } + + Context 'Clear-VSTeamDefaultProject' { + It 'should clear default project' { + Set-VSTeamDefaultProject -Project $expectedProjectName + + Clear-VSTeamDefaultProject + + $info = Get-VSTeamInfo + + $info.DefaultProject | Should -BeNullOrEmpty + } } Context 'Get-VSTeamInfo' { @@ -35,7 +46,7 @@ Describe 'Team' -Tag 'integration' { # Set-VSTeamAccount is set in the Before All # so just set the default project here # Arrange - Set-VSTeamDefaultProject -Project 'MyProject' + Set-VSTeamDefaultProject -Project $expectedProjectName # Act $info = Get-VSTeamInfo @@ -53,7 +64,7 @@ Describe 'Team' -Tag 'integration' { } It 'should return default project' { - $info.DefaultProject | Should -Be "MyProject" + $info.DefaultProject | Should -Be $expectedProjectName } } diff --git a/integration/test/010_projects.Tests.ps1 b/integration/test/010_projects.Tests.ps1 index 366031105..0676094ab 100644 --- a/integration/test/010_projects.Tests.ps1 +++ b/integration/test/010_projects.Tests.ps1 @@ -1,20 +1,5 @@ Set-StrictMode -Version Latest -############################################################## -# THESE TEST ARE DESTRUCTIVE. USE AN EMPTY ACCOUNT. # -############################################################## -# Before running these tests you must set the following # -# Environment variables. # -# $env:API_VERSION = TFS2017, TFS2018, AzD2019 or VSTS # -# depending on the value used for ACCT # -# $env:EMAIL = Email of user to remove and re-add to account # -# $env:ACCT = VSTS Account Name or full TFS URL including # -# collection # -# $env:PAT = Personal Access token of ACCT # -############################################################## -# THESE TEST ARE DESTRUCTIVE. USE AN EMPTY ACCOUNT. # -############################################################## - Describe 'VSTeam Integration Tests' -Tag 'integration' { BeforeAll { Set-VSTeamAPIVersion -Target $env:API_VERSION @@ -23,9 +8,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $acct = $env:ACCT $email = $env:EMAIL $api = $env:API_VERSION - $projectName = 'TeamModuleIntegration' + [guid]::NewGuid().toString().substring(0, 5) - $newProjectName = $projectName + [guid]::NewGuid().toString().substring(0, 5) + '1' - + $originalLocation = Get-Location $search = "*$acct*" @@ -43,8 +26,22 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $oName = $profile.Name } + Remove-VSTeamProfile -Name intTests -Force Add-VSTeamProfile -Account $acct -PersonalAccessToken $pat -Version $api -Name intTests - Set-VSTeamAccount -Profile intTests -Drive int + Set-VSTeamAccount -Profile intTests + + $projectDescription = 'Project for VSTeam integration testing.' + $projectName = 'TeamModuleIntegration-' + [guid]::NewGuid().toString().substring(0, 5) + $newProjectName = $projectName + [guid]::NewGuid().toString().substring(0, 5) + '1' + + $existingProject = $(Get-VSTeamProject | Where-Object Description -eq $projectDescription) + + if ($existingProject) { + $projectName = $existingProject.Name + } + else { + Add-VSTeamProject -Name $projectName -Description $projectDescription | Should -Not -Be $null + } } AfterAll { @@ -57,36 +54,6 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Set-VSTeamDefaultProject' { - It 'should set default project' { - Set-VSTeamDefaultProject -Project 'MyProject' - - $info = Get-VSTeamInfo - - $info.DefaultProject | Should -Be 'MyProject' - } - - It 'should update default project' { - Set-VSTeamDefaultProject -Project $newProjectName - - $info = Get-VSTeamInfo - - $info.DefaultProject | Should -Be $newProjectName - } - } - - Context 'Clear-VSTeamDefaultProject' { - It 'should clear default project' { - Set-VSTeamDefaultProject -Project 'MyProject' - - Clear-VSTeamDefaultProject - - $info = Get-VSTeamInfo - - $info.DefaultProject | Should -BeNullOrEmpty - } - } - Context 'Profile full exercise' { It 'Get-VSTeamProfile' { Get-VSTeamProfile inttests | Should -Not -Be $null @@ -98,49 +65,21 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } Context 'Project full exercise' { - It 'Add-VSTeamProject Should create project' { - Add-VSTeamProject -Name $projectName | Should -Not -Be $null - } - It 'Get-VSTeamProject Should return projects' { Get-VSTeamProject -Name $projectName -IncludeCapabilities | Should -Not -Be $null } It 'Update-VSTeamProject Should update description' { - Update-VSTeamProject -Name $projectName -NewDescription 'Test Description' -Force + Update-VSTeamProject -Name $projectName -NewDescription $projectDescription -Force - Get-VSTeamProject -Name $projectName | Select-Object -ExpandProperty 'Description' | Should -Be 'Test Description' + Get-VSTeamProject -Name $projectName | Select-Object -ExpandProperty 'Description' | Should -Be $projectDescription } It 'Update-VSTeamProject Should update name' { Update-VSTeamProject -Name $projectName -NewName $newProjectName -Force - Get-VSTeamProject -Name $newProjectName | Select-Object -ExpandProperty 'Description' | Should -Be 'Test Description' - } - } - - Context 'PS Drive full exercise' { - BeforeAll { - New-PSDrive -Name int -PSProvider SHiPS -Root 'VSTeam#VSTeamAccount' - $actual = Set-Location int: -PassThru - } - - It 'Should be able to mount drive' { - $actual | Should -Not -Be $null - } - - It 'Should list projects' { - Get-ChildItem | Should -Not -Be $null - } - - It 'Should list Builds, Releases and Teams' { - Set-Location $newProjectName - Get-ChildItem | Should -Not -Be $null - } - - It 'Should list Teams' { - Set-Location 'Teams' - Get-ChildItem | Should -Not -Be $null + # Calling Get-VSTeamProject with new name verifies the name was changed. + Get-VSTeamProject -Name $newProjectName | Select-Object -ExpandProperty 'Description' | Should -Be $projectDescription } } @@ -151,12 +90,14 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { It 'Add-VSTeamGitRepository Should create repository' { Add-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' + (Get-VSTeamGitRepository -ProjectName $newProjectName).Count | Should -Be 2 Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' | Select-Object -ExpandProperty Name | Should -Be 'testing' } It 'Remove-VSTeamGitRepository Should delete repository' { Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' | Select-Object -ExpandProperty Id | Remove-VSTeamGitRepository -Force + Get-VSTeamGitRepository -ProjectName $newProjectName | Where-Object { $_.Name -eq 'testing' } | Should -Be $null } } @@ -191,6 +132,10 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $srcBuildDef | ConvertTo-Json -Depth 10 | Set-Content -Path $tmpBuildDef2 } + AfterAll { + Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'CI' | Remove-VSTeamGitRepository -Force + } + It 'Add-VSTeamBuildDefinition should add a build definition' { Add-VSTeamBuildDefinition -ProjectName $newProjectName -InFile $tmpBuildDef1 $buildDef = Get-VSTeamBuildDefinition -ProjectName $newProjectName @@ -308,81 +253,120 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Simple Variable Group' { - BeforeAll { - $variableGroupName = "TestVariableGroup1" - $variableGroupUpdatedName = "TestVariableGroup2" - } - It 'Add-VSTeamVariableGroup Should add a variable group' { - $parameters = @{ - ProjectName = $newProjectName - Name = $variableGroupName - Description = "A test variable group" - Variables = @{ - key1 = @{ - value = "value1" - } - key2 = @{ - value = "value2" - isSecret = $true + if ($(Get-VSTeamAPIVersion -Service VariableGroups) -ne '') { + # Only run these tests on versions that support the API + Context 'Simple Variable Group' { + BeforeAll { + $variableGroupName = "TestVariableGroup1" + $variableGroupUpdatedName = "TestVariableGroup2" + } + + It 'Add-VSTeamVariableGroup Should add a variable group' { + $parameters = @{ + ProjectName = $newProjectName + Name = $variableGroupName + Description = "A test variable group" + Variables = @{ + key1 = @{ + value = "value1" + } + key2 = @{ + value = "value2" + isSecret = $true + } } } - } - if ($api -ne 'TFS2017') { - $parameters.Add("Type", "Vsts") - } - - $newVariableGroup = Add-VSTeamVariableGroup @parameters - $newVariableGroup | Should -Not -Be $null - } + if ($api -ne 'TFS2017') { + $parameters.Add("Type", "Vsts") + } - It 'Get-VSTeamVariableGroup Should get the variable group created first by list then by id' { - $existingVariableGroups = , (Get-VSTeamVariableGroup -ProjectName $newProjectName) - $existingVariableGroups.Count | Should -BeGreaterThan 0 + $newVariableGroup = Add-VSTeamVariableGroup @parameters + $newVariableGroup | Should -Not -Be $null + } - $newVariableGroup = ($existingVariableGroups | Where-Object { $_.Name -eq $variableGroupName }) - $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 -BeGreaterThan 0 - $existingVariableGroup = Get-VSTeamVariableGroup -ProjectName $newProjectName -Id $newVariableGroup.Id - $existingVariableGroup | Should -Not -Be $null - } + $newVariableGroup = ($existingVariableGroups | Where-Object { $_.Name -eq $variableGroupName }) + $newVariableGroup | 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 + $existingVariableGroup = Get-VSTeamVariableGroup -ProjectName $newProjectName -Id $newVariableGroup.Id + $existingVariableGroup | Should -Not -Be $null + } - $parameters = @{ - ProjectName = $newProjectName - Id = $newVariableGroup.Id - Name = $variableGroupUpdatedName - Description = "A test variable group update" - Variables = @{ - key3 = @{ - value = "value3" + It 'Update-VSTeamVariableGroup Should update the variable group' { + $newVariableGroup = (Get-VSTeamVariableGroup -ProjectName $newProjectName | Where-Object { $_.Name -eq $variableGroupName }) + $newVariableGroup | Should -Not -Be $null + + $parameters = @{ + ProjectName = $newProjectName + Id = $newVariableGroup.Id + Name = $variableGroupUpdatedName + Description = "A test variable group update" + Variables = @{ + key3 = @{ + value = "value3" + } } } + if ($api -ne 'TFS2017') { + $parameters.Add("Type", "Vsts") + } + + $updatedVariableGroup = Update-VSTeamVariableGroup @parameters + $updatedVariableGroup | Should -Not -Be $null } - if ($api -ne 'TFS2017') { - $parameters.Add("Type", "Vsts") + + It 'Remove-VSTeamVariableGroup Should remove the variable group' { + $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 } + } + } + + Context 'Policy full exercise' { + BeforeAll { + $actualTypes = Get-VSTeamPolicyType -ProjectName $newProjectName + } + + It 'Should return all policy types' { + $actualTypes | Should -Not -Be $null + } + + It 'Should add Policy' { + $typeId = $($actualTypes | Where-Object displayName -eq 'Minimum number of reviewers' | Select-Object -ExpandProperty id) + $repoId = $(Get-VSTeamGitRepository -ProjectName $newProjectName -Name $newProjectName | Select-Object -ExpandProperty Id) + + Add-VSTeamPolicy -ProjectName $newProjectName -type $typeId -enabled -blocking -settings @{MinimumApproverCount = 1; Scope = @(@{repositoryId = $repoId; matchKind = "Exact"; refName = "refs/heads/master" }) } + + $newPolicy = Get-VSTeamPolicy -ProjectName $newProjectName + + $newPolicy | Should -Not -Be $null + $newPolicy.settings.minimumApproverCount | Should -Be 1 + } - $updatedVariableGroup = Update-VSTeamVariableGroup @parameters - $updatedVariableGroup | Should -Not -Be $null + It 'Should update Policy' { + $newPolicy = Get-VSTeamPolicy -ProjectName $newProjectName + $typeId = $($actualTypes | Where-Object displayName -eq 'Minimum number of reviewers' | Select-Object -ExpandProperty id) + $newPolicy = Update-VSTeamPolicy -id $newPolicy.Id -ProjectName $newProjectName -type $typeId -enabled -blocking -settings @{MinimumApproverCount = 2; Scope = @(@{repositoryId = $repoId; matchKind = "Exact"; refName = "refs/heads/master" }) } + + $newPolicy.settings.minimumApproverCount | Should -Be 2 } - It 'Remove-VSTeamVariableGroup Should remove the variable group' { - $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 + It 'Should remove Policy' { + $newPolicy = Get-VSTeamPolicy -ProjectName $newProjectName + Remove-VSTeamPolicy -id $newPolicy.Id -ProjectName $newProjectName + + Get-VSTeamPolicy -ProjectName $newProjectName | Should -Be $null } } Context 'Service Endpoints full exercise' { - It 'Add-VSTeamSonarQubeEndpoint Should add service endpoint' { - { Add-VSTeamSonarQubeEndpoint -ProjectName $newProjectName -EndpointName 'TestSonarQube' ` - -SonarQubeURl 'http://sonarqube.somewhereIn.cloudapp.azure.com:9000' -PersonalAccessToken 'Faketoken' } | Should -Not -Throw + BeforeAll { + $newProjectName = $(Get-VSTeamProject | Where-Object Description -eq $projectDescription) } - It 'Add-VSTeamAzureRMServiceEndpoint Should add service endpoint' { { Add-VSTeamAzureRMServiceEndpoint -ProjectName $newProjectName -displayName 'AzureEndoint' ` -subscriptionId '00000000-0000-0000-0000-000000000000' -subscriptionTenantId '00000000-0000-0000-0000-000000000000' ` @@ -392,7 +376,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { It 'Get-VSTeamServiceEndpoint Should return service endpoints' { $actual = Get-VSTeamServiceEndpoint -ProjectName $newProjectName - $actual.Count | Should -Be 2 + $actual | Should -Not -Be $null } It 'Remove-VSTeamServiceEndpoint Should delete service endpoints' { @@ -400,20 +384,6 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { Get-VSTeamServiceEndpoint -ProjectName $newProjectName | Should -Be $null } - - # Not supported on TFS 2017 - if ($env:API_VERSION -ne 'TFS2017') { - It 'Add-VSTeamServiceFabricEndpoint Should add service endpoint' { - { Add-VSTeamServiceFabricEndpoint -ProjectName $newProjectName -endpointName 'ServiceFabricTestEndoint' ` - -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false } | Should -Not -Be $null - } - } - else { - It 'Add-VSTeamServiceFabricEndpoint not supported on TFS2017 Should throw' { - { Add-VSTeamServiceFabricEndpoint -ProjectName $newProjectName -endpointName 'ServiceFabricTestEndoint' ` - -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false } | Should -Throw - } - } } # Not supported on TFS @@ -453,10 +423,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { (Get-VSTeamUserEntitlement).Count | Should -Be 3 } } - } - - # Not supported on TFS - if (-not ($env:ACCT -like "http://*")) { + Context 'Feed exercise' { BeforeAll { $FeedName = 'TeamModuleIntegration' + [guid]::NewGuid().toString().substring(0, 5) @@ -484,10 +451,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { Get-VSTeamFeed | Where-Object name -eq $FeedName | Should -Be $null } } - } - - # Not supported on TFS - if (-not ($env:ACCT -like "http://*")) { + Context 'Access control list' { It 'Get-VSTeamAccessControlList should return without error' { $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList) | Should -Not -Be $null @@ -558,21 +522,5 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $info.DefaultProject | Should -BeNullOrEmpty } - - It 'Remove-VSTeamProject Should remove Project' { - Set-VSTeamAPIVersion $env:API_VERSION - - # I have noticed that if the delete happens too soon you will get a - # 400 response and told to try again later. So this test needs to be - # retried. We need to wait a minute after the rename before we try - # and delete - Start-Sleep -Seconds 60 - - Remove-VSTeamProject -ProjectName $newProjectName -Force - } - - It 'Remove-VSTeamAccount Should remove account' { - Remove-VSTeamAccount - } } } \ No newline at end of file diff --git a/integration/test/020_.psDrive.Tests.ps1 b/integration/test/020_.psDrive.Tests.ps1 new file mode 100644 index 000000000..dd531451b --- /dev/null +++ b/integration/test/020_.psDrive.Tests.ps1 @@ -0,0 +1,58 @@ +Describe "PS Drive Full exercise" { + BeforeAll { + Set-VSTeamAPIVersion -Target $env:API_VERSION + + $pat = $env:PAT + $acct = $env:ACCT + $email = $env:EMAIL + $api = $env:API_VERSION + + $projectDescription = 'Project for VSTeam integration testing.' + $newProjectName = 'TeamModuleIntegration-' + [guid]::NewGuid().toString().substring(0, 5) + + $originalLocation = Get-Location + + Set-VSTeamAccount -Account $acct -PersonalAccessToken $pat -Version $api -Drive int + + $existingProject = $(Get-VSTeamProject | Where-Object Description -eq $projectDescription) + + if($existingProject) { + $newProjectName = $existingProject.Name + } else { + Add-VSTeamProject -Name $newProjectName -Description $projectDescription | Should -Not -Be $null + } + } + + Context 'PS Drive full exercise' { + BeforeAll { + New-PSDrive -Name int -PSProvider SHiPS -Root 'VSTeam#VSTeamAccount' + $actual = Set-Location int: -PassThru + } + + It 'Should be able to mount drive' { + $actual | Should -Not -Be $null + } + + It 'Should list projects' { + $projects = Get-ChildItem + $projects | Should -Not -Be $null + } + + It 'Should list Builds, Releases and Teams' { + Set-Location $newProjectName + $projectChildren = Get-ChildItem + $projectChildren | Should -Not -Be $null + } + + It 'Should list Teams' { + Set-Location 'Teams' + $teamsChildren = Get-ChildItem + $teamsChildren | Should -Not -Be $null + } + } + + AfterAll { + # Put everything back + Set-Location $originalLocation + } +} \ No newline at end of file diff --git a/integration/test/030_VSTeamExtension.Tests.ps1 b/integration/test/030_VSTeamExtension.Tests.ps1 new file mode 100644 index 000000000..da26c1574 --- /dev/null +++ b/integration/test/030_VSTeamExtension.Tests.ps1 @@ -0,0 +1,40 @@ +Describe "VSTeamExtension" { + BeforeAll { + Set-VSTeamAPIVersion -Target $env:API_VERSION + + $pat = $env:PAT + $acct = $env:ACCT + $email = $env:EMAIL + $api = $env:API_VERSION + + $projectDescription = 'Project for VSTeam integration testing.' + $newProjectName = 'TeamModuleIntegration' + [guid]::NewGuid().toString().substring(0, 5) + + $originalLocation = Get-Location + + Set-VSTeamAccount -Account $acct -PersonalAccessToken $pat -Version $api + + $existingProject = $(Get-VSTeamProject | Where-Object Description -eq $projectDescription) + + if ($existingProject) { + $newProjectName = $existingProject.Name + } + else { + Add-VSTeamProject -Name $newProjectName -Description $projectDescription | Should -Not -Be $null + } + } + + Context 'Add-VSTeamExtension' { + It 'Should add SonarQube Extension' { + $actual = Add-VSTeamExtension -PublisherId 'sonarsource' -ExtensionId 'sonarqube' + + $($actual | Where-Object name -eq SonarQube) | Should -Not -Be $null + } + + It 'Should remove SonarQube Extension' { + $actual = Remove-VSTeamExtension -PublisherId sonarsource -ExtensionId sonarqube -Force + + $($actual | Where-Object name -eq SonarQube) | Should -Be $null + } + } +} \ No newline at end of file diff --git a/integration/test/999_VSTeam-RemoveProject.Tests.ps1 b/integration/test/999_VSTeam-RemoveProject.Tests.ps1 new file mode 100644 index 000000000..19a2e42bf --- /dev/null +++ b/integration/test/999_VSTeam-RemoveProject.Tests.ps1 @@ -0,0 +1,42 @@ +Describe "VSTeamProject" { + BeforeAll { + Set-VSTeamAPIVersion -Target $env:API_VERSION + + $pat = $env:PAT + $acct = $env:ACCT + $email = $env:EMAIL + $api = $env:API_VERSION + + $projectDescription = 'Project for VSTeam integration testing.' + $newProjectName = 'TeamModuleIntegration-' + [guid]::NewGuid().toString().substring(0, 5) + + Set-VSTeamAccount -Account $acct -PersonalAccessToken $pat -Version $api + + $existingProject = $(Get-VSTeamProject | Where-Object Description -eq $projectDescription) + + if ($existingProject) { + $newProjectName = $existingProject.Name + } + else { + Add-VSTeamProject -Name $newProjectName -Description $projectDescription | Should -Not -Be $null + } + } + + Context 'Remove-VSTeamProject' { + It 'should remove Project' { + Set-VSTeamAPIVersion $env:API_VERSION + + # I have noticed that if the delete happens too soon you will get a + # 400 response and told to try again later. So this test needs to be + # retried. We need to wait a minute after the rename before we try + # and delete + Start-Sleep -Seconds 15 + + Get-VSTeamProject -Name $newProjectName | Remove-VSTeamProject -Force + + Start-Sleep -Seconds 15 + + $(Get-VSTeamProject | Where-Object name -eq $newProjectName) | Should -Be $null + } + } +} \ No newline at end of file diff --git a/unit/test/Add-VSTeam.Tests.ps1 b/unit/test/Add-VSTeam.Tests.ps1 index 359399b56..969cd4e95 100644 --- a/unit/test/Add-VSTeam.Tests.ps1 +++ b/unit/test/Add-VSTeam.Tests.ps1 @@ -5,7 +5,7 @@ Describe "VSTeam" { Import-Module SHiPS $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - + . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" . "$PSScriptRoot/../../Source/Private/common.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamTeam.ps1" diff --git a/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 b/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 index d7a20aa96..7b3026276 100644 --- a/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 +++ b/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 @@ -20,7 +20,7 @@ Describe 'VSTeamKubernetesEndpoint' { Mock _hasProjectCacheExpired { return $false } Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } Mock Write-Progress Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } diff --git a/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 b/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 index ed5ef4575..6f3251b5d 100644 --- a/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 +++ b/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 @@ -22,7 +22,7 @@ Describe 'VSTeamNuGetEndpoint' { Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } Mock Write-Progress Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } diff --git a/unit/test/Add-VSTeamProject.Tests.ps1 b/unit/test/Add-VSTeamProject.Tests.ps1 index 647ef71df..ae769128b 100644 --- a/unit/test/Add-VSTeamProject.Tests.ps1 +++ b/unit/test/Add-VSTeamProject.Tests.ps1 @@ -9,6 +9,7 @@ Describe 'VSTeamProject' { . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" + . "$PSScriptRoot/../../Source/Classes/VSTeamProcess.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" @@ -61,6 +62,13 @@ Describe 'VSTeamProject' { Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } + Mock _callApi -ParameterFilter {$area -eq 'work' -and $resource -eq 'processes'} -MockWith { + return @{value = @( + @{name = 'Agile'; Typeid = '00000000-0000-0000-0000-000000000001' }, + @{name = 'CMMI' ; Typeid = '00000000-0000-0000-0000-000000000002' }, + @{name = 'Scrum'; Typeid = '00000000-0000-0000-0000-000000000003' } + )} + } } Context 'Add-VSTeamProject' { @@ -90,8 +98,9 @@ Describe 'VSTeamProject' { Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - } + } +#-Area 'work' -resource 'processes' It 'with tfvc should create project with tfvc' { Add-VSTeamProject -Name Test -tfvc @@ -111,7 +120,6 @@ Describe 'VSTeamProject' { Mock Invoke-RestMethod { return @{status = 'inProgress'; id = 1; url = 'https://someplace.com' } } -ParameterFilter { $Method -eq 'Post' -and $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" } Mock _trackProjectProgress Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - Mock Get-VSTeamProcess { return @{name = 'Agile'; id = 1 } } } It 'Should create project with Agile' { diff --git a/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 b/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 index 3da12d3cf..bbdbb0a85 100644 --- a/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 +++ b/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 @@ -23,7 +23,7 @@ Describe 'VSTeamServiceFabricEndpoint' { Context 'Services' { BeforeAll { Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } Mock Write-Progress Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } @@ -76,22 +76,25 @@ Describe 'VSTeamServiceFabricEndpoint' { BeforeAll { Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } + Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } } Context 'Add-VSTeamServiceFabricEndpoint' { BeforeAll { - Mock ConvertTo-Json { throw 'Should not be called' } + Mock Add-VSTeamServiceEndpoint -ParameterFilter { + $endpointType -eq 'servicefabric' + } } - It 'Should throw' { + # Service Fabric is supported on all VSTeam supported versions of TFS + It 'Should not throw' { { Add-VSTeamServiceFabricEndpoint -projectName 'project' ` -endpointName 'PM_DonovanBrown' -url "tcp://0.0.0.0:19000" ` - -useWindowsSecurity $false } | Should -Throw + -useWindowsSecurity $false } | Should -Not -Throw } - It 'ConvertTo-Json should not be called' { - Should -Invoke ConvertTo-Json -Exactly -Times 0 -Scope Context + It 'Add-VSTeamServiceEndpoint should be called' { + Should -Invoke Add-VSTeamServiceEndpoint -Exactly -Times 1 -Scope Context } } } diff --git a/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 b/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 index a527504b5..96f78fee2 100644 --- a/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 +++ b/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 @@ -19,7 +19,7 @@ Describe 'VSTeamSonarQubeEndpoint' { Mock _hasProjectCacheExpired { return $false } Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } Mock Write-Warning Mock Write-Error -Verifiable diff --git a/unit/test/Get-VSTeamExtension.Tests.ps1 b/unit/test/Get-VSTeamExtension.Tests.ps1 index a82fbc504..36c4ab203 100644 --- a/unit/test/Get-VSTeamExtension.Tests.ps1 +++ b/unit/test/Get-VSTeamExtension.Tests.ps1 @@ -27,7 +27,7 @@ Describe 'VSTeamExtension' { $env:Team_TOKEN = '1234' Mock _callAPI { return $results } - Mock _callAPI { return $singleResult } -ParameterFilter { $resource -eq "extensionmanagement/installedextensionsbyname/test/test" } + Mock _callAPI { return $singleResult } -ParameterFilter { $id -eq "test/test" } } AfterAll { @@ -40,10 +40,10 @@ Describe 'VSTeamExtension' { ## Assert Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { - $Method -eq 'Get' -and $subDomain -eq 'extmgmt' -and + $area -eq 'extensionmanagement' -and + $resource -eq 'installedextensions' -and $version -eq $(_getApiVersion ExtensionsManagement) - $Url -like "*https://extmgmt.dev.azure.com/test/_apis/_apis/extensionmanagement/installedextensions*" } } @@ -53,13 +53,10 @@ Describe 'VSTeamExtension' { ## Assert Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { - $Method -eq 'Get' -and $subDomain -eq 'extmgmt' -and + $area -eq 'extensionmanagement' -and + $resource -eq 'installedextensions' -and $version -eq $(_getApiVersion ExtensionsManagement) - $Url -like "*https://extmgmt.dev.azure.com/test/_apis/_apis/extensionmanagement/installedextensions*" -and - $Url -like "*includeInstallationIssues*" -and - $Url -like "*includeDisabledExtensions*" -and - $Url -like "*includeErrors*" } } @@ -69,12 +66,12 @@ Describe 'VSTeamExtension' { ## Assert Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { - $Method -eq 'Get' -and + $id -eq 'test/test' -and $subDomain -eq 'extmgmt' -and + $area -eq 'extensionmanagement' -and + $resource -eq 'installedextensionsbyname' -and $version -eq $(_getApiVersion ExtensionsManagement) - $Url -like "*https://extmgmt.dev.azure.com/test/_apis/_apis/extensionmanagement/installedextensionsbyname/test/test*" } } } -} - +} \ No newline at end of file diff --git a/unit/test/Get-VSTeamFeed.Tests.ps1 b/unit/test/Get-VSTeamFeed.Tests.ps1 index 2550ad69a..a0a2f0010 100644 --- a/unit/test/Get-VSTeamFeed.Tests.ps1 +++ b/unit/test/Get-VSTeamFeed.Tests.ps1 @@ -16,52 +16,35 @@ Describe 'VSTeamFeed' { } Context 'Get-VSTeamFeed' { - Context 'Services' { - BeforeAll { - ## Arrange - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Packaging' } - $results = Get-Content "$PSScriptRoot\sampleFiles\feeds.json" -Raw | ConvertFrom-Json - - Mock _supportsFeeds { return $true } - Mock Invoke-RestMethod { return $results } - Mock _getInstance { return 'https://dev.azure.com/test' } - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - Mock Invoke-RestMethod { return $results.value[0] } -ParameterFilter { $Uri -like "*00000000-0000-0000-0000-000000000000*" } - } - - it 'with no parameters should return all the Feeds' { - ## Act - Get-VSTeamFeed - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds?api-version=$(_getApiVersion packaging)" - } - } + BeforeAll { + ## Arrange + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Packaging' } + $results = Get-Content "$PSScriptRoot\sampleFiles\feeds.json" -Raw | ConvertFrom-Json + + Mock Invoke-RestMethod { return $results } + Mock _getInstance { return 'https://dev.azure.com/test' } + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } + Mock Invoke-RestMethod { return $results.value[0] } -ParameterFilter { $Uri -like "*00000000-0000-0000-0000-000000000000*" } + } - it 'by id should return one feed' { - ## Act - Get-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' + it 'with no parameters should return all the Feeds' { + ## Act + Get-VSTeamFeed - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion packaging)" - } + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds?api-version=$(_getApiVersion packaging)" } } - Context 'Server' { - BeforeAll { - ## Arrange - Mock _supportsFeeds { return $false } - Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Packaging' } - } + it 'by id should return one feed' { + ## Act + Get-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' - it 'is not supported and should throw' { - ## Act / Assert - { Get-VSTeamFeed } | Should -Throw + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion packaging)" } } } diff --git a/unit/test/Get-VSTeamProcess.Tests.ps1 b/unit/test/Get-VSTeamProcess.Tests.ps1 index 88b741d6d..307c7ba9a 100644 --- a/unit/test/Get-VSTeamProcess.Tests.ps1 +++ b/unit/test/Get-VSTeamProcess.Tests.ps1 @@ -20,44 +20,56 @@ Describe 'VSTeamProcess' { Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ - name = 'Agile' - description = '' - url = '' - id = '123-5464-dee43' - isDefault = 'false' - type = 'Agile' - } + #Note: if the call is to ...work/processes... the identity field is "TypeID". calling to ...Process/processes... it is "ID" + $results = [PSCustomObject]@{ + value = @( + [PSCustomObject]@{ + name = 'Agile' + description = '' + url = '' + typeid = '123-5464-dee43' + isDefault = 'false' + type = 'Agile' + } + [PSCustomObject]@{ + name = 'Scrum' + description = '' + url = '' + typeid = '234-6575-eff54' + isDefault = 'false' + type = 'Agile' + } + ) } $singleResult = [PSCustomObject]@{ name = 'Agile' description = '' url = '' - id = '123-5464-dee43' + typeid = '123-5464-dee43' isDefault = 'false' type = 'Agile' } - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*123-5464-dee43*" } + Mock Invoke-RestMethod {return $results } + Mock Invoke-RestMethod {return $singleResult } -ParameterFilter { $Uri -like "*123-5464-dee43*" } } Context 'Get-VSTeamProcess' { It 'with no parameters using BearerToken should return process' { ## Act - Get-VSTeamProcess + $p = Get-VSTeamProcess ## Assert + $p.count | should -Be 2 + $p[0].gettype().name | should -Be VSTeamProcess # don't use BeOfType it's not in this scope/ # Make sure it was called with the correct URI Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$top=100*" + $Uri -like "*https://dev.azure.com/test/_apis/work/processes*" -and + $Uri -like "*api-version=$(_getApiVersion ProcessDefinition)*" } } - +<# no longer pass top or skip. Parameters are ignored. It 'with top 10 should return top 10 process' { ## Act Get-VSTeamProcess -top 10 @@ -65,7 +77,7 @@ Describe 'VSTeamProcess' { ## Assert # Make sure it was called with the correct URI Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and + $Uri -like "*https://dev.azure.com/test/_apis/work/processes*" -and $Uri -like "*`$top=10*" } } @@ -77,21 +89,24 @@ Describe 'VSTeamProcess' { ## Assert # Make sure it was called with the correct URI Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and + $Uri -like "*https://dev.azure.com/test/_apis/work/processes*" -and $Uri -like "*api-version=$(_getApiVersion Core)*" -and $Uri -like "*`$skip=1*" -and $Uri -like "*`$top=100*" } } - +#> It 'by Name should return Process by Name' { - Get-VSTeamProcess -Name Agile + [VSTeamProcessCache]::timestamp = -1 + $p = Get-VSTeamProcess -Name Agile - # Make sure it was called with the correct URI - # It is called twice once for the call and once for the validator - Should -Invoke Invoke-RestMethod -Exactly -Times 2 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" + $p.name | should -Be 'Agile' + $p.id | should -Not -BeNullOrEmpty + # Make sure it was ca lled with the correct URI + # Only called once for name - we don't validate the name, so wildcards can be given. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/work/processes*" -and + $Uri -like "*api-version=$(_getApiVersion ProcessDefinition)*" } } @@ -100,8 +115,8 @@ Describe 'VSTeamProcess' { # Make sure it was called with the correct URI Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/process/processes/123-5464-dee43*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" + $Uri -like "*https://dev.azure.com/test/_apis/work/processes/123-5464-dee43*" -and + $Uri -like "*api-version=$(_getApiVersion ProcessDefinition)*" } } } diff --git a/unit/test/Get-VSTeamWiql.Tests.ps1 b/unit/test/Get-VSTeamWiql.Tests.ps1 index 0be82f5d8..47ef09f93 100644 --- a/unit/test/Get-VSTeamWiql.Tests.ps1 +++ b/unit/test/Get-VSTeamWiql.Tests.ps1 @@ -7,6 +7,10 @@ Describe 'VSTeamWiql' { . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" + . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" + . "$PSScriptRoot/../../Source/Classes/VSTeamQueryCache.ps1" + . "$PSScriptRoot/../../Source/Classes/QueryCompleter.ps1" + . "$PSScriptRoot/../../Source/Classes/QueryTransformToIDAttribute.ps1" . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" . "$PSScriptRoot/../../Source/Private/common.ps1" . "$PSScriptRoot/../../Source/Public/Get-VSTeamWorkItem.ps1" @@ -33,15 +37,6 @@ Describe 'VSTeamWiql' { descending = $false } - $wiqlResult = @{ - querytype = "flat" - queryTypeResult = "worItem" - asOf = "2019-10-03T18:35:09.117Z" - columns = @($column) - sortColumns = @($sortColumn) - workItems = @($workItem, $workItem) - } - $expandedWorkItems = @{ count = 1 value = @($workItem, $workItem) @@ -54,6 +49,16 @@ Describe 'VSTeamWiql' { # If this test fails uncomment the line below to see how the mock was called. # Write-Host $args + # result is returned and -Expand is specified, the work items field is overwritten + # If $wiqlResult is defined once (like column, and work item) the second expand has a problem + $wiqlResult = @{ + querytype = "flat" + queryTypeResult = "workItem" + asOf = "2019-10-03T18:35:09.117Z" + columns = @($column) + sortColumns = @($sortColumn) + workItems = @($workItem, $workItem) + } return $wiqlResult } @@ -64,10 +69,11 @@ Describe 'VSTeamWiql' { return $expandedWorkItems } + + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") } It 'Get work items with custom WIQL query' { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery @@ -84,7 +90,6 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query with -Top 250' { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Top 250 @@ -101,7 +106,6 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query with -Top 0' { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Top 0 @@ -118,7 +122,6 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query with expanded work items' { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Expand @@ -135,7 +138,6 @@ Describe 'VSTeamWiql' { } It 'Get work items with custom WIQL query with time precision' { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -TimePrecision @@ -147,14 +149,13 @@ Describe 'VSTeamWiql' { $Body -like "*[System.State]*" -and $Body -like '*`}' -and # Make sure the body is an object $ContentType -eq 'application/json' -and - $Uri -like "*timePrecision=True*" - $Uri -like "*`$top=100*" + $Uri -like "*timePrecision=True*" -and + $Uri -like "*`$top=100*" -and $Uri -like "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)*" } } It 'Get work items with query ID query' { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Get-VSTeamWiql -ProjectName "test" -Team "test team" -Id 1 Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { @@ -163,7 +164,6 @@ Describe 'VSTeamWiql' { } It 'Get work items with query ID query with expanded work items' { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Get-VSTeamWiql -ProjectName "test" -Team "test team" -Id 1 -Expand Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { diff --git a/unit/test/ProcessTemplateCompleter.Tests.ps1 b/unit/test/ProcessTemplateCompleter.Tests.ps1 new file mode 100644 index 000000000..e1eb2a674 --- /dev/null +++ b/unit/test/ProcessTemplateCompleter.Tests.ps1 @@ -0,0 +1,31 @@ +Set-StrictMode -Version Latest + +Describe "ProcessTemplateCompleter" { + BeforeAll { + $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") + + . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" + . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" + . "$PSScriptRoot/../../Source/Private/common.ps1" + . "$PSScriptRoot/../../Source/Classes/$sut" + + Mock _hasProcessTemplateCacheExpired { return $true } + Mock _getProcesses { return @("Scrum", "Basic", "CMMI", "Agile", "Scrum With Space") } + } + + Context "names with spaces" { + BeforeAll { + $target = [ProcessTemplateCompleter]::new() + + $actual = $target.CompleteArgument("", "", "", $null, @{ }) + } + + It "should return process templates" { + $actual.count | Should -Be 5 + } + + It "should quote the names with space" { + $actual[4].CompletionText | Should -Be "'Scrum With Space'" + } + } +} \ No newline at end of file diff --git a/unit/test/ProcessValidateAttribute.Tests.ps1 b/unit/test/ProcessValidateAttribute.Tests.ps1 index 6653caf69..f42b2a6c4 100644 --- a/unit/test/ProcessValidateAttribute.Tests.ps1 +++ b/unit/test/ProcessValidateAttribute.Tests.ps1 @@ -4,35 +4,49 @@ Describe "ProcessValidateAttribute" { BeforeAll { $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") + . "$PSScriptRoot/../../Source/Classes/VSTeamProcess.ps1" . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" + . "$PSScriptRoot/../../Source/Classes/ProcessTemplateCompleter.ps1" . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" . "$PSScriptRoot/../../Source/Private/common.ps1" . "$PSScriptRoot/../../Source/Classes/$sut" + . "$PSScriptRoot/../../Source/Public/Get-VSTeamProcess.ps1" + } Context "Existing Process" { BeforeAll { - Mock _hasProcessTemplateCacheExpired { return $true } - Mock _getProcesses { return @("Test1", "Test2") } + Mock Get-VSTeamProcess { + return @( + [PSCustomObject]@{Name = "Test1"; url='http://bogus.none/100'}, + [PSCustomObject]@{Name = "Test2"; url='http://bogus.none/101'} + ) + } + [VSTeamProcessCache]::Invalidate() } - It "it is not in list and should throw" { + It "should not throw if name is in the list and should populate cache on first call" { + $target = [ProcessValidateAttribute]::new() + { $target.Validate("Test1", $null) } | Should -Not -Throw + Should -Invoke -CommandName Get-VSTeamProcess -Times 1 -Exactly + [VSTeamProcessCache]::processes.Count | should -BeGreaterThan 0 + [VSTeamProcessCache]::timestamp | should -BeGreaterOrEqual 0 + } + It "should throw if name is not in list " { $target = [ProcessValidateAttribute]::new() { $target.Validate("Test", $null) } | Should -Throw } - It "it is in list and should not throw" { - $target = [ProcessValidateAttribute]::new() - { $target.Validate("Test1", $null) } | Should -Not -Throw - } } Context "No Processes" { BeforeAll { - Mock _getProcesses { return @() } - Mock _hasProcessTemplateCacheExpired { return $true } + Mock Get-VSTeamProcess { + return @( ) + } + [VSTeamProcessCache]::Invalidate() } It "list is empty and should not throw" { diff --git a/unit/test/Remove-VSTeamFeed.Tests.ps1 b/unit/test/Remove-VSTeamFeed.Tests.ps1 index dcba1d33d..e623daed8 100644 --- a/unit/test/Remove-VSTeamFeed.Tests.ps1 +++ b/unit/test/Remove-VSTeamFeed.Tests.ps1 @@ -12,7 +12,6 @@ Describe 'VSTeamFeed' { . "$PSScriptRoot/../../Source/Private/common.ps1" . "$PSScriptRoot/../../Source/Public/$sut" - Mock _supportsFeeds { return $true } Mock _getApiVersion { return '1.0-unitTests' } Mock _getInstance { return 'https://dev.azure.com/test' } diff --git a/unit/test/Set-VSTeamAPIVersion.Tests.ps1 b/unit/test/Set-VSTeamAPIVersion.Tests.ps1 index 5b1c4d28a..66997a654 100644 --- a/unit/test/Set-VSTeamAPIVersion.Tests.ps1 +++ b/unit/test/Set-VSTeamAPIVersion.Tests.ps1 @@ -82,8 +82,8 @@ Describe 'VSTeamAPIVersion' { } It 'Should change just ServiceFabricEndpoint' { - Set-VSTeamAPIVersion -Service ServiceFabricEndpoint -Version '7.0' - [VSTeamVersions]::ServiceFabricEndpoint | Should -Be '7.0' + Set-VSTeamAPIVersion -Service ServiceEndpoints -Version '7.0' + [VSTeamVersions]::ServiceEndpoints | Should -Be '7.0' } It 'Should change just ExtensionsManagement' { diff --git a/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 b/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 index 131dcee39..97e735038 100644 --- a/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 +++ b/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 @@ -20,7 +20,7 @@ Describe 'VSTeamServiceEndpoint' { Mock _hasProjectCacheExpired { return $false } Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceFabricEndpoint' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } Mock Write-Progress Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Get' }