diff --git a/.build/CredScanTask.md b/.build/CredScanTask.md new file mode 100644 index 000000000..1fee96c61 --- /dev/null +++ b/.build/CredScanTask.md @@ -0,0 +1,71 @@ +# Credential Scanner (CredScan) in the Build + +This repository uses the so called [CredScan created by Microsoft](https://secdevtools.azurewebsites.net/helpcredscan.html#collapseOne) to prevent passwords being added to the master branch. + +To not even commit credentials to the repository you can download and install a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=VSIDEDevOpsMSFT.ContinuousDeliveryToolsforVisualStudio&ssr=false#overview). Unfortunately, no VS Code extension is available yet. + +## Unit tests + +When writing unit tests fake passwords have to be used sometimes. +To prevent CredScan to mix up fake passwords with real ones, a suppression file is used. + +There are several passwords defined, that can be used: + +If you write a unit test, which needs a fake password please include this in the suppression file for CredScan. + +**Note**: This only applies for unit tests and documentation, but not for the module itself. + +## How suppressions work + +The following documentation is taken from [the official CredScan](https://secdevtools.azurewebsites.net/helpcredscan.html) page. + +### Suppress all occurrences of a given secret within the specified path + +The hash key of the secret from the CredScan output file is required as shown in the sample below + +```json +{ + "tool": "Credential Scanner", + "suppressions": [ + { + "hash": "CLgYxl2FcQE8XZgha9/UbKLTkJkUh3Vakkxh2CAdhtY=", + "_justification": "Secret used by MSDN sample, it is fake." + } + ] +} +``` + +**Warning:** The hash key is generated by a portion of the matching value or file content. Any source code revision could change the hash key and disable the suppression rule. + +### To suppress all secrets in a specified file (or to suppress the secrets file itself) + +The file expression could be a file name or any postfix portion of the full file path/name. Wildcards are not supported. + +#### Example + +File to be suppressed: [InputPath]\src\JS\lib\angular.js +Valid Suppression Rules: + +- [InputPath]\src\JS\lib\angular.js -- suppress the file in the specified path +- \src\JS\lib\angular.js +- \JS\lib\angular.js +- \lib\angular.js +- angular.js -- suppress any file with the same name + +```json +{ + "tool": "Credential Scanner", + "suppressions": [ + { + "file": "\\files\\AdditonalSearcher.xml", + "_justification": "Additional CredScan searcher specific to my team" + }, + { + "file": "\\files\\unittest.pfx", + "_justification": "Legitimate UT certificate file with private key" + } + ] +} +``` + +**Warning:** All future secrets added to the file will also get suppressed automatically. diff --git a/build/credscan-supression.json b/.build/credscan-supression.json similarity index 88% rename from build/credscan-supression.json rename to .build/credscan-supression.json index 0c074e265..2b1da4f94 100644 --- a/build/credscan-supression.json +++ b/.build/credscan-supression.json @@ -28,6 +28,10 @@ { "file": "buildDefyaml.json", "_justification": "Fake credentials only used for unit tests." + }, + { + "file": "Get-BuildDefinition_AzD.json", + "_justification": "Redacted credentials only used for unit tests." } ] } \ No newline at end of file diff --git a/build/integrationTests.yml b/.build/integrationTests.yml similarity index 90% rename from build/integrationTests.yml rename to .build/integrationTests.yml index f453c9560..7d33c4bab 100644 --- a/build/integrationTests.yml +++ b/.build/integrationTests.yml @@ -24,6 +24,10 @@ jobs: runOnce: deploy: steps: + - download: current + displayName: 'Download tests' + artifact: test + - task: AzureResourceGroupDeployment@2 displayName: 'Start TFS 2017' inputs: @@ -40,19 +44,20 @@ jobs: resourceGroupName: WinBldBox condition: and(succeeded(), eq('${{ parameters.start2018 }}', 'true')) + - task: NuGetAuthenticate@0 + inputs: + nuGetServiceConnections: 'Azure Artifacts' + - task: PowerShell@2 displayName: 'Register Private Repository' inputs: targetType: 'inline' script: | $n = 'LoECDA' - $e = "$(EMAIL)" $url = "$(REPO_URL)" - $pwd = ConvertTo-SecureString "$(PKG_PAT)" -AsPlainText -Force - $creds = New-Object PSCredential($e, $pwd) if(-not (Get-PSRepository | Where-Object Name -eq $n)) { - Register-PSRepository -Credential $creds -Name $n -SourceLocation $url -InstallationPolicy Trusted -Verbose + Register-PSRepository -Name $n -SourceLocation $url -InstallationPolicy Trusted -Verbose } Get-PSRepository @@ -74,7 +79,7 @@ jobs: Get-PSRepository Install-Module -Name VSTeam -Repository $n -Credential $creds -MaximumVersion $b -MinimumVersion $b -Force -Scope CurrentUser -Verbose - workingDirectory: '$(Pipeline.Workspace)/Test' + workingDirectory: '$(Pipeline.Workspace)/test' - task: PowerShell@2 displayName: 'Install Pester' @@ -106,14 +111,14 @@ jobs: Invoke-Pester -Configuration $pesterArgs failOnStderr: true - workingDirectory: '$(Pipeline.Workspace)/Test/integration' + workingDirectory: '$(Pipeline.Workspace)/test/Tests' - task: PublishTestResults@2 displayName: 'Publish Test Results' inputs: testResultsFormat: NUnit testResultsFiles: '**/test-results.xml' - searchFolder: '$(Pipeline.Workspace)/Test/integration' + searchFolder: '$(Pipeline.Workspace)/test' testRunTitle: '${{ parameters.os }} Tests' continueOnError: true condition: succeededOrFailed() diff --git a/build/unitTests.yml b/.build/unitTests.yml similarity index 76% rename from build/unitTests.yml rename to .build/unitTests.yml index 0a2ff111a..832d6fbe9 100644 --- a/build/unitTests.yml +++ b/.build/unitTests.yml @@ -7,22 +7,38 @@ steps: - task: PowerShell@2 displayName: 'Build Module' inputs: + pwsh: true targetType: 'inline' ${{ if eq(parameters.buildHelp, 'false') }}: - script: '.\Build-Module.ps1 -installDep' + script: '.\Build-Module.ps1 -installDep -configuration Release' ${{ if eq(parameters.buildHelp, 'true') }}: - script: '.\Build-Module.ps1 -installDep -buildHelp' + script: '.\Build-Module.ps1 -installDep -buildHelp -configuration Release' + +- ${{ if eq(parameters.os, 'Windows') }}: + - task: DotNetCoreCLI@2 + displayName: 'Run C# Unit Tests with code coverage' + inputs: + command: 'test' + arguments: '--collect:"Code Coverage"' + +- ${{ if ne(parameters.os, 'Windows') }}: + - task: DotNetCoreCLI@2 + displayName: 'Run C# Unit Tests' + inputs: + command: 'test' - task: PowerShell@2 displayName: 'Install Pester' inputs: + pwsh: true targetType: 'inline' script: 'Install-Module -Name Pester -Repository PSGallery -Force -AllowPrerelease -MinimumVersion "$(PESTER_VERSION)" -Scope CurrentUser -AllowClobber -SkipPublisherCheck' - ${{ if eq(parameters.CodeCoverage, 'false') }}: - task: PowerShell@2 - displayName: 'Run Unit Tests' + displayName: 'Run PowerShell Unit Tests' inputs: + pwsh: true targetType: 'inline' script: | Import-Module .\dist\*.psd1 @@ -30,9 +46,9 @@ steps: Import-Module Pester $pesterArgs = [PesterConfiguration]::Default $pesterArgs.Run.Exit = $true - $pesterArgs.Run.Path = '.\unit' + $pesterArgs.Run.Path = './Tests/function' $pesterArgs.Run.PassThru = $false - $pesterArgs.Output.Verbosity = "Detailed" + $pesterArgs.Output.Verbosity = "Normal" $pesterArgs.TestResult.Enabled = $true $pesterArgs.TestResult.OutputPath = 'test-results.xml' @@ -41,8 +57,9 @@ steps: - ${{ if eq(parameters.CodeCoverage, 'true') }}: - task: PowerShell@2 - displayName: 'Run Unit Tests' + displayName: 'Run PowerShell Unit Tests' inputs: + pwsh: true targetType: 'inline' script: | Import-Module .\dist\*.psd1 @@ -50,9 +67,9 @@ steps: Import-Module Pester $pesterArgs = [PesterConfiguration]::Default $pesterArgs.Run.Exit = $true - $pesterArgs.Run.Path = '.\unit' + $pesterArgs.Run.Path = './Tests/function' $pesterArgs.Run.PassThru = $false - $pesterArgs.Output.Verbosity = "Detailed" + $pesterArgs.Output.Verbosity = "Normal" $pesterArgs.TestResult.Enabled = $true $pesterArgs.TestResult.OutputPath = 'test-results.xml' @@ -64,15 +81,16 @@ steps: displayName: 'Run Unit Tests with Code Coverage' inputs: targetType: 'inline' + pwsh: true script: | Import-Module .\dist\*.psd1 # This loads [PesterConfiguration] into scope Import-Module Pester $pesterArgs = [PesterConfiguration]::Default $pesterArgs.Run.Exit = $true - $pesterArgs.Run.Path = '.\unit' + $pesterArgs.Run.Path = './Tests/function' $pesterArgs.Run.PassThru = $false - $pesterArgs.Output.Verbosity = "Detailed" + $pesterArgs.Output.Verbosity = "Normal" $pesterArgs.TestResult.Enabled = $true $pesterArgs.TestResult.OutputPath = 'test-results.xml' $pesterArgs.CodeCoverage.Enabled = $true @@ -88,7 +106,7 @@ steps: displayName: 'Publish code coverage' inputs: summaryFileLocation: '**\coverage.xml' - failIfCoverageEmpty: true + failIfCoverageEmpty: false condition: and(succeededOrFailed(), eq(variables['System.PullRequest.IsFork'], false)) - task: PublishTestResults@2 diff --git a/.docs/Add-VSTeam.md b/.docs/Add-VSTeam.md index 30300232a..81d27195a 100644 --- a/.docs/Add-VSTeam.md +++ b/.docs/Add-VSTeam.md @@ -14,20 +14,25 @@ ## EXAMPLES -## PARAMETERS +### Example 1: Add a team - +```powershell +Add-VSTeam -ProjectName Scrum -Name 'Testing' +``` -### -Description +This command adds a team named 'Testing' to the project named 'Scrum'. -The description of the team. +### Example 2: Add a team with description -```yaml -Type: String -Position: 1 +```powershell +Add-VSTeam 'Scrum' 'Testing2' 'Test team' ``` -### -Name +This command adds a team named 'Testing2' with description 'Test team' to the project named 'Scrum'. + +## PARAMETERS + +### Name The name of the team @@ -35,21 +40,36 @@ The name of the team Type: String Aliases: TeamName Required: True +Position: 0 +``` + +### Description + +The description of the team. + +```yaml +Type: String Position: 1 ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Get-VSTeam](Get-VSTeam.md) [Remove-VSTeam](Remove-VSTeam.md) [Show-VSTeam](Show-VSTeam.md) -[Update-VSTeam](pda-VSTeam.md) +[Update-VSTeam](Update-VSTeam.md) \ No newline at end of file diff --git a/.docs/Add-VSTeamAccessControlEntry.md b/.docs/Add-VSTeamAccessControlEntry.md index 8cb8ca3c0..cca85f885 100644 --- a/.docs/Add-VSTeamAccessControlEntry.md +++ b/.docs/Add-VSTeamAccessControlEntry.md @@ -16,29 +16,114 @@ ## PARAMETERS - - - +### SecurityNamespace -### -SecurityNamespace - -Security namespace identifier. +Security namespace object. ```yaml -Type: VSTeamSecurityNamespace +Type: vsteam_lib.SecurityNamespace +Parameter Sets: ByNamespace Required: True ``` -### -SecurityNamespaceId +### SecurityNamespaceId Security namespace identifier. +Valid IDs are: + +AzD: + +- Analytics (58450c49-b02d-465a-ab12-59ae512d6531) +- AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) +- ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) +- ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) +- Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) +- WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) +- DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) +- WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) +- GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) +- VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) +- EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) +- WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) +- ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) +- ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) +- Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) +- Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) +- Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) +- Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) +- Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) +- AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) +- Library (b7e84409-6553-448a-bbb2-af228e07cbeb) +- Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) +- Project (52d39943-cb85-4d7f-8fa8-c6baac873819) +- EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) +- CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) +- TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) +- ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) +- Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) +- MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) +- Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) +- Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) +- Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) +- Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) +- ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) +- Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) +- WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) +- StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) +- Server (1f4179b3-6bac-4d01-b421-71ea09171400) +- TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) +- SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) +- BuildAdministration (302acaca-b667-436d-a946-87133492041c) +- Location (2725d2bc-7520-4af4-b0e3-8d876494731f) +- Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) +- UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) +- WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) +- WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) +- VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) +- Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) +- CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) +- WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) +- Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) +- BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) +- DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) +- Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) +- Security (9a82c708-bfbe-4f31-984c-e860c2196781) +- IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) +- ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) +- Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) +- DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) +- VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) + +VSSPS: + +- EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) +- EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) +- Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) +- Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) +- Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) +- SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) +- Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) +- CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) +- StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) +- GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) +- Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) +- SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) +- RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) +- Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) +- WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) +- DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) +- Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) +- IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) +- ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) + ```yaml Type: String +Parameter Sets: ByNamespaceId Required: True ``` -### -Token +### Token The security Token @@ -47,7 +132,7 @@ Type: String Required: True ``` -### -AllowMask +### AllowMask Bitmask for Allow Permissions @@ -56,7 +141,7 @@ Type: Int Required: True ``` -### -DenyMask +### DenyMask Bitmask for Deny Permissions @@ -65,12 +150,20 @@ Type: Int Required: True ``` + + ## INPUTS ## OUTPUTS -### VSTeamAccessControlEntry +### vsteam_lib.AccessControlEntry ## NOTES +This is a low-level function. You should really use a high level function (Add-VSTeam...Permission / Set-VSTeam...Permission / Get-VSTeam...Permission) unless you know what you are doing. + + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamArea.md b/.docs/Add-VSTeamArea.md index 0cd320c1c..71a578519 100644 --- a/.docs/Add-VSTeamArea.md +++ b/.docs/Add-VSTeamArea.md @@ -10,39 +10,46 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamArea -ProjectName Demo -Name "NewArea" -Path "MyArea/Path" +```powershell +Add-VSTeamArea -ProjectName Demo -Name "NewArea" -Path "MyArea/Path" ``` This command adds a new area named NewArea to the Demo project under the area path MyArea/Path. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Add-VSTeamArea -ProjectName Demo -Name "NewArea" +```powershell +Add-VSTeamArea -ProjectName Demo -Name "NewArea" ``` This command adds a new area named NewArea to the Demo project. +### Example 3 + +```powershell +Add-VSTeamArea "NewArea" +``` + +This command adds a new area named NewArea to the default project. + ## DESCRIPTION ## PARAMETERS - - -### -Name +### Name Name of the new area. ```yaml Type: string +Position: 0 ``` -### -Path +### Path Path of the existing area under where the new one will be created. @@ -50,6 +57,8 @@ Path of the existing area under where the new one will be created. Type: string ``` + + ## INPUTS ## OUTPUTS @@ -60,8 +69,12 @@ Type: string This function is a wrapper of the base function Add-VSTeamClassificationNode. + + ## RELATED LINKS + + [Add-VSTeamClassificationNode](Add-VSTeamClassificationNode.md) [Add-VSTeamIteration](Add-VSTeamIteration.md) diff --git a/.docs/Add-VSTeamAzureRMServiceEndpoint.md b/.docs/Add-VSTeamAzureRMServiceEndpoint.md index 82b3473a3..ed812f426 100644 --- a/.docs/Add-VSTeamAzureRMServiceEndpoint.md +++ b/.docs/Add-VSTeamAzureRMServiceEndpoint.md @@ -16,9 +16,7 @@ The cmdlet adds a new connection between TFS/AzD and Azure using the Azure Resou ## PARAMETERS - - -### -SubscriptionName +### SubscriptionName The name of the Azure Subscription. @@ -30,7 +28,7 @@ Position: 1 Accept pipeline input: true (ByPropertyName) ``` -### -SubscriptionId +### SubscriptionId The id of the Azure subscription to use. @@ -41,7 +39,7 @@ Position: 2 Accept pipeline input: true (ByPropertyName) ``` -### -SubscriptionTenantId +### SubscriptionTenantId The id of the Azure tenant to use. @@ -52,7 +50,7 @@ Position: 3 Accept pipeline input: true (ByPropertyName) ``` -### -ServicePrincipalId +### ServicePrincipalId The ID of the Azure Service Principal to use with this service endpoint. @@ -63,7 +61,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -ServicePrincipalKey +### ServicePrincipalKey The key of the Azure Service Principal to use with this service endpoint. @@ -74,7 +72,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -EndpointName +### EndpointName The name displayed on the services page. In AzD this is the Connection Name. @@ -84,14 +82,20 @@ Type: String Position: 4 ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) [Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) diff --git a/.docs/Add-VSTeamBuild.md b/.docs/Add-VSTeamBuild.md index 6b46ff020..cde858753 100644 --- a/.docs/Add-VSTeamBuild.md +++ b/.docs/Add-VSTeamBuild.md @@ -18,11 +18,11 @@ To have the BuildDefinition and QueueNames tab complete you must set a default p ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI +```powershell +Set-VSTeamDefaultProject Demo +Add-VSTeamBuild -BuildDefinition Demo-CI Build Definition Build Number Status Result ---------------- ------------ ------ ------ @@ -31,11 +31,11 @@ Demo-CI Demo-CI-45 notStarted This example sets the default project so you can tab complete the BuildDefinition parameter. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -SourceBranch refs/heads/develop +```powershell +Set-VSTeamDefaultProject Demo +Add-VSTeamBuild -BuildDefinition Demo-CI -SourceBranch refs/heads/develop Build Definition Build Number Status Result ---------------- ------------ ------ ------ @@ -44,11 +44,11 @@ Demo-CI Demo-CI-45 notStarted This example queues the build for the 'develop' branch, overriding the default branch in the build definition. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -BuildParameters @{msg="hello world!"; 'system.debug'='true'} +```powershell +Set-VSTeamDefaultProject Demo +Add-VSTeamBuild -BuildDefinition Demo-CI -BuildParameters @{msg="hello world!"; 'system.debug'='true'} Build Definition Build Number Status Result ---------------- ------------ ------ ------ @@ -59,9 +59,7 @@ This example queues the build and sets the system.debug variable to true and msg ## PARAMETERS - - -### -BuildDefinitionName +### BuildDefinitionName The name of the build definition to use to queue to build. @@ -72,7 +70,7 @@ Aliases: BuildDefinition Accept pipeline input: true (ByPropertyName) ``` -### -QueueName +### QueueName The name of the queue to use for this build. @@ -81,7 +79,7 @@ Type: String Accept pipeline input: true (ByPropertyName) ``` -### -BuildDefinitionId +### BuildDefinitionId The Id of the build definition to use to queue to build. @@ -92,7 +90,7 @@ Aliases: Id Accept pipeline input: true (ByPropertyName) ``` -### -SourceBranch +### SourceBranch Which source branch to use for this build. Overrides default branch in build definition. @@ -100,7 +98,7 @@ Which source branch to use for this build. Overrides default branch in build def Type: String ``` -### -BuildParameters +### BuildParameters A hashtable with build parameters. @@ -108,6 +106,8 @@ A hashtable with build parameters. Type: System.Collection.Hashtable ``` + + ## INPUTS ### System.String @@ -130,12 +130,16 @@ Build Parameters ## OUTPUTS -### Team.Build +### vsteam_lib.Build ## NOTES BuildDefinition and QueueName are dynamic parameters and use the default project value to query their validate set. -If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamBuild you will have to type in the names. +If you do not set the default project by called Set-VSTeamDefaultProject you must pass in -ProjectName or you will have to type in the names. + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamBuildDefinition.md b/.docs/Add-VSTeamBuildDefinition.md index 1d9db2c0b..e22c163bb 100644 --- a/.docs/Add-VSTeamBuildDefinition.md +++ b/.docs/Add-VSTeamBuildDefinition.md @@ -16,10 +16,10 @@ You must call Set-VSTeamAccount before calling this function. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamBuildDefinition -ProjectName Demo -InFile build.json +```powershell +Add-VSTeamBuildDefinition -ProjectName Demo -InFile build.json ``` This command reads build.json and creates a new build definition from it @@ -27,9 +27,7 @@ on the demo team project. ## PARAMETERS - - -### -InFile +### InFile Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. @@ -40,6 +38,8 @@ Position: 1 Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ### System.String @@ -48,12 +48,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the -project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have -to pass the ProjectName with each call. + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamBuildTag.md b/.docs/Add-VSTeamBuildTag.md index 67993767a..abe9bcd3a 100644 --- a/.docs/Add-VSTeamBuildTag.md +++ b/.docs/Add-VSTeamBuildTag.md @@ -16,17 +16,13 @@ Adds a tag to a build. ## PARAMETERS - - - - - + - + ## INPUTS @@ -36,4 +32,8 @@ Adds a tag to a build. ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamClassificationNode.md b/.docs/Add-VSTeamClassificationNode.md index de87d164f..d49f4b6b6 100644 --- a/.docs/Add-VSTeamClassificationNode.md +++ b/.docs/Add-VSTeamClassificationNode.md @@ -14,67 +14,72 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamClassificationNode -ProjectName Demo -Name "NewIteration" -StructureGroup "iteration" -Path "MyIteration/Path" +```powershell +Add-VSTeamClassificationNode -ProjectName Demo -Name "NewIteration" -StructureGroup "iteration" -Path "MyIteration/Path" ``` This command adds a new iteration named NewIteration to the Demo project under the iteration path MyIteration/Path. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Add-VSTeamClassificationNode -ProjectName "Demo" -FinishDate (Get-Date "31.01.2020") -StartDate (Get-Date "01.01.2020") -Name "NewIteration" -StructureGroup "iterations" +```powershell +Add-VSTeamClassificationNode -ProjectName "Demo" -FinishDate (Get-Date "31.01.2020") -StartDate (Get-Date "01.01.2020") -Name "NewIteration" -StructureGroup "iterations" ``` This command adds a new iteration named NewIteration to the Demo project with the start date 01.01.2020 and finish date 31.01.2020. ## PARAMETERS - - -### -Name +### Name Name of the new classification node. ```yaml Type: string +Required: True ``` -### -StructureGroup +### StructureGroup Structure group of the classification node. ```yaml Type: string +Required: True Accepted values: iterations, areas ``` -### -Path +### Path Path of the classification node. ```yaml Type: string +Required: False ``` -### -StartDate +### StartDate -Start date of the classification node. +Start date of the iteration. ```yaml Type: datetime +Required: False ``` -### -FinishDate +### FinishDate -Finish date of the classification node. +Finish date of the iteration. ```yaml Type: datetime +Required: False ``` + + ## INPUTS ## OUTPUTS @@ -85,8 +90,12 @@ Type: datetime This function is the base function for Add-VSTeamArea and Add-VSTeamIteration. + + ## RELATED LINKS + + [Add-VSTeamArea](Add-VSTeamArea.md) [Add-VSTeamIteration](Add-VSTeamIteration.md) diff --git a/.docs/Add-VSTeamExtension.md b/.docs/Add-VSTeamExtension.md index 359fa23ef..c7a7a0c25 100644 --- a/.docs/Add-VSTeamExtension.md +++ b/.docs/Add-VSTeamExtension.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PublisherId +### PublisherId The id of the publisher. @@ -25,7 +25,7 @@ Type: String Required: True ``` -### -ExtensionId +### ExtensionId The id of the extension. @@ -34,7 +34,7 @@ Type: String Required: True ``` -### -Version +### Version The version of the extension. Example: "0.1.35". @@ -49,8 +49,12 @@ Required: False ## NOTES + + ## RELATED LINKS + + [Add-VSTeamExtension](Add-VSTeamExtension.md) [Get-VSTeamExtension](Get-VSTeamExtension.md) diff --git a/.docs/Add-VSTeamFeed.md b/.docs/Add-VSTeamFeed.md index db1e37303..937090358 100644 --- a/.docs/Add-VSTeamFeed.md +++ b/.docs/Add-VSTeamFeed.md @@ -14,17 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamFeed -Name test -Description 'Test Description' +```powershell +Add-VSTeamFeed -Name test -Description 'Test Description' ``` This command adds a new package feed to the account. ## PARAMETERS -### -Name +### Name Name of the feed @@ -33,7 +33,7 @@ Type: string Accept pipeline input: true (ByPropertyName) ``` -### -Description +### Description Description of the feed @@ -41,7 +41,7 @@ Description of the feed Type: string ``` -### -EnableUpstreamSources +### EnableUpstreamSources Enables npm and nuget upstream sources for the feed @@ -49,7 +49,7 @@ Enables npm and nuget upstream sources for the feed Type: SwitchParameter ``` -### -showDeletedPackageVersions +### showDeletedPackageVersions The feed will show deleted version in the feed @@ -63,4 +63,8 @@ Type: SwitchParameter ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamGitRepository.md b/.docs/Add-VSTeamGitRepository.md index 0ac6e8a32..c572c311f 100644 --- a/.docs/Add-VSTeamGitRepository.md +++ b/.docs/Add-VSTeamGitRepository.md @@ -14,19 +14,17 @@ Add-VSTeamGitRepository adds a Git repository to your Azure DevOps or Team Found ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamGitRepository -ProjectName Demo -Name Temp +```powershell +Add-VSTeamGitRepository -ProjectName Demo -Name Temp ``` This command adds a new repository named Temp to the Demo project. ## PARAMETERS - - -### -Name +### Name Specifies the name of the repository. @@ -36,10 +34,16 @@ Aliases: RepositoryID Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamGitRepositoryPermission.md b/.docs/Add-VSTeamGitRepositoryPermission.md index 98bcf1044..109e87f99 100644 --- a/.docs/Add-VSTeamGitRepositoryPermission.md +++ b/.docs/Add-VSTeamGitRepositoryPermission.md @@ -16,64 +16,64 @@ ## PARAMETERS - - -### -RepositoryId +### RepositoryId ```yaml Type: String Required: True ``` -### -RepositoryName +### RepositoryName ```yaml Type: String Required: True ``` -### -BranchName +### BranchName ```yaml Type: String Required: True ``` -### -Descriptor +### Descriptor ```yaml Type: String Required: True ``` -### -User +### User ```yaml Type: VSTeamUser Required: True ``` -### -Group +### Group ```yaml Type: VSTeamGroup Required: True ``` -### -Allow +### Allow ```yaml Type: VSTeamGitRepositoryPermissions Required: True ``` -### -Deny +### Deny ```yaml Type: VSTeamGitRepositoryPermissions Required: True ``` + + ## INPUTS ## OUTPUTS @@ -82,4 +82,8 @@ Required: True ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamIteration.md b/.docs/Add-VSTeamIteration.md index 8b3c2ea51..da009d95d 100644 --- a/.docs/Add-VSTeamIteration.md +++ b/.docs/Add-VSTeamIteration.md @@ -10,18 +10,18 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamIteration -ProjectName Demo -Name "NewIteration" -Path "MyIteration/Path" +```powershell +Add-VSTeamIteration -ProjectName Demo -Name "NewIteration" -Path "MyIteration/Path" ``` This command adds a new iteration named NewIteration to the Demo project under the iteration path MyIteration/Path. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Add-VSTeamIteration -ProjectName "Demo" -FinishDate (Get-Date "31.01.2020") -StartDate (Get-Date "01.01.2020") -Name "NewIteration" +```powershell +Add-VSTeamIteration -ProjectName "Demo" -FinishDate "31.01.2020" -StartDate "01.01.2020" -Name "NewIteration" ``` This command adds a new iteration named NewIteration to the Demo project with the start date 01.01.2020 and finish date 31.01.2020. @@ -32,25 +32,25 @@ This command adds a new iteration named NewIteration to the Demo project with th ## PARAMETERS - - -### -Name +### Name Name of the new iteration. ```yaml Type: string +Required: True ``` -### -Path +### Path Path of the existing iteration under where the new one will be created. ```yaml Type: string +Required: True ``` -### -StartDate +### StartDate Start date of the iteration. @@ -58,7 +58,7 @@ Start date of the iteration. Type: datetime ``` -### -FinishDate +### FinishDate Finish date of the iteration. @@ -66,6 +66,8 @@ Finish date of the iteration. Type: datetime ``` + + ## INPUTS ## OUTPUTS @@ -76,8 +78,12 @@ Type: datetime This function is a wrapper of the base function Add-VSTeamClassificationNode. + + ## RELATED LINKS + + [Add-VSTeamArea](Add-VSTeamArea.md) [Add-VSTeamClassificationNode](Add-VSTeamClassificationNode.md) diff --git a/.docs/Add-VSTeamKubernetesEndpoint.md b/.docs/Add-VSTeamKubernetesEndpoint.md index 81fffe567..6e30bed97 100644 --- a/.docs/Add-VSTeamKubernetesEndpoint.md +++ b/.docs/Add-VSTeamKubernetesEndpoint.md @@ -18,9 +18,7 @@ This is only used when using the Kubernetes tasks. ## PARAMETERS - - -### -Kubeconfig +### Kubeconfig kubeconfig as JSON string @@ -30,7 +28,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -KubernetesUrl +### KubernetesUrl URL of Kubernetes cluster @@ -40,7 +38,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -EndpointName +### EndpointName The name displayed on the services page. In AzD this is the Connection Name. @@ -50,7 +48,7 @@ Type: String Position: 3 ``` -### -ClientCertificateData +### ClientCertificateData Client certificate from Kubeconfig @@ -59,7 +57,7 @@ Type: String Required: True ``` -### -ClientKeyData +### ClientKeyData Client private key from Kubeconfig @@ -69,7 +67,7 @@ Parameter Sets: Plain Required: True ``` -### -AcceptUntrustedCerts +### AcceptUntrustedCerts Accept untrusted certificates for cluster @@ -77,7 +75,7 @@ Accept untrusted certificates for cluster Type: Switch ``` -### -GeneratePfx +### GeneratePfx Generate pfx file @@ -85,6 +83,8 @@ Generate pfx file Type: Switch ``` + + ## INPUTS ### System.String @@ -95,8 +95,12 @@ Type: Switch ## NOTES + + ## RELATED LINKS + + [Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) [Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) diff --git a/.docs/Add-VSTeamMembership.md b/.docs/Add-VSTeamMembership.md index 2140f9c08..07cd3a943 100644 --- a/.docs/Add-VSTeamMembership.md +++ b/.docs/Add-VSTeamMembership.md @@ -14,12 +14,12 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> $user = Get-VSTeamUser | ? DisplayName -eq 'Test User' -PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' -PS C:\> Add-VSTeamMembership -MemberDescriptor $user.Descriptor -ContainerDescriptor $group.Descriptor +```powershell +$user = Get-VSTeamUser | ? DisplayName -eq 'Test User' +$group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' +Add-VSTeamMembership -MemberDescriptor $user.Descriptor -ContainerDescriptor $group.Descriptor ``` Adds Test User to the Endpoint Administrators group. @@ -36,8 +36,12 @@ Adds Test User to the Endpoint Administrators group. ## NOTES + + ## RELATED LINKS + + [Get-VsTeamUser](Get-VsTeamUser.md) [Get-VsTeamGroup](Get-VsTeamGroup.md) diff --git a/.docs/Add-VSTeamNuGetEndpoint.md b/.docs/Add-VSTeamNuGetEndpoint.md index 9541e6fba..98add6b71 100644 --- a/.docs/Add-VSTeamNuGetEndpoint.md +++ b/.docs/Add-VSTeamNuGetEndpoint.md @@ -16,12 +16,12 @@ This is only used when using the NuGet tasks. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> $apikey = Read-Host -Prompt 'ApiKey' -AsSecureString +```powershell +$apikey = Read-Host -Prompt 'ApiKey' -AsSecureString ApiKey: ************************************ -PS C:\> Add-NuGetEndpoint -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -SecureApiKey $apikey +Add-NuGetEndpoint -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -SecureApiKey $apikey ``` This will add a project name MyProject with no description using the Scrum process @@ -29,9 +29,7 @@ template and Git source control. ## PARAMETERS - - -### -NuGetUrl +### NuGetUrl URL of the NuGet server. @@ -42,7 +40,7 @@ Position: 1 Accept pipeline input: true (ByPropertyName) ``` -### -PersonalAccessToken +### PersonalAccessToken Authentication Token generated by NuGet. @@ -54,7 +52,7 @@ Position: Named Accept pipeline input: true (ByPropertyName) ``` -### -ApiKey +### ApiKey Authentication ApiKey generated by NuGet. @@ -66,7 +64,7 @@ Position: Named Accept pipeline input: true (ByPropertyName) ``` -### -Username +### Username Username to use with basic authentication. @@ -76,7 +74,7 @@ Parameter Sets: SecurePassword Position: Named ``` -### -EndpointName +### EndpointName The name displayed on the services page. In AzD this is the Connection Name. @@ -86,7 +84,7 @@ Type: String Position: Named ``` -### -SecureApiKey +### SecureApiKey A secured string to capture your sensitive information. @@ -98,7 +96,7 @@ Parameter Sets: SecureApiKey Required: True ``` -### -SecurePersonalAccessToken +### SecurePersonalAccessToken A secured string to capture your sensitive information. @@ -112,7 +110,7 @@ Parameter Sets: SecureToken Required: True ``` -### -SecurePassword +### SecurePassword A secured string to capture your sensitive information. @@ -122,14 +120,20 @@ Parameter Sets: SecurePassword Required: True ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) [Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) diff --git a/.docs/Add-VSTeamPolicy.md b/.docs/Add-VSTeamPolicy.md index 7c08ceb43..8b3d81780 100644 --- a/.docs/Add-VSTeamPolicy.md +++ b/.docs/Add-VSTeamPolicy.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamPolicy -ProjectName Demo -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} +```powershell +Add-VSTeamPolicy -ProjectName Demo -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} ``` This command adds a new policy to the Demo project's repository specified. The policy added requires a minimum number of reviewers and applies to the master branch. Specifying `-blocking` will block pushes to master directly. ## PARAMETERS - - -### -type +### type Specifies the id of the type of policy to be created. @@ -35,7 +33,7 @@ Type: Guid Required: True ``` -### -enabled +### enabled Enables the policy @@ -43,7 +41,7 @@ Enables the policy Type: Switch ``` -### -blocking +### blocking Determines if the policy will block pushes to the branch if the policy is not adhered to. @@ -51,7 +49,7 @@ Determines if the policy will block pushes to the branch if the policy is not ad Type: Switch ``` -### -settings +### settings The settings for the policy. @@ -62,14 +60,20 @@ Type: Hashtable Required: True ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Get-VSTeamPolicy](Get-VSTeamPolicy.md) [Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) diff --git a/.docs/Add-VSTeamProfile.md b/.docs/Add-VSTeamProfile.md index 08e230137..97570b6d0 100644 --- a/.docs/Add-VSTeamProfile.md +++ b/.docs/Add-VSTeamProfile.md @@ -12,33 +12,33 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamProfile +```powershell +Add-VSTeamProfile ``` You will be prompted for the account name and personal access token. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Add-VSTeamProfile -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Version TFS2018 +```powershell +Add-VSTeamProfile -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Version TFS2018 ``` Allows you to provide all the information on the command line. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Add-VSTeamProfile -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication +```powershell +Add-VSTeamProfile -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication ``` On Windows, allows you use to use Windows authentication against a local TFS server. ## PARAMETERS -### -Account +### Account The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. @@ -57,7 +57,7 @@ Required: True Position: 1 ``` -### -PAT +### PAT A secured string to capture your personal access token. @@ -72,7 +72,7 @@ Parameter Sets: Secure Required: True ``` -### -PersonalAccessToken +### PersonalAccessToken The personal access token from AzD/TFS to use to access this account. @@ -83,7 +83,7 @@ Required: True Position: 2 ``` -### -UseWindowsAuthentication +### UseWindowsAuthentication Allows the use of the current user's Windows credentials to authenticate against a local TFS. @@ -92,7 +92,7 @@ Type: SwitchParameter Parameter Sets: Windows ``` -### -UseBearerToken +### UseBearerToken Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. @@ -101,7 +101,7 @@ Type: SwitchParameter Parameter Sets: Secure, Plain ``` -### -Name +### Name Optional name for the profile. If this parameter is not provided the account will also serve as the name. @@ -119,8 +119,8 @@ Position: 3 ## NOTES -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + diff --git a/.docs/Add-VSTeamProject.md b/.docs/Add-VSTeamProject.md index c0ca2d5e0..595ee6e90 100644 --- a/.docs/Add-VSTeamProject.md +++ b/.docs/Add-VSTeamProject.md @@ -14,19 +14,19 @@ This will create a new Team Project in your Team Foundation Server or Team Servi ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamProject 'MyProject' +```powershell +Add-VSTeamProject 'MyProject' ``` This will add a project name MyProject with no description using the Scrum process template and Git source control. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Add-VSTeamProject 'MyProject' -TFVC -ProcessTemplate Agile +```powershell +Add-VSTeamProject 'MyProject' -TFVC -ProcessTemplate Agile ``` This will add a project name MyProject with no description using the Agile process @@ -34,7 +34,7 @@ template and TFVC source control. ## PARAMETERS -### -ProjectName +### ProjectName The name of the project to create. @@ -45,7 +45,7 @@ Required: True Position: 0 ``` -### -ProcessTemplate +### ProcessTemplate The name of the process template to use for the project. @@ -56,7 +56,7 @@ Type: String Default value: Scrum ``` -### -Description +### Description The description of the team project. @@ -64,7 +64,7 @@ The description of the team project. Type: String ``` -### -TFVC +### TFVC Switches the source control from Git to TFVC. @@ -78,9 +78,11 @@ Type: SwitchParameter ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + [Remove-VSTeamProject](Remove-VSTeamProject.md) diff --git a/.docs/Add-VSTeamProjectPermission.md b/.docs/Add-VSTeamProjectPermission.md index 76b83772d..eb11e2284 100644 --- a/.docs/Add-VSTeamProjectPermission.md +++ b/.docs/Add-VSTeamProjectPermission.md @@ -16,43 +16,43 @@ ## PARAMETERS - - -### -Descriptor +### Descriptor ```yaml Type: String Required: True ``` -### -User +### User ```yaml Type: VSTeamUser Required: True ``` -### -Group +### Group ```yaml Type: VSTeamGroup Required: True ``` -### -Allow +### Allow ```yaml Type: VSTeamProjectPermissions Required: True ``` -### -Deny +### Deny ```yaml Type: VSTeamProjectPermissions Required: True ``` + + ## INPUTS ## OUTPUTS @@ -61,4 +61,8 @@ Required: True ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamPullRequest.md b/.docs/Add-VSTeamPullRequest.md index fe9cf42d5..d5b7aa2c9 100644 --- a/.docs/Add-VSTeamPullRequest.md +++ b/.docs/Add-VSTeamPullRequest.md @@ -14,21 +14,19 @@ Create a new Pull Request ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Add-VSTeamPullRequest -ProjectName project -RepositoryId $r.RepositoryId -SourceRefName "refs/heads/mybranch" -TargetRefName "refs/heads/master" -Title "My PR" -Description "My Description" -Draft +```powershell +Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken +$r = Get-VSTeamGitRepository -ProjectName project -Name demorepo +Add-VSTeamPullRequest -ProjectName project -RepositoryId $r.RepositoryId -SourceRefName "refs/heads/mybranch" -TargetRefName "refs/heads/master" -Title "My PR" -Description "My Description" -Draft ``` Create a new pull request as a draft ## PARAMETERS - - -### -RepositoryId +### RepositoryId Specifies the ID of the repository @@ -39,7 +37,7 @@ Aliases: Id Accept pipeline input: true (ByPropertyName) ``` -### -SourceRefName +### SourceRefName A source reference, like a branch or commit Needs to be in ref format like refs/heads/MyBranch @@ -49,7 +47,7 @@ Type: String Required: True ``` -### -TargetRefName +### TargetRefName A target reference, like a branch or commit Needs to be in ref format like refs/heads/MyBranch @@ -59,7 +57,7 @@ Type: String Required: True ``` -### -Title +### Title The title of the pull request @@ -68,7 +66,7 @@ Type: String Required: True ``` -### -Description +### Description The description of the pull request @@ -77,7 +75,7 @@ Type: String Required: True ``` -### -Draft +### Draft Mark the new pull request as a draft @@ -85,18 +83,20 @@ Mark the new pull request as a draft Type: Switch ``` - - - + - + ## INPUTS ## OUTPUTS -### Team.PullRequest +### vsteam_lib.PullRequest ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamRelease.md b/.docs/Add-VSTeamRelease.md index 29365367a..607008635 100644 --- a/.docs/Add-VSTeamRelease.md +++ b/.docs/Add-VSTeamRelease.md @@ -18,30 +18,30 @@ You must call Set-VSTeamAccount before calling this function. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamBuild | ft id,name +```powershell +Get-VSTeamBuild | ft id,name id name -- ---- 44 Demo-CI-44 -PS C:\> Get-VSTeamReleaseDefinition -Expand artifacts | ft id,name,@{l='Alias';e={$_.artifacts[0].alias}} +Get-VSTeamReleaseDefinition -Expand artifacts | ft id,name,@{l='Alias';e={$_.artifacts[0].alias}} id name Alias -- ---- ----- 1 Demo-CD Demo-CI -PS C:\> Add-VSTeamRelease -DefinitionId 1 -Description Test -ArtifactAlias Demo-CI -BuildId 44 +Add-VSTeamRelease -DefinitionId 1 -Description Test -ArtifactAlias Demo-CI -BuildId 44 ``` This example shows how to find the Build ID, Artifact Alias, and Release definition ID required to start a release. If you call Set-VSTeamDefaultProject you can use Example 2 which is much easier. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Add-VSTeamRelease -DefinitionName Demo-CD -Description Test -BuildNumber Demo-CI-44 +```powershell +Add-VSTeamRelease -DefinitionName Demo-CD -Description Test -BuildNumber Demo-CI-44 ``` This command starts a new release using the Demo-CD release definition and the build with build number Demo-CI-44. @@ -50,9 +50,7 @@ You must set a default project to tab complete DefinitionName and BuildNumber. ## PARAMETERS - - -### -DefinitionId +### DefinitionId The id of the release definition to use. @@ -62,7 +60,7 @@ Parameter Sets: ById Required: True ``` -### -Description +### Description The description to use on the release. @@ -71,7 +69,7 @@ Type: String Required: True ``` -### -ArtifactAlias +### ArtifactAlias The alias of the artifact to use with this release. @@ -81,7 +79,7 @@ Parameter Sets: ById Required: True ``` -### -Name +### Name The name of this release. @@ -89,7 +87,7 @@ The name of this release. Type: String ``` -### -BuildId +### BuildId The id of the build to use with this release. @@ -99,7 +97,7 @@ Parameter Sets: ById Required: True ``` -### -DefinitionName +### DefinitionName The name of the release definition to use. @@ -109,7 +107,7 @@ Parameter Sets: ByName Accept pipeline input: true (ByPropertyName) ``` -### -SourceBranch +### SourceBranch The branch of the artifact @@ -117,7 +115,7 @@ The branch of the artifact Type: String ``` -### -BuildNumber +### BuildNumber The number of the build to use. @@ -127,7 +125,9 @@ Parameter Sets: ByName Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS @@ -135,10 +135,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamReleaseDefinition.md b/.docs/Add-VSTeamReleaseDefinition.md index 256662b41..f62e88c19 100644 --- a/.docs/Add-VSTeamReleaseDefinition.md +++ b/.docs/Add-VSTeamReleaseDefinition.md @@ -16,19 +16,17 @@ You must call Set-VSTeamAccount before calling this function. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamReleaseDefinition -ProjectName demo -inFile release.json +```powershell +Add-VSTeamReleaseDefinition -ProjectName demo -inFile release.json ``` This command reads release.json and creates a new release definition from it on the demo team project. ## PARAMETERS - - -### -InFile +### InFile Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. @@ -38,18 +36,18 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ### System.String ## OUTPUTS -## RELATED LINKS - ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. + -You can tab complete from a list of available projects. +## RELATED LINKS -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + \ No newline at end of file diff --git a/.docs/Add-VSTeamServiceEndpoint.md b/.docs/Add-VSTeamServiceEndpoint.md index ee8775b3e..0b122a4f0 100644 --- a/.docs/Add-VSTeamServiceEndpoint.md +++ b/.docs/Add-VSTeamServiceEndpoint.md @@ -16,9 +16,7 @@ The cmdlet adds a new generic connection between TFS/AzD and a third party servi ## PARAMETERS - - -### -Object +### Object Hashtable of Payload for REST call @@ -28,7 +26,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -EndpointName +### EndpointName The name displayed on the services page. In AzD this is the Connection Name. @@ -37,7 +35,7 @@ Type: String Position: 2 ``` -### -EndpointType +### EndpointType Type of endpoint (eg. `kubernetes`, `sonarqube`). See AzD service page for supported endpoints. @@ -46,16 +44,22 @@ Type: String Position: 3 ``` + + ## INPUTS ## OUTPUTS -### Team.ServiceEndpoint +### vsteam_lib.ServiceEndpoint ## NOTES + + ## RELATED LINKS + + [Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) [Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) diff --git a/.docs/Add-VSTeamServiceFabricEndpoint.md b/.docs/Add-VSTeamServiceFabricEndpoint.md index 46866e970..282bf7e33 100644 --- a/.docs/Add-VSTeamServiceFabricEndpoint.md +++ b/.docs/Add-VSTeamServiceFabricEndpoint.md @@ -14,39 +14,37 @@ The cmdlet adds a new Service Fabric service endpoint to an existing project. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "NoAuthTest" -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false +```powershell +Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "NoAuthTest" -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false ``` Adds a Service Fabric Endpoint for a non-secure cluster -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "AzureAdAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -username "someUser@someplace.com" -password $password +```powershell +$password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force +Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "AzureAdAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -username "someUser@someplace.com" -password $password ``` Adds a Service Fabric Endpoint for an Azure AD secured cluster. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force -PS C:\> $pathToPFX = "C:\someFolder\theCertificateFile.pfx" -PS C:\> $base64Cert = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes($pathToPFX)) -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "CertificateAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -certificate $base64Cert -certificatePassword $password +```powershell +$password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force +$pathToPFX = "C:\someFolder\theCertificateFile.pfx" +$base64Cert = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes($pathToPFX)) +Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "CertificateAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -certificate $base64Cert -certificatePassword $password ``` Adds a Service Fabric Endpoint for a certificate secured cluster. ## PARAMETERS - - -### -url +### url The url of the Service Fabric management endpoint. @@ -57,7 +55,7 @@ Position: 1 Accept pipeline input: true (ByPropertyName) ``` -### -useWindowsSecurity +### useWindowsSecurity If windows integrated authentication should be enabled. If set to false, all authentication is disabled. @@ -67,7 +65,7 @@ Position: 2 Accept pipeline input: true (ByPropertyName) ``` -### -clusterSpn +### clusterSpn Specify the cluster service principal name, for use with windows integrated authentication. @@ -76,7 +74,7 @@ Type: String Accept pipeline input: true (ByPropertyName) ``` -### -serverCertThumbprint +### serverCertThumbprint The server certificate thumbprint, used for communicating with the Service Fabric cluster. @@ -87,7 +85,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -username +### username The Azure AD Username, used for communicating with the Service Fabric cluster. @@ -98,7 +96,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -password +### password The Password for the Azure AD User, used for communicating with the Service Fabric cluster. @@ -109,7 +107,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -certificate +### certificate The certificate used for communicating with the Service Fabric cluster. @@ -120,7 +118,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -certificatePassword +### certificatePassword The Password for the certificate used for communicating with the Service Fabric cluster. @@ -131,7 +129,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -endpointName +### endpointName The name displayed on the services page. In AzD this is the Connection Name. @@ -142,16 +140,22 @@ Position: 3 Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ## OUTPUTS -### Team.ServiceEndpoint +### vsteam_lib.ServiceEndpoint ## NOTES + + ## RELATED LINKS + + [Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) [Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) diff --git a/.docs/Add-VSTeamSonarQubeEndpoint.md b/.docs/Add-VSTeamSonarQubeEndpoint.md index dd605ebed..56799d9a6 100644 --- a/.docs/Add-VSTeamSonarQubeEndpoint.md +++ b/.docs/Add-VSTeamSonarQubeEndpoint.md @@ -20,9 +20,7 @@ Using SonarQube with the Maven tasks uses a Generic Connection type. ## PARAMETERS - - -### -SonarQubeUrl +### SonarQubeUrl URL of the sonarqube server. @@ -33,7 +31,7 @@ Position: 1 Accept pipeline input: true (ByPropertyName) ``` -### -PersonalAccessToken +### PersonalAccessToken Authentication Token generated by SonarQube. @@ -45,7 +43,7 @@ Position: 2 Accept pipeline input: true (ByPropertyName) ``` -### -EndpointName +### EndpointName The name displayed on the services page. In AzD this is the Connection Name. @@ -55,7 +53,7 @@ Type: String Position: 3 ``` -### -SecurePersonalAccessToken +### SecurePersonalAccessToken A secured string to capture your personal access token. @@ -69,14 +67,20 @@ Parameter Sets: Secure Required: True ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) [Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) diff --git a/.docs/Add-VSTeamTaskGroup.md b/.docs/Add-VSTeamTaskGroup.md index ceb57ccff..e82debf7e 100644 --- a/.docs/Add-VSTeamTaskGroup.md +++ b/.docs/Add-VSTeamTaskGroup.md @@ -14,7 +14,7 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 ```powershell @@ -33,27 +33,8 @@ This example is useful for when one wants to copy an existing task group in one ## PARAMETERS -### -ProjectName - - -### -WhatIf - -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InFile +### InFile The path to the json file that represents the task group @@ -69,7 +50,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Body +### Body The json that represents the task group as a string @@ -85,10 +66,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorTask, -InformationAction, -InformationTask, -OutTask, -OutBuffer, -PipelineTask, -Verbose, -WarningAction, and -WarningTask. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS @@ -100,8 +78,12 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES + + ## RELATED LINKS + + [Update-VSTeamTaskGroup](Update-VSTeamTaskGroup.md) [Get-VSTeamTaskGroup](Get-VSTeamTaskGroup.md) diff --git a/.docs/Add-VSTeamUserEntitlement.md b/.docs/Add-VSTeamUserEntitlement.md index a9a0c0a73..c229318b2 100644 --- a/.docs/Add-VSTeamUserEntitlement.md +++ b/.docs/Add-VSTeamUserEntitlement.md @@ -16,9 +16,7 @@ ## PARAMETERS - - -### -License +### License Type of Account License. The acceptable values for this parameter are: @@ -35,7 +33,7 @@ Required: True Default value: EarlyAdopter ``` -### -Group +### Group The acceptable values for this parameter are: @@ -51,7 +49,7 @@ Required: True Default value: ProjectContributor ``` -### -LicensingSource +### LicensingSource Licensing Source (e.g. Account. MSDN etc.). The acceptable values for this parameter are: @@ -67,7 +65,7 @@ Type: String Default value: account ``` -### -MSDNLicenseType +### MSDNLicenseType Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.). The acceptable values for this parameter are: @@ -85,6 +83,8 @@ Type: String Default value: none ``` + + ## INPUTS ## OUTPUTS @@ -93,4 +93,8 @@ Default value: none ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamVariableGroup.md b/.docs/Add-VSTeamVariableGroup.md index f0a7227a5..844eed948 100644 --- a/.docs/Add-VSTeamVariableGroup.md +++ b/.docs/Add-VSTeamVariableGroup.md @@ -14,10 +14,9 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 ```powershell - $methodParameters = @{ ProjectName = "some_project_name" Name = "new_variable_group" @@ -37,10 +36,9 @@ $methodParameters = @{ Add-VSTeamVariableGroup @methodParameters ``` -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 ```powershell - $methodParameters = @{ ProjectName = "some_project_name" Name = "new_variable_group" @@ -63,7 +61,7 @@ $methodParameters = @{ Add-VSTeamVariableGroup @methodParameters ``` -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 ```powershell # Copy variable group varGroupName from project sourceProjectName to project targetProjectName. If varGroupName already exists, we'll update it; else, we'll add it. @@ -86,9 +84,7 @@ else { ## PARAMETERS - - -### -Description +### Description The variable group description @@ -104,7 +100,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Name +### Name The variable group name @@ -120,7 +116,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -ProviderData +### ProviderData The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. @@ -136,7 +132,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Type +### Type The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. @@ -153,7 +149,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Variables +### Variables The variable group variables. @@ -169,7 +165,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Body +### Body The json that represents the variable group as a string @@ -185,10 +181,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS @@ -202,8 +195,12 @@ System.Collections.Hashtable ## NOTES + + ## RELATED LINKS + + [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) diff --git a/.docs/Add-VSTeamWorkItem.md b/.docs/Add-VSTeamWorkItem.md index 9d6bb89bd..c9001d57b 100644 --- a/.docs/Add-VSTeamWorkItem.md +++ b/.docs/Add-VSTeamWorkItem.md @@ -14,34 +14,34 @@ Add-VSTeamWorkItem will add a new work item to your project. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task +```powershell +Set-VSTeamDefaultProject Demo +Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task ID Title Status -- ----- ------ 6 New Work Item To Do ``` -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" +```powershell +Set-VSTeamDefaultProject Demo +Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" ID Title Status -- ----- ------ 6 New Work Item To Do ``` -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> $additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"} -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields +```powershell +Set-VSTeamDefaultProject Demo +$additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"} +Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields ID Title Status -- ----- ------ @@ -50,9 +50,7 @@ ID Title Status ## PARAMETERS - - -### -Title +### Title The title of the work item @@ -61,7 +59,7 @@ Type: String Required: True ``` -### -Description +### Description The Description of the work item @@ -70,7 +68,7 @@ Type: String Required: False ``` -### -IterationPath +### IterationPath The IterationPath of the work item @@ -79,7 +77,7 @@ Type: String Required: False ``` -### -AssignedTo +### AssignedTo The email address of the user this work item will be assigned to. @@ -88,7 +86,7 @@ Type: String Required: False ``` -### -WorkItemType +### WorkItemType The type of work item to add. @@ -101,7 +99,7 @@ Type: String Required: True ``` -### -ParentId +### ParentId The Id of the parent work item that this work item will be related to. @@ -110,7 +108,7 @@ Type: Int Required: False ``` -### -AdditionalFields +### AdditionalFields Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'. @@ -119,6 +117,8 @@ Type: Hashtable Required: False ``` + + ## INPUTS ### System.String @@ -131,12 +131,14 @@ WorkItemType ## NOTES -WorkItemType is a dynamic parameter and use the default -project value to query their validate set. +WorkItemType is a dynamic parameter and uses the project value to query their validate set. + +If you do not set the default project by calling Set-VSTeamDefaultProject before calling Add-VSTeamWorkItem you need to provide the -ProjectName before -WorkItemType or will have to type in the names. -If you do not set the default project by called Set-VSTeamDefaultProject before -calling Add-VSTeamWorkItem you will have to type in the names. +Any of the basic work item parameters defined in this method, will cause an exception if also added to the parameter AdditionalFields, since it is redundant. Either only use the parameter or define them in the AdditionalFields parameter. -Any of the basic work item parameters defined in this method, will cause an exception if also added to the parameter AdditionalFields, since it is redundant. Either only use the parameter OR define them in the AdditionalFields parameter. + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamWorkItemAreaPermission.md b/.docs/Add-VSTeamWorkItemAreaPermission.md index e7289be14..00f696e02 100644 --- a/.docs/Add-VSTeamWorkItemAreaPermission.md +++ b/.docs/Add-VSTeamWorkItemAreaPermission.md @@ -16,57 +16,57 @@ ## PARAMETERS - - -### -AreaID +### AreaID ```yaml Type: Int32 Required: True ``` -### -AreaPath +### AreaPath ```yaml Type: String Required: True ``` -### -Descriptor +### Descriptor ```yaml Type: String Required: True ``` -### -User +### User ```yaml Type: VSTeamUser Required: True ``` -### -Group +### Group ```yaml Type: VSTeamGroup Required: True ``` -### -Allow +### Allow ```yaml Type: VSTeamWorkItemAreaPermissions Required: True ``` -### -Deny +### Deny ```yaml Type: VSTeamWorkItemAreaPermissions Required: True ``` + + ## INPUTS ## OUTPUTS @@ -75,4 +75,8 @@ Required: True ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Add-VSTeamWorkItemIterationPermission.md b/.docs/Add-VSTeamWorkItemIterationPermission.md index f15691b03..6109eb0eb 100644 --- a/.docs/Add-VSTeamWorkItemIterationPermission.md +++ b/.docs/Add-VSTeamWorkItemIterationPermission.md @@ -16,57 +16,57 @@ ## PARAMETERS - - -### -IterationID +### IterationID ```yaml Type: Int32 Required: True ``` -### -IterationPath +### IterationPath ```yaml Type: String Required: True ``` -### -Descriptor +### Descriptor ```yaml Type: String Required: True ``` -### -User +### User ```yaml Type: VSTeamUser Required: True ``` -### -Group +### Group ```yaml Type: VSTeamGroup Required: True ``` -### -Allow +### Allow ```yaml Type: VSTeamWorkItemIterationPermissions Required: True ``` -### -Deny +### Deny ```yaml Type: VSTeamWorkItemIterationPermissions Required: True ``` + + ## INPUTS ## OUTPUTS @@ -75,4 +75,8 @@ Required: True ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Clear-VSTeamDefaultAPITimeout.md b/.docs/Clear-VSTeamDefaultAPITimeout.md index 7e34089c7..fbcb3cd68 100644 --- a/.docs/Clear-VSTeamDefaultAPITimeout.md +++ b/.docs/Clear-VSTeamDefaultAPITimeout.md @@ -14,17 +14,17 @@ Clears the value stored in the default timeout parameter value. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Clear-VSTeamDefaultAPITimeout +```powershell +Clear-VSTeamDefaultAPITimeout ``` This will clear the default timeout parameter value. ## PARAMETERS -### -Level +### Level On Windows allows you to clear your default timeout at the Process, User or Machine levels. @@ -38,8 +38,8 @@ Type: String ## NOTES -## RELATED LINKS + -[Set-VSTeamDefaultAPITimeout](Set-VSTeamDefaultAPITimeout.md) +## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + diff --git a/.docs/Clear-VSTeamDefaultProject.md b/.docs/Clear-VSTeamDefaultProject.md index e5a44abe8..7954177f3 100644 --- a/.docs/Clear-VSTeamDefaultProject.md +++ b/.docs/Clear-VSTeamDefaultProject.md @@ -14,17 +14,17 @@ Clears the value stored in the default project parameter value. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Clear-VSTeamDefaultProject +```powershell +Clear-VSTeamDefaultProject ``` This will clear the default project parameter value. You will now have to provide a project for any functions that require a project. ## PARAMETERS -### -Level +### Level On Windows allows you to clear your default project at the Process, User or Machine levels. @@ -38,8 +38,8 @@ Type: String ## NOTES -## RELATED LINKS + -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) +## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + diff --git a/.docs/Disable-VSTeamAgent.md b/.docs/Disable-VSTeamAgent.md index cc34e5a47..08e55251a 100644 --- a/.docs/Disable-VSTeamAgent.md +++ b/.docs/Disable-VSTeamAgent.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PoolId +### PoolId Id of the pool. @@ -26,7 +26,7 @@ Required: True Accept pipeline input: true (ByValue) ``` -### -Id +### Id Id of the agent to disable. @@ -37,6 +37,8 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ### System.String @@ -45,4 +47,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Enable-VSTeamAgent.md b/.docs/Enable-VSTeamAgent.md index ce037782a..5b602552d 100644 --- a/.docs/Enable-VSTeamAgent.md +++ b/.docs/Enable-VSTeamAgent.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PoolId +### PoolId Id of the pool. @@ -26,7 +26,7 @@ Required: True Accept pipeline input: true (ByValue) ``` -### -Id +### Id Id of the agent to enable. @@ -45,4 +45,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeam.md b/.docs/Get-VSTeam.md index 1721794c2..a13397848 100644 --- a/.docs/Get-VSTeam.md +++ b/.docs/Get-VSTeam.md @@ -14,11 +14,17 @@ ## EXAMPLES -## PARAMETERS +### Example 1: Get team by name - +```powershell +Get-VSTeamProject | Get-VSTeam 'Test Team' +``` -### -Skip +This command pipes the project name to Get-VSTeam and returns the team with the name 'Test Team' + +## PARAMETERS + +### Skip The number of items to skip. @@ -27,16 +33,7 @@ Type: Int32 Parameter Sets: List ``` -### -TeamId - -The id of the team to retrieve. - -```yaml -Type: String[] -Parameter Sets: ByID -``` - -### -Top +### Top Specifies the maximum number to return. @@ -45,21 +42,37 @@ Type: Int32 Parameter Sets: List ``` -### -Name +### Name The name of the team to retrieve. ```yaml Type: String[] Parameter Sets: ByName +Position: 0 ``` +### TeamId + +The id of the team to retrieve. + +```yaml +Type: String[] +Parameter Sets: ByID +``` + + + ## INPUTS ## OUTPUTS -### Team.Team +### vsteam_lib.Team ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamAPIVersion.md b/.docs/Get-VSTeamAPIVersion.md index 222d5b305..e155339ca 100644 --- a/.docs/Get-VSTeamAPIVersion.md +++ b/.docs/Get-VSTeamAPIVersion.md @@ -14,25 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamAPIVersion +```powershell +Get-VSTeamAPIVersion ``` This command gets the API versions currently in use. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamAPIVersion -Service Release +```powershell +Get-VSTeamAPIVersion -Service Release ``` This command gets the version of the Release API currently in use. ## PARAMETERS -### -Service +### Service Specifies the service to change. The acceptable values for this parameter are: @@ -59,4 +59,8 @@ Parameter Sets: Service ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamAccessControlList.md b/.docs/Get-VSTeamAccessControlList.md index 9689a4af8..b8aed42d9 100644 --- a/.docs/Get-VSTeamAccessControlList.md +++ b/.docs/Get-VSTeamAccessControlList.md @@ -14,33 +14,35 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell +```powershell Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList ``` ## PARAMETERS -### -SecurityNamespace +### SecurityNamespace -Security namespace identifier. +Security namespace object. ```yaml -Type: VSTeamSecurityNamespace +Type: vsteam_lib.SecurityNamespace +Parameter Sets: ByNamespace Required: True ``` -### -SecurityNamespaceId +### SecurityNamespaceId Security namespace identifier. ```yaml Type: String +Parameter Sets: ByNamespaceId Required: True ``` -### -Token +### Token Security token @@ -49,7 +51,7 @@ Type: String Required: True ``` -### -Descriptors +### Descriptors An optional filter string containing a list of identity descriptors whose ACEs should be retrieved. If this is not set entire ACLs will be returned. @@ -58,7 +60,7 @@ Type: String Required: True ``` -### -IncludeExtendedInfo +### IncludeExtendedInfo If set, populate the extended information properties for the access control entries contained in the returned lists. @@ -67,7 +69,7 @@ Type: Switch Required: True ``` -### -Recurse +### Recurse If true and this is a hierarchical namespace, return child ACLs of the specified token. @@ -80,8 +82,12 @@ Required: True ## OUTPUTS -### VSTeamAccessControlList +### vsteam_lib.AccessControlList ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamAgent.md b/.docs/Get-VSTeamAgent.md index d5f199775..6a427d99f 100644 --- a/.docs/Get-VSTeamAgent.md +++ b/.docs/Get-VSTeamAgent.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PoolId +### PoolId Id of the pool. @@ -26,7 +26,7 @@ Required: True Accept pipeline input: true (ByValue) ``` -### -Id +### Id Id of the agent to return. @@ -52,4 +52,8 @@ To read system capabilities that contain dots you have to use the PSObject Prope (Get-VSTeamAgent 1 91).systemCapabilities.PSObject.Properties['Agent.OS'].Value + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamApproval.md b/.docs/Get-VSTeamApproval.md index ab4f2557d..9acbc46ac 100644 --- a/.docs/Get-VSTeamApproval.md +++ b/.docs/Get-VSTeamApproval.md @@ -18,7 +18,7 @@ When using with AzD "IncludeMyGroupApprovals" will be added to the request when When using with TFS "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter, Release Id Filter are not empty and Status Filter equals Pending. -The Team.Approval type has three custom table formats: +The vsteam_lib.Approval type has three custom table formats: - Pending: ID, Status, Release Name, Environment, Type, Approver Name, Release Definitions - Approved: Release Name, Environment, Is Automated, Approval Type, Approver Name, Release Definitions, Comments @@ -26,35 +26,33 @@ The Team.Approval type has three custom table formats: ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo +```powershell +Get-VSTeamApproval -ProjectName Demo ``` This command gets a list of all pending approvals. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo -StatusFilter Approved | Format-Table -View Approved +```powershell +Get-VSTeamApproval -ProjectName Demo -StatusFilter Approved | Format-Table -View Approved ``` This command gets a list of all approved approvals using a custom table format. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo -AssignedToFilter Administrator -StatusFilter Rejected | FT -View Rejected +```powershell +Get-VSTeamApproval -ProjectName Demo -AssignedToFilter Administrator -StatusFilter Rejected | FT -View Rejected ``` This command gets a list of all approvals rejected by Administrator using a custom table format. ## PARAMETERS - - -### -StatusFilter +### StatusFilter By default the function returns Pending approvals. @@ -66,16 +64,15 @@ There is a custom table view for each status. Type: String ``` -### -ReleaseIdsFilter +### ReleaseId Only approvals for the release ids provided will be returned. ```yaml Type: Int32[] -Aliases: ReleaseIdFilter ``` -### -AssignedToFilter +### AssignedToFilter Approvals are filtered to only those assigned to this user. @@ -83,27 +80,23 @@ Approvals are filtered to only those assigned to this user. Type: String ``` + + ## INPUTS ## OUTPUTS -### Team.BuildDefinition +### vsteam_lib.BuildDefinition ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build definition IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) diff --git a/.docs/Get-VSTeamArea.md b/.docs/Get-VSTeamArea.md index 0779d52e5..8b0d5bb78 100644 --- a/.docs/Get-VSTeamArea.md +++ b/.docs/Get-VSTeamArea.md @@ -14,9 +14,7 @@ ## PARAMETERS - - -### -Depth +### Depth Depth of children to fetch. @@ -24,7 +22,7 @@ Depth of children to fetch. Type: int32 ``` -### -Path +### Path Path of the classification node. @@ -32,7 +30,7 @@ Path of the classification node. Type: string ``` -### -Ids +### Id Integer classification nodes ids. @@ -40,6 +38,8 @@ Integer classification nodes ids. Type: int32[] ``` + + ## INPUTS ## OUTPUTS @@ -50,8 +50,12 @@ Type: int32[] This is a wrapper function for Get-VSTeamClassificationNode + + ## RELATED LINKS + + [Get-VSTeamClassificationNode](Get-VSTeamClassificationNode.md) [Get-VSTeamIteration](Get-VSTeamIteration.md) diff --git a/.docs/Get-VSTeamBuild.md b/.docs/Get-VSTeamBuild.md index 50308de87..bca52a956 100644 --- a/.docs/Get-VSTeamBuild.md +++ b/.docs/Get-VSTeamBuild.md @@ -18,10 +18,10 @@ You can also specify a particular build by ID. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo | Format-List * +```powershell +Get-VSTeamBuild -ProjectName demo | Format-List * ``` This command gets a list of all builds in the demo project. @@ -29,43 +29,41 @@ This command gets a list of all builds in the demo project. The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the build objects. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -top 5 -resultFilter failed +```powershell +Get-VSTeamBuild -ProjectName demo -top 5 -resultFilter failed ``` This command gets a list of 5 failed builds in the demo project. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> 1203,1204 | Get-VSTeamBuild -ProjectName demo +```powershell +1203,1204 | Get-VSTeamBuild -ProjectName demo ``` This command gets builds with IDs 1203 and 1204 by using the pipeline. -### -------------------------- EXAMPLE 4 -------------------------- +### Example 4 -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203,1204 +```powershell +Get-VSTeamBuild -ProjectName demo -ID 1203,1204 ``` This command gets builds with IDs 1203 and 1204 by using the ID parameter. -### -------------------------- EXAMPLE 5 -------------------------- +### Example 5 -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203 -Raw +```powershell +Get-VSTeamBuild -ProjectName demo -ID 1203 -Raw ``` This command returns the raw object returned from the server. ## PARAMETERS - - -### -Top +### Top Specifies the maximum number to return. @@ -75,7 +73,7 @@ Parameter Sets: List Default value: 0 ``` -### -ResultFilter +### ResultFilter Specifies the result of the builds to return Succeeded, PartiallySucceeded, Failed, or Canceled. @@ -84,7 +82,7 @@ Type: String Parameter Sets: List ``` -### -ReasonFilter +### ReasonFilter Specifies the reason the build was created of the builds to return Manual, IndividualCI, BatchedCI, Schedule, UserCreated, ValidateShelveSet, CheckInShelveSet, Triggered, or All. @@ -93,7 +91,7 @@ Type: String Parameter Sets: List ``` -### -StatusFilter +### StatusFilter Specifies the status of the builds to return InProgress, Completed, Cancelling, Postponed, NotStarted, or All. @@ -102,7 +100,7 @@ Type: String Parameter Sets: List ``` -### -Queues +### Queues A comma-delimited list of queue IDs that specifies the builds to return. @@ -111,7 +109,7 @@ Type: Int32[] Parameter Sets: List ``` -### -Definitions +### Definitions A comma-delimited list of build definition IDs that specifies the builds to return. @@ -120,7 +118,7 @@ Type: Int32[] Parameter Sets: List ``` -### -BuildNumber +### BuildNumber Returns the build with this build number. @@ -133,7 +131,7 @@ Type: String Parameter Sets: List ``` -### -Type +### Type The type of builds to retrieve. @@ -142,7 +140,7 @@ Type: String Parameter Sets: List ``` -### -MaxBuildsPerDefinition +### MaxBuildsPerDefinition The maximum number of builds to retrieve for each definition. @@ -153,7 +151,7 @@ Type: Int32 Parameter Sets: List ``` -### -Properties +### Properties A comma-delimited list of extended properties to retrieve. @@ -164,7 +162,7 @@ Parameter Sets: List -### -JSON +### JSON Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. @@ -174,7 +172,7 @@ Required: True Parameter Sets: ByIDJson ``` -### -Raw +### Raw Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. @@ -184,27 +182,23 @@ Required: True Parameter Sets: ByIDRaw ``` + + ## INPUTS ## OUTPUTS -### Team.Build +### vsteam_lib.Build ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamBuild](Add-VSTeamBuild.md) diff --git a/.docs/Get-VSTeamBuildArtifact.md b/.docs/Get-VSTeamBuildArtifact.md index ced106136..33c4d9020 100644 --- a/.docs/Get-VSTeamBuildArtifact.md +++ b/.docs/Get-VSTeamBuildArtifact.md @@ -16,10 +16,10 @@ ## PARAMETERS - - + + ## INPUTS ## OUTPUTS @@ -28,4 +28,8 @@ ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamBuildDefinition.md b/.docs/Get-VSTeamBuildDefinition.md index 9fc5bb882..9145e5a67 100644 --- a/.docs/Get-VSTeamBuildDefinition.md +++ b/.docs/Get-VSTeamBuildDefinition.md @@ -20,37 +20,35 @@ You can also specify a particular build definition by ID. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo | Format-List * +```powershell +Get-VSTeamBuildDefinition -ProjectName Demo | Format-List * ``` This command gets a list of all build definitions in the demo project. The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the build definition objects. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Json +```powershell +Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Json ``` This command returns the raw object returned from the server formatted as a JSON string. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Raw +```powershell +Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Raw ``` This command returns the raw object returned from the server. ## PARAMETERS - - -### -Filter +### Filter Filters to definitions whose names equal this value. Append a * to filter to definitions whose names start with this value. For example: MS* @@ -60,21 +58,7 @@ Type: String Parameter Sets: List ``` -### -Type - -The type of the build definitions to retrieve. The acceptable values for this parameter are: - -- build -- xaml -- All - -```yaml -Type: String -Parameter Sets: List -Default value: All -``` - -### -Id +### Id Specifies one or more build definitions by ID. @@ -90,7 +74,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -Revision +### Revision Specifies the specific revision number of the definition to retrieve. @@ -100,17 +84,16 @@ Parameter Sets: ByID Default value: -1 ``` -### -JSON +### JSON Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. ```yaml Type: Switch Required: True -Parameter Sets: ByIDJson ``` -### -Raw +### Raw Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. @@ -120,21 +103,23 @@ Required: True Parameter Sets: ByIDRaw ``` + + ## INPUTS ## OUTPUTS -### Team.BuildDefinition +### vsteam_lib.BuildDefinition ## NOTES You can pipe build definition IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) diff --git a/.docs/Get-VSTeamBuildLog.md b/.docs/Get-VSTeamBuildLog.md index 1749d40fe..2ea32a1c7 100644 --- a/.docs/Get-VSTeamBuildLog.md +++ b/.docs/Get-VSTeamBuildLog.md @@ -14,10 +14,10 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamBuild -Top 1 | Get-VSTeamBuildLog +```powershell +Get-VSTeamBuild -Top 1 | Get-VSTeamBuildLog ``` This command displays the logs of the first build. @@ -27,11 +27,9 @@ displays the logs. ## PARAMETERS - - -### -Index +### Index Each task stores its logs in an array. If you know the index of a specific task you can return just its logs. If you do not provide a value all the logs are displayed. @@ -39,6 +37,8 @@ Each task stores its logs in an array. If you know the index of a specific task Type: Int32 ``` + + ## INPUTS ## OUTPUTS @@ -47,4 +47,8 @@ Type: Int32 ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamBuildTag.md b/.docs/Get-VSTeamBuildTag.md index bc672b043..9841bfd5a 100644 --- a/.docs/Get-VSTeamBuildTag.md +++ b/.docs/Get-VSTeamBuildTag.md @@ -16,10 +16,10 @@ ## PARAMETERS - - + + ## INPUTS ## OUTPUTS @@ -28,4 +28,8 @@ ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamBuildTimeline.md b/.docs/Get-VSTeamBuildTimeline.md index d821f7df2..1a68fe993 100644 --- a/.docs/Get-VSTeamBuildTimeline.md +++ b/.docs/Get-VSTeamBuildTimeline.md @@ -18,47 +18,46 @@ You can also specify a particular timeline by ID to get . ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 | Format-List * +```powershell +Get-VSTeamBuildTimeline -ProjectName demo -Id 1 | Format-List * ``` -This command gets a list of all timelines of thr build with Id 1 in the demo project. +This command gets a list of all timelines of the build with Id 1 in the demo project. The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the timeline objects. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 -Id 595dac0c-0f1a-4bfd-a35f-e5a838ac71d7 -ChangeId 2 -PlanId 356de525-47a9-4251-80c6-d3849a9d6382 +```powershell +Get-VSTeamBuildTimeline -ProjectName demo -Id 1 -TimelineId 595dac0c-0f1a-4bfd-a35f-e5a838ac71d7 -ChangeId 2 -PlanId 356de525-47a9-4251-80c6-d3849a9d6382 ``` -This command gets the timelines with ID 1 and timeline id 595dac0c-0f1a-4bfd-a35f-e5a838ac71d7. It is filtered with the change ID and plan ID. +This command gets the timelines with build Id 1 and timeline Id 595dac0c-0f1a-4bfd-a35f-e5a838ac71d7. It is filtered with the change ID and plan ID. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 -ID @(1,2) +```powershell +Get-VSTeamBuildTimeline -ProjectName demo -Id 1 -TimelineId @(1,2) ``` This command gets timelines with IDs 1 and 2 by using the ID parameter. -## PARAMETERS +### Example 4 - +```powershell +Get-VSTeamBuild | Get-VSTeamBuildTimeline -ProjectName demo +``` -### -BuildId +This command gets timelines with build Ids from the pipeline. -Build id where you get the time line from +## PARAMETERS -```yaml -Type: int[] -Parameter Sets: ByID -``` + -### -Id +### TimelineId Returns the timelines with the given timeline id. @@ -68,7 +67,7 @@ Aliases: TimelineId Parameter Sets: ByID ``` -### -ChangeId +### ChangeId Returns the timelines with the given change id. @@ -77,7 +76,7 @@ Type: Int32 Parameter Sets: ByID ``` -### -PlanId +### PlanId Returns the timelines with the given plan id. @@ -86,28 +85,22 @@ Type: Guid Parameter Sets: ByID ``` - + ## INPUTS ## OUTPUTS -### Team.Build +### vsteam_lib.Build ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Get-VSTeamBuild](Get-VSTeamBuild.md) \ No newline at end of file diff --git a/.docs/Get-VSTeamClassificationNode.md b/.docs/Get-VSTeamClassificationNode.md index 1813637d4..50a3c52f7 100644 --- a/.docs/Get-VSTeamClassificationNode.md +++ b/.docs/Get-VSTeamClassificationNode.md @@ -14,9 +14,7 @@ ## PARAMETERS - - -### -StructureGroup +### StructureGroup Structure group of the classification node, area or iteration. @@ -24,7 +22,7 @@ Structure group of the classification node, area or iteration. Type: string ``` -### -Depth +### Depth Depth of children to fetch. @@ -32,7 +30,7 @@ Depth of children to fetch. Type: int32 ``` -### -Path +### Path Path of the classification node. @@ -40,7 +38,7 @@ Path of the classification node. Type: string ``` -### -Ids +### Id Integer classification nodes ids. @@ -48,6 +46,8 @@ Integer classification nodes ids. Type: int32[] ``` + + ## INPUTS ## OUTPUTS @@ -58,8 +58,12 @@ Type: int32[] This function is the base function for Get-VSTeamArea and Get-VSTeamIteration. + + ## RELATED LINKS + + [Get-VSTeamArea](Get-VSTeamArea.md) [Get-VSTeamIteration](Get-VSTeamIteration.md) diff --git a/.docs/Get-VSTeamCloudSubscription.md b/.docs/Get-VSTeamCloudSubscription.md index 6baba1803..969292d21 100644 --- a/.docs/Get-VSTeamCloudSubscription.md +++ b/.docs/Get-VSTeamCloudSubscription.md @@ -14,10 +14,10 @@ The Get-VSTeamCloudSubscription function gets the Azure subscriptions associated ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamCloudSubscription +```powershell +Get-VSTeamCloudSubscription ``` This command gets a list of all Azure subscriptions associated with the Team Services account. @@ -30,12 +30,14 @@ This command gets a list of all Azure subscriptions associated with the Team Ser ## OUTPUTS -### Team.AzureSubscription +### vsteam_lib.AzureSubscription ## NOTES This function currently is not supported in TFS. + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + diff --git a/.docs/Get-VSTeamDescriptor.md b/.docs/Get-VSTeamDescriptor.md index 1b63421fd..bfca76f4f 100644 --- a/.docs/Get-VSTeamDescriptor.md +++ b/.docs/Get-VSTeamDescriptor.md @@ -16,13 +16,14 @@ ## PARAMETERS -### -StorageKey +### StorageKey Storage key of the subject (user, group, scope, etc.) to resolve ```yaml Type: String Required: True +Position: 0 Parameter Sets: ByStorageKey ``` @@ -32,4 +33,8 @@ Parameter Sets: ByStorageKey ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamExtension.md b/.docs/Get-VSTeamExtension.md index 845a2aa19..9f8827547 100644 --- a/.docs/Get-VSTeamExtension.md +++ b/.docs/Get-VSTeamExtension.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PublisherId +### PublisherId The id of the publisher. @@ -26,7 +26,7 @@ Required: True Parameter Sets: GetById ``` -### -ExtensionId +### ExtensionId The id of the extension. @@ -36,7 +36,7 @@ Required: True Parameter Sets: GetById ``` -### -IncludeInstallationIssues +### IncludeInstallationIssues If true (the default), include installed extensions with issues. @@ -45,7 +45,7 @@ Type: Switch Parameter Sets: List ``` -### -IncludeDisabledExtensions +### IncludeDisabledExtensions If true (the default), include disabled extensions in the results. @@ -54,7 +54,7 @@ Type: Switch Parameter Sets: List ``` -### -IncludeErrors +### IncludeErrors If true, include installed extensions with errors. @@ -69,8 +69,12 @@ Parameter Sets: List ## NOTES + + ## RELATED LINKS + + [Add-VSTeamExtension](Add-VSTeamExtension.md) [Get-VSTeamExtension](Get-VSTeamExtension.md) diff --git a/.docs/Get-VSTeamFeed.md b/.docs/Get-VSTeamFeed.md index 189d1ca6d..05021143f 100644 --- a/.docs/Get-VSTeamFeed.md +++ b/.docs/Get-VSTeamFeed.md @@ -14,17 +14,17 @@ Get-VSTeamFeed gets all the feeds for the account ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamFeed +```powershell +Get-VSTeamFeed ``` This command returns all the package feeds for the account. ## PARAMETERS -### -FeedId +### FeedId Specifies the ID of the feed. @@ -40,4 +40,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamGitCommit.md b/.docs/Get-VSTeamGitCommit.md index 1c050c155..6c687fbd2 100644 --- a/.docs/Get-VSTeamGitCommit.md +++ b/.docs/Get-VSTeamGitCommit.md @@ -14,19 +14,25 @@ The Get-VSTeamGitCommit function gets the commits for a git repository. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamGitCommit -ProjectName demo -RepositoryId 118C262F-0D4C-4B76-BD9B-7DD8CA12F196 +```powershell +Get-VSTeamGitCommit -ProjectName demo -RepositoryId 118C262F-0D4C-4B76-BD9B-7DD8CA12F196 ``` This command gets a list of all commits in the demo project for a specific repository. -## PARAMETERS +### Example 2 - +```powershell +Get-VSTeamGitRepository | Select-Object -First 1 | Get-VSTeamGitCommit +``` -### -RepositoryId +This command gets the Repository Id from the pipeline and the project name from the default project. + +## PARAMETERS + +### RepositoryId The id or friendly name of the repository. To use the friendly name, projectId must also be specified. @@ -37,7 +43,7 @@ Accept pipeline input: true (ByPropertyName) Parameter Sets: All, ItemVersion, CompareVersion, ItemPath, ByIds ``` -### -FromDate +### FromDate If provided, only include history entries created after this date (string) @@ -46,7 +52,7 @@ Type: DateTime Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -ToDate +### ToDate If provided, only include history entries created before this date (string) @@ -55,7 +61,7 @@ Type: DateTime Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -ItemVersionVersionType +### ItemVersionVersionType Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: @@ -68,7 +74,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -ItemVersionVersion +### ItemVersionVersion Version string identifier (name of tag/branch, SHA1 of commit) @@ -77,7 +83,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -ItemVersionVersionOptions +### ItemVersionVersionOptions Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: @@ -90,7 +96,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -CompareVersionVersionType +### CompareVersionVersionType Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: @@ -103,7 +109,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -CompareVersionVersion +### CompareVersionVersion Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: @@ -116,7 +122,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -CompareVersionVersionOptions +### CompareVersionVersionOptions Version options - Specify additional modifiers to version (e.g Previous) @@ -125,7 +131,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -FromCommitId +### FromCommitId If provided, a lower bound for filtering commits alphabetically @@ -134,7 +140,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -ToCommitId +### ToCommitId If provided, an upper bound for filtering commits alphabetically @@ -143,7 +149,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -Author +### Author Alias or display name of the author @@ -152,7 +158,7 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -Ids +### Id If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. @@ -161,7 +167,7 @@ Type: String Parameter Sets: ByIds ``` -### -ItemPath +### ItemPath Path of item to search under @@ -170,7 +176,7 @@ Type: String Parameter Sets: All, ItemPath ``` -### -ExcludeDeletes +### ExcludeDeletes Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. @@ -179,7 +185,7 @@ Type: Switch Parameter Sets: All, ItemPath ``` -### -Top +### Top Maximum number of entries to retrieve @@ -188,7 +194,7 @@ Type: Int32 Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -Skip +### Skip Number of entries to skip @@ -197,7 +203,7 @@ Type: Int32 Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` -### -HistoryMode +### HistoryMode What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. The acceptable values for this parameter are: @@ -211,7 +217,7 @@ Type: String Parameter Sets: ItemPath ``` -### -User +### User Alias or display name of the committer @@ -220,18 +226,18 @@ Type: String Parameter Sets: All, ItemVersion, CompareVersion, ItemPath ``` + + ## INPUTS ## OUTPUTS ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets commits. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe a repository ID to this function. + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamGitRef.md b/.docs/Get-VSTeamGitRef.md index 7f0d246d7..22ee0cdc9 100644 --- a/.docs/Get-VSTeamGitRef.md +++ b/.docs/Get-VSTeamGitRef.md @@ -14,19 +14,17 @@ Get-VSTeamGitRef gets all the refs for the provided repository. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamGitRef -ProjectName Demo +```powershell +Get-VSTeamGitRepository -ProjectName Demo -Name Demo | Get-VSTeamGitRef ``` This command returns all the Git refs for the Demo team project. ## PARAMETERS - - -### -RepositoryId +### RepositoryId Specifies the ID of the repository. @@ -36,7 +34,7 @@ Aliases: ID Accept pipeline input: true (ByPropertyName) ``` -### -Filter +### Filter A filter to apply to the refs (starts with). @@ -44,7 +42,7 @@ A filter to apply to the refs (starts with). Type: string ``` -### -FilterContains +### FilterContains A filter to apply to the refs (contains). (Azure DevOps Service and Azure DevOps Server 2019+ only) @@ -52,7 +50,7 @@ A filter to apply to the refs (contains). (Azure DevOps Service and Azure DevOps Type: string ``` -### -Top +### Top Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuationToken is, top will default to 100. (Azure DevOps Service and Azure DevOps Server 2019+ only) @@ -60,7 +58,7 @@ Maximum number of refs to return. It cannot be bigger than 1000. If it is not pr Type: int ``` -### -ContinuationToken +### ContinuationToken The continuation token used for pagination. (Azure DevOps Service and Azure DevOps Server 2019+ only) @@ -68,10 +66,16 @@ The continuation token used for pagination. (Azure DevOps Service and Azure DevO Type: string ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamGitRepository.md b/.docs/Get-VSTeamGitRepository.md index 09ea39b46..bd74973f0 100644 --- a/.docs/Get-VSTeamGitRepository.md +++ b/.docs/Get-VSTeamGitRepository.md @@ -14,35 +14,33 @@ Get-VSTeamGitRepository gets all the repositories in your Azure DevOps or Team F ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamGitRepository +```powershell +Get-VSTeamGitRepository ``` This command returns all the Git repositories for your TFS or Team Services account. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamGitRepository -ProjectName Demo +```powershell +Get-VSTeamGitRepository -ProjectName Demo ``` This command returns all the Git repositories for the Demo team project. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> git clone (Get-VSTeamGitRepository | select -ExpandProperty remoteUrl) +```powershell +git clone (Get-VSTeamGitRepository | select -ExpandProperty remoteUrl) ``` This command gets the remote URL and passes it to git clone command. ## PARAMETERS - - -### -Id +### Id Specifies one or more repositories by ID. @@ -57,7 +55,7 @@ Aliases: RepositoryID Accept pipeline input: true (ByPropertyName) ``` -### -Name +### Name Specifies one or more repositories by name. @@ -71,10 +69,16 @@ Parameter Sets: ByName Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamGitStat.md b/.docs/Get-VSTeamGitStat.md index 88eedcacc..2aca4c5fc 100644 --- a/.docs/Get-VSTeamGitStat.md +++ b/.docs/Get-VSTeamGitStat.md @@ -14,35 +14,33 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD +```powershell +Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD ``` This command returns all the Git stats for the entire repository -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop +```powershell +Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop ``` This command returns all the Git stats for a specific branch -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop -VersionType branch -Version 67cae2b029dff7eb3dc062b49403aaedca5bad8d +```powershell +Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop -VersionType branch -Version 67cae2b029dff7eb3dc062b49403aaedca5bad8d ``` This command returns all the Git stats for a specific commit ## PARAMETERS - - -### -RepositoryId +### RepositoryId Specifies the ID of the repository. @@ -53,7 +51,7 @@ Required: true Accept pipeline input: true (ByPropertyName) ``` -### -BranchName +### BranchName Name of the branch. @@ -62,7 +60,7 @@ Type: String Required: true ``` -### -VersionOptions +### VersionOptions Version options - Specify additional modifiers to version (e.g Previous). Valid options for this parameter are: @@ -75,7 +73,7 @@ Type: String Parameter Sets: ByVersion ``` -### -Version +### Version Version string identifier (name of tag/branch, SHA1 of commit) @@ -84,7 +82,7 @@ Type: String Parameter Sets: ByVersion ``` -### -VersionType +### VersionType Version type (branch, tag, or commit). Determines how Id is interpreted. Valid options for this parameter are: @@ -97,10 +95,16 @@ Type: String Parameter Sets: ByVersion ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamGroup.md b/.docs/Get-VSTeamGroup.md index 4887500a6..ce503f213 100644 --- a/.docs/Get-VSTeamGroup.md +++ b/.docs/Get-VSTeamGroup.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' +```powershell +$group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' ``` Assigns Endpoint Administrators group to $group variable. ## PARAMETERS - - -### -SubjectTypes +### SubjectTypes A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: @@ -40,7 +38,7 @@ Required: False Parameter Sets: List, ListByProjectName ``` -### -ScopeDescriptor +### ScopeDescriptor Specify a non-default scope (collection, project) to search for groups. @@ -50,7 +48,7 @@ Required: False Parameter Sets: List ``` -### -Descriptor +### Descriptor The descriptor of the desired graph group. @@ -60,10 +58,16 @@ Required: False Parameter Sets: ByGroupDescriptor ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamInfo.md b/.docs/Get-VSTeamInfo.md index b8974e74b..ffcc81893 100644 --- a/.docs/Get-VSTeamInfo.md +++ b/.docs/Get-VSTeamInfo.md @@ -14,10 +14,10 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamInfo +```powershell +Get-VSTeamInfo ``` This will display your current account and default project @@ -30,6 +30,8 @@ This will display your current account and default project ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + diff --git a/.docs/Get-VSTeamIteration.md b/.docs/Get-VSTeamIteration.md index edf049564..bd62a24b0 100644 --- a/.docs/Get-VSTeamIteration.md +++ b/.docs/Get-VSTeamIteration.md @@ -14,9 +14,7 @@ ## PARAMETERS - - -### -Depth +### Depth Depth of children to fetch. @@ -24,7 +22,7 @@ Depth of children to fetch. Type: int32 ``` -### -Path +### Path Path of the classification node. @@ -32,7 +30,7 @@ Path of the classification node. Type: string ``` -### -Ids +### Id Integer classification nodes ids. @@ -40,6 +38,8 @@ Integer classification nodes ids. Type: int32[] ``` + + ## INPUTS ## OUTPUTS @@ -50,8 +50,12 @@ Type: int32[] This is a wrapper function for Get-VSTeamClassificationNode + + ## RELATED LINKS + + [Get-VSTeamClassificationNode](Get-VSTeamClassificationNode.md) [Get-VSTeamIteration](Get-VSTeamIteration.md) diff --git a/.docs/Get-VSTeamJobRequest.md b/.docs/Get-VSTeamJobRequest.md index f0e2ed96c..de10cc301 100644 --- a/.docs/Get-VSTeamJobRequest.md +++ b/.docs/Get-VSTeamJobRequest.md @@ -14,17 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamJobRequest 1 111 +```powershell +Get-VSTeamJobRequest 1 111 ``` This will display all the job request of agent with id 111 under the pool with id 1. ## PARAMETERS -### -PoolId +### PoolId Id of the pool. @@ -34,7 +34,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -AgentId +### AgentId Id of the agent to return. @@ -44,7 +44,7 @@ Required: True Accept pipeline input: true (ByValue) ``` -### -CompletedRequestCount +### CompletedRequestCount The number of requests to return. @@ -62,4 +62,8 @@ Type: Int32 ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamMember.md b/.docs/Get-VSTeamMember.md index 38d15738f..8325471de 100644 --- a/.docs/Get-VSTeamMember.md +++ b/.docs/Get-VSTeamMember.md @@ -16,9 +16,7 @@ ## PARAMETERS - - -### -Skip +### Skip The number of items to skip. @@ -26,7 +24,7 @@ The number of items to skip. Type: Int32 ``` -### -TeamId +### TeamId The id of the team to search. @@ -38,7 +36,7 @@ Position: 2 Accept pipeline input: true (ByPropertyName) ``` -### -Top +### Top Specifies the maximum number to return. @@ -46,12 +44,18 @@ Specifies the maximum number to return. Type: Int32 ``` + + ## INPUTS ## OUTPUTS -### Team.Team +### vsteam_lib.TeamMember ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamMembership.md b/.docs/Get-VSTeamMembership.md index 11a212579..65328c218 100644 --- a/.docs/Get-VSTeamMembership.md +++ b/.docs/Get-VSTeamMembership.md @@ -14,25 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -(Get-VSTeamMembership -MemberDescriptor $user.ID).value | % { Get-VSTeamGroup -Descriptor $_.containerDescriptor } +```powershell +Get-VSTeamUser | Select-Object -Last 1 | Get-VSTeamMembership | Get-VSTeamGroup ``` -Get all the groups for a user +Get all the groups for the last user -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -(Get-VSTeamMembership -ContainerDescriptor $group.id).value | % {Get-VSTeamUser -Descriptor $_.memberDescriptor } +```powershell +Get-VSTeamGroup | Select-Object -First 1 -Skip 2 | Get-VSTeamMembership | Get-VSTeamUser ``` -Get all the members for a group +Get all the members for the third group ## PARAMETERS -### -ContainerDescriptor +### ContainerDescriptor A container descriptor retrieved by Get-VsTeamGroup @@ -43,7 +43,7 @@ Parameter Sets: ByContainerId Position: 0 ``` -### -MemberDescriptor +### MemberDescriptor A member descriptor retrieved by Get-VsTeamUser @@ -60,8 +60,12 @@ Position: 0 ## NOTES + + ## RELATED LINKS + + [Get-VsTeamUser](Get-VsTeamUser.md) [Get-VsTeamGroup](Get-VsTeamGroup.md) diff --git a/.docs/Get-VSTeamOption.md b/.docs/Get-VSTeamOption.md index 19264d6fb..5082446e5 100644 --- a/.docs/Get-VSTeamOption.md +++ b/.docs/Get-VSTeamOption.md @@ -12,7 +12,7 @@ -There are two table formats defined for the Team.Option type, Default and Versions. +There are two table formats defined for the vsteam_lib.Option type, Default and Versions. Default view contains Name, Area, Max Version and URI Template. @@ -20,49 +20,49 @@ Version view contains Name, Area, Min Version, Max Version, Released Version and ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamOption +```powershell +Get-VSTeamOption ``` This will display all the versions of supported APIs for your account using the 'Default' table format. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamOption | Format-Table -View Versions +```powershell +Get-VSTeamOption | Format-Table -View Versions ``` This will display all the versions of supported APIs for your account using the 'Versions' custom table format. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamOption -SubDomain vsrm +```powershell +Get-VSTeamOption -SubDomain vsrm ``` This will display all the versions of supported APIs for the release management service. -### -------------------------- EXAMPLE 4 -------------------------- +### Example 4 -```PowerShell -PS C:\> Get-VSTeamOption -Area core +```powershell +Get-VSTeamOption -Area core ``` This will display all the versions of supported APIs for the area core. -### -------------------------- EXAMPLE 5 -------------------------- +### Example 5 -```PowerShell -PS C:\> Get-VSTeamOption -Area core -Resource teams +```powershell +Get-VSTeamOption -Area core -Resource teams ``` This will display all the versions of supported APIs for resources teams under the area core. ## PARAMETERS -### -SubDomain +### SubDomain Returns options for that sub domain APIs. Some examples include: @@ -77,7 +77,7 @@ Type: String Required: false ``` -### -Area +### Area Returns options for that area's APIs. @@ -86,7 +86,7 @@ Type: String Required: false ``` -### -Resource +### Resource Returns options for that resource's APIs. @@ -101,6 +101,8 @@ Required: false ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + diff --git a/.docs/Get-VSTeamPermissionInheritance.md b/.docs/Get-VSTeamPermissionInheritance.md index 394c9f634..36be4d741 100644 --- a/.docs/Get-VSTeamPermissionInheritance.md +++ b/.docs/Get-VSTeamPermissionInheritance.md @@ -14,27 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition +```powershell +Get-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition ``` This command returns true or false. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamBuildDefinition | Get-VSTeamPermissionInheritance -ResourceType BuildDefinition +```powershell +Get-VSTeamBuildDefinition | Get-VSTeamPermissionInheritance ``` This command returns true or false for every build definition returned from Get-VSTeamBuildDefinition. ## PARAMETERS - - -### -Name +### Name Specifies the name of the resource. @@ -44,7 +42,7 @@ Accept pipeline input: true (ByPropertyName) Required: True ``` -### -ResourceType +### ResourceType Specifies the type of resource. The acceptable values for this parameter are: @@ -57,14 +55,20 @@ Type: String Required: True ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Add-VSTeamPolicy](Add-VSTeamPolicy.md) [Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) diff --git a/.docs/Get-VSTeamPolicy.md b/.docs/Get-VSTeamPolicy.md index e97357a31..048a5d51b 100644 --- a/.docs/Get-VSTeamPolicy.md +++ b/.docs/Get-VSTeamPolicy.md @@ -14,27 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamPolicy -ProjectName Demo +```powershell +Get-VSTeamPolicy -ProjectName Demo ``` This command returns all the policies for the Demo project in your TFS or Team Services account. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamPolicy -ProjectName Demo -Id 1 +```powershell +Get-VSTeamPolicy -ProjectName Demo -Id 1 ``` This command gets the policy with an id of 1 within the Demo project. ## PARAMETERS - - -### -Id +### Id Specifies one code policy by id. @@ -46,14 +44,20 @@ Parameter Sets: ByID Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Add-VSTeamPolicy](Add-VSTeamPolicy.md) [Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) diff --git a/.docs/Get-VSTeamPolicyType.md b/.docs/Get-VSTeamPolicyType.md index 01537d261..98965a414 100644 --- a/.docs/Get-VSTeamPolicyType.md +++ b/.docs/Get-VSTeamPolicyType.md @@ -14,27 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamPolicyType -ProjectName Demo +```powershell +Get-VSTeamPolicyType -ProjectName Demo ``` This command returns all the policy types for the Demo project. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamPolicyType -ProjectName Demo -Id 73da726a-8ff9-44d7-8caa-cbb581eac991 +```powershell +Get-VSTeamPolicyType -ProjectName Demo -Id 73da726a-8ff9-44d7-8caa-cbb581eac991 ``` This command gets the policy type by the specified id within the Demo project. ## PARAMETERS - - -### -Id +### Id Specifies one policy type by id. @@ -43,14 +41,20 @@ Type: Guid[] Parameter Sets: ByID ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Add-VSTeamPolicy](Add-VSTeamPolicy.md) [Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) diff --git a/.docs/Get-VSTeamPool.md b/.docs/Get-VSTeamPool.md index ec2894b58..17c5c4c59 100644 --- a/.docs/Get-VSTeamPool.md +++ b/.docs/Get-VSTeamPool.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -Id +### Id Id of the pool to return. @@ -38,4 +38,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamProcess.md b/.docs/Get-VSTeamProcess.md index 126e00c28..41337359b 100644 --- a/.docs/Get-VSTeamProcess.md +++ b/.docs/Get-VSTeamProcess.md @@ -16,26 +16,26 @@ You must call Set-VSTeamAccount before calling this function. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamProcess +```powershell +Get-VSTeamProcess ``` This will return all the Process Templates -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamProcess | Format-Wide +```powershell +Get-VSTeamProcess | Format-Wide ``` This will return the Process Templates only showing their name -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamProcess *scrum* +```powershell +Get-VSTeamProcess *scrum* ``` This will return an process templates with names containing scrum, @@ -46,31 +46,7 @@ names like "Custom Scrum", "Scrum for Contoso" will all be returned. -### -Top - -Specifies the maximum number to return. -If -Skip is specified and -Top is omitted the next 100 will be returned. -If neither Skip nor -Top is specified, all process templates will be returned. - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 100 -``` - -### -Skip - -Defines the number of Process Templates to skip. -If -Top is specified and -Skip is omitted none will be skipped. -If neither Skip nor -Top is specified, all process templates will be returned. - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 0 -``` - -### -Id +### Id The id of the Process Template to return. @@ -86,8 +62,10 @@ Aliases: ProcessID ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + [Add-VSTeamProject](Add-VSTeamProject.md) diff --git a/.docs/Get-VSTeamProfile.md b/.docs/Get-VSTeamProfile.md index 5e407a4ea..ee33ceca9 100644 --- a/.docs/Get-VSTeamProfile.md +++ b/.docs/Get-VSTeamProfile.md @@ -14,25 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamProfile +```powershell +Get-VSTeamProfile ``` Return the list of saved profiles -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamProfile -Name mydemos +```powershell +Get-VSTeamProfile -Name mydemos ``` Will return details of the profile provided ## PARAMETERS -### -Name +### Name Optional name for the profile. @@ -48,8 +48,10 @@ Required: True ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + [Add-VSTeamProfile](Add-VSTeamProfile.md) diff --git a/.docs/Get-VSTeamProject.md b/.docs/Get-VSTeamProject.md index 6ced7e550..04705385b 100644 --- a/.docs/Get-VSTeamProject.md +++ b/.docs/Get-VSTeamProject.md @@ -18,27 +18,25 @@ You must call Set-VSTeamAccount before calling this function. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamProject +```powershell +Get-VSTeamProject ``` This will return all the WellFormed team projects. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamProject -top 5 | Format-Wide +```powershell +Get-VSTeamProject -top 5 | Format-Wide ``` This will return the top five WellFormed team projects only showing their name ## PARAMETERS - - -### -StateFilter +### StateFilter Returns team projects in a specific team project state. The acceptable values for this parameter are: @@ -54,7 +52,7 @@ Parameter Sets: List Default value: WellFormed ``` -### -Top +### Top Specifies the maximum number to return. @@ -64,7 +62,7 @@ Parameter Sets: List Default value: 100 ``` -### -Skip +### Skip Defines the number of team projects to skip. The default value is 0 @@ -74,7 +72,7 @@ Parameter Sets: List Default value: 0 ``` -### -Id +### Id The id of the project to return. @@ -84,7 +82,7 @@ Parameter Sets: ByID Aliases: ProjectID ``` -### -IncludeCapabilities +### IncludeCapabilities Will return additional information about the project. @@ -93,15 +91,19 @@ Type: SwitchParameter Parameter Sets: ByID ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + [Add-VSTeamProject](Add-VSTeamProject.md) diff --git a/.docs/Get-VSTeamPullRequest.md b/.docs/Get-VSTeamPullRequest.md index c26a96969..a11ccf95c 100644 --- a/.docs/Get-VSTeamPullRequest.md +++ b/.docs/Get-VSTeamPullRequest.md @@ -14,57 +14,57 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamPullRequest +```powershell +Get-VSTeamPullRequest ``` This command returns all the open pull requests for your TFS or Team Services account. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamPullRequest -ProjectName Demo +```powershell +Get-VSTeamPullRequest -ProjectName Demo ``` This command returns all the open pull requests for the Demo team project. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamPullRequest -ProjectName Demo -All +```powershell +Get-VSTeamPullRequest -ProjectName Demo -All ``` This command returns all pull requests for the Demo team project. -### -------------------------- EXAMPLE 4 -------------------------- +### Example 4 -```PowerShell -PS C:\> Get-VSTeamPullRequest -ProjectName Demo -TargetBranchRef "refs/heads/mybranch" +```powershell +Get-VSTeamPullRequest -ProjectName Demo -TargetBranchRef "refs/heads/mybranch" ``` This command returns all open pull requests for a specific branch -### -------------------------- EXAMPLE 5 -------------------------- +### Example 5 -```PowerShell -PS C:\> Get-VSTeamPullRequest -Id 123 +```powershell +Get-VSTeamPullRequest -Id 123 ``` This command gets the pull request with an Id of 123. -### -------------------------- EXAMPLE 6 -------------------------- +### Example 6 -```PowerShell -PS C:\> Get-VSTeamPullRequest -Id 123 -RepositoryId "93BBA613-2729-4158-9217-751E952AB4AF" -IncludeCommits +```powershell +Get-VSTeamPullRequest -Id 123 -RepositoryId "93BBA613-2729-4158-9217-751E952AB4AF" -IncludeCommits ``` This command gets the pull request with an Id of 123 and includes the commits that are part of the pull request. ## PARAMETERS -### -ProjectName +### ProjectName Specifies the team project for which this function operates. @@ -80,7 +80,7 @@ Position: 0 Accept pipeline input: true (ByPropertyName) ``` -### -Id +### Id Specifies the pull request by ID. @@ -91,7 +91,7 @@ Accept pipeline input: true (ByPropertyName) Parameter Sets: ById, IncludeCommits ``` -### -RepositoryId +### RepositoryId The repository ID of the pull request's target branch. @@ -100,7 +100,7 @@ Type: Guid Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll, ById, IncludeCommits ``` -### -SourceRepositoryId +### SourceRepositoryId If set, search for pull requests whose source branch is in this repository. @@ -109,7 +109,7 @@ Type: Guid Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll ``` -### -SourceBranchRef +### SourceBranchRef If set, search for pull requests from this branch. @@ -118,7 +118,7 @@ Type: String Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll ``` -### -TargetBranchRef +### TargetBranchRef If set, search for pull requests into this branch. @@ -127,7 +127,7 @@ Type: String Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll ``` -### -Status +### Status If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: @@ -142,14 +142,14 @@ Type: String Parameter Sets: SearchCriteriaWithStatus ``` -### -All +### All ```yaml Type: Switch Parameter Sets: SearchCriteriaWithAll ``` -### -Top +### Top The number of pull requests to retrieve. @@ -158,7 +158,7 @@ Type: Int32 Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll ``` -### -Skip +### Skip The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. @@ -167,7 +167,7 @@ Type: Int32 Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll ``` -### -IncludeCommits +### IncludeCommits If set, includes the commits that are part of the pull request. Requires the RepositoryId to be set. @@ -182,8 +182,12 @@ Parameter Sets: IncludeCommits ## NOTES + + ## RELATED LINKS + + [Show-VSTeamPullRequest](Show-VSTeamPullRequest.md) [Add-VSTeamPullRequest](Add-VSTeamPullRequest.md) [Update-VSTeamPullRequest](Update-VSTeamPullRequest.md) diff --git a/.docs/Get-VSTeamQuery.md b/.docs/Get-VSTeamQuery.md new file mode 100644 index 000000000..97a7e7532 --- /dev/null +++ b/.docs/Get-VSTeamQuery.md @@ -0,0 +1,74 @@ + + +# Get-VSTeamQuery + +## SYNOPSIS + + + +## SYNTAX + +## DESCRIPTION + + + +## EXAMPLES + +### Example 1 + +```powershell +Get-VSTeamQuery MyProject +``` + +## PARAMETERS + +### Depth + +In the folder of queries, return child queries and folders to this depth. + +```yaml +Type: Int +Default value: 1 +``` + +### Target + +Specifies the version to use. The acceptable values for this parameter are: + +- all +- clauses +- minimal +- none +- wiql + +```yaml +Type: String +Default value: none +``` + +### IncludeDeleted + +Include deleted queries and folders + +```yaml +Type: SwitchParameter +Required: false +Position: Named +Accept pipeline input: false +``` + + + +## INPUTS + +## OUTPUTS + +### vsteam_lib.Query + +## NOTES + + + +## RELATED LINKS + + diff --git a/.docs/Get-VSTeamQueue.md b/.docs/Get-VSTeamQueue.md index 6da691557..557db2ac1 100644 --- a/.docs/Get-VSTeamQueue.md +++ b/.docs/Get-VSTeamQueue.md @@ -16,9 +16,7 @@ ## PARAMETERS - - -### -QueueName +### QueueName Name of the queue to return. @@ -27,7 +25,7 @@ Type: String Parameter Sets: List ``` -### -ActionFilter +### ActionFilter None, Manage or Use. @@ -36,7 +34,7 @@ Type: String Parameter Sets: List ``` -### -Id +### Id Id of the queue to return. @@ -46,12 +44,18 @@ Parameter Sets: ByID Aliases: QueueID ``` + + ## INPUTS ## OUTPUTS -### Team.Queue +### vsteam_lib.Queue ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamRelease.md b/.docs/Get-VSTeamRelease.md index f841d4660..b09d6bed6 100644 --- a/.docs/Get-VSTeamRelease.md +++ b/.docs/Get-VSTeamRelease.md @@ -20,37 +20,35 @@ You can also specify a particular release definition by ID. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamRelease -ProjectName demo | Format-List * +```powershell +Get-VSTeamRelease -ProjectName demo | Format-List * ``` This command gets a list of all releases in the demo project. The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Raw +```powershell +Get-VSTeamRelease -ProjectName demo -Id 10 -Raw ``` This command returns the raw object returned from the server. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Json +```powershell +Get-VSTeamRelease -ProjectName demo -Id 10 -Json ``` -This command returns the raw object returned from the server formated as JSON. +This command returns the raw object returned from the server formatted as JSON. ## PARAMETERS - - -### -Expand +### Expand Specifies which property should be expanded in the list of Release (environments, artifacts, none). @@ -59,7 +57,7 @@ Type: String Parameter Sets: List ``` -### -StatusFilter +### StatusFilter Draft, Active or Abandoned. @@ -68,7 +66,7 @@ Type: String Parameter Sets: List ``` -### -DefinitionId +### DefinitionId Id of the release definition @@ -78,7 +76,7 @@ Parameter Sets: List Default value: 0 ``` -### -Top +### Top Specifies the maximum number to return. @@ -88,42 +86,42 @@ Parameter Sets: List Default value: 0 ``` -### -CreatedBy +### CreatedBy ```yaml Type: String Parameter Sets: List ``` -### -MinCreatedTime +### MinCreatedTime ```yaml Type: DateTime Parameter Sets: List ``` -### -MaxCreatedTime +### MaxCreatedTime ```yaml Type: DateTime Parameter Sets: List ``` -### -QueryOrder +### QueryOrder ```yaml Type: String Parameter Sets: List ``` -### -ContinuationToken +### ContinuationToken ```yaml Type: String Parameter Sets: List ``` -### -Id +### Id Specifies one or more releases by ID. @@ -133,23 +131,22 @@ To find the ID of a release definition, type Get-VSTeamRelease. ```yaml Type: Int32[] -Parameter Sets: ByID, ByIDJson, ByIDRaw +Parameter Sets: ByID, ByIDRaw Aliases: ReleaseID Required: True Accept pipeline input: true (ByPropertyName) ``` -### -JSON +### JSON Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. ```yaml Type: Switch Required: True -Parameter Sets: ByIDJson ``` -### -Raw +### Raw Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. @@ -159,27 +156,23 @@ Required: True Parameter Sets: ByIDRaw ``` + + ## INPUTS ## OUTPUTS -### Team.Release +### vsteam_lib.Release ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe release definition IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamRelease](Add-VSTeamRelease.md) diff --git a/.docs/Get-VSTeamReleaseDefinition.md b/.docs/Get-VSTeamReleaseDefinition.md index 9ca9ec066..dbe9f04b1 100644 --- a/.docs/Get-VSTeamReleaseDefinition.md +++ b/.docs/Get-VSTeamReleaseDefinition.md @@ -20,37 +20,35 @@ You can also specify a particular release definition by ID. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Format-List * +```powershell +Get-VSTeamReleaseDefinition -ProjectName demo | Format-List * ``` This command gets a list of all release definitions in the demo project. The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Json +```powershell +Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Json ``` This command returns the raw object returned from the server formatted as a JSON string. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Raw +```powershell +Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Raw ``` This command returns the raw object returned from the server. ## PARAMETERS - - -### -Expand +### Expand Specifies which property should be expanded in the list of Release Definition (environments, artifacts, none). @@ -59,7 +57,7 @@ Type: String Parameter Sets: List ``` -### -Id +### Id Specifies one or more release definitions by ID. @@ -74,17 +72,16 @@ Aliases: ReleaseDefinitionID Accept pipeline input: true (ByPropertyName) ``` -### -JSON +### JSON Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. ```yaml Type: Switch Required: True -Parameter Sets: ByIDJson ``` -### -Raw +### Raw Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. @@ -94,21 +91,23 @@ Required: True Parameter Sets: ByIDRaw ``` + + ## INPUTS ### Int[] ## OUTPUTS -### Team.ReleaseDefinition +### vsteam_lib.ReleaseDefinition ## NOTES -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamReleaseDefinition](Add-VSTeamReleaseDefinition.md) diff --git a/.docs/Get-VSTeamResourceArea.md b/.docs/Get-VSTeamResourceArea.md index 25a41d116..ae20cd67a 100644 --- a/.docs/Get-VSTeamResourceArea.md +++ b/.docs/Get-VSTeamResourceArea.md @@ -14,10 +14,10 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamResourceArea +```powershell +Get-VSTeamResourceArea ``` This will display all the areas of supported APIs for your account. @@ -30,8 +30,8 @@ This will display all the areas of supported APIs for your account. ## NOTES -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Add-VSTeamOption](Add-VSTeamOption.md) + diff --git a/.docs/Get-VSTeamSecurityNamespace.md b/.docs/Get-VSTeamSecurityNamespace.md index 3bf060d1a..14b2fbb90 100644 --- a/.docs/Get-VSTeamSecurityNamespace.md +++ b/.docs/Get-VSTeamSecurityNamespace.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -Id +### Id Security namespace identifier. @@ -26,7 +26,7 @@ Required: False Parameter Sets: ByNamespaceId ``` -### -Name +### Name Security namespace name. @@ -36,7 +36,7 @@ Required: False Parameter Sets: ByNamespaceName ``` -### -LocalOnly +### LocalOnly If true, retrieve only local security namespaces. @@ -50,8 +50,12 @@ Parameter Sets: List ## OUTPUTS -### VSTeamSecurityNamespace +### vsteam_lib.SecurityNamespace ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamServiceEndpoint.md b/.docs/Get-VSTeamServiceEndpoint.md index dfcead87a..2b862ab1f 100644 --- a/.docs/Get-VSTeamServiceEndpoint.md +++ b/.docs/Get-VSTeamServiceEndpoint.md @@ -16,9 +16,7 @@ ## PARAMETERS - - -### -Id +### Id Id of the service endpoint @@ -29,6 +27,8 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ### System.String @@ -39,4 +39,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamServiceEndpointType.md b/.docs/Get-VSTeamServiceEndpointType.md index 7c21d69f8..541c47424 100644 --- a/.docs/Get-VSTeamServiceEndpointType.md +++ b/.docs/Get-VSTeamServiceEndpointType.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -Type +### Type Name of service endpoint type to return. @@ -26,7 +26,7 @@ Parameter Sets: ByType Accept pipeline input: true (ByPropertyName) ``` -### -Scheme +### Scheme Scheme of service endpoint @@ -46,4 +46,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamTaskGroup.md b/.docs/Get-VSTeamTaskGroup.md index ceb02bd37..7116c55e4 100644 --- a/.docs/Get-VSTeamTaskGroup.md +++ b/.docs/Get-VSTeamTaskGroup.md @@ -14,10 +14,9 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 ```powershell - $methodParameters = @{ ProjectName = "some_project_name" } @@ -27,7 +26,7 @@ Get-VSTeamTaskGroup @methodParameters Get all the task groups for the some_project_name project. Here we are splatting the parameter, but it may also be directly specified. See a non-splatting example below. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 ```powershell Get-VSTeamTaskGroup -ProjectName "some_project_name" -Id "Task_group_id" @@ -35,7 +34,7 @@ Get-VSTeamTaskGroup -ProjectName "some_project_name" -Id "Task_group_id" Get a task group when the ID is already known. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 ```powershell @@ -51,11 +50,9 @@ Get a task group by name, when the ID is not known. Here we are splatting the p ## PARAMETERS -### -ProjectName - - +### ProjectName -### -Id +### Id ID of the existing task group @@ -71,7 +68,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Name +### Name Name of the existing task group @@ -87,10 +84,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorTask, -InformationAction, -InformationTask, -OutTask, -OutBuffer, -PipelineTask, -Verbose, -WarningAction, and -WarningTask. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS @@ -102,8 +96,12 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES + + ## RELATED LINKS + + [Add-VSTeamTaskGroup](Add-VSTeamTaskGroup.md) [Update-VSTeamTaskGroup](Update-VSTeamTaskGroup.md) diff --git a/.docs/Get-VSTeamTfvcBranch.md b/.docs/Get-VSTeamTfvcBranch.md index 97c6fed8e..dae96a6f8 100644 --- a/.docs/Get-VSTeamTfvcBranch.md +++ b/.docs/Get-VSTeamTfvcBranch.md @@ -14,58 +14,84 @@ Get-VSTeamTfvcBranch gets a branch for a given path from TFVC source control. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch +```powershell +Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch ``` This command returns the branch object for the path $/MyProject/MyBranch -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeChildren +```powershell +Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeChildren ``` This command returns the branch object for the path $/MyProject/MyBranch and its child branches. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeParent +```powershell +Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeParent ``` This command returns the branch object for the path $/MyProject/MyBranch and its parent. -### -------------------------- EXAMPLE 4 -------------------------- +### Example 4 -```PowerShell -PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeDeleted +```powershell +Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeDeleted ``` This command returns the branch object for the path $/MyProject/MyBranch, even if it's marked as deleted. -### -------------------------- EXAMPLE 5 -------------------------- +### Example 5 -```PowerShell -PS C:\> '$/MyProject/MyBranch','$/AnotherProject/AnotherBranch' | Get-VSTeamTfvcBranch +```powershell +'$/MyProject/MyBranch','$/AnotherProject/AnotherBranch' | Get-VSTeamTfvcBranch ``` This command returns the branch objects for the paths $/MyProject/MyBranch and $/AnotherProject/AnotherBranch by using the pipeline. +### Example 6 + +```powershell +Get-VSTeamTfvcBranch -ProjectName TestProject +``` + +This command returns all the branches under a project. + ## PARAMETERS -### -Path +### 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 +Parameter Sets: List +Accept pipeline input: true (ByPropertyName) +``` + +### Path Full path to the branch. ```yaml Type: String[] +Parameter Sets: ByPath Accept pipeline input: true ``` -### -IncludeChildren +### IncludeChildren Return child branches, if there are any. @@ -73,7 +99,7 @@ Return child branches, if there are any. Type: SwitchParameter ``` -### -IncludeParent +### IncludeParent Return the parent branch, if there is one. @@ -81,7 +107,7 @@ Return the parent branch, if there is one. Type: SwitchParameter ``` -### -IncludeDeleted +### IncludeDeleted Return branches marked as deleted. @@ -97,4 +123,8 @@ Type: SwitchParameter You can pipe paths to this function. + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamTfvcRootBranch.md b/.docs/Get-VSTeamTfvcRootBranch.md index ed348e72f..53dc21062 100644 --- a/.docs/Get-VSTeamTfvcRootBranch.md +++ b/.docs/Get-VSTeamTfvcRootBranch.md @@ -14,33 +14,33 @@ Get-VSTeamTfvcRootBranch gets root branches for all projects with TFVC source co ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamTfvcRootBranch +```powershell +Get-VSTeamTfvcRootBranch ``` This command returns root branches for all projects. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamTfvcRootBranch -IncludeChildren +```powershell +Get-VSTeamTfvcRootBranch -IncludeChildren ``` This command returns root branches for all projects and their respective child branches. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamTfvcRootBranch -IncludeDeleted +```powershell +Get-VSTeamTfvcRootBranch -IncludeDeleted ``` This command returns root branches for all projects, also those marked as deleted. ## PARAMETERS -### -IncludeChildren +### IncludeChildren Return the child branches for each root branch. @@ -48,7 +48,7 @@ Return the child branches for each root branch. Type: SwitchParameter ``` -### -IncludeDeleted +### IncludeDeleted Return deleted branches. @@ -62,4 +62,8 @@ Type: SwitchParameter ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamUser.md b/.docs/Get-VSTeamUser.md index 8e0a6c0b6..9eaa06cfa 100644 --- a/.docs/Get-VSTeamUser.md +++ b/.docs/Get-VSTeamUser.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -SubjectTypes +### SubjectTypes A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: @@ -33,7 +33,7 @@ Required: False Parameter Sets: List ``` -### -Descriptor +### Descriptor The descriptor of the desired graph user. @@ -49,4 +49,8 @@ Parameter Sets: ByUserDescriptor ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamUserEntitlement.md b/.docs/Get-VSTeamUserEntitlement.md index 3561e920d..03dba95e8 100644 --- a/.docs/Get-VSTeamUserEntitlement.md +++ b/.docs/Get-VSTeamUserEntitlement.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -Skip +### Skip The number of items to skip. @@ -25,7 +25,7 @@ Type: Int32 Parameter Sets: List ``` -### -UserId +### UserId The id of the user to retrieve. @@ -34,7 +34,7 @@ Type: String[] Parameter Sets: ByID ``` -### -Top +### Top Specifies the maximum number to return. @@ -43,7 +43,7 @@ Type: Int32 Parameter Sets: List ``` -### -Select +### Select Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are: @@ -64,4 +64,8 @@ Default value: None ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamVariableGroup.md b/.docs/Get-VSTeamVariableGroup.md index 0a49cfdea..55c7a34b2 100644 --- a/.docs/Get-VSTeamVariableGroup.md +++ b/.docs/Get-VSTeamVariableGroup.md @@ -14,10 +14,9 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 ```powershell - $methodParameters = @{ ProjectName = "some_project_name" } @@ -25,10 +24,9 @@ $methodParameters = @{ Get-VSTeamVariableGroup @methodParameters ``` -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 ```powershell - $methodParameters = @{ ProjectName = "some_project_name" Id = "variable_group_id" @@ -37,10 +35,9 @@ $methodParameters = @{ Get-VSTeamVariableGroup @methodParameters ``` -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 ```powershell - $methodParameters = @{ ProjectName = "some_project_name" Name = "variable_group_name" @@ -51,15 +48,16 @@ Get-VSTeamVariableGroup @methodParameters ## PARAMETERS -### -ProjectName - - - -### -Id +### Id ID of the existing variable group -### -Name +```yaml +Type: String +Required: false +``` + +### Name Name of the existing variable group @@ -74,10 +72,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS @@ -89,8 +84,12 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES + + ## RELATED LINKS + + [Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) diff --git a/.docs/Get-VSTeamWiql.md b/.docs/Get-VSTeamWiql.md index cd593f990..9b4d17d13 100644 --- a/.docs/Get-VSTeamWiql.md +++ b/.docs/Get-VSTeamWiql.md @@ -1,6 +1,6 @@ -# Get-VSTeamWiqlItem +# Get-VSTeamWiql ## SYNOPSIS @@ -14,25 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" -Expand +```powershell +Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" -Expand ``` This command gets work items via a WIQL query and expands the return work items with only the selected fields System.Id, System.Title and System.State. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" +```powershell +Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" ``` This command gets work items via a WIQL query and returns the WIQL query result with only work item IDs. ## PARAMETERS -### -Id +### Id The id query to return work items for. This is the ID of any saved query within a team in a project @@ -42,7 +42,7 @@ Parameter Sets: ByID Required: True ``` -### -Query +### Query The WIQL query. For the syntax check [the official documentation](https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops). @@ -52,7 +52,7 @@ Parameter Sets: ByQuery Required: True ``` -### -Top +### Top The max number of results to return. @@ -62,7 +62,7 @@ Required: False Default value: 100 ``` -### -TimePrecision +### TimePrecision Whether or not to use time precision. @@ -70,7 +70,7 @@ Whether or not to use time precision. Type: Switch ``` -### -Expand +### Expand The expand the work items with the selected attributes in the WIQL query. @@ -88,6 +88,10 @@ ProjectName ## NOTES -If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWiql you will have to type in the names. +If you do not set the default project by called Set-VSTeamDefaultProject you must pass in -ProjectName for the tab completion of names to work. + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamWorkItem.md b/.docs/Get-VSTeamWorkItem.md index 95bcdec8f..f9a6e6448 100644 --- a/.docs/Get-VSTeamWorkItem.md +++ b/.docs/Get-VSTeamWorkItem.md @@ -14,17 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamWorkItem -Id 47,48 +```powershell +Get-VSTeamWorkItem -Id 47,48 ``` This command gets work items with IDs 47 and 48 by using the IDs parameter. ## PARAMETERS -### -Id +### Id The id of one or more work items. @@ -35,7 +35,7 @@ Required: True Accept pipeline input: true (ByPropertyName, ByValue) ``` -### -ErrorPolicy +### ErrorPolicy The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: @@ -49,7 +49,7 @@ Required: True Default value: omit ``` -### -Fields +### Fields Comma-separated list of requested fields. @@ -57,7 +57,7 @@ Comma-separated list of requested fields. Type: String[] ``` -### -Expand +### Expand Comma-separated list of requested fields. The acceptable values for this parameter are: @@ -85,6 +85,10 @@ WorkItemType WorkItemType is a dynamic parameter and use the default project value to query their validate set. -If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. +If you do not set the default project by called Set-VSTeamDefaultProject you must provide -ProjectName or you will have to type in the names. + + ## RELATED LINKS + + diff --git a/.docs/Get-VSTeamWorkItemType.md b/.docs/Get-VSTeamWorkItemType.md index 4c69580ce..437ecca50 100644 --- a/.docs/Get-VSTeamWorkItemType.md +++ b/.docs/Get-VSTeamWorkItemType.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS R:\repos\vsteam> Get-WorkItemType -ProjectName test -WorkItemType 'Code Review Response' +```powershell +Get-VSTeamWorkItemType -ProjectName test -WorkItemType 'Code Review Response' ``` This command gets a single work item type. ## PARAMETERS - - -### -WorkItemType +### WorkItemType The type of work item to retrieve. @@ -35,6 +33,8 @@ Type: String Parameter Sets: ByType ``` + + ## INPUTS ### System.String @@ -49,6 +49,8 @@ The JSON returned has empty named items i.e. "": "To Do" This causes issues with the ConvertFrom-Json CmdLet. Therefore, all "": are replaced with "_end": + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + diff --git a/.docs/Index.md b/.docs/Index.md deleted file mode 100644 index 6a0405628..000000000 --- a/.docs/Index.md +++ /dev/null @@ -1,3 +0,0 @@ -## VSTeam Functions - - diff --git a/.docs/Invoke-VSTeamRequest.md b/.docs/Invoke-VSTeamRequest.md index 0c220b382..46af5af38 100644 --- a/.docs/Invoke-VSTeamRequest.md +++ b/.docs/Invoke-VSTeamRequest.md @@ -14,27 +14,25 @@ Invoke-VSTeamRequest allows you to call a TFS/AzD REST API much easier than usin ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Invoke-VSTeamRequest -resource projectHistory -version '4.1-preview' -Verbose +```powershell +Invoke-VSTeamRequest -resource projectHistory -version '4.1-preview' -Verbose ``` This command will return the project history. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> ivr -area release -resource releases -version '4.1-preview' -subDomain vsrm -Verbose +```powershell +ivr -area release -resource releases -version '4.1-preview' -subDomain vsrm -Verbose ``` This command will return the releases for a project. ## PARAMETERS - - -### -ContentType +### ContentType Specifies the content type of the request. @@ -47,7 +45,7 @@ Type: String Default value: application/json ``` -### -Method +### Method Specifies the method used for the request. The acceptable values for this parameter are: @@ -67,7 +65,7 @@ Type: String Default value: Get ``` -### -Body +### Body Specifies the body of the request. The body is the content of the request that follows the headers. @@ -82,7 +80,7 @@ Type: Object Accept pipeline input: true (ByValue) ``` -### -InFile +### InFile Path and file name to the file that contains the contents of the request. If the path is omitted, the default is the current location. @@ -90,7 +88,7 @@ Path and file name to the file that contains the contents of the request. If the Type: String ``` -### -OutFile +### OutFile Specifies the output file for which this function saves the response body. Enter a path and file name. If you omit the path, the default is the current location. @@ -98,7 +96,7 @@ Specifies the output file for which this function saves the response body. Enter Type: String ``` -### -Area +### Area The area to find the resource. You can tab complete this value. It can be filtered by passing -subDomain first. @@ -106,7 +104,7 @@ The area to find the resource. You can tab complete this value. It can be filter Type: String ``` -### -Resource +### Resource The name of the feature you want to manipulate. You can tab complete this value if you pass -Area before this parameter. @@ -114,7 +112,7 @@ The name of the feature you want to manipulate. You can tab complete this value Type: String ``` -### -Id +### Id The unique value of the item you want to work with. @@ -122,7 +120,7 @@ The unique value of the item you want to work with. Type: String ``` -### -Version +### Version The version of the API you wish to target. @@ -130,7 +128,7 @@ The version of the API you wish to target. Type: String ``` -### -SubDomain +### SubDomain The SubDomain before .dev.azure.com. For example, to target Release Management you must use the SubDomain vsrm. @@ -138,7 +136,7 @@ The SubDomain before .dev.azure.com. For example, to target Release Management y Type: String ``` -### -JSON +### JSON Converts the PowerShell object into JSON and displays in the console. @@ -146,7 +144,7 @@ Converts the PowerShell object into JSON and displays in the console. Type: Switch ``` -### -AdditionalHeaders +### AdditionalHeaders Adds additional headers to the request @@ -156,6 +154,8 @@ Type: Hashtable + + ## INPUTS ### System.String @@ -166,4 +166,8 @@ Type: Hashtable ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeam.md b/.docs/Remove-VSTeam.md index 860647d5f..d4b894b3d 100644 --- a/.docs/Remove-VSTeam.md +++ b/.docs/Remove-VSTeam.md @@ -14,26 +14,46 @@ ## EXAMPLES -## PARAMETERS +### Example 1: Remove second team - +```powershell +Set-DefaultProject Test +Get-VSTeam | Select-Object -First 1 -Skip 1 | Remove-VSTeam +``` -### -TeamId +### Example 2: Remove team by name + +```powershell +Remove-VSTeam LastTeam -ProjectName Test -Force +``` + +This command removes the team named 'LastTeam'. + +### Example 2: Remove team by id + +```powershell +Remove-VSTeam -Id 30246aee-95f8-45cc-9552-bceff1921a40 -Force +``` + +This command removes the team with id 30246aee-95f8-45cc-9552-bceff1921a40. + +## PARAMETERS + +### Id The id of the team to remove. ```yaml Type: String -Aliases: name +Aliases: Name, TeamId, TeamName Required: True +Position: 0 Accept pipeline input: true (ByPropertyName) ``` - - - + - + ## INPUTS @@ -41,4 +61,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamAccessControlEntry.md b/.docs/Remove-VSTeamAccessControlEntry.md index 299a02abb..b8707e2d3 100644 --- a/.docs/Remove-VSTeamAccessControlEntry.md +++ b/.docs/Remove-VSTeamAccessControlEntry.md @@ -1,4 +1,3 @@ - # Remove-VSTeamAccessControlEntry @@ -14,72 +13,75 @@ Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") +### Example 1 + +```powershell +Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") ``` This will remove the specified descriptor from the specified repository, using the security namespace id, while confirming for the remove action. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -confirm:$false +```powershell +Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -force ``` This will remove the specified descriptor from the specified repository, using the security namespace id, with no confirmation for the remove action. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("descriptor1","descriptor2") +```powershell +Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("descriptor1","descriptor2") ``` This will remove multiple descriptors from the specified repository, using the security namespace id, while confirming for the remove action. -### -------------------------- EXAMPLE 4 -------------------------- +### Example 4 -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") +```powershell +Remove-VSTeamAccessControlEntry -securityNamespace [vsteam_lib.SecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") ``` This will remove the specified descriptor from the specified repository, using a security namespace object, while confirming for the remove action. -### -------------------------- EXAMPLE 5 -------------------------- +### Example 5 -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -confirm:$false +```powershell +Remove-VSTeamAccessControlEntry -securityNamespace [vsteam_lib.SecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -force ``` This will remove the specified descriptor from the specified repository, using a security namespace object, with no confirmation for the remove action. -### -------------------------- EXAMPLE 6 -------------------------- +### Example 6 -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("descriptor1","descriptor2") +```powershell +Remove-VSTeamAccessControlEntry -securityNamespace [vsteam_lib.SecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("descriptor1","descriptor2") ``` This will remove multiple descriptors from the specified repository, using a security namespace object, while confirming for the remove action. ## PARAMETERS -### -SecurityNamespace +### SecurityNamespace -VSTeamSecurityNamespace object. +Security namespace object. ```yaml -Type: VSTeamSecurityNamespace +Type: vsteam_lib.SecurityNamespace +Parameter Sets: ByNamespace Required: True ``` -### -SecurityNamespaceId +### SecurityNamespaceId Security namespace identifier. Valid IDs are: AzD: + - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) @@ -142,6 +144,7 @@ AzD: - VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) VSSPS: + - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) @@ -164,10 +167,11 @@ VSSPS: ```yaml Type: String +Parameter Sets: ByNamespaceId Required: True ``` -### -Token +### Token The security Token @@ -182,7 +186,7 @@ Type: String Required: True ``` -### -Descriptor +### Descriptor An array of descriptors of users/groups to be removed @@ -191,6 +195,8 @@ Type: System.Array Required: True ``` + + ## INPUTS ## OUTPUTS @@ -199,4 +205,8 @@ Required: True This function outputs a non-terminating error if the ACE removal from the ACL returns $False. This can be due to the wrong descriptor being provided, or the descriptor already not being on the ACL. + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamAccessControlList.md b/.docs/Remove-VSTeamAccessControlList.md index ae01da160..ac19091b8 100644 --- a/.docs/Remove-VSTeamAccessControlList.md +++ b/.docs/Remove-VSTeamAccessControlList.md @@ -16,25 +16,27 @@ ## PARAMETERS -### -SecurityNamespace +### SecurityNamespace -Security namespace identifier. +Security namespace object. ```yaml -Type: VSTeamSecurityNamespace +Type: vsteam_lib.SecurityNamespace +Parameter Sets: ByNamespace Required: True ``` -### -SecurityNamespaceId +### SecurityNamespaceId Security namespace identifier. ```yaml Type: String +Parameter Sets: ByNamespaceId Required: True ``` -### -Tokens +### Tokens One or more comma-separated security tokens @@ -43,7 +45,7 @@ Type: String Required: True ``` -### -Recurse +### Recurse If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens. @@ -60,4 +62,8 @@ Required: True ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamAccount.md b/.docs/Remove-VSTeamAccount.md index 5c22f1151..abefb1d7e 100644 --- a/.docs/Remove-VSTeamAccount.md +++ b/.docs/Remove-VSTeamAccount.md @@ -16,17 +16,17 @@ To remove from the Machine level you must be running PowerShell as administrator ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamAccount +```powershell +Remove-VSTeamAccount ``` This will clear your account name and personal access token. ## PARAMETERS -### -Level +### Level On Windows allows you to clear your account information at the Process, User or Machine levels. @@ -34,7 +34,7 @@ On Windows allows you to clear your account information at the Process, User or Type: String ``` - + ## INPUTS @@ -42,6 +42,8 @@ Type: String ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + diff --git a/.docs/Remove-VSTeamAgent.md b/.docs/Remove-VSTeamAgent.md index d0ee15e87..67fb9d240 100644 --- a/.docs/Remove-VSTeamAgent.md +++ b/.docs/Remove-VSTeamAgent.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PoolId +### PoolId Id of the pool. @@ -26,7 +26,7 @@ Required: True Accept pipeline input: true (ByValue) ``` -### -Id +### Id Id of the agent to remove. @@ -37,7 +37,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` - + ## INPUTS @@ -47,4 +47,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamArea.md b/.docs/Remove-VSTeamArea.md index 5d0f8633d..374ad9acc 100644 --- a/.docs/Remove-VSTeamArea.md +++ b/.docs/Remove-VSTeamArea.md @@ -14,43 +14,48 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamArea -ProjectName Demo -Path "\MyIteration\Path" +```powershell +Remove-VSTeamArea -ProjectName "Demo" -Path "\MyArea\Path" -ReClassifyId 19 ``` -This command removes an existing area with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root area, since no reclassification id has been given. +This command removes an existing area with the path \MyArea\Path to the Demo project. Any work items that are assigned to that path get reassigned to the area with the id 19. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Remove-VSTeamArea -ProjectName "Demo" -Path "\MyIteration\Path" -ReClassifyId 19 +```powershell +Get-VSTeamArea | Remove-VSTeamArea "A1" -Force ``` -This command removes an existing area with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the area with the id 19. +This command removes an existing area with the path "A1" to the default project. Any work items that are assigned to that path get reassigned to the area with the returned by Get-VSTeamArea. ## PARAMETERS - - -### -Path +### Path Path of the area node. ```yaml Type: string +Required: True +Position: 0 ``` -### -ReClassifyId +### ReClassifyId Id of an area where work items should be reassigned to if they are currently assigned to the area being deleted. ```yaml Type: int +Required: True +Aliases: NodeId +Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS @@ -60,10 +65,14 @@ Type: int ## NOTES -This function is a wrapper of the base function Remove-VSTeamClassificationNode.md. +This function is a wrapper of the base function Remove-VSTeamClassificationNode. + + ## RELATED LINKS + + [Remove-VSTeamClassificationNode](Remove-VSTeamClassificationNode.md) [Remove-VSTeamIteration](Remove-VSTeamIteration.md) diff --git a/.docs/Remove-VSTeamBuild.md b/.docs/Remove-VSTeamBuild.md index 7d4a5ab05..fe1053f28 100644 --- a/.docs/Remove-VSTeamBuild.md +++ b/.docs/Remove-VSTeamBuild.md @@ -14,21 +14,21 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamBuild | Remove-VSTeamBuild -Force +```powershell +Get-VSTeamBuild | Remove-VSTeamBuild -Force ``` This command will delete all builds that are not marked retain indefinitely. ## PARAMETERS - - - + + + ## INPUTS @@ -38,4 +38,8 @@ This command will delete all builds that are not marked retain indefinitely. ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamBuildDefinition.md b/.docs/Remove-VSTeamBuildDefinition.md index 3df6e0d9a..0f0bcdd99 100644 --- a/.docs/Remove-VSTeamBuildDefinition.md +++ b/.docs/Remove-VSTeamBuildDefinition.md @@ -16,10 +16,10 @@ The project name is a Dynamic Parameter which may not be displayed in the syntax ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo | Remove-VSTeamBuildDefinition +```powershell +Get-VSTeamBuildDefinition -ProjectName Demo | Remove-VSTeamBuildDefinition ``` This command gets a list of all build definitions in the demo project. @@ -28,9 +28,7 @@ The pipeline operator (|) passes the data to the Remove-VSTeamBuildDefinition fu ## PARAMETERS - - -### -Id +### Id Specifies one or more build definitions by ID. @@ -44,7 +42,9 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS @@ -54,19 +54,13 @@ Accept pipeline input: true (ByPropertyName) ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build definition IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) diff --git a/.docs/Remove-VSTeamBuildTag.md b/.docs/Remove-VSTeamBuildTag.md index f0e45dbcd..8bb0745bd 100644 --- a/.docs/Remove-VSTeamBuildTag.md +++ b/.docs/Remove-VSTeamBuildTag.md @@ -16,17 +16,13 @@ ## PARAMETERS - - - - - + - + ## INPUTS @@ -34,4 +30,8 @@ ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamClassificationNode.md b/.docs/Remove-VSTeamClassificationNode.md index 178039e90..71883c5c9 100644 --- a/.docs/Remove-VSTeamClassificationNode.md +++ b/.docs/Remove-VSTeamClassificationNode.md @@ -14,27 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamClassificationNode -ProjectName Demo -StructureGroup "iterations" -Path "\MyIteration\Path" +```powershell +Remove-VSTeamClassificationNode -ProjectName Demo -StructureGroup "iterations" -Path "\MyIteration\Path" ``` This command removes an existing iteration with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root iteration, since no reclassification id has been given. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Remove-VSTeamClassificationNode -ProjectName "Demo" -StructureGroup "areas" -Path "\MyIteration\Path" -ReClassifyId 19 +```powershell +Remove-VSTeamClassificationNode -ProjectName "Demo" -StructureGroup "areas" -Path "\MyIteration\Path" -ReClassifyId 19 ``` This command removes an existing area with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the area with the id 19. ## PARAMETERS - - -### -StructureGroup +### StructureGroup Structure group of the classification node. @@ -43,7 +41,7 @@ Type: string Accepted values: iterations, areas ``` -### -Path +### Path Path of the classification node. @@ -51,7 +49,7 @@ Path of the classification node. Type: string ``` -### -ReClassifyId +### ReClassifyId Id of a classification node where work items should be reassigned to if they are currently assigned to the node being deleted. @@ -59,7 +57,9 @@ Id of a classification node where work items should be reassigned to if they are Type: int ``` - + + + ## INPUTS @@ -71,8 +71,12 @@ Type: int This function is the base function for Remove-VSTeamArea and Remove-VSTeamIteration. + + ## RELATED LINKS + + [Remove-VSTeamArea](Remove-VSTeamArea.md) [Remove-VSTeamIteration](Remove-VSTeamIteration.md) diff --git a/.docs/Remove-VSTeamExtension.md b/.docs/Remove-VSTeamExtension.md index ff8a7a2dc..48fe1b3b4 100644 --- a/.docs/Remove-VSTeamExtension.md +++ b/.docs/Remove-VSTeamExtension.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PublisherId +### PublisherId The id of the publisher. @@ -25,7 +25,7 @@ Type: String Required: True ``` -### -ExtensionId +### ExtensionId The id of the extension. @@ -34,7 +34,7 @@ Type: String Required: True ``` - + ## INPUTS @@ -42,8 +42,12 @@ Required: True ## NOTES + + ## RELATED LINKS + + [Add-VSTeamExtension](Add-VSTeamExtension.md) [Get-VSTeamExtension](Get-VSTeamExtension.md) diff --git a/.docs/Remove-VSTeamFeed.md b/.docs/Remove-VSTeamFeed.md index 714be6da8..f893a4f66 100644 --- a/.docs/Remove-VSTeamFeed.md +++ b/.docs/Remove-VSTeamFeed.md @@ -14,17 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' +```powershell +Remove-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' ``` This command remove the package feed from the account. ## PARAMETERS -### -FeedId +### FeedId Specifies the ID of the feed. @@ -40,4 +40,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamGitRepository.md b/.docs/Remove-VSTeamGitRepository.md index f96597fff..1ba6365b3 100644 --- a/.docs/Remove-VSTeamGitRepository.md +++ b/.docs/Remove-VSTeamGitRepository.md @@ -14,17 +14,17 @@ Remove-VSTeamGitRepository removes the Git repository from your Azure DevOps or ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamGitRepository -Id 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 +```powershell +Remove-VSTeamGitRepository -Id 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 ``` This command removes all the Git repositories for your TFS or Team Services account. ## PARAMETERS -### -Id +### Id Specifies one or more repositories by ID. @@ -38,7 +38,7 @@ Aliases: RepositoryID Accept pipeline input: true (ByPropertyName) ``` - + ## INPUTS @@ -46,4 +46,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamIteration.md b/.docs/Remove-VSTeamIteration.md index bba239e59..40afb8175 100644 --- a/.docs/Remove-VSTeamIteration.md +++ b/.docs/Remove-VSTeamIteration.md @@ -14,43 +14,45 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamIteration -ProjectName Demo -Path "\MyIteration\Path" +```powershell +Remove-VSTeamIteration -ProjectName Demo -Path "\MyIteration\Path" ``` This command removes an existing iteration with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root iteration, since no reclassification id has been given. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Remove-VSTeamIteration -ProjectName "Demo" -Path "\MyIteration\Path" -ReClassifyId 19 +```powershell +Remove-VSTeamIteration -ProjectName "Demo" -Path "\MyIteration\Path" -ReClassifyId 19 ``` This command removes an existing iteration with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the iteration with the id 19. ## PARAMETERS - - -### -Path +### Path Path of the iteration node. ```yaml Type: string +Required: True ``` -### -ReClassifyId +### ReClassifyId Id of an iteration where work items should be reassigned to if they are currently assigned to the iteration being deleted. ```yaml Type: int +Required: True ``` - + + + ## INPUTS @@ -60,10 +62,14 @@ Type: int ## NOTES -This function is a wrapper of the base function Remove-VSTeamClassificationNode.md. +This function is a wrapper of the base function Remove-VSTeamClassificationNode. + + ## RELATED LINKS + + [Remove-VSTeamArea](Add-VSTeamArea.md) [Remove-VSTeamClassificationNode](Add-VSTeamClassificationNode.md) diff --git a/.docs/Remove-VSTeamMembership.md b/.docs/Remove-VSTeamMembership.md index 1399e2e43..845592907 100644 --- a/.docs/Remove-VSTeamMembership.md +++ b/.docs/Remove-VSTeamMembership.md @@ -14,12 +14,12 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> $user = Get-VSTeamUser | ? DisplayName -eq 'Test User' -PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' -PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -ContainerDescriptor $group.Descriptor +```powershell +$user = Get-VSTeamUser | ? DisplayName -eq 'Test User' +$group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' +Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -ContainerDescriptor $group.Descriptor ``` Removes Test User from the Endpoint Administrators group. @@ -36,8 +36,12 @@ Removes Test User from the Endpoint Administrators group. ## NOTES + + ## RELATED LINKS + + [Get-VsTeamUser](Get-VsTeamUser.md) [Get-VsTeamGroup](Get-VsTeamGroup.md) diff --git a/.docs/Remove-VSTeamPolicy.md b/.docs/Remove-VSTeamPolicy.md index 1fadac1b0..2322657c5 100644 --- a/.docs/Remove-VSTeamPolicy.md +++ b/.docs/Remove-VSTeamPolicy.md @@ -14,19 +14,17 @@ Remove-VSTeamPolicy removes the policy from the specified project. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamPolicy -ProjectName Demo -Id 1 +```powershell +Remove-VSTeamPolicy -ProjectName Demo -Id 1 ``` This command removes the policy with ID of 1 from the Demo project. ## PARAMETERS - - -### -Id +### Id Specifies one or more policies by ID. @@ -38,7 +36,9 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS @@ -46,8 +46,12 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + [Add-VSTeamPolicy](Add-VSTeamPolicy.md) [Get-VSTeamPolicy](Get-VSTeamPolicy.md) diff --git a/.docs/Remove-VSTeamProfile.md b/.docs/Remove-VSTeamProfile.md index d2d98ccb7..af4338585 100644 --- a/.docs/Remove-VSTeamProfile.md +++ b/.docs/Remove-VSTeamProfile.md @@ -14,17 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamProfile | Remove-VSTeamProfile -Force +```powershell +Get-VSTeamProfile | Remove-VSTeamProfile -Force ``` This will remove all the profiles on your system. ## PARAMETERS -### -Name +### Name Name of profile to remove. @@ -33,7 +33,7 @@ Type: String Required: True ``` - + ## INPUTS @@ -41,6 +41,10 @@ Required: True ## NOTES + + ## RELATED LINKS + + [Add-VSTeamProfile](Add-VSTeamProfile.md) diff --git a/.docs/Remove-VSTeamProject.md b/.docs/Remove-VSTeamProject.md index 35a3825e0..3cd71fb77 100644 --- a/.docs/Remove-VSTeamProject.md +++ b/.docs/Remove-VSTeamProject.md @@ -16,26 +16,26 @@ This function takes a DynamicParam for ProjectName that can be read from the Pip ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamProject 'MyProject' +```powershell +Remove-VSTeamProject 'MyProject' ``` You will be prompted for confirmation and the project will be deleted. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Remove-VSTeamProject 'MyProject' -Force +```powershell +Remove-VSTeamProject 'MyProject' -Force ``` You will NOT be prompted for confirmation and the project will be deleted. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamProject | Remove-VSTeamProject -Force +```powershell +Get-VSTeamProject | Remove-VSTeamProject -Force ``` This will remove all projects @@ -44,7 +44,7 @@ This will remove all projects - + ## INPUTS @@ -52,8 +52,10 @@ This will remove all projects ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + [Add-VSTeamProject](Add-VSTeamProject.md) diff --git a/.docs/Remove-VSTeamRelease.md b/.docs/Remove-VSTeamRelease.md index 27bde1ba3..8b35bfb6d 100644 --- a/.docs/Remove-VSTeamRelease.md +++ b/.docs/Remove-VSTeamRelease.md @@ -16,10 +16,10 @@ The project name is a Dynamic Parameter which may not be displayed in the syntax ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamRelease -ProjectName demo | Remove-VSTeamRelease +```powershell +Get-VSTeamRelease -ProjectName demo | Remove-VSTeamRelease ``` This command gets a list of all releases in the demo project. @@ -28,9 +28,7 @@ The pipeline operator (|) passes the data to the Remove-VSTeamRelease function, ## PARAMETERS - - -### -Id +### Id Specifies one or more releases by ID. @@ -44,7 +42,9 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS @@ -54,19 +54,13 @@ Accept pipeline input: true (ByPropertyName) ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe release definition IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamRelease](Add-VSTeamRelease.md) diff --git a/.docs/Remove-VSTeamReleaseDefinition.md b/.docs/Remove-VSTeamReleaseDefinition.md index 4874c3a5a..fa034a209 100644 --- a/.docs/Remove-VSTeamReleaseDefinition.md +++ b/.docs/Remove-VSTeamReleaseDefinition.md @@ -16,10 +16,10 @@ The project name is a Dynamic Parameter which may not be displayed in the syntax ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Remove-VSTeamReleaseDefinition +```powershell +Get-VSTeamReleaseDefinition -ProjectName demo | Remove-VSTeamReleaseDefinition ``` This command gets a list of all release definitions in the demo project. @@ -28,9 +28,7 @@ The pipeline operator (|) passes the data to the Remove-VSTeamReleaseDefinition ## PARAMETERS - - -### -Id +### Id Specifies one or more release definitions by ID. @@ -44,7 +42,9 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS @@ -54,19 +54,13 @@ Accept pipeline input: true (ByPropertyName) ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe release definition IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamReleaseDefinition](Add-VSTeamReleaseDefinition.md) diff --git a/.docs/Remove-VSTeamServiceEndpoint.md b/.docs/Remove-VSTeamServiceEndpoint.md index df68d921d..ea7394e0a 100644 --- a/.docs/Remove-VSTeamServiceEndpoint.md +++ b/.docs/Remove-VSTeamServiceEndpoint.md @@ -16,9 +16,7 @@ ## PARAMETERS - - -### -Id +### Id Id of the service endpoint @@ -28,7 +26,9 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS @@ -36,4 +36,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamTaskGroup.md b/.docs/Remove-VSTeamTaskGroup.md index ea1852786..a09f9cf0f 100644 --- a/.docs/Remove-VSTeamTaskGroup.md +++ b/.docs/Remove-VSTeamTaskGroup.md @@ -14,10 +14,9 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 ```powershell - $projectName = "some_project_name" $taskGroup = Get-VSTeamTaskGroup -Name "taskName" -ProjectName $projectName @@ -32,57 +31,7 @@ Remove-VSTeamTaskGroup @methodParameters ## PARAMETERS -### -Confirm - -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Force - -Does not prompt - -```yaml -Type: SwitchParameter -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ProjectName - - - -### -WhatIf - -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Id +### Id ID of the existing task group @@ -97,10 +46,9 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### CommonParameters + -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorTask, -InformationAction, -InformationTask, -OutTask, -OutBuffer, -PipelineTask, -Verbose, -WarningAction, and -WarningTask. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS @@ -114,8 +62,12 @@ System.String ## NOTES + + ## RELATED LINKS + + [Add-VSTeamTaskGroup](Add-VSTeamTaskGroup.md) [Get-VSTeamTaskGroup](Get-VSTeamTaskGroup.md) diff --git a/.docs/Remove-VSTeamUserEntitlement.md b/.docs/Remove-VSTeamUserEntitlement.md index 5345d9064..eb180cd81 100644 --- a/.docs/Remove-VSTeamUserEntitlement.md +++ b/.docs/Remove-VSTeamUserEntitlement.md @@ -16,11 +16,7 @@ ## PARAMETERS - - - - -### -UserId +### UserId The id of the user to remove. @@ -32,7 +28,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -Email +### Email The email of the user to remove. @@ -44,7 +40,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` - + ## INPUTS @@ -56,4 +52,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Remove-VSTeamVariableGroup.md b/.docs/Remove-VSTeamVariableGroup.md index fe98ed935..3f8285860 100644 --- a/.docs/Remove-VSTeamVariableGroup.md +++ b/.docs/Remove-VSTeamVariableGroup.md @@ -14,10 +14,9 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 ```powershell - $methodParameters = @{ ProjectName = "some_project_name" Name = "new_variable_group" @@ -44,15 +43,7 @@ Remove-VSTeamVariableGroup @methodParameters ## PARAMETERS - - - - - - - - -### -Id +### Id ID of the existing variable group @@ -67,10 +58,9 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### CommonParameters + -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS @@ -84,8 +74,12 @@ System.String ## NOTES + + ## RELATED LINKS + + [Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) diff --git a/.docs/Remove-VSTeamWorkItem.md b/.docs/Remove-VSTeamWorkItem.md index ea286a76c..c520d034a 100644 --- a/.docs/Remove-VSTeamWorkItem.md +++ b/.docs/Remove-VSTeamWorkItem.md @@ -14,33 +14,33 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Remove-VSTeamWorkItem -Id 47,48 -Force +```powershell +Remove-VSTeamWorkItem -Id 47,48 -Force ``` This command deletes work items with IDs 47 and 48 by using the IDs parameter. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Remove-VSTeamWorkItem -Id 47 +```powershell +Remove-VSTeamWorkItem -Id 47 ``` This command deletes the work item with ID 47 by using the ID parameter. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Remove-VSTeamWorkItem -Id 47 -Destroy -Force +```powershell +Remove-VSTeamWorkItem -Id 47 -Destroy -Force ``` This command deletes work item with IDs 47 **permanently** by using the Destroy parameter. ## PARAMETERS -### -Id +### Id The id of one or more work items. @@ -51,7 +51,7 @@ Required: True Accept pipeline input: true (ByPropertyName, ByValue) ``` -### -Destroy +### Destroy Optional parameter, if set to true, the work item is deleted permanently. **Please note: the destroy action is PERMANENT and cannot be undone.** @@ -59,11 +59,7 @@ Optional parameter, if set to true, the work item is deleted permanently. **Plea Type: Switch ``` - - - - - + ## INPUTS @@ -77,4 +73,8 @@ ProjectName If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. + + ## RELATED LINKS + + diff --git a/.docs/Set-VSTeamAPIVersion.md b/.docs/Set-VSTeamAPIVersion.md index 549b114ab..836769a26 100644 --- a/.docs/Set-VSTeamAPIVersion.md +++ b/.docs/Set-VSTeamAPIVersion.md @@ -14,25 +14,25 @@ Set-VSTeamAPIVersion sets the versions of APIs used. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamAPIVersion AzD +```powershell +Set-VSTeamAPIVersion AzD ``` This command sets the API versions to support AzD. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Set-VSTeamAPIVersion -Service Release -Version '5.0' +```powershell +Set-VSTeamAPIVersion -Service Release -Version '5.0' ``` This command sets the version of the Release calls to 5.0. ## PARAMETERS -### -Target +### Target Specifies the version to use. The acceptable values for this parameter are: @@ -57,7 +57,7 @@ Parameter Sets: Target Default value: TFS2017 ``` -### -Service +### Service Specifies the service to change. The acceptable values for this parameter are: @@ -78,7 +78,7 @@ Required: True Parameter Sets: Service ``` -### -Version +### Version Specifies the version to use. @@ -88,7 +88,7 @@ Required: True Parameter Sets: Service ``` - + ## INPUTS @@ -96,4 +96,8 @@ Parameter Sets: Service ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Set-VSTeamAccount.md b/.docs/Set-VSTeamAccount.md index bdff740ea..4223539b4 100644 --- a/.docs/Set-VSTeamAccount.md +++ b/.docs/Set-VSTeamAccount.md @@ -18,69 +18,69 @@ Calling Set-VSTeamAccount will clear any default project. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamAccount +```powershell +Set-VSTeamAccount ``` You will be prompted for the account name and personal access token. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrthisisnotreal4uhlh5vgbmgap3mziwnga +```powershell +Set-VSTeamAccount -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrthisisnotreal4uhlh5vgbmgap3mziwnga ``` Allows you to provide all the information on the command line. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Set-VSTeamAccount -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication +```powershell +Set-VSTeamAccount -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication ``` On Windows, allows you use to use Windows authentication against a local TFS server. -### -------------------------- EXAMPLE 4 -------------------------- +### Example 4 -```PowerShell -PS C:\> Set-VSTeamAccount -Profile demonstrations +```powershell +Set-VSTeamAccount -Profile demonstrations ``` Will add the account from the profile provided. -### -------------------------- EXAMPLE 5 -------------------------- +### Example 5 -```PowerShell -PS C:\> Set-VSTeamAccount -Profile demonstrations -Drive demo | Invoke-Expression -PS C:\> Set-Location demo: +```powershell +Set-VSTeamAccount -Profile demonstrations -Drive demo | Invoke-Expression +Set-Location demo: PS demo:\> Get-ChildItem ``` Will add the account from the profile provided and mount a drive named demo that you can navigate like a file system. If you do not pipe to Invoke-Expression you can simply copy and paste the output and execute it. -### -------------------------- EXAMPLE 6 -------------------------- +### Example 6 -```PowerShell -PS C:\> Set-VSTeamAccount -Profile demonstrations -Level Machine +```powershell +Set-VSTeamAccount -Profile demonstrations -Level Machine ``` Will add the account from the profile provided and store the information at the Machine level. Now any new PowerShell sessions will auto load this account. Note: You must run PowerShell as an Administrator to store at the Machine level. -### -------------------------- EXAMPLE 7 -------------------------- +### Example 7 -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken +```powershell +Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken ``` Will add the account and use the OAuth Token provided by AzD when you check the *Allow scripts to access OAuth token* checkbox on the phase. Using this method removes the need to create a Personal Access Token. Note -Token is just an alias for -PersonalAccessToken. The token is scoped to only allow access to the account running the build or release. To access other accounts you will have to use a personal access token. ## PARAMETERS -### -Account +### Account The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. @@ -99,7 +99,7 @@ Required: True Position: 1 ``` -### -SecurePersonalAccessToken +### SecurePersonalAccessToken A secured string to capture your personal access token. @@ -114,7 +114,7 @@ Parameter Sets: Secure Required: True ``` -### -Level +### Level On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. @@ -126,7 +126,7 @@ Type: String Parameter Sets: Secure, Plain, Windows ``` -### -PersonalAccessToken +### PersonalAccessToken The personal access token from AzD/TFS to use to access this account. @@ -138,7 +138,7 @@ Required: True Position: 2 ``` -### -UseWindowsAuthentication +### UseWindowsAuthentication Allows the use of the current user's Windows credentials to authenticate against a local Team Foundation Server or Azure DevOps Server. This cannot be used to connect to Azure DevOps Services. @@ -147,7 +147,7 @@ Type: SwitchParameter Parameter Sets: Windows ``` -### -UseBearerToken +### UseBearerToken Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. @@ -156,7 +156,7 @@ Type: SwitchParameter Parameter Sets: Secure, Plain ``` -### -Profile +### Profile The profile name stored using Add-VSTeamProfile function. You can tab complete through existing profile names. @@ -168,7 +168,7 @@ Required: True -### -Drive +### Drive The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: @@ -176,7 +176,7 @@ The name of the drive you want to mount to this account. The command you need to Type: String ``` - + ## INPUTS @@ -184,12 +184,12 @@ Type: String ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + [Add-VSTeamProfile](Add-VSTeamProfile.md) -[Clear-VSTeamDefaultProject](Clear-VSTeamDefaultProject.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) +[Clear-VSTeamDefaultProject](Clear-VSTeamDefaultProject.md) \ No newline at end of file diff --git a/.docs/Set-VSTeamAlias.md b/.docs/Set-VSTeamAlias.md index 4796344ae..4b025d7b6 100644 --- a/.docs/Set-VSTeamAlias.md +++ b/.docs/Set-VSTeamAlias.md @@ -16,7 +16,7 @@ ## PARAMETERS - + ## INPUTS @@ -28,4 +28,8 @@ ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Set-VSTeamApproval.md b/.docs/Set-VSTeamApproval.md index 5d68a9d3e..5a41f324a 100644 --- a/.docs/Set-VSTeamApproval.md +++ b/.docs/Set-VSTeamApproval.md @@ -14,27 +14,25 @@ Set-VSTeamApproval sets the status of approval to Approved, Rejected, Pending, o ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamApproval | Set-VSTeamApproval +```powershell +Get-VSTeamApproval | Set-VSTeamApproval ``` This command sets all pending approvals to approved. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Set-VSTeamApproval -Id 1 -Status Rejected +```powershell +Set-VSTeamApproval -Id 1 -Status Rejected ``` This command rejects approval with Id of 1. ## PARAMETERS - - -### -Id +### Id Specifies the approval IDs of the approvals to set. @@ -44,7 +42,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -Status +### Status Specifies the status to set for the approval. The acceptable values for this parameter are: @@ -59,7 +57,7 @@ Required: True Default value: Approved ``` -### -Approver +### Approver Specifies the user to whom the approval has been re-assigned to Alias of the user chuckreinhart@outlook.com, for example. @@ -67,7 +65,7 @@ Specifies the user to whom the approval has been re-assigned to Alias of the use Type: String ``` -### -Comment +### Comment Specifies the comment to be stored with this approval. @@ -75,7 +73,9 @@ Specifies the comment to be stored with this approval. Type: String ``` - + + + ## INPUTS @@ -83,4 +83,8 @@ Type: String ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Set-VSTeamDefaultAPITimeout.md b/.docs/Set-VSTeamDefaultAPITimeout.md index 1ddeed70e..4edff6435 100644 --- a/.docs/Set-VSTeamDefaultAPITimeout.md +++ b/.docs/Set-VSTeamDefaultAPITimeout.md @@ -14,19 +14,17 @@ By setting a default timeout you can adjust the value for your needs ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamDefaultAPITimeout 30 +```powershell +Set-VSTeamDefaultAPITimeout 30 ``` This command sets 30 seconds as the default timeout. ## PARAMETERS - - -### -TimeoutSec +### TimeoutSec Specifies the timeout for all function calls. @@ -36,7 +34,7 @@ Required: True Accept pipeline input: False ``` -### -Level +### Level On Windows allows you to store your default timeout at the Process, User or Machine levels. @@ -46,6 +44,8 @@ When saved at the User or Machine level your default timeout will be in any futu Type: String ``` + + ## INPUTS ### System.String @@ -56,4 +56,8 @@ Type: String ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Set-VSTeamDefaultProject.md b/.docs/Set-VSTeamDefaultProject.md index 53cb6e302..88740b345 100644 --- a/.docs/Set-VSTeamDefaultProject.md +++ b/.docs/Set-VSTeamDefaultProject.md @@ -16,10 +16,10 @@ By setting a default project you can omit that parameter from your function call ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo +```powershell +Set-VSTeamDefaultProject Demo ``` This command sets Demo as the default project. @@ -28,23 +28,19 @@ You can now call other functions that require a project name without passing the ## PARAMETERS - - -### -Project +### Project 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 Required: True Accept pipeline input: true (ByPropertyName) ``` -### -Level +### Level On Windows allows you to store your default project at the Process, User or Machine levels. @@ -54,6 +50,8 @@ When saved at the User or Machine level your default project will be in any futu Type: String ``` + + ## INPUTS ### System.String @@ -64,6 +62,8 @@ Type: String ## NOTES -Setting a default project also enables tab completion of dynamic parameters when you call Add-VSTeamBuild. + ## RELATED LINKS + + diff --git a/.docs/Set-VSTeamEnvironmentStatus.md b/.docs/Set-VSTeamEnvironmentStatus.md index 579028a44..97bfaeadc 100644 --- a/.docs/Set-VSTeamEnvironmentStatus.md +++ b/.docs/Set-VSTeamEnvironmentStatus.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamEnvironmentStatus -ReleaseId 54 -Id 5 -status inProgress +```powershell +Set-VSTeamEnvironmentStatus -ReleaseId 54 -Id 5 -status inProgress ``` This command will set the status of environment with id 5 of release 54 to inProgress. You can use this call to redeploy an environment. ## PARAMETERS - - -### -EnvironmentId +### EnvironmentId Specifies one or more environments by ID you wish to deploy. @@ -43,7 +41,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -ReleaseId +### ReleaseId Specifies the release by ID. @@ -53,7 +51,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -Status +### Status The status to set for the environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. @@ -61,7 +59,7 @@ The status to set for the environment to canceled, inProgress, notStarted, parti Type: String ``` -### -Comment +### Comment The comment to set for the status change. @@ -69,7 +67,7 @@ The comment to set for the status change. Type: String ``` -### -ScheduledDeploymentTime +### ScheduledDeploymentTime The date and time to schedule when setting the status to scheduled. @@ -77,7 +75,9 @@ The date and time to schedule when setting the status to scheduled. Type: DateTime ``` - + + + ## INPUTS @@ -85,10 +85,8 @@ Type: DateTime ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + ## RELATED LINKS + + diff --git a/.docs/Set-VSTeamPermissionInheritance.md b/.docs/Set-VSTeamPermissionInheritance.md index ee48340e3..e08260a52 100644 --- a/.docs/Set-VSTeamPermissionInheritance.md +++ b/.docs/Set-VSTeamPermissionInheritance.md @@ -14,27 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition -NewState $true -Force +```powershell +Set-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition -NewState $true -Force ``` This command sets the permission inheritance to true. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Get-VSTeamBuildDefinition | Set-VSTeamPermissionInheritance -ResourceType BuildDefinition -NewState $true -Force +```powershell +Get-VSTeamBuildDefinition | Set-VSTeamPermissionInheritance -ResourceType BuildDefinition -NewState $true -Force ``` -ThisThis command sets the permission inheritance to true for every build definition returned from Get-VSTeamBuildDefinition. +This command sets the permission inheritance to true for every build definition returned from Get-VSTeamBuildDefinition. ## PARAMETERS - - -### -Name +### Name Specifies the name of the resource. @@ -44,7 +42,7 @@ Accept pipeline input: true (ByPropertyName) Required: True ``` -### -ResourceType +### ResourceType Specifies the type of resource. The acceptable values for this parameter are: @@ -57,7 +55,7 @@ Type: String Required: True ``` -### -NewState +### NewState The new state to set @@ -66,7 +64,9 @@ Type: Boolean Required: True ``` - + + + ## INPUTS @@ -74,8 +74,12 @@ Required: True ## NOTES + + ## RELATED LINKS + + [Add-VSTeamPolicy](Add-VSTeamPolicy.md) [Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) diff --git a/.docs/Set-VSTeamReleaseStatus.md b/.docs/Set-VSTeamReleaseStatus.md index ab950343e..f92d19b1a 100644 --- a/.docs/Set-VSTeamReleaseStatus.md +++ b/.docs/Set-VSTeamReleaseStatus.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamReleaseStatus -Id 5 -status Abandoned +```powershell +Set-VSTeamReleaseStatus -Id 5 -status Abandoned ``` This command will set the status of release with id 5 to Abandoned. ## PARAMETERS - - -### -Id +### Id Specifies one or more releases by ID. @@ -40,7 +38,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -Status +### Status The status to set for the release Active or Abandoned. @@ -48,7 +46,9 @@ The status to set for the release Active or Abandoned. Type: String ``` - + + + ## INPUTS @@ -56,4 +56,8 @@ Type: String ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Show-VSTeam.md b/.docs/Show-VSTeam.md index 5fff3a4cf..60d737a90 100644 --- a/.docs/Show-VSTeam.md +++ b/.docs/Show-VSTeam.md @@ -14,10 +14,10 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeam +```powershell +Show-VSTeam ``` This will open a browser to the TFS or AzD site @@ -30,6 +30,8 @@ This will open a browser to the TFS or AzD site ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + diff --git a/.docs/Show-VSTeamApproval.md b/.docs/Show-VSTeamApproval.md index 73168dde2..486a7234b 100644 --- a/.docs/Show-VSTeamApproval.md +++ b/.docs/Show-VSTeamApproval.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo | Show-VSTeamApproval +```powershell +Get-VSTeamApproval -ProjectName Demo | Show-VSTeamApproval ``` This command opens a web browser showing the release requiring approval. ## PARAMETERS - - -### -ReleaseDefinitionId +### ReleaseDefinitionId Only approvals for the release id provided will be returned. @@ -38,27 +36,23 @@ Position: 1 Accept pipeline input: true (ByPropertyName, ByValue) ``` + + ## INPUTS ## OUTPUTS -### Team.BuildDefinition +### vsteam_lib.BuildDefinition ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build definition IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) diff --git a/.docs/Show-VSTeamBuild.md b/.docs/Show-VSTeamBuild.md index edbc60679..92e10c822 100644 --- a/.docs/Show-VSTeamBuild.md +++ b/.docs/Show-VSTeamBuild.md @@ -14,43 +14,59 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamBuild -ProjectName Demo -Id 3 +```powershell +Show-VSTeamBuild -ProjectName Demo -Id 3 ``` This command will open a web browser with the summary of build 3. ## PARAMETERS -### -Id +### Id Specifies build by ID. ```yaml Type: Int32 -Parameter Sets: ByID +Position: 0 Aliases: BuildID Required: True Accept pipeline input: true (ByPropertyName) ``` +### 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: 1 +Required: True +Accept pipeline input: true (ByPropertyName) +``` + ## INPUTS ## OUTPUTS -### Team.Build +### vsteam_lib.Build ## NOTES You can pipe the build ID to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamBuild](Add-VSTeamBuild.md) diff --git a/.docs/Show-VSTeamBuildDefinition.md b/.docs/Show-VSTeamBuildDefinition.md index 420607850..eac2de0e9 100644 --- a/.docs/Show-VSTeamBuildDefinition.md +++ b/.docs/Show-VSTeamBuildDefinition.md @@ -20,19 +20,17 @@ You can also specify a particular build definition by ID. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamBuildDefinition -ProjectName Demo +```powershell +Show-VSTeamBuildDefinition -ProjectName Demo ``` This command will open a web browser with All Definitions for this project showing. ## PARAMETERS - - -### -Type +### Type The type of the build definitions to retrieve. The acceptable values for this parameter are: @@ -49,7 +47,7 @@ Parameter Sets: List Default value: All ``` -### -Path +### Path The folder of the build definitions to retrieve. @@ -59,7 +57,7 @@ Parameter Sets: List Default value: \ ``` -### -Id +### Id Specifies build definition by ID. @@ -71,21 +69,23 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ## OUTPUTS -### Team.BuildDefinition +### vsteam_lib.BuildDefinition ## NOTES You can pipe build definition IDs to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) diff --git a/.docs/Show-VSTeamFeed.md b/.docs/Show-VSTeamFeed.md index d8834da31..451ed4df1 100644 --- a/.docs/Show-VSTeamFeed.md +++ b/.docs/Show-VSTeamFeed.md @@ -14,17 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamFeed -Name Demo +```powershell +Show-VSTeamFeed -Name Demo ``` This command will open a web browser with this feed showing. ## PARAMETERS -### -Id +### Id Specifies feed by ID or Name. @@ -40,12 +40,14 @@ Accept pipeline input: true (ByPropertyName) ## OUTPUTS -### Team.Feed +### vsteam_lib.Feed ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + [Add-VSTeamFeed](Add-VSTeamFeed.md) diff --git a/.docs/Show-VSTeamGitRepository.md b/.docs/Show-VSTeamGitRepository.md index 77459b0db..a53a74b3f 100644 --- a/.docs/Show-VSTeamGitRepository.md +++ b/.docs/Show-VSTeamGitRepository.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamGitRepository -ProjectName Demo +```powershell +Show-VSTeamGitRepository -ProjectName Demo ``` This command opens the Git repository in a browser. ## PARAMETERS - - -### -RemoteUrl +### RemoteUrl The RemoteUrl of the Git repository to open. @@ -36,10 +34,16 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Show-VSTeamProject.md b/.docs/Show-VSTeamProject.md index e29b9c379..82f22ccef 100644 --- a/.docs/Show-VSTeamProject.md +++ b/.docs/Show-VSTeamProject.md @@ -16,19 +16,17 @@ You must call Set-VSTeamAccount before calling this function. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamProject TestProject +```powershell +Show-VSTeamProject TestProject ``` This will open a browser to the TestProject site ## PARAMETERS - - -### -Id +### Id The id of the project to return. @@ -38,15 +36,19 @@ Parameter Sets: ByID Aliases: ProjectID ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS -[Set-VSTeamAccount](Set-VSTeamAccount.md) + [Add-VSTeamProject](Add-VSTeamProject.md) diff --git a/.docs/Show-VSTeamPullRequest.md b/.docs/Show-VSTeamPullRequest.md index d52e881c4..aa273a3e3 100644 --- a/.docs/Show-VSTeamPullRequest.md +++ b/.docs/Show-VSTeamPullRequest.md @@ -14,25 +14,25 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamPullRequest 3 +```powershell +Show-VSTeamPullRequest 3 ``` This command will open a web browser with the pull request id of 3. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Show-VSTeamPullRequest -Id 3 +```powershell +Show-VSTeamPullRequest -Id 3 ``` This command will open a web browser with the pull request id of 3. ## PARAMETERS -### -PullRequestId +### PullRequestId Specifies pull request by ID. @@ -47,12 +47,14 @@ Accept pipeline input: true (ByPropertyName) ## OUTPUTS -### Team.Release - ## NOTES You can pipe the pull request ID to this function. + + ## RELATED LINKS + + [Get-VSTeamPullRequest](Get-VSTeamPullRequest.md) diff --git a/.docs/Show-VSTeamRelease.md b/.docs/Show-VSTeamRelease.md index 728f8281f..70f2fefa2 100644 --- a/.docs/Show-VSTeamRelease.md +++ b/.docs/Show-VSTeamRelease.md @@ -14,17 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamRelease -ProjectName Demo -Id 3 +```powershell +Show-VSTeamRelease -ProjectName Demo -Id 3 ``` This command will open a web browser with the summary of release 3. ## PARAMETERS -### -Id +### Id Specifies release by ID. @@ -40,17 +40,15 @@ Accept pipeline input: true (ByPropertyName) ## OUTPUTS -### Team.Release - ## NOTES You can pipe the release ID to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamRelease](Add-VSTeamRelease.md) diff --git a/.docs/Show-VSTeamReleaseDefinition.md b/.docs/Show-VSTeamReleaseDefinition.md index 1a38295f0..2b0a51a6a 100644 --- a/.docs/Show-VSTeamReleaseDefinition.md +++ b/.docs/Show-VSTeamReleaseDefinition.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamReleaseDefinition -ProjectName Demo +```powershell +Show-VSTeamReleaseDefinition -ProjectName Demo ``` This command will open a web browser with All Release Definitions for this project showing. ## PARAMETERS - - -### -Id +### Id Specifies release definition by ID. @@ -38,21 +36,23 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ## OUTPUTS -### Team.ReleaseDefinition +### vsteam_lib.ReleaseDefinition ## NOTES You can pipe the release definition ID to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamReleaseDefinition](Add-VSTeamReleaseDefinition.md) diff --git a/.docs/Show-VSTeamWorkItem.md b/.docs/Show-VSTeamWorkItem.md index a58e64bbe..84d1d2be4 100644 --- a/.docs/Show-VSTeamWorkItem.md +++ b/.docs/Show-VSTeamWorkItem.md @@ -14,17 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Show-VSTeamWorkItem -ProjectName Demo -Id 3 +```powershell +Show-VSTeamWorkItem -ProjectName Demo -Id 3 ``` This command will open a web browser with the summary of work item 3. ## PARAMETERS -### -Id +### Id Specifies work item by ID. @@ -40,17 +40,17 @@ Accept pipeline input: true (ByPropertyName) ## OUTPUTS -### Team.WorkItem +### vsteam_lib.WorkItem ## NOTES You can pipe the WorkItem ID to this function. -## RELATED LINKS + -[Set-VSTeamAccount](Set-VSTeamAccount.md) +## RELATED LINKS -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + [Add-VSTeamWorkItem](Add-VSTeamWorkItem.md) diff --git a/.docs/Stop-VSTeamBuild.md b/.docs/Stop-VSTeamBuild.md index 5607bee83..1f281b7d6 100644 --- a/.docs/Stop-VSTeamBuild.md +++ b/.docs/Stop-VSTeamBuild.md @@ -14,34 +14,32 @@ Stop-VSTeamBuild will cancel a build using the build id. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Stop-VSTeamBuild -id 1 +```powershell +Set-VSTeamDefaultProject Demo +Stop-VSTeamBuild -id 1 ``` This example cancels the build with build id 1. -### -------------------------- EXAMPLE 3 -------------------------- +### 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 } +```powershell +Set-VSTeamDefaultProject Demo +$buildsToCancel = Get-VSTeamBuild -StatusFilter "inProgress" | where-object definitionName -eq Build-Defenition-Name +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 - - - + - + ## INPUTS @@ -57,4 +55,8 @@ BuildId ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Team.md b/.docs/Team.md deleted file mode 100644 index 61b067983..000000000 --- a/.docs/Team.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -Module Name: Team -Module Guid: 22fe5207-1749-4832-9648-e939fe074b7f -Help Version: 1.0.0.0 -Locale: en-US ---- - -# VSTeam Module - -## Description - - - - \ No newline at end of file diff --git a/.docs/Test-VSTeamMembership.md b/.docs/Test-VSTeamMembership.md index 5dc960705..6cb4ab38c 100644 --- a/.docs/Test-VSTeamMembership.md +++ b/.docs/Test-VSTeamMembership.md @@ -28,8 +28,12 @@ ## NOTES + + ## RELATED LINKS + + [Get-VsTeamUser](Get-VsTeamUser.md) [Get-VsTeamGroup](Get-VsTeamGroup.md) diff --git a/.docs/Test-VSTeamYamlPipeline.md b/.docs/Test-VSTeamYamlPipeline.md index a818c082d..60c2e9cdf 100644 --- a/.docs/Test-VSTeamYamlPipeline.md +++ b/.docs/Test-VSTeamYamlPipeline.md @@ -14,10 +14,10 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -FilePath './azure-pipelines.yml' +```powershell +Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -FilePath './azure-pipelines.yml' Name Id url state ---- -- --- ----- @@ -26,29 +26,27 @@ Name Id url This example checks the YAML pipeline with ID 24 and the file './azure-pipelines.yml' for consistency on Azure DevOps to see if the changes still work. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> $yamlOverride = [string](Get-Content -raw $FilePath) -PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -YamlOverride $yamlOverride +```powershell +$yamlOverride = [string](Get-Content -raw $FilePath) +Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -YamlOverride $yamlOverride ``` This example checks the YAML pipeline with ID 24 and the content of a yaml file in the variable $yamlOverride for consistency on Azure DevOps to see if the changes still work. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> $yamlOverride = [string](Get-Content -raw $FilePath) -PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 +```powershell +$yamlOverride = [string](Get-Content -raw $FilePath) +Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 ``` This example checks the YAML pipeline with ID 24 for consistency on Azure DevOps to see if the existing YAML of the pipeline works. ## PARAMETERS - - -### -PipelineId +### PipelineId Id of the YAML pipeline to be checked @@ -57,7 +55,7 @@ Type: Int32 Position: 1 ``` -### -FilePath +### FilePath Path to the file that should be checked @@ -65,6 +63,8 @@ Path to the file that should be checked Type: String ``` + + ## INPUTS ### System.String @@ -77,14 +77,16 @@ PipelineId ## OUTPUTS -### Team.YamlPipelineResult +### vsteam_lib.YamlPipelineResult ## NOTES -If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamBuild you will have to type in the names. - Currently the API that is used by this cmdlet is only supporting YAML pipelines without template references. This will be supported soon. see the issue in GitHub: [https://github.com/microsoft/azure-pipelines-yaml/issues/34#issuecomment-591092498](https://github.com/microsoft/azure-pipelines-yaml/issues/34#issuecomment-591092498) + + ## RELATED LINKS + + [Get-VSTeamBuildDefinition](Get-VSTeamBuildDefinition.md) diff --git a/.docs/Update-VSTeam.md b/.docs/Update-VSTeam.md index 252f4b200..a2b56ab18 100644 --- a/.docs/Update-VSTeam.md +++ b/.docs/Update-VSTeam.md @@ -16,29 +16,19 @@ ## PARAMETERS - - -### -Description - -The new description of the team - -```yaml -Type: String -Position: 2 -``` - -### -Name +### Name The name of the team to update ```yaml Type: String +Position: 0 Aliases: Id, TeamToUpdate, TeamId, TeamName Required: True Accept pipeline input: true (ByPropertyName) ``` -### -NewTeamName +### NewTeamName The new name of the team @@ -46,11 +36,17 @@ The new name of the team Type: String ``` - +### Description - +The new description of the team - +```yaml +Type: String +``` + + + + ## INPUTS @@ -64,8 +60,12 @@ NewTeamName ## OUTPUTS -### Team.Team +### vsteam_lib.Team ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Update-VSTeamAgent.md b/.docs/Update-VSTeamAgent.md index f5ea6029b..0aef3a409 100644 --- a/.docs/Update-VSTeamAgent.md +++ b/.docs/Update-VSTeamAgent.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PoolId +### PoolId Id of the pool. @@ -26,7 +26,7 @@ Required: True Accept pipeline input: true (ByValue) ``` -### -Id +### Id Id of the agent to Update. @@ -37,11 +37,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` - - - - - + ## INPUTS @@ -51,4 +47,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Update-VSTeamBuild.md b/.docs/Update-VSTeamBuild.md index bfc7594d2..48672a4fe 100644 --- a/.docs/Update-VSTeamBuild.md +++ b/.docs/Update-VSTeamBuild.md @@ -14,19 +14,17 @@ Allows you to set the keep forever flag and build number. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Get-VSTeamBuild | Update-VSTeamBuild -KeepForever $false +```powershell +Get-VSTeamBuild | Update-VSTeamBuild -KeepForever $false ``` Sets the keep forever property of every build to false. ## PARAMETERS - - -### -BuildNumber +### BuildNumber The value you want to set as the build number. @@ -37,7 +35,7 @@ Accept pipeline input: true (ByPropertyName, ByValue) -### -KeepForever +### KeepForever $True or $False to set the keep forever property of the build. @@ -46,18 +44,20 @@ Type: Boolean Accept pipeline input: true (ByPropertyName, ByValue) ``` - - - + - + ## INPUTS ## OUTPUTS -### Team.Build +### vsteam_lib.Build ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Update-VSTeamBuildDefinition.md b/.docs/Update-VSTeamBuildDefinition.md index c57d06339..6b40cb606 100644 --- a/.docs/Update-VSTeamBuildDefinition.md +++ b/.docs/Update-VSTeamBuildDefinition.md @@ -16,29 +16,27 @@ You must call Set-VSTeamAccount before calling this function. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Update-VSTeamBuildDefinition -ProjectName Demo -Id 123 -InFile build.json +```powershell +Update-VSTeamBuildDefinition -ProjectName Demo -Id 123 -InFile build.json ``` This command reads build.json and updates existing build definition with id 123 from it on the demo team project. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> $b = Get-VSTeamBuildDefinition -ProjectName Demo -Id 23 -Raw -PS C:\> $b.variables.subscriptionId.value = 'Some New Value' -PS C:\> $body = $b | ConvertTo-Json -Depth 100 -PS C:\> Update-VSTeamBuildDefinition -ProjectName Demo -Id 23 -BuildDefinition $body +```powershell +$b = Get-VSTeamBuildDefinition -ProjectName Demo -Id 23 -Raw +$b.variables.subscriptionId.value = 'Some New Value' +$body = $b | ConvertTo-Json -Depth 100 +Update-VSTeamBuildDefinition -ProjectName Demo -Id 23 -BuildDefinition $body ``` ## PARAMETERS - - -### -Id +### Id Specifies the build definition to update by ID. @@ -50,7 +48,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -InFile +### InFile Path and file name to the JSON file that contains the definition to be updated. If the path is omitted, the default is the current location. @@ -62,7 +60,7 @@ Position: 1 Accept pipeline input: true (ByPropertyName) ``` -### -BuildDefinition +### BuildDefinition JSON string of build definition. @@ -74,6 +72,8 @@ Position: 1 Accept pipeline input: true (ByPropertyName) ``` + + ## INPUTS ## OUTPUTS @@ -82,10 +82,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + ## RELATED LINKS + + diff --git a/.docs/Update-VSTeamExtension.md b/.docs/Update-VSTeamExtension.md index 3bdcb77e6..f30432853 100644 --- a/.docs/Update-VSTeamExtension.md +++ b/.docs/Update-VSTeamExtension.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -PublisherId +### PublisherId The id of the publisher. @@ -25,7 +25,7 @@ Type: String Required: True ``` -### -ExtensionId +### ExtensionId The id of the extension. @@ -34,7 +34,7 @@ Type: String Required: True ``` -### -ExtensionState +### ExtensionState The state of an installed extension. Example: "disabled". The acceptable values for this parameter are: @@ -46,7 +46,7 @@ Type: String Required: True ``` - + ## INPUTS @@ -54,8 +54,12 @@ Required: True ## NOTES + + ## RELATED LINKS + + [Add-VSTeamExtension](Add-VSTeamExtension.md) [Get-VSTeamExtension](Get-VSTeamExtension.md) diff --git a/.docs/Update-VSTeamPolicy.md b/.docs/Update-VSTeamPolicy.md index d283e6f3a..dbab57e32 100644 --- a/.docs/Update-VSTeamPolicy.md +++ b/.docs/Update-VSTeamPolicy.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Update-VSTeamPolicy -ProjectName Demo -id 1 -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} +```powershell +Update-VSTeamPolicy -ProjectName Demo -id 1 -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} ``` This command updates an existing policy in the Demo project. ## PARAMETERS - - -### -Id +### Id Specifies the policy to update. @@ -34,7 +32,7 @@ Specifies the policy to update. Type: Int ``` -### -type +### type Specifies the id of the type of policy to be update. This must match the original policy, it cannot be changed via this call. @@ -43,7 +41,7 @@ Type: Guid Required: True ``` -### -enabled +### enabled Enables the policy @@ -51,7 +49,7 @@ Enables the policy Type: Switch ``` -### -blocking +### blocking Determines if the policy will block pushes to the branch if the policy is not adhered to. @@ -59,7 +57,7 @@ Determines if the policy will block pushes to the branch if the policy is not ad Type: Switch ``` -### -settings +### settings The settings for the policy. @@ -70,14 +68,20 @@ Type: Hashtable Required: True ``` + + ## INPUTS ## OUTPUTS ## NOTES + + ## RELATED LINKS + + [Get-VSTeamPolicy](Get-VSTeamPolicy.md) [Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) diff --git a/.docs/Update-VSTeamProfile.md b/.docs/Update-VSTeamProfile.md index 451fd2c89..cd8baf518 100644 --- a/.docs/Update-VSTeamProfile.md +++ b/.docs/Update-VSTeamProfile.md @@ -12,33 +12,33 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Update-VSTeamProfile -Name ProfileName +```powershell +Update-VSTeamProfile -Name ProfileName ``` You will be prompted for the account name and personal access token. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Update-VSTeamProfile -Name mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga +```powershell +Update-VSTeamProfile -Name mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga ``` Allows you to provide all the information on the command line. -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Get-VSTeamProfile | Where-Object version -eq vsts | Select-Object -skip 1 | Update-VSTeamProfile -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Force +```powershell +Get-VSTeamProfile | Where-Object version -eq vsts | Select-Object -skip 1 | Update-VSTeamProfile -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Force ``` This will update all but the first AzD profile ## PARAMETERS -### -PAT +### PAT A secured string to capture your personal access token. @@ -53,7 +53,7 @@ Parameter Sets: Secure Required: True ``` -### -PersonalAccessToken +### PersonalAccessToken The personal access token from AzD/TFS to use to access this account. @@ -64,7 +64,7 @@ Required: True Position: 2 ``` -### -Name +### Name Name of the profile to be updated @@ -74,7 +74,7 @@ Required: True Position: 3 ``` - + ## INPUTS @@ -82,8 +82,12 @@ Position: 3 ## NOTES + + ## RELATED LINKS + + [Update-VSTeamAccount](Set-VSTeamAccount.md) [Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) diff --git a/.docs/Update-VSTeamProject.md b/.docs/Update-VSTeamProject.md index 5f9ac6234..5a574d889 100644 --- a/.docs/Update-VSTeamProject.md +++ b/.docs/Update-VSTeamProject.md @@ -14,19 +14,17 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Update-VSTeamProject -Name Demo -NewName aspDemo +```powershell +Update-VSTeamProject -Name Demo -NewName aspDemo ``` This command changes the name of your project from Demo to aspDemo. ## PARAMETERS - - -### -NewName +### NewName The new name for the project. @@ -34,7 +32,7 @@ The new name for the project. Type: String ``` -### -NewDescription +### NewDescription The new description for the project. @@ -42,7 +40,7 @@ The new description for the project. Type: String ``` -### -Id +### Id The id of the project to update. @@ -53,7 +51,9 @@ Aliases: ProjectId Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS @@ -65,4 +65,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Update-VSTeamPullRequest.md b/.docs/Update-VSTeamPullRequest.md index 761b9f5a9..b85d93890 100644 --- a/.docs/Update-VSTeamPullRequest.md +++ b/.docs/Update-VSTeamPullRequest.md @@ -14,29 +14,29 @@ Update a pull request ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Draft +```powershell +Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken +$r = Get-VSTeamGitRepository -ProjectName project -Name demorepo +Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Draft ``` Set the pull request to be a draft -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Status abandoned +```powershell +Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken +$r = Get-VSTeamGitRepository -ProjectName project -Name demorepo +Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Status abandoned ``` Abandon a pull request ## PARAMETERS -### -RepositoryId +### RepositoryId The id of the repository @@ -48,7 +48,7 @@ Accept pipeline input: true (ByPropertyName) Parameter Sets: Draft, Publish, Status, EnableAutoComplete, DisableAutoComplete ``` -### -PullRequestId +### PullRequestId The id of the pull request @@ -58,7 +58,7 @@ Required: True Parameter Sets: Draft, Publish, Status, EnableAutoComplete, DisableAutoComplete ``` -### -Status +### Status The status to set the pull request to. Valid values for this are: @@ -72,7 +72,7 @@ Type: String Parameter Sets: Status ``` -### -EnableAutoComplete +### EnableAutoComplete Set the pull requests auto complete status @@ -81,7 +81,7 @@ Type: Switch Parameter Sets: EnableAutoComplete ``` -### -AutoCompleteIdentity +### AutoCompleteIdentity The identity that enabled autocomplete. This is mandatory if -AutoComplete is set to $true @@ -90,7 +90,7 @@ Type: VSTeamUser Parameter Sets: EnableAutoComplete ``` -### -DisableAutoComplete +### DisableAutoComplete Unset the pull requests auto complete status @@ -99,7 +99,7 @@ Type: Switch Parameter Sets: DisableAutoComplete ``` -### -Draft +### Draft Set the pull request as a draft @@ -108,18 +108,18 @@ Type: Switch Parameter Sets: Draft ``` - - - - - + ## INPUTS ## OUTPUTS -### Team.PullRequest +### vsteam_lib.PullRequest ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Update-VSTeamRelease.md b/.docs/Update-VSTeamRelease.md index 1617b5482..f5b4e9d7e 100644 --- a/.docs/Update-VSTeamRelease.md +++ b/.docs/Update-VSTeamRelease.md @@ -14,33 +14,31 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamRelease -ProjectName project -Id 76 -Raw -PS C:\> $r.variables.temp.value='temp' -PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r +```powershell +Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken +$r = Get-VSTeamRelease -ProjectName project -Id 76 -Raw +$r.variables.temp.value='temp' +Update-VSTeamRelease -ProjectName project -Id 76 -release $r ``` Changes the variable temp on the release. This can be done in one stage and read in another stage. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamRelease -ProjectName project -Id 76 -Raw -PS C:\> $r.variables | Add-Member NoteProperty temp([PSCustomObject]@{value='test'}) -PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r +```powershell +Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken +$r = Get-VSTeamRelease -ProjectName project -Id 76 -Raw +$r.variables | Add-Member NoteProperty temp([PSCustomObject]@{value='test'}) +Update-VSTeamRelease -ProjectName project -Id 76 -release $r ``` Adds a variable temp to the release with a value of test. ## PARAMETERS - - -### -Id +### Id The id of the release to update @@ -50,7 +48,7 @@ Required: True Accept pipeline input: true (ByPropertyName) ``` -### -Release +### Release The updated release to save in AzD @@ -59,18 +57,20 @@ Type: PSCustomObject Required: True ``` - - - + - + ## INPUTS ## OUTPUTS -### Team.Release +### vsteam_lib.Release ## NOTES + + ## RELATED LINKS + + diff --git a/.docs/Update-VSTeamReleaseDefinition.md b/.docs/Update-VSTeamReleaseDefinition.md index 0ad3abfd6..33baccf59 100644 --- a/.docs/Update-VSTeamReleaseDefinition.md +++ b/.docs/Update-VSTeamReleaseDefinition.md @@ -16,31 +16,29 @@ You must call Set-VSTeamAccount before calling this function. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Update-VSTeamReleaseDefinition -ProjectName Demo -Id 123 -InFile release.json +```powershell +Update-VSTeamReleaseDefinition -ProjectName Demo -Id 123 -InFile release.json ``` This command reads release.json and updates existing release definition with id 123 from it on the demo team project. -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> $b = Get-VSTeamReleaseDefinition -ProjectName Demo -Id 23 -Raw -PS C:\> $b.variables.subscriptionId.value = 'Some New Value' -PS C:\> $body = $b | ConvertTo-Json -Depth 100 -PS C:\> Update-VSTeamReleaseDefinition -ProjectName Demo -ReleaseDefinition $body +```powershell +$b = Get-VSTeamReleaseDefinition -ProjectName Demo -Id 23 -Raw +$b.variables.subscriptionId.value = 'Some New Value' +$body = $b | ConvertTo-Json -Depth 100 +Update-VSTeamReleaseDefinition -ProjectName Demo -ReleaseDefinition $body ``` This commands update the variables of the release definition. ## PARAMETERS - - -### -InFile +### InFile Path and file name to the JSON file that contains the definition to be updated. If the path is omitted, the default is the current location. @@ -52,23 +50,19 @@ Position: 1 Accept pipeline input: true (ByPropertyName) ``` -### -ReleaseDefinition +### ReleaseDefinition JSON string of release definition. ```yaml Type: String -Required: true +Required: true Parameter Sets: JSON Position: 1 Accept pipeline input: true (ByPropertyName) ``` - - - - - + ## INPUTS @@ -78,10 +72,8 @@ Accept pipeline input: true (ByPropertyName) ## NOTES -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. + ## RELATED LINKS + + diff --git a/.docs/Update-VSTeamServiceEndpoint.md b/.docs/Update-VSTeamServiceEndpoint.md index e86958b9e..619c66ce2 100644 --- a/.docs/Update-VSTeamServiceEndpoint.md +++ b/.docs/Update-VSTeamServiceEndpoint.md @@ -16,9 +16,7 @@ ## PARAMETERS - - -### -Id +### Id UUID of existing services endpoint from AzD @@ -27,7 +25,7 @@ Type: String Position: 1 ``` -### -Object +### Object Hashtable of payload for REST call @@ -37,18 +35,24 @@ Required: true Accept pipeline input: true (ByPropertyName) ``` - + + + ## INPUTS ## OUTPUTS -### Team.ServiceEndpoint +### vsteam_lib.ServiceEndpoint ## NOTES + + ## RELATED LINKS + + [Add-VSTeamServiceEndpoint](Add-VSTeamServiceEndpoint.md) [Add-VSTeamServiceFabricEndpoint](Add-VSTeamServiceFabricEndpoint.md) diff --git a/.docs/Update-VSTeamTaskGroup.md b/.docs/Update-VSTeamTaskGroup.md index d26bc8129..634d1c2ad 100644 --- a/.docs/Update-VSTeamTaskGroup.md +++ b/.docs/Update-VSTeamTaskGroup.md @@ -14,10 +14,9 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 ```powershell - $projectName = "projectName" $taskGroup = Get-VSTeamTaskGroup -Name "taskGroupName" -ProjectName $projectName @@ -32,7 +31,7 @@ Update-VSTeamTaskGroup -ProjectName $projectName -Id $taskGroup.id -Body $taskGr ## PARAMETERS -### -Confirm +### Confirm Prompts you for confirmation before running the cmdlet. @@ -47,7 +46,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Force +### Force Does not prompt @@ -62,11 +61,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ProjectName - - - -### -WhatIf +### WhatIf Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -82,7 +77,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Id +### Id ID of the existing task group @@ -97,7 +92,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -InFile +### InFile The path to the json file that represents the task group @@ -113,7 +108,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Body +### Body The json that represents the task group as a string @@ -129,10 +124,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorTask, -InformationAction, -InformationTask, -OutTask, -OutBuffer, -PipelineTask, -Verbose, -WarningAction, and -WarningTask. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS @@ -144,8 +136,12 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES + + ## RELATED LINKS + + [Add-VSTeamTaskGroup](Add-VSTeamTaskGroup.md) [Get-VSTeamTaskGroup](Get-VSTeamTaskGroup.md) diff --git a/.docs/Update-VSTeamUserEntitlement.md b/.docs/Update-VSTeamUserEntitlement.md index 6fae70d4a..49a18d813 100644 --- a/.docs/Update-VSTeamUserEntitlement.md +++ b/.docs/Update-VSTeamUserEntitlement.md @@ -16,7 +16,7 @@ ## PARAMETERS -### -Id +### Id The id of the user to be updated. @@ -26,7 +26,7 @@ Parameter Sets: ById Required: True ``` -### -Email +### Email The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive. @@ -36,7 +36,7 @@ Parameter Sets: ByEmail Required: True ``` -### -License +### License Type of Account License you want to change to. The acceptable values for this parameter are: @@ -52,7 +52,7 @@ Type: String Required: True ``` - + ## INPUTS @@ -60,6 +60,10 @@ Required: True ## NOTES + + ## RELATED LINKS + + [Get-VSTeamUserEntitlement](Get-VSTeamUserEntitlement.md) diff --git a/.docs/Update-VSTeamVariableGroup.md b/.docs/Update-VSTeamVariableGroup.md index bd289884a..e74a6ec2c 100644 --- a/.docs/Update-VSTeamVariableGroup.md +++ b/.docs/Update-VSTeamVariableGroup.md @@ -14,10 +14,9 @@ ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 ```powershell - $methodParameters = @{ ProjectName = "some_project_name" Name = "new_variable_group" @@ -56,7 +55,7 @@ $methodParameters = @{ Update-VSTeamVariableGroup @methodParameters ``` -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 ```powershell # Copy variable group varGroupName from project sourceProjectName to project targetProjectName. If varGroupName already exists, we'll update it; else, we'll add it. @@ -79,7 +78,7 @@ else { ## PARAMETERS -### -Confirm +### Confirm Prompts you for confirmation before running the cmdlet. @@ -94,7 +93,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Force +### Force Does not prompt @@ -109,11 +108,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ProjectName - - - -### -WhatIf +### WhatIf Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -129,7 +124,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Id +### Id ID of the existing variable group @@ -144,7 +139,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Description +### Description The variable group description @@ -160,7 +155,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Name +### Name The variable group name @@ -176,7 +171,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -ProviderData +### ProviderData The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. @@ -192,7 +187,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Type +### Type The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. @@ -209,7 +204,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Variables +### Variables The variable group variables. @@ -225,7 +220,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Body +### Body The json that represents the task group as a string @@ -241,10 +236,7 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS @@ -258,8 +250,12 @@ System.Collections.Hashtable ## NOTES + + ## RELATED LINKS + + [Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) diff --git a/.docs/Update-VSTeamWorkItem.md b/.docs/Update-VSTeamWorkItem.md index 543257943..e7dad6c52 100644 --- a/.docs/Update-VSTeamWorkItem.md +++ b/.docs/Update-VSTeamWorkItem.md @@ -14,34 +14,34 @@ Update-VSTeamWorkItem will update a new work item in your project. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Update-VSTeamWorkItem -WorkItemId 1 -Title "Updated Work Item" +```powershell +Set-VSTeamDefaultProject Demo +Update-VSTeamWorkItem -WorkItemId 1 -Title "Updated Work Item" ID Title Status -- ----- ------ 6 Updated Work Item To Do ``` -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" +```powershell +Set-VSTeamDefaultProject Demo +Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" ID Title Status -- ----- ------ 6 Updated Work Item To Do ``` -### -------------------------- EXAMPLE 3 -------------------------- +### Example 3 -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> $additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"} -PS C:\> Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields +```powershell +Set-VSTeamDefaultProject Demo +$additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"} +Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields ID Title Status -- ----- ------ @@ -50,7 +50,7 @@ ID Title Status ## PARAMETERS -### -Id +### Id The id of the work item. @@ -61,7 +61,7 @@ Required: True Accept pipeline input: true (ByPropertyName, ByValue) ``` -### -Title +### Title The title of the work item @@ -70,7 +70,7 @@ Type: String Required: False ``` -### -Description +### Description The Description of the work item @@ -79,7 +79,7 @@ Type: String Required: False ``` -### -IterationPath +### IterationPath The IterationPath of the work item @@ -88,7 +88,7 @@ Type: String Required: False ``` -### -AssignedTo +### AssignedTo The email address of the user this work item will be assigned to. @@ -97,7 +97,7 @@ Type: String Required: False ``` -### -AdditionalFields +### AdditionalFields Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'. @@ -106,7 +106,7 @@ Type: Hashtable Required: False ``` - + ## INPUTS @@ -120,12 +120,10 @@ WorkItemType ## NOTES -WorkItemType is a dynamic parameter and use the default -project value to query their validate set. - -If you do not set the default project by called Set-VSTeamDefaultProject before -calling Update-VSTeamWorkItem you will have to type in the names. - Any of the basic work item parameters defined in this method, will cause an exception if also added to the parameter AdditionalFields, since it is redundant. Either only use the parameter OR define them in the AdditionalFields parameter. + + ## RELATED LINKS + + diff --git a/.docs/common/prerequisites.md b/.docs/common/prerequisites.md new file mode 100644 index 000000000..b22e755f2 --- /dev/null +++ b/.docs/common/prerequisites.md @@ -0,0 +1,11 @@ +Prerequisites: + +Set the account and version that all calls will use with Set-VSTeamAccount. If you do not set the version it default to 3.0, TFS2017. Using the default could limit API functionality. + +You can check what version of the API that will be called with Get-VSTeamAPIVersion, or Get-VSTeamInfo. + +You can also use Set-VSTeamDefaultProject so you do not have to provide the -ProjectName parameter with the rest of the calls in the module. However, the -ProjectName parameter is dynamic and you can use tab completion to cycle through all the projects. + +Use Set-VSTeamDefaultAPITimeout to change the default timeout of 60 seconds for all calls. + +You can also use Profiles to load an account and the correct version. diff --git a/.docs/common/related.md b/.docs/common/related.md new file mode 100644 index 000000000..206871e77 --- /dev/null +++ b/.docs/common/related.md @@ -0,0 +1,13 @@ +[Set-VSTeamAccount](Set-VSTeamAccount.md) + +[Set-VSTeamAPIVersion](Set-VSTeamAPIVersion.md) + +[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) + +[Set-VSTeamDefaultAPITimeout](Set-VSTeamDefaultAPITimeout.md) + +[about_vsteam](about_vsteam) + +[about_vsteam_profiles](about_vsteam_profiles) + +[about_vsteam_provider](about_vsteam_provider) \ No newline at end of file diff --git a/.docs/gen-help.ps1 b/.docs/gen-help.ps1 index 04c1a5d48..a390f47b7 100644 --- a/.docs/gen-help.ps1 +++ b/.docs/gen-help.ps1 @@ -1,4 +1,4 @@ -Write-Output 'Clearing old files' +Write-Verbose 'Clearing old files' if ((Test-Path ..\docs) -eq $false) { New-Item -ItemType Directory -Name ..\docs @@ -6,52 +6,19 @@ if ((Test-Path ..\docs) -eq $false) { Get-ChildItem ..\docs | Remove-Item -Write-Output 'Creating file index' - -$sb = New-Object System.Text.StringBuilder -$files = Get-ChildItem -Path . -Filter '*-*.md' - -foreach ($file in $files) { - # Notice that I'm assigning the result of $sb.Append to $null, - # to avoid sending any unwanted data down the pipeline. - $null = $sb.Append("### [$($file.BaseName)]($($file.Name))`r`n`r`n") - $null = $sb.Append("`r`n`r`n") - - # I found files where the name of the file did not match the top most - # title in the file. This will cause issues trying to load help for that - # function. So test that you can find # {FileName} in the file. - $stringToFind = "# $($file.BaseName)" - if($null -eq $(Get-ChildItem $($file.Name) | Select-String $stringToFind)) { - Write-Error "Title cannot be found in $($file.Name). Make sure the first header is # $($file.BaseName)`n$($File.Directory)\$File" -ErrorAction Stop - } -} - -Set-Content -Path files.md -Value $sb.ToString() - -Write-Output 'Merging Markdown files' +Write-Verbose 'Merging Markdown files' if(-not (Get-Module Trackyon.Markdown -ListAvailable)) { Install-Module Trackyon.Markdown -Scope CurrentUser -Force } merge-markdown $PSScriptRoot $PSScriptRoot\..\docs -Write-Output 'Creating new file' +Write-Verbose 'Creating new file' if(-not (Get-Module platyPS -ListAvailable)) { Install-Module platyPS -Scope CurrentUser -Force } -New-ExternalHelp ..\docs -OutputPath ..\Source\en-US -Force - -# Run again and strip header -Write-Output 'Cleaning doc files for publishing' -Get-ChildItem ..\docs | Remove-Item -Rename-Item -Path .\common\header.md -NewName header.txt -Set-Content -Path .\common\header.md -Value '' - -# Docs now don't have headers -merge-markdown $PSScriptRoot $PSScriptRoot\..\docs +$helpOutput = New-ExternalHelp ..\docs -OutputPath ..\Source\en-US -Force | Out-String -# Put header back -Remove-Item .\common\header.md -Rename-Item -Path .\common\header.txt -NewName header.md -Force \ No newline at end of file +Write-Verbose $helpOutput \ No newline at end of file diff --git a/.docs/params/BuildId.md b/.docs/params/BuildId.md index 6810e6b8c..c97d5a960 100644 --- a/.docs/params/BuildId.md +++ b/.docs/params/BuildId.md @@ -1,4 +1,4 @@ -### -Id +### Id The id of the build. diff --git a/.docs/params/BuildIds.md b/.docs/params/BuildIds.md index d9e4b781a..e456fc1c3 100644 --- a/.docs/params/BuildIds.md +++ b/.docs/params/BuildIds.md @@ -1,4 +1,4 @@ -### -Id +### Id Specifies one or more builds by ID. diff --git a/.docs/params/BuildTags.md b/.docs/params/BuildTags.md index 2ab1f7735..0e139b760 100644 --- a/.docs/params/BuildTags.md +++ b/.docs/params/BuildTags.md @@ -1,4 +1,4 @@ -### -Tags +### Tags One or more tags. To specify multiple, use commas to separate. diff --git a/.docs/params/Force.md b/.docs/params/Force.md index c987d47fe..3a5bc212d 100644 --- a/.docs/params/Force.md +++ b/.docs/params/Force.md @@ -1,6 +1,6 @@ -### -Force +### Force -Forces the function without confirmation +Forces the function without confirmation. ```yaml Type: SwitchParameter diff --git a/.docs/params/SecurityNamespaceName.md b/.docs/params/SecurityNamespaceName.md deleted file mode 100644 index f25daac54..000000000 --- a/.docs/params/SecurityNamespaceName.md +++ /dev/null @@ -1,92 +0,0 @@ -### -SecurityNamespaceName - -Security Namespace Name. Valid names are: - -AzD: -- Analytics (58450c49-b02d-465a-ab12-59ae512d6531) -- AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) -- ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) -- ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) -- Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) -- WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) -- DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) -- WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) -- GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) -- VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) -- EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) -- WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) -- ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) -- ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) -- Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) -- Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) -- Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) -- Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) -- Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) -- AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) -- Library (b7e84409-6553-448a-bbb2-af228e07cbeb) -- Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) -- Project (52d39943-cb85-4d7f-8fa8-c6baac873819) -- EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) -- CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) -- TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) -- ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) -- Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) -- MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) -- Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) -- Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) -- Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) -- Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) -- ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) -- Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) -- WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) -- StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) -- Server (1f4179b3-6bac-4d01-b421-71ea09171400) -- TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) -- SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) -- BuildAdministration (302acaca-b667-436d-a946-87133492041c) -- Location (2725d2bc-7520-4af4-b0e3-8d876494731f) -- Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) -- UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) -- WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) -- WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) -- VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) -- Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) -- CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) -- WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) -- Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) -- BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) -- DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) -- Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) -- Security (9a82c708-bfbe-4f31-984c-e860c2196781) -- IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) -- ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) -- Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) -- DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) -- VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) - -VSSPS: -- EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) -- EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) -- Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) -- Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) -- Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) -- SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) -- Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) -- CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) -- StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) -- GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) -- Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) -- SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) -- RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) -- Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) -- WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) -- DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) -- Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) -- IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) -- ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) - - -```yaml -Type: String -Required: True -``` \ No newline at end of file diff --git a/.docs/params/Version.md b/.docs/params/Version.md index c596d2f70..b7a7bed9c 100644 --- a/.docs/params/Version.md +++ b/.docs/params/Version.md @@ -1,14 +1,21 @@ -### -Version +### Version Specifies the version to use. The acceptable values for this parameter are: - TFS2017 +- TFS2017U1 +- TFS2017U2 +- TFS2017U3 - TFS2018 +- TFS2018U1 +- TFS2018U2 +- TFS2018U3 - AzD2019 +- AzD2019U1 - VSTS - AzD -If you are on AzD it will default to Azd otherwise it will default to TFS2017 +If you are on AzD it will default to Azd otherwise it will default to TFS2017. ```yaml Type: String diff --git a/.docs/params/confirm.md b/.docs/params/confirm.md index 38d6c43c5..282f3c61b 100644 --- a/.docs/params/confirm.md +++ b/.docs/params/confirm.md @@ -1,4 +1,4 @@ -### -Confirm +### Confirm Prompts you for confirmation before running the function. diff --git a/.docs/params/containerDescriptor.md b/.docs/params/containerDescriptor.md index d19e291e9..92f0505c1 100644 --- a/.docs/params/containerDescriptor.md +++ b/.docs/params/containerDescriptor.md @@ -1,6 +1,6 @@ -### -ContainerDescriptor +### ContainerDescriptor -A container descriptor retrieved by Get-VsTeamGroup +A container descriptor retrieved by Get-VsTeamGroup. ```yaml Type: String diff --git a/.docs/params/forcegroup.md b/.docs/params/forcegroup.md new file mode 100644 index 000000000..2ba78a206 --- /dev/null +++ b/.docs/params/forcegroup.md @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/.docs/params/memberDescriptor.md b/.docs/params/memberDescriptor.md index 73a830f29..435543c0b 100644 --- a/.docs/params/memberDescriptor.md +++ b/.docs/params/memberDescriptor.md @@ -1,6 +1,6 @@ -### -MemberDescriptor +### MemberDescriptor -A member descriptor retrieved by Get-VsTeamUser +A member descriptor retrieved by Get-VsTeamUser. ```yaml Type: String diff --git a/.docs/params/processName.md b/.docs/params/processName.md index 75e67b815..ffe9cc2e1 100644 --- a/.docs/params/processName.md +++ b/.docs/params/processName.md @@ -1,4 +1,4 @@ -### -Name +### Name Specifies the process template name for which this function operates. diff --git a/.docs/params/projectName.md b/.docs/params/projectName.md index c2d39c69a..7c45bf924 100644 --- a/.docs/params/projectName.md +++ b/.docs/params/projectName.md @@ -1,4 +1,4 @@ -### -ProjectName +### ProjectName Specifies the team project for which this function operates. @@ -9,7 +9,7 @@ you do not have to pass the ProjectName with each call. ```yaml Type: String -Position: 0 +Position: Named Required: True Accept pipeline input: true (ByPropertyName) -``` \ No newline at end of file +``` diff --git a/.docs/params/useProjectId.md b/.docs/params/useProjectId.md index 5ca192903..a631f90c9 100644 --- a/.docs/params/useProjectId.md +++ b/.docs/params/useProjectId.md @@ -1,4 +1,4 @@ -### -UseProjectId +### UseProjectId Converts the project name to project id before building the URI for the REST API call. diff --git a/.docs/params/whatIf.md b/.docs/params/whatIf.md index e015e53c0..b24809127 100644 --- a/.docs/params/whatIf.md +++ b/.docs/params/whatIf.md @@ -1,4 +1,4 @@ -### -WhatIf +### WhatIf Shows what would happen if the function runs. The function is not run. diff --git a/.docs/readme.md b/.docs/readme.md deleted file mode 100644 index 648d46f15..000000000 --- a/.docs/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# VSTeam Help - - - -## About files - -[VSTeam](../en-US/about_vsteam.help.txt) - -Learn about the goals of VSTeam. - -[Profiles](../en-US/about_vsteam_profiles.help.txt) - -Profiles allow you to store your account information for easy switching of accounts. - -[Provider](../en-US/about_vsteam_provider.help.txt) - -The provider allows you to navigate your TFS or AzD as a file system. - - \ No newline at end of file diff --git a/.docs/synopsis/Add-VSTeamAccessControlEntry.md b/.docs/synopsis/Add-VSTeamAccessControlEntry.md index 1ec6e6187..a545293dc 100644 --- a/.docs/synopsis/Add-VSTeamAccessControlEntry.md +++ b/.docs/synopsis/Add-VSTeamAccessControlEntry.md @@ -1,3 +1,3 @@ Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. -Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. \ No newline at end of file +Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. diff --git a/.docs/synopsis/Add-VSTeamPullRequest.md b/.docs/synopsis/Add-VSTeamPullRequest.md index 4de6957ed..d9e22b829 100644 --- a/.docs/synopsis/Add-VSTeamPullRequest.md +++ b/.docs/synopsis/Add-VSTeamPullRequest.md @@ -1 +1 @@ -Create a new Pull Request \ No newline at end of file +Creates a new Pull Request. \ No newline at end of file diff --git a/.docs/synopsis/Add-VSTeamRelease.md b/.docs/synopsis/Add-VSTeamRelease.md index 93c378193..6914f228b 100644 --- a/.docs/synopsis/Add-VSTeamRelease.md +++ b/.docs/synopsis/Add-VSTeamRelease.md @@ -1 +1 @@ -Queues a new release \ No newline at end of file +Queues a new release. \ No newline at end of file diff --git a/.docs/synopsis/Get-VSTeamPermissionInheritance.md b/.docs/synopsis/Get-VSTeamPermissionInheritance.md index 55e219a19..3e186155a 100644 --- a/.docs/synopsis/Get-VSTeamPermissionInheritance.md +++ b/.docs/synopsis/Get-VSTeamPermissionInheritance.md @@ -1 +1,3 @@ +**Undocumented API** + Returns true or false. \ No newline at end of file diff --git a/.docs/synopsis/Get-VSTeamQuery.md b/.docs/synopsis/Get-VSTeamQuery.md new file mode 100644 index 000000000..05575922a --- /dev/null +++ b/.docs/synopsis/Get-VSTeamQuery.md @@ -0,0 +1 @@ +Gets the root queries and their children. \ No newline at end of file diff --git a/.docs/synopsis/Set-VSTeamPermissionInheritance.md b/.docs/synopsis/Set-VSTeamPermissionInheritance.md index 273e18ce4..93aadb9cc 100644 --- a/.docs/synopsis/Set-VSTeamPermissionInheritance.md +++ b/.docs/synopsis/Set-VSTeamPermissionInheritance.md @@ -1 +1,3 @@ +**Undocumented API** + Sets the permission inheritance to true or false. \ No newline at end of file diff --git a/.gitignore b/.gitignore index c85ec7be2..618433fab 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,8 @@ test/sample.txt /src/.vs /node_modules -/docs/files.md -/docs/index.md -integration/prime.ps1 +**/docs +Tests/integration/prime.ps1 integration/test/test-results.xml /Debugscript.txt .docs/files.md @@ -37,3 +36,231 @@ vsteam_wcore1903_ps7_tests_result.xml integration/fullRun.ps1 integration/Start-PSCountdown.ps1 integrationTest-results.xml +.vs/* + +# The following command works for downloading when using Git for Windows: +# curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore +# +# Download this file using PowerShell v3 under Windows with the following comand: +# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore +# +# or wget: +# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +[Bb]in/ +[Oo]bj/ +# build folder is nowadays used for build scripts and should not be ignored +#build/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# OS generated files # +.DS_Store* +Icon? + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings +modulesbin/ +tempbin/ + +# EPiServer Site file (VPP) +AppData/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# vim +*.txt~ +*.swp +*.swo + +# Temp files when opening LibreOffice on ubuntu +.~lock.* + +# svn +.svn + +# CVS - Source Control +**/CVS/ + +# Remainings from resolving conflicts in Source Control +*.orig + +# SQL Server files +**/App_Data/*.mdf +**/App_Data/*.ldf +**/App_Data/*.sdf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +# SASS Compiler cache +.sass-cache + +# Visual Studio 2014 CTP +**/*.sln.ide + +# Visual Studio temp something +.vs/ + +# dotnet stuff +project.lock.json + +# VS 2015+ +*.vc.vc.opendb +*.vc.db + +# Rider +.idea/ + +# Visual Studio Code +.vscode/ + +# Output folder used by Webpack or other FE stuff +**/node_modules/* +**/wwwroot/* + +# SpecFlow specific +*.feature.cs +*.feature.xlsx.* +*.Specs_*.html + +##### +# End of core ignore list, below put you custom 'per project' settings (patterns or path) +##### +Source/en-US/VSTeam-Help.xml diff --git a/.vscode/launch.json b/.vscode/launch.json index f0916c74e..cc5d94945 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,16 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "Start PowerShell", + "type": "coreclr", + "request": "launch", + "program": "C:\\Program Files\\PowerShell\\7\\pwsh.exe", + "args": [], + "cwd": "${workspaceFolder}", + "stopAtEntry": false, + "externalConsole": true + }, { "type": "PowerShell", "request": "launch", diff --git a/.vscode/settings.json b/.vscode/settings.json index 943968eed..6430bb7c5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -55,5 +55,6 @@ "workbench.action.files.newUntitled" ], "powershell.pester.useLegacyCodeLens": false, - "powershell.pester.outputVerbosity": "Detailed" + "powershell.pester.outputVerbosity": "Detailed", + "powershell.codeFormatting.addWhitespaceAroundPipe": true } \ No newline at end of file diff --git a/Build-Module.ps1 b/Build-Module.ps1 index f08ce94f6..90ef10047 100644 --- a/Build-Module.ps1 +++ b/Build-Module.ps1 @@ -43,7 +43,17 @@ param( # runs the integration tests [Parameter(ParameterSetName = "UnitTest")] [Parameter(ParameterSetName = "All")] - [switch]$runIntegrationTests + [switch]$runIntegrationTests, + + [Parameter(ParameterSetName = "UnitTest")] + [Parameter(ParameterSetName = "All")] + [switch]$skipLibBuild, + + [ValidateSet('LibOnly', 'Debug', 'Release')] + [string]$configuration = "LibOnly", + + [ValidateSet('Diagnostic', 'Detailed', 'Normal', 'Minimal', 'None', 'ErrorsOnly')] + [string]$testOutputLevel = "ErrorsOnly" ) function Import-Pester { @@ -61,17 +71,31 @@ function Start-IntegrationTests { param() process { + Write-Output ' Testing: Functions (integration)' + + if (-not $(Test-Path -Path './Tests/TestResults')) { + New-Item -Path './Tests/TestResults' -ItemType Directory | Out-Null + } + Import-Pester $pesterArgs = [PesterConfiguration]::Default - $pesterArgs.Run.Path = '.\integration' + $pesterArgs.Run.Path = './Tests/integration' $pesterArgs.Run.Exit = $true - $pesterArgs.Output.Verbosity = "Detailed" $pesterArgs.TestResult.Enabled = $true - $pesterArgs.TestResult.OutputPath = 'integrationTest-results.xml' + $pesterArgs.TestResult.OutputPath = './Tests/TestResults/integrationTest-results.xml' $pesterArgs.Run.PassThru = $false - Invoke-Pester -Configuration $pesterArgs + if ('ErrorsOnly' -eq $testOutputLevel) { + $pesterArgs.Output.Verbosity = 'none' + $pesterArgs.Run.PassThru = $true + $intTestResults = Invoke-Pester -Configuration $pesterArgs + $intTestResults.Failed | Select-Object -ExpandProperty ErrorRecord + } + else { + $pesterArgs.Output.Verbosity = $testOutputLevel + Invoke-Pester -Configuration $pesterArgs + } } } @@ -96,14 +120,13 @@ else { $output = [System.IO.Path]::GetFullPath($output) -Merge-File -inputFile ./Source/_functions.json -outputDir $output Merge-File -inputFile ./Source/types/_types.json -outputDir $output -Merge-File -inputFile ./Source/Classes/_classes.json -outputDir $output Merge-File -inputFile ./Source/formats/_formats.json -outputDir $output +Merge-File -inputFile ./Source/_functions.json -outputDir $output # Build the help if ($buildHelp.IsPresent) { - Write-Output 'Creating help files' + Write-Output 'Processing: External help file' Push-Location Set-Location ./.docs Try { @@ -114,27 +137,59 @@ if ($buildHelp.IsPresent) { } } -Write-Output 'Publishing about help files' +Write-Output 'Publishing: About help files' Copy-Item -Path ./Source/en-US -Destination "$output/" -Recurse -Force + +Write-Output 'Publishing: Manifest file' Copy-Item -Path ./Source/VSTeam.psm1 -Destination "$output/VSTeam.psm1" -Force -Write-Output 'Updating Functions To Export' +Write-Output ' Updating: Functions To Export' $newValue = ((Get-ChildItem -Path "./Source/Public" -Filter '*.ps1').BaseName | ForEach-Object -Process { Write-Output "'$_'" }) -join ',' (Get-Content "./Source/VSTeam.psd1") -Replace ("FunctionsToExport.+", "FunctionsToExport = ($newValue)") | Set-Content "$output/VSTeam.psd1" -Write-Output "Publish complete to $output" +if (-not $skipLibBuild.IsPresent) { + Write-Output " Building: C# project ($configuration config)" + + if (-not $(Test-Path -Path $output\bin)) { + New-Item -Path $output\bin -ItemType Directory | Out-Null + } + + $buildOutput = dotnet build --nologo --verbosity quiet --configuration $configuration | Out-String + Copy-Item -Destination "$output\bin\vsteam-lib.dll" -Path ".\Source\Classes\bin\$configuration\netstandard2.0\vsteam-lib.dll" -Force + Copy-Item -Destination "$output\bin\Trackyon.System.Management.Automation.Abstractions.dll" -Path ".\Source\Classes\bin\$configuration\netstandard2.0\Trackyon.System.Management.Automation.Abstractions.dll" -Force + + if (-not ($buildOutput | Select-String -Pattern 'succeeded')) { + Write-Output $buildOutput + } +} + +Write-Output "Publishing: Complete to $output" # run the unit tests with Pester if ($runTests.IsPresent) { + if (-not $skipLibBuild.IsPresent -and $configuration -ne 'LibOnly') { + Write-Output ' Testing: C# project (unit)' + $testOutput = dotnet test --nologo --configuration $configuration | Out-String + + if (-not ($testOutput | Select-String -Pattern 'Test Run Successful')) { + Write-Output $testOutput + } + } + + Write-Output ' Testing: Functions (unit)' + + if (-not $(Test-Path -Path './Tests/TestResults')) { + New-Item -Path './Tests/TestResults' -ItemType Directory | Out-Null + } + Import-Pester $pesterArgs = [PesterConfiguration]::Default - $pesterArgs.Run.Path = '.\unit' - $pesterArgs.Output.Verbosity = "Detailed" + $pesterArgs.Run.Path = './Tests/function' $pesterArgs.TestResult.Enabled = $true - $pesterArgs.TestResult.OutputPath = 'test-results.xml' + $pesterArgs.TestResult.OutputPath = './Tests/TestResults/test-results.xml' if ($codeCoverage.IsPresent) { $pesterArgs.CodeCoverage.Enabled = $true @@ -150,7 +205,16 @@ if ($runTests.IsPresent) { $pesterArgs.Filter.FullName = $testName } - Invoke-Pester -Configuration $pesterArgs + if ('ErrorsOnly' -eq $testOutputLevel) { + $pesterArgs.Output.Verbosity = 'none' + $pesterArgs.Run.PassThru = $true + $unitTestResults = Invoke-Pester -Configuration $pesterArgs + $unitTestResults.Failed | Select-Object -ExpandProperty ErrorRecord + } + else { + $pesterArgs.Output.Verbosity = $testOutputLevel + Invoke-Pester -Configuration $pesterArgs + } } # reload the just built module @@ -160,7 +224,7 @@ if ($ipmo.IsPresent -or $analyzeScript.IsPresent -or $runIntegrationTests.IsPres Remove-Module VSTeam } - Write-Host "Importing module" + Write-Host " Importing: Module" Import-Module "$output/VSTeam.psd1" -Force Set-VSTeamAlias diff --git a/CHANGELOG.md b/CHANGELOG.md index c414eaf7f..662c7e789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,82 @@ # Changelog +## 7.0.0 + +## Breaking changes + +All classes are moved to a new C# class library. + +You must have [.netCore](dot.net) installed to build the class lib on macOS, Linux and Windows. + +All types were changed from 'Team.' to 'vsteam_lib.' this will make it easy when moving types from PowerShell to C#. + +VSTeamDescriptor is now vsteam_lib.Descriptor and no longer has a Descriptor property. Use the Id, Name or ToString() property in its place. + +ProjectName is now a named parameter for most functions. This freed position 0 for other parameters to make functions easier to use. + +User2 is now vsteam_lib.User + +Removed CUID from vsteam_lib.User. + +Removed RequestedFor from vsteam_lib.Release + +Disable-VSTeamAgent now requires -Force. + +ReleaseIdsFilter changed to ReleaseId on Get-VSTeamApproval + +Changed Ids parameter to Id on the following functions to be consistent with other functions: + +- Get-VSTeamArea +- Get-VSTeamIteration +- Get-VSTeamGitCommit +- Get-VSTeamClassificationNode + +ReClassifyId and Path are now required on Remove-VSTeamArea. + +Get-VSTeamGitCommit removed Id alias on RepositoryId parameter. + +Renamed parameters on Get-VSTeamBuildTimeline to make it easier to pipe results of Get-VSTeamBuild into Get-VSTeamBuildTimeline. $Id of type Guid is now $TimelineId. $BuildId of type int[] is now $Id. + +Removed Type parameter from Get-VSTeamBuildDefinition. + +Removed the Top and Skip parameters from Get-VSTeamProcess. + +Get-VSTeamMembership now returns a collection. There is no need to .value with results. + +### Core changes + +The folder structure of the project was changed to support the new C# class library. + +All the tests and sample files are under the Tests folder. + +There is a new packages folder that contains required libs to build the C# project that do not live in NuGet. + +The Build folder is now the .build folder. + +Build-Module script builds the class lib project as well. + +The C# solution files is in the root of the project vsteam_lib.sln. + +The lib is in the classes folder under source and the tests are under the library folder under Tests. + +You can now call Get-VSTeamTfvcBranch with no parameters. + +Added -force to Remove-VSTeamAccessControlEntry so you don't have to use -confirm:$false. This make it consistent with the rest of the functions + +Get-VSTeamUser and Get-VSTeamGroup can now take Descriptor from pipeline. + +All unit tests were reviewed and all now use sample files where possible instead of inline objects. + +Added -Force to Stop-VSTeamBuild + +### Docs changes + +Added HelpUri to all public functions + +Deleted the docs folder because all docs are now available [here](https://methodsandpractices.github.io/vsteam-docs/) + +Added examples to all the help files. + ## 6.5.1 Fixed bug [337](https://github.com/MethodsAndPractices/vsteam/issues/337) diff --git a/Merge-File.ps1 b/Merge-File.ps1 index f2d751cda..944dda516 100644 --- a/Merge-File.ps1 +++ b/Merge-File.ps1 @@ -39,7 +39,7 @@ PS C:\> Merge-File -InputFile .\Source\Classes\classes.json Write-Verbose "Full Path: $fullPath" $fileOrder = Get-Content $fullPath -Raw | ConvertFrom-Json - Write-Output "Processing: $($fileOrder.fileType) in $fullPath" + Write-Output "Processing: $($fileOrder.fileType) => $($fileOrder.outputFile)" $workingDir = Split-Path $fullPath Write-Verbose "Working Directory: $workingDir" @@ -53,7 +53,13 @@ PS C:\> Merge-File -InputFile .\Source\Classes\classes.json $files = $() foreach ($file in $fileOrder.files) { - foreach ($item in $(Get-ChildItem -Filter $file)) { + $children = $(Get-ChildItem -Filter $file) + + if ($children.Length -eq 0) { + Write-Warning "Could not find $file" + } + + foreach ($item in $children) { $files += , (Resolve-Path $item.FullName) } } @@ -63,7 +69,7 @@ PS C:\> Merge-File -InputFile .\Source\Classes\classes.json # This makes sure the file is there and empty. # If the file already exisit it will be overwritten. $null = New-Item -ItemType file -Path $output -Force - Write-Output "Creating: $output" + Write-Verbose "Creating: $output" switch ($fileOrder.fileType) { 'formats' { @@ -151,16 +157,30 @@ function Merge-Function { process { $contents = New-Object System.Text.StringBuilder - ForEach ($file in $files) { + foreach ($file in $files) { Write-Verbose -Message "Merging from $file" $fileContents = Get-Content $file + $foundCmdletBinding = $false + + if($null -ne $($fileContents | Select-String -Pattern 'CmdletBinding')){ + $foundCmdletBinding = $true + } + foreach ($line in $fileContents) { + + + + $line = ($line -replace ' +$', '') if ($null -ne $line.Trim() -and '' -ne $line.Trim()) { $contents.AppendLine($line) | Out-Null } } + + if(-not $foundCmdletBinding) { + Write-Warning -Message "CmdletBinding not found in $file" + } } # Remove all trailing whitespace @@ -203,7 +223,7 @@ function Merge-Class { # Remove all trailing whitespace $newFileContents = ($newFileContents -replace ' +$', '') - + # This not only removes the comment but any whitespace before it. $newFileContents = ($newFileContents -replace ' +#.+', '') foreach ($line in $newFileContents) { diff --git a/README.md b/README.md index edc33ec7d..1ff9153cf 100644 --- a/README.md +++ b/README.md @@ -68,19 +68,19 @@ To run build the script Build-Module.ps1. The script has the following parameter Below are some examples on how to build the module locally. It is expected that your working directory is at the root of the repository. Builds the module, installs needed dependencies, loads the module into the session and also builds the help. -```PowerShell +```powershell .\Build-Module.ps1 -installDep -ipmo -buildHelp ``` #### Run Tests Locally Runs all unit tests and executes the static code analysis. -```PowerShell +```powershell .\Build-Module.ps1 -runTests -codeCoverage -analyzeScript ``` Runs the tests, but executes only the unit tests that have the description "workitems" for the logical grouped unit tests. This can be used if you only want to test a portion of your unit tests. -```PowerShell +```powershell .\Build-Module.ps1 -runTests -testName workitems ``` diff --git a/Source/Classes/Attribute/BaseValidateArgumentsAttribute.cs b/Source/Classes/Attribute/BaseValidateArgumentsAttribute.cs new file mode 100644 index 000000000..37aa463a1 --- /dev/null +++ b/Source/Classes/Attribute/BaseValidateArgumentsAttribute.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace vsteam_lib +{ + public abstract class BaseValidateArgumentsAttribute : ValidateArgumentsAttribute + { + internal abstract IEnumerable GetValues(); + + protected override void Validate(object arguments, EngineIntrinsics engineIntrinsics) + { + if (string.IsNullOrEmpty(arguments?.ToString())) + { + return; + } + + var cache = this.GetValues(); + + if (cache.Count() > 0 && cache.All(s => string.Compare(arguments.ToString(), s, true) != 0)) + { + throw new ValidationMetadataException($"'{arguments}' is invalid"); + } + } + } +} diff --git a/Source/Classes/Attribute/ProcessTemplateValidateAttribute.cs b/Source/Classes/Attribute/ProcessTemplateValidateAttribute.cs new file mode 100644 index 000000000..87357b2ab --- /dev/null +++ b/Source/Classes/Attribute/ProcessTemplateValidateAttribute.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace vsteam_lib +{ + public class ProcessTemplateValidateAttribute : BaseValidateArgumentsAttribute + { + internal override IEnumerable GetValues() => ProcessTemplateCache.GetCurrent(); + } +} diff --git a/Source/Classes/Attribute/ProjectValidateAttribute.cs b/Source/Classes/Attribute/ProjectValidateAttribute.cs new file mode 100644 index 000000000..200ddd595 --- /dev/null +++ b/Source/Classes/Attribute/ProjectValidateAttribute.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace vsteam_lib +{ + public class ProjectValidateAttribute : BaseValidateArgumentsAttribute + { + private readonly bool _forceUpdate; + + public ProjectValidateAttribute(bool forceUpdate) + { + this._forceUpdate = forceUpdate; + } + + internal override IEnumerable GetValues() => ProjectCache.GetCurrent(_forceUpdate); + } +} diff --git a/Source/Classes/Attribute/QueryTransformToIDAttribute.cs b/Source/Classes/Attribute/QueryTransformToIDAttribute.cs new file mode 100644 index 000000000..f45bd606f --- /dev/null +++ b/Source/Classes/Attribute/QueryTransformToIDAttribute.cs @@ -0,0 +1,22 @@ +using System.Management.Automation; +using System.Text.RegularExpressions; + +namespace vsteam_lib +{ + public sealed class QueryTransformToIDAttribute : ArgumentTransformationAttribute + { + public override 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 + var value = inputData?.ToString(); + + if (!string.IsNullOrEmpty(value) && !Regex.Match(value, "[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}").Success) + { + value = QueryCache.GetId(value); + } + + return value; + } + } +} diff --git a/Source/Classes/Attribute/WorkItemTypeValidateAttribute.cs b/Source/Classes/Attribute/WorkItemTypeValidateAttribute.cs new file mode 100644 index 000000000..977fe56b9 --- /dev/null +++ b/Source/Classes/Attribute/WorkItemTypeValidateAttribute.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace vsteam_lib +{ + public class WorkItemTypeValidateAttribute : BaseValidateArgumentsAttribute + { + internal override IEnumerable GetValues() => WorkItemTypeCache.GetCurrent(); + } +} diff --git a/Source/Classes/BuildCompleter.ps1 b/Source/Classes/BuildCompleter.ps1 deleted file mode 100644 index 1138084a8..000000000 --- a/Source/Classes/BuildCompleter.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -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 -# build numbers 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 BuildCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - # If the user has explicitly 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 (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 deleted file mode 100644 index c933f5393..000000000 --- a/Source/Classes/BuildDefinitionCompleter.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -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 -# build definition names 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 BuildDefinitionCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - # If the user has explicitly 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 (Get-VSTeamBuildDefinition -ProjectName $projectName).name) { - if ($value -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) - } - } - } - - return $results - } -} diff --git a/Source/Classes/Cache/InternalCache.cs b/Source/Classes/Cache/InternalCache.cs new file mode 100644 index 000000000..6d918aff7 --- /dev/null +++ b/Source/Classes/Cache/InternalCache.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib +{ + public class InternalCache + { + private double _timeStamp = -1; + public List Values { get; } = new List(); + public int MinutesToExpire { get; set; } = 1; + + /// + /// Used for unit testing + /// + private IPowerShell _powerShell; + private readonly string _command; + private readonly string _property; + private readonly bool _requiresProject; + + public InternalCache(string command, string property, bool requiresProject) + { + this._command = command; + this._property = property; + this._requiresProject = requiresProject; + } + + [ExcludeFromCodeCoverage] + public IPowerShell Shell + { + get + { + if (this._powerShell != null) + { + return this._powerShell; + } + + return new PowerShellWrapper(RunspaceMode.CurrentRunspace); + } + + set => this._powerShell = value; + } + + internal void Update(IEnumerable list, int minutesToExpire = 1) + { + this.MinutesToExpire = minutesToExpire; + + // If a list is passed in use it. If not call Get-VSTeamProcess + if (null == list) + { + if (this._requiresProject) + { + var projectName = Common.GetDefaultProject(this.Shell); + + if (!string.IsNullOrEmpty(projectName)) + { + this.Shell.Commands.Clear(); + + list = this.Shell.AddCommand(this._command) + .AddParameter("ProjectName", projectName) + .AddCommand("Select-Object") + .AddParameter("ExpandProperty", this._property) + .AddCommand("Sort-Object") + .Invoke(); + } + } + else + { + this.Shell.Commands.Clear(); + + list = this.Shell.AddCommand(this._command) + .AddCommand("Select-Object") + .AddParameter("ExpandProperty", this._property) + .AddCommand("Sort-Object") + .Invoke(); + } + } + + this.PreFill(list); + } + + internal void PreFill(IEnumerable list) + { + this.Values.Clear(); + + if (null != list) + { + foreach (var item in list) + { + this.Values.Add(item); + } + } + + this._timeStamp = Math.Round(DateTime.UtcNow.TimeOfDay.TotalMinutes); + } + + internal IEnumerable GetCurrent() + { + if (this.HasCacheExpired) + { + this.Update(null); + } + + return this.Values; + } + + internal void Invalidate() => this._timeStamp = -1; + internal bool HasCacheExpired + { + get + { + if (this._timeStamp == -1) + { + return true; + } + + return Math.Round(DateTime.UtcNow.TimeOfDay.TotalMinutes) - this._timeStamp > this.MinutesToExpire; + } + } + } +} diff --git a/Source/Classes/Cache/ProcessTemplateCache.cs b/Source/Classes/Cache/ProcessTemplateCache.cs new file mode 100644 index 000000000..3ad98af65 --- /dev/null +++ b/Source/Classes/Cache/ProcessTemplateCache.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; + +namespace vsteam_lib +{ + /// + /// Cache process template names to reduce the number of + /// rest APIs calls needed for parameter completion / validation + /// + public static class ProcessTemplateCache + { + internal static InternalCache Cache { get; } = new InternalCache("Get-VSTeamProcess", "Name", false); + + internal static bool HasCacheExpired => Cache.HasCacheExpired; + + public static void Invalidate() => Cache.Invalidate(); + + public static void Update(IEnumerable list) => Cache.Update(list); + + public static IEnumerable GetCurrent() => Cache.GetCurrent(); + } +} diff --git a/Source/Classes/Cache/ProjectCache.cs b/Source/Classes/Cache/ProjectCache.cs new file mode 100644 index 000000000..74adbd28c --- /dev/null +++ b/Source/Classes/Cache/ProjectCache.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using System.Management.Automation; + +namespace vsteam_lib +{ + /// + /// Cache project names to reduce the number of + /// rest APIs calls needed for parameter completion / validation + /// + public static class ProjectCache + { + public static void Invalidate() => Cache.Invalidate(); + internal static bool HasCacheExpired => Cache.HasCacheExpired; + internal static InternalCache Cache { get; } = new InternalCache("Get-VSTeamProject", "Name", false); + public static void Update(IEnumerable list, int minutesToExpire = 1) => Cache.Update(list, minutesToExpire); + + /// + /// There are times we need to force an update of the cache + /// even if it has not expired yet. This will be true when we + /// add a new project. + /// + /// + /// + public static IEnumerable GetCurrent(bool forceUpdate) + { + if (HasCacheExpired || forceUpdate) + { + Update(null); + } + + return Cache.Values; + } + } +} diff --git a/Source/Classes/Cache/QueryCache.cs b/Source/Classes/Cache/QueryCache.cs new file mode 100644 index 000000000..097baa414 --- /dev/null +++ b/Source/Classes/Cache/QueryCache.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using System.Linq; + +namespace vsteam_lib +{ + public static class QueryCache + { + internal static InternalCache Cache { get; } = new InternalCache("Get-VSTeamQuery", "Name", true); + + internal static bool HasCacheExpired => Cache.HasCacheExpired; + internal static Dictionary Ids { get; } = new Dictionary(); + + public static void Invalidate() => Cache.Invalidate(); + + public static void Update(IEnumerable list) + { + Ids.Clear(); + + // If a list is passed in use it. If not call Get-VSTeamProcess + if (null == list) + { + var projectName = Common.GetDefaultProject(Cache.Shell); + + if (!string.IsNullOrEmpty(projectName)) + { + Cache.Shell.Commands.Clear(); + + // Use this to store the ids + var queries = Cache.Shell.AddCommand("Get-VSTeamQuery") + .AddParameter("ProjectName", projectName) + .Invoke(); + + foreach (var query in queries) + { + Ids.Add(query.Properties["Name"].Value.ToString(), query.Properties["Id"].Value.ToString()); + } + + // This will return just the names + list = Cache.Shell.AddArgument(queries) + .AddCommand("Select-Object") + .AddParameter("ExpandProperty", "Name") + .AddCommand("Sort-Object") + .Invoke(); + } + } + + Cache.PreFill(list); + } + + public static IEnumerable GetCurrent() + { + if (HasCacheExpired) + { + Update(null); + } + + return Cache.Values; + } + + public static string GetId(string name) + { + if (Ids.Keys.Contains(name)) + { + return Ids[name]; + } + + return name; + } + } +} diff --git a/Source/Classes/Cache/WorkItemTypeCache.cs b/Source/Classes/Cache/WorkItemTypeCache.cs new file mode 100644 index 000000000..e42ca8aff --- /dev/null +++ b/Source/Classes/Cache/WorkItemTypeCache.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; + +namespace vsteam_lib +{ + /// + /// Cache process template names to reduce the number of + /// rest APIs calls needed for parameter completion / validation + /// + public static class WorkItemTypeCache + { + /// + /// This is where all the work is done. Every other call just delegates to this object. + /// + internal static InternalCache Cache { get; } = new InternalCache("Get-VSTeamWorkItemType", "Name", true); + + internal static bool HasCacheExpired => Cache.HasCacheExpired; + + public static void Invalidate() => Cache.Invalidate(); + + public static void Update(IEnumerable list) => Cache.Update(list); + + public static IEnumerable GetCurrent() => Cache.GetCurrent(); + } +} diff --git a/Source/Classes/Common.cs b/Source/Classes/Common.cs new file mode 100644 index 000000000..9c15b5068 --- /dev/null +++ b/Source/Classes/Common.cs @@ -0,0 +1,75 @@ +using System; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public static class Common + { + public static string GetDefaultProject(IPowerShell powerShell) + { + powerShell.Commands.Clear(); + + var results = powerShell.AddScript("$Global:PSDefaultParameterValues[\"*-vsteam*:projectName\"]") + .Invoke(); + + PowerShellWrapper.LogPowerShellError(powerShell, results); + + return results[0]; + } + + public static void MoveProperties(object target, PSObject source) + { + if(source == null) + { + return; + } + + foreach (var prop in target.GetType().GetProperties()) + { + if (prop.GetSetMethod() == null) + { + continue; + } + + var propertyName = prop.Name; + + // See if there is an attribute to help get more information + var attrib = (XmlAttributeAttribute)prop.GetCustomAttributes(false).FirstOrDefault(a => a is XmlAttributeAttribute); + + if (attrib != null) + { + propertyName = attrib.AttributeName; + } + + // If this is a nested property (contains a .) let it through + if (source.HasValue(propertyName) || propertyName.IndexOf(".") != -1) + { + var value = source.GetValue(propertyName); + + if (prop.PropertyType.Name == "String") + { + prop.SetValue(target, value?.ToString()); + } + // In PowerShell 5 the name is nullable1 with DateTime as part of FullName + else if(prop.PropertyType.Name == "DateTime" || + prop.PropertyType.FullName.Contains("DateTime")) + { + prop.SetValue(target, DateTime.Parse(value.ToString())); + } + else if(prop.PropertyType.Name == "Guid") + { + prop.SetValue(target, Guid.Parse(value.ToString())); + } + else + { + prop.SetValue(target, value); + } + } + } + } + } +} diff --git a/Source/Classes/Completer/BaseCompleter.cs b/Source/Classes/Completer/BaseCompleter.cs new file mode 100644 index 000000000..1e756d127 --- /dev/null +++ b/Source/Classes/Completer/BaseCompleter.cs @@ -0,0 +1,50 @@ +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Management.Automation.Language; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("vsteam-lib.Test")] + +namespace vsteam_lib +{ + public abstract class BaseCompleter : IArgumentCompleter + { + protected readonly IPowerShell _powerShell; + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + protected BaseCompleter(IPowerShell powerShell) { this._powerShell = powerShell; } + + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + protected BaseCompleter() : this(new PowerShellWrapper(RunspaceMode.CurrentRunspace)) { } + + public abstract IEnumerable CompleteArgument(string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters); + + protected static void SelectValues(string wordToComplete, IEnumerable words, List values) + { + foreach (var word in words) + { + if (string.IsNullOrEmpty(wordToComplete) || word.StartsWith(wordToComplete, true, CultureInfo.InvariantCulture)) + { + // Only wrap in single quotes if they have a space. This makes it easier + // to use on macOs + values.Add(new CompletionResult(word.Contains(" ") ? $"'{word}'" : word)); + } + } + } + } +} diff --git a/Source/Classes/Completer/BaseProjectCompleter.cs b/Source/Classes/Completer/BaseProjectCompleter.cs new file mode 100644 index 000000000..2d4ce6d40 --- /dev/null +++ b/Source/Classes/Completer/BaseProjectCompleter.cs @@ -0,0 +1,107 @@ +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Management.Automation.Language; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("vsteam-lib.Test")] + +namespace vsteam_lib +{ + /// + /// This base class if for completers that could be passed a + /// project name. + /// + public abstract class BaseProjectCompleter : BaseCompleter + { + private readonly string _command; + private readonly string _property; + private readonly bool _descending; + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + protected BaseProjectCompleter(string command, string property, bool descending, IPowerShell powerShell) : base(powerShell) + { + this._command = command; + this._property = property; + this._descending = descending; + } + + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + protected BaseProjectCompleter(string command, string property, bool descending) : base() + { + this._command = command; + this._property = property; + this._descending = descending; + } + + /// + /// Completers that need the project name to call the correct function must + /// implement this overload of GetValue + /// + /// Name of the project to use + /// A list of strings + internal virtual IEnumerable GetValues(string projectName) + { + this._powerShell.Commands.Clear(); + + var results = this._powerShell.AddCommand(this._command) + .AddParameter("ProjectName", projectName) + .AddCommand("Select-Object") + .AddParameter("ExpandProperty", this._property) + .AddParameter("Unique") + .AddCommand("Sort-Object") + .AddParameter("Descending", this._descending) + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this._powerShell, results); + + return results; + } + + /// + /// Completers that need the project name to call the correct function must + /// implement this overload of GetValue + /// + /// Name of the project to use + /// A list of strings + //internal abstract IEnumerable GetValues(string projectName); + + public override IEnumerable CompleteArgument(string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters) + { + var values = new List(); + + // If the user has explicitly added the -ProjectName parameter + // to the command use that instead of the default project. + var projectName = fakeBoundParameters["ProjectName"]?.ToString(); + + // Only use the default project if the ProjectName parameter was + // not used + if (string.IsNullOrEmpty(projectName)) + { + projectName = Common.GetDefaultProject(this._powerShell); + } + + // If there is no projectName by this point just return a empty + // list. + if (!string.IsNullOrEmpty(projectName)) + { + SelectValues(wordToComplete, this.GetValues(projectName), values); + } + + return values; + } + } +} diff --git a/Source/Classes/Completer/BuildCompleter.cs b/Source/Classes/Completer/BuildCompleter.cs new file mode 100644 index 000000000..6a73e89ae --- /dev/null +++ b/Source/Classes/Completer/BuildCompleter.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib +{ + public class BuildCompleter : BaseProjectCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public BuildCompleter() : base("Get-VSTeamBuild", "BuildNumber", true) { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + internal BuildCompleter(IPowerShell powerShell) : base("Get-VSTeamBuild", "BuildNumber", true, powerShell) { } + } +} diff --git a/Source/Classes/Completer/BuildDefinitionCompleter.cs b/Source/Classes/Completer/BuildDefinitionCompleter.cs new file mode 100644 index 000000000..7c4bb2c3e --- /dev/null +++ b/Source/Classes/Completer/BuildDefinitionCompleter.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib +{ + public class BuildDefinitionCompleter : BaseProjectCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public BuildDefinitionCompleter() : base("Get-VSTeamBuildDefinition", "Name", false) { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + internal BuildDefinitionCompleter(IPowerShell powerShell) : base("Get-VSTeamBuildDefinition", "Name", false, powerShell) { } + } +} diff --git a/Source/Classes/Completer/InvokeCompleter.cs b/Source/Classes/Completer/InvokeCompleter.cs new file mode 100644 index 000000000..24c4a2d5c --- /dev/null +++ b/Source/Classes/Completer/InvokeCompleter.cs @@ -0,0 +1,85 @@ +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Management.Automation.Language; + +namespace vsteam_lib +{ + public class InvokeCompleter : BaseCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public InvokeCompleter() : base() { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + public InvokeCompleter(IPowerShell powerShell) : base(powerShell) { } + + public override IEnumerable CompleteArgument(string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters) + { + var values = new List(); + + // If the user has explicitly added the -subDomain parameter + // to the command use that to filter the results. + var subDomain = fakeBoundParameters["subDomain"]?.ToString(); + + // To complete resources you have to provide the area first + var area = fakeBoundParameters["area"]?.ToString(); + + var spat = new Dictionary(); + + if (!string.IsNullOrEmpty(subDomain)) + { + spat.Add("subDomain", subDomain); + } + + this._powerShell.Commands.Clear(); + + if (string.Compare(parameterName, "Area", true) == 0) + { + var areas = this._powerShell.AddCommand("Get-VSTeamOption") + .AddParameters(spat) + .AddCommand("Select-Object") + .AddParameter("ExpandProperty", "Area") + .AddParameter("Unique") + .AddCommand("Sort-Object") + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this._powerShell, areas); + + SelectValues(wordToComplete, areas, values); + } + else if (!string.IsNullOrEmpty(area)) + { + var resources = this._powerShell.AddCommand("Get-VSTeamOption") + .AddParameters(spat) + .AddCommand("Where-Object") + .AddParameter("Property", "area") + .AddParameter("-EQ") + .AddParameter("Value", area) + .AddCommand("Select-Object") + .AddParameter("ExpandProperty", "ResourceName") + .AddParameter("Unique") + .AddCommand("Sort-Object") + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this._powerShell, resources); + + SelectValues(wordToComplete, resources, values); + } + + return values; + } + } +} diff --git a/Source/Classes/Completer/ProcessTemplateCompleter.cs b/Source/Classes/Completer/ProcessTemplateCompleter.cs new file mode 100644 index 000000000..5491e8d25 --- /dev/null +++ b/Source/Classes/Completer/ProcessTemplateCompleter.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Management.Automation.Language; + +namespace vsteam_lib +{ + public class ProcessTemplateCompleter : BaseCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public ProcessTemplateCompleter() : base() { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + public ProcessTemplateCompleter(IPowerShell powerShell) : base(powerShell) { } + + public override IEnumerable CompleteArgument(string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters) + { + var values = new List(); + + SelectValues(wordToComplete, ProcessTemplateCache.GetCurrent(), values); + + return values; + } + } +} diff --git a/Source/Classes/Completer/ProjectCompleter.cs b/Source/Classes/Completer/ProjectCompleter.cs new file mode 100644 index 000000000..9a2af8843 --- /dev/null +++ b/Source/Classes/Completer/ProjectCompleter.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Management.Automation.Language; + +namespace vsteam_lib +{ + public class ProjectCompleter : BaseCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public ProjectCompleter() : base() { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + public ProjectCompleter(IPowerShell powerShell) : base(powerShell) { } + + public override IEnumerable CompleteArgument(string commandName, + string parameterName, + string wordToComplete, + CommandAst commandAst, + IDictionary fakeBoundParameters) + { + var values = new List(); + + SelectValues(wordToComplete, ProjectCache.GetCurrent(false), values); + + return values; + } + } +} diff --git a/Source/Classes/Completer/QueryCompleter.cs b/Source/Classes/Completer/QueryCompleter.cs new file mode 100644 index 000000000..c5f3ef0f4 --- /dev/null +++ b/Source/Classes/Completer/QueryCompleter.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib +{ + public class QueryCompleter : BaseProjectCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public QueryCompleter() : base("Get-VSTeamQuery", "Name", false) { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + internal QueryCompleter(IPowerShell powerShell) : base("Get-VSTeamQuery", "Name", false, powerShell) { } + } +} diff --git a/Source/Classes/Completer/QueueCompleter.cs b/Source/Classes/Completer/QueueCompleter.cs new file mode 100644 index 000000000..a184cc82b --- /dev/null +++ b/Source/Classes/Completer/QueueCompleter.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib +{ + public class QueueCompleter : BaseProjectCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public QueueCompleter() : base("Get-VSTeamQueue", "Name", false) { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + internal QueueCompleter(IPowerShell powerShell) : base("Get-VSTeamQueue", "Name", false, powerShell) { } + } +} diff --git a/Source/Classes/Completer/ReleaseDefinitionCompleter.cs b/Source/Classes/Completer/ReleaseDefinitionCompleter.cs new file mode 100644 index 000000000..85d767f7a --- /dev/null +++ b/Source/Classes/Completer/ReleaseDefinitionCompleter.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib +{ + public class ReleaseDefinitionCompleter : BaseProjectCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public ReleaseDefinitionCompleter() : base("Get-VSTeamReleaseDefinition", "Name", false) { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + internal ReleaseDefinitionCompleter(IPowerShell powerShell) : base("Get-VSTeamReleaseDefinition", "Name", false, powerShell) { } + } +} diff --git a/Source/Classes/Completer/WorkItemTypeCompleter.cs b/Source/Classes/Completer/WorkItemTypeCompleter.cs new file mode 100644 index 000000000..e75c968a1 --- /dev/null +++ b/Source/Classes/Completer/WorkItemTypeCompleter.cs @@ -0,0 +1,21 @@ +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib +{ + public class WorkItemTypeCompleter : BaseProjectCompleter + { + /// + /// This constructor is used when running in a PowerShell session. It cannot be + /// loaded in a unit test. + /// + [ExcludeFromCodeCoverage] + public WorkItemTypeCompleter() : base("Get-VSTeamWorkItemType", "Name", false) { } + + /// + /// This constructor is used during unit testings + /// + /// fake instance of IPowerShell used for testing + internal WorkItemTypeCompleter(IPowerShell powerShell) : base("Get-VSTeamWorkItemType", "Name", false, powerShell) { } + } +} diff --git a/Source/Classes/GlobalSuppressions.cs b/Source/Classes/GlobalSuppressions.cs new file mode 100644 index 000000000..67e372edf --- /dev/null +++ b/Source/Classes/GlobalSuppressions.cs @@ -0,0 +1,10 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Performance", "CA1813:Avoid unsealed attributes", Justification = "I need this file unsealed so my test project can derive from it to gain access to the protected method.", Scope = "type", Target = "~T:vsteam_lib.ProcessTemplateValidateAttribute")] +[assembly: SuppressMessage("Performance", "CA1813:Avoid unsealed attributes", Justification = "I need this file unsealed so my test project can derive from it to gain access to the protected method.", Scope = "type", Target = "~T:vsteam_lib.ProjectValidateAttribute")] +[assembly: SuppressMessage("Performance", "CA1813:Avoid unsealed attributes", Justification = "I need this file unsealed so my test project can derive from it to gain access to the protected method.", Scope = "type", Target = "~T:vsteam_lib.WorkItemTypeValidateAttribute")] diff --git a/Source/Classes/InvokeCompleter.ps1 b/Source/Classes/InvokeCompleter.ps1 deleted file mode 100644 index 2810ceec2..000000000 --- a/Source/Classes/InvokeCompleter.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -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 -# areas for Invoke-VSTeamRequest for function parameters. -class InvokeCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - # If the user has explicitly added the -subDomain parameter - # to the command use that to filter the results. - $subDomain = $FakeBoundParameters['subDomain'] - - # To complete resources you have to provide the area first - $area = $FakeBoundParameters['area'] - - $p = @{} - - # Use the sub domain if provided to filter the results. - if ($subDomain) { - $p['subDomain'] = $subDomain - } - - if ($ParameterName -eq 'Area') { - $areas = $(Get-VSTeamOption @p | Select-Object Area | Sort-Object -Property Area -Unique) - - 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 ($value in $resources.resourceName) { - if ($value -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) - } - } - } - - return $results - } -} diff --git a/Source/Classes/ProcessTemplateCompleter.ps1 b/Source/Classes/ProcessTemplateCompleter.ps1 deleted file mode 100644 index e707497cc..000000000 --- a/Source/Classes/ProcessTemplateCompleter.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -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 -# process templates for function parameters. -class ProcessTemplateCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - if (_hasProcessTemplateCacheExpired) { - [VSTeamProcessCache]::processes = _getProcesses - [VSTeamProcessCache]::timestamp = (Get-Date).Minute - } - - foreach ($value in [VSTeamProcessCache]::processes) { - if ($value -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) - } - } - - return $results - } -} diff --git a/Source/Classes/ProcessValidateAttribute.ps1 b/Source/Classes/ProcessValidateAttribute.ps1 deleted file mode 100644 index 2a9406d26..000000000 --- a/Source/Classes/ProcessValidateAttribute.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -using namespace System.Management.Automation - -class ProcessValidateAttribute : ValidateArgumentsAttribute { - [void] Validate( - [object] $arguments, - [EngineIntrinsics] $EngineIntrinsics) { - - # Do not fail on null or empty, leave that to other validation conditions - if ([string]::IsNullOrEmpty($arguments)) { - return - } - - $cachedProcesses = [VSTeamProcessCache]::GetCurrent() - - if (($cachedProcesses.count -gt 0) -and ($arguments -notin $cachedProcesses)) { - throw [ValidationMetadataException]::new( - "'$arguments' is not a valid process. Valid processes are: '" + - ($cachedProcesses -join "', '") + "'") - } - } -} \ No newline at end of file diff --git a/Source/Classes/ProjectCompleter.ps1 b/Source/Classes/ProjectCompleter.ps1 deleted file mode 100644 index a2b062643..000000000 --- a/Source/Classes/ProjectCompleter.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -using namespace System.Collections -using namespace System.Collections.Generic -using namespace System.Management.Automation - -class ProjectCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - $cachedProjects = [VSTeamProjectCache]::GetCurrent($false) - - foreach ($value in $cachedProjects) { - 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/ProjectValidateAttribute.ps1 b/Source/Classes/ProjectValidateAttribute.ps1 deleted file mode 100644 index 9340b7944..000000000 --- a/Source/Classes/ProjectValidateAttribute.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -using namespace System.Management.Automation - -class ProjectValidateAttribute : ValidateArgumentsAttribute { - [void] Validate( - [object] $arguments, - [EngineIntrinsics] $EngineIntrinsics) { - - # Do not fail on null or empty, leave that to other validation conditions - if ([string]::IsNullOrEmpty($arguments)) { - return - } - - $cachedProjects = [VSTeamProjectCache]::GetCurrent($false) - - if (($cachedProjects.count -gt 0) -and ($arguments -notin $cachedProjects)) { - throw [ValidationMetadataException]::new( - "'$arguments' is not a valid project. Valid projects are: '" + - ($cachedProjects -join "', '") + "'") - } - } -} \ No newline at end of file diff --git a/Source/Classes/Properties/launchSettings.json b/Source/Classes/Properties/launchSettings.json new file mode 100644 index 000000000..99d041f06 --- /dev/null +++ b/Source/Classes/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "vsteam-lib": { + "commandName": "Executable", + "executablePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe", + "commandLineArgs": "-NoExit -Command \"& { bu 5; .\\Build-Module.ps1 -skipLibBuild -ipmo; ata -profile blackshirt }\"" + } + } +} \ No newline at end of file diff --git a/Source/Classes/Provider/AccessControlEntry.cs b/Source/Classes/Provider/AccessControlEntry.cs new file mode 100644 index 000000000..35622082b --- /dev/null +++ b/Source/Classes/Provider/AccessControlEntry.cs @@ -0,0 +1,20 @@ +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class AccessControlEntry : Leaf + { + public long Deny { get; set; } + public long Allow { get; set; } + public string Descriptor { get; set; } + public PSObject ExtendedInfo { get; set; } + + public AccessControlEntry(PSObject obj) : + base(obj, obj.GetValue("descriptor"), obj.GetValue("descriptor"), null) + { + } + + public override string ToString() => $"{this.Descriptor}: Allow={this.Allow}, Deny={this.Deny}"; + } +} diff --git a/Source/Classes/Provider/AccessControlList.cs b/Source/Classes/Provider/AccessControlList.cs new file mode 100644 index 000000000..d90ec93dd --- /dev/null +++ b/Source/Classes/Provider/AccessControlList.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class AccessControlList : Leaf + { + public string Token { get; set; } + public bool InheritPermissions { get; set; } + public Hashtable Aces { get; } + + public AccessControlList(PSObject obj) : + base(obj, obj.GetValue("token"), obj.GetValue("token"), null) + { + this.Aces = new Hashtable(); + + var props = ((PSObject)obj.Members["acesDictionary"].Value).Properties; + + foreach (var prop in props) + { + var entry = new AccessControlEntry((PSObject)prop.Value); + this.Aces.Add(entry.Descriptor, entry); + } + } + + public override string ToString() => this.Token; + } +} diff --git a/Source/Classes/Provider/Account.cs b/Source/Classes/Provider/Account.cs new file mode 100644 index 000000000..9782fa030 --- /dev/null +++ b/Source/Classes/Provider/Account.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib.Provider +{ + public class Account : Directory + { + /// + /// This is called by unit testing framework and other constructors + /// + /// + /// + public Account(string name, IPowerShell powerShell) : + base(name, "Project", powerShell) + { + // Invalidate any cache of projects + ProjectCache.Invalidate(); + } + + /// + /// This will be called by SHiPS when a new drive is added. + /// + /// + [ExcludeFromCodeCoverage] + public Account(string name) : + this(name, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + + protected override object[] GetChildren() + { + var menus = new List() + { + new Directory("Agent Pools", "Pool", this.PowerShell), + new Directory("Extensions", "Extension", this.PowerShell), + new Directory("Feeds", "Feed", this.PowerShell) + }; + + if (Versions.TestGraphSupport()) + { + menus.Add(new Permissions("Permissions", this.PowerShell)); + } + + // This will add any projects + menus.AddRange(base.GetChildren()); + + return menus.ToArray(); + } + } +} diff --git a/Source/Classes/Provider/Action.cs b/Source/Classes/Provider/Action.cs new file mode 100644 index 000000000..858e29a8b --- /dev/null +++ b/Source/Classes/Provider/Action.cs @@ -0,0 +1,18 @@ +using System; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Action : Leaf + { + public long Bit { get; set; } + public Guid NamespaceId { get; set; } + public string DisplayName { get; set; } + + public Action(PSObject obj) : + base(obj, obj.GetValue("name"), obj.GetValue("bit").ToString(), null) + { + } + } +} diff --git a/Source/Classes/Provider/Agent.cs b/Source/Classes/Provider/Agent.cs new file mode 100644 index 000000000..a1de2ca0a --- /dev/null +++ b/Source/Classes/Provider/Agent.cs @@ -0,0 +1,48 @@ +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Agent : Directory + { + [XmlAttribute("osDescription")] + public string OS { get; set; } + public long PoolId { get; set; } + public bool Enabled { get; set; } + [XmlAttribute("id")] + public long AgentId { get; set; } + public string Status { get; set; } + public string Version { get; set; } + public PSObject SystemCapabilities { get; set; } + + public Agent(PSObject obj, long poolId, IPowerShell powerShell) : + base(obj, obj.GetValue("name"), "JobRequest", powerShell, null) + { + this.PoolId = poolId; + } + + [ExcludeFromCodeCoverage] + public Agent(PSObject obj, long poolId) : + this(obj, poolId, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + + protected override object[] GetChildren() + { + this.PowerShell.Commands.Clear(); + + var children = this.PowerShell.AddCommand(this.Command) + .AddParameter("PoolId", this.PoolId) + .AddParameter("AgentId", this.AgentId) + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this.PowerShell, children); + + return children.AddTypeName(this.TypeName); + } + } +} diff --git a/Source/Classes/Provider/AgentPool.cs b/Source/Classes/Provider/AgentPool.cs new file mode 100644 index 000000000..f15808d72 --- /dev/null +++ b/Source/Classes/Provider/AgentPool.cs @@ -0,0 +1,66 @@ +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Net.Sockets; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class AgentPool : Directory + { + /// + /// The id of the agent pool. This can be used to find and return + /// this item. + /// + public long Id { get; set; } + + /// + /// Used so this object can be piped to functions + /// that require a poolId like Get-VSTeamAgent + /// + [XmlAttribute("id")] + public long PoolId { get; set; } + + /// + /// The number of agents in the pool + /// + [XmlAttribute("size")] + public long Count { get; set; } + + /// + /// True when this is a hosted pool managed by Azure DevOps + /// + public bool IsHosted { get; set; } + + public AgentPool(PSObject obj, IPowerShell powerShell) : + base(obj, obj.GetValue("name"), "Agent", powerShell, null) + { + if (this.IsHosted) + { + this.DisplayMode = "d-r-s-"; + }; + } + + [ExcludeFromCodeCoverage] + public AgentPool(PSObject obj) : + this(obj, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + + protected override object[] GetChildren() + { + this.PowerShell.Commands.Clear(); + + var children = this.PowerShell.AddCommand(this.Command) + .AddParameter("PoolId", this.Id) + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this.PowerShell, children); + + // This is important so the correct formatting is applied + return children.AddTypeName(this.TypeName); + } + } +} diff --git a/Source/Classes/Provider/Attempt.cs b/Source/Classes/Provider/Attempt.cs new file mode 100644 index 000000000..ba93478c7 --- /dev/null +++ b/Source/Classes/Provider/Attempt.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Management.Automation; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Attempt : Directory + { + public long Id { get; set; } + public string Status { get; set; } + [XmlAttribute("attempt")] + public long AttemptNo { get; set; } + public IList Tasks { get; } + + public Attempt(PSObject obj, string projectName) : + base(obj, $"Attempt {obj.GetValue("attempt")}", "Task", null, projectName) + { + this.Tasks = new List(); + var phases = obj.GetValue("releaseDeployPhases"); + + if (phases.Length > 0) + { + var jobs = ((PSObject)phases[0]).GetValue("deploymentJobs"); + + if (jobs.Length > 0) + { + foreach (var item in ((PSObject)jobs[0]).GetValue("tasks")) + { + this.Tasks.Add(new Task((PSObject)item, this.ProjectName)); + } + } + } + } + + /// + /// Return the list with the correct type applied for formatting. + /// + /// + protected override object[] GetChildren() => this.Tasks.AddTypeName(this.TypeName); + } +} diff --git a/Source/Classes/Provider/Build.cs b/Source/Classes/Provider/Build.cs new file mode 100644 index 000000000..fc4bb562e --- /dev/null +++ b/Source/Classes/Provider/Build.cs @@ -0,0 +1,57 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Build : Leaf + { + public Queue Queue { get; } + public string Status { get; set; } + public string Result { get; set; } + public string BuildNumber { get; set; } + public DateTime? StartTime { get; set; } + public User RequestedBy { get; } + public User RequestedFor { get; } + public User LastChangedBy { get; } + public BuildDefinition BuildDefinition { get; } + public Project Project { get; } + + // Properties below were in the old type file and are + // here to break as little as possible for those that + // upgrade. + [XmlAttribute("definition.name")] + public string DefinitionName { get; set; } + [XmlAttribute("queue.id")] + public string QueueId { get; set; } + [XmlAttribute("queue.name")] + public string QueueName { get; set; } + [XmlAttribute("repository.type")] + public string RepositoryType { get; set; } + public string RequestedByUser => this.RequestedBy.DisplayName; + public string RequestedForUser => this.RequestedFor.DisplayName; + public string LastChangedByUser => this.LastChangedBy.DisplayName; + + public Build(PSObject obj, string projectName, IPowerShell powerShell) : + base(obj, obj.GetValue("buildNumber"), obj.GetValue("Id"), projectName) + + { + this.RequestedBy = new User(obj.GetValue("requestedBy")); + this.RequestedFor = new User(obj.GetValue("requestedFor")); + this.LastChangedBy = new User(obj.GetValue("lastChangedBy")); + + this.Project = new Project(obj.GetValue("project"), powerShell); + this.Queue = new Queue(obj.GetValue("queue"), projectName, powerShell); + this.BuildDefinition = new BuildDefinition(obj.GetValue("definition"), projectName, powerShell); + } + + [ExcludeFromCodeCoverage] + public Build(PSObject obj, string projectName) : + this(obj, projectName, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + } +} diff --git a/Source/Classes/Provider/BuildDefinition.cs b/Source/Classes/Provider/BuildDefinition.cs new file mode 100644 index 000000000..c57a8db6c --- /dev/null +++ b/Source/Classes/Provider/BuildDefinition.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class BuildDefinition : Directory + { + public long Id { get; set; } + public string Path { get; set; } + public long Revision { get; set; } + public IList Tags { get; } + public IList Demands { get; } + public IList Options { get; set; } + public IList Triggers { get; set; } + public IList RetentionRules { get; set; } + public object Variables { get; set; } + public object Repository { get; set; } + public GitRepository GitRepository { get; } + [XmlAttribute("repository.type")] + public string RepositoryType { get; set; } + public Queue Queue { get; } + public string BuildNumberFormat { get; set; } + public long JobCancelTimeoutInMinutes { get; set; } + public string JobAuthorizationScope { get; set; } + [XmlAttribute("createdDate")] + public DateTime CreatedOn { get; set; } + public User AuthoredBy { get; } + public IList Steps { get; } + public BuildDefinitionProcess Process { get; } + /// + /// Used to pass on pipeline to Get-VSTeamPermissionInheritance + /// + public string ResourceType => "BuildDefinition"; + + public BuildDefinition(PSObject obj, string projectName, IPowerShell powerShell) : + base(obj, obj.GetValue("name"), "BuildDefinition", powerShell, projectName) + { + this.Tags = obj.GetStringArray("tags"); + this.Demands = obj.GetStringArray("demands"); + + if (obj.HasValue("authoredBy")) + { + this.AuthoredBy = new User(obj.GetValue("authoredBy")); + } + + // Depending on the build definition you might have a build or + // process element. + if (obj.HasValue("build")) + { + var i = 1; + this.Steps = new List(); + foreach (var item in obj.GetValue("build")) + { + this.Steps.Add(new BuildDefinitionProcessPhaseStep((PSObject)item, i++, projectName)); + } + } + + if (obj.HasValue("process")) + { + this.Process = new BuildDefinitionProcess(obj.GetValue("process"), projectName, powerShell); + } + + if (obj.HasValue("queue")) + { + this.Queue = new Queue(obj.GetValue("queue"), this.ProjectName, powerShell); + } + + if (this.RepositoryType == "TfsGit") + { + this.GitRepository = new GitRepository(obj.GetValue("repository"), this.ProjectName, powerShell); + } + } + + [ExcludeFromCodeCoverage] + public BuildDefinition(PSObject obj, string projectName) : + this(obj, projectName, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + + public override string ToString() => this.Name; + + protected override object[] GetChildren() + { + // Wrap in a PSObject so a type can be applied so the correct + // formatter is selected + if (this.Steps != null) + { + return this.Steps.AddTypeName("vsteam_lib.Provider.BuildDefinitionProcessPhaseStep"); + } + + if (this.Process.Type == 1) + { + return this.Process.Phases.AddTypeName("vsteam_lib.Provider.BuildDefinitionProcessPhase"); + } + + var process = PSObject.AsPSObject(this.Process); + + if (this.Process.Type == 2) + { + process.AddTypeName("vsteam_lib.Provider.BuildDefinitionYamlProcess"); + } + + return new object[] { process }; + } + } +} \ No newline at end of file diff --git a/Source/Classes/Provider/BuildDefinitionProcess.cs b/Source/Classes/Provider/BuildDefinitionProcess.cs new file mode 100644 index 000000000..053ce9428 --- /dev/null +++ b/Source/Classes/Provider/BuildDefinitionProcess.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class BuildDefinitionProcess : Directory + { + /// + /// 1 = classic + /// 2 = YAML + /// + public long Type { get; set; } + public string YamlFilename { get; set; } + public IList Phases { get; } + + public BuildDefinitionProcess(PSObject obj, string projectName, IPowerShell powerShell) : + base(obj, "Process", string.Empty, powerShell, projectName) + { + if (this.Type == 1) + { + this.TypeName = "BuildDefinitionPhasedProcess"; + + this.Phases = new List(); + foreach (var item in obj.GetValue("phases")) + { + this.Phases.Add(new BuildDefinitionProcessPhase((PSObject)item, projectName, powerShell)); + } + } + else + { + this.DisplayMode = "------"; + this.TypeName = "BuildDefinitionYamlProcess"; + } + } + + public override string ToString() => this.Type == 1 ? $"Number of phases: {this.Phases.Count}" : this.YamlFilename; + } +} diff --git a/Source/Classes/Provider/BuildDefinitionProcessPhase.cs b/Source/Classes/Provider/BuildDefinitionProcessPhase.cs new file mode 100644 index 000000000..32a0d11cb --- /dev/null +++ b/Source/Classes/Provider/BuildDefinitionProcessPhase.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class BuildDefinitionProcessPhase : Directory + { + public object Target { get; set; } + public long StepCount { get; set; } + public string Condition { get; set; } + public string JobAuthorizationScope { get; set; } + public long JobCancelTimeoutInMinutes { get; set; } + public IList Steps { get; } + + public BuildDefinitionProcessPhase(PSObject obj, string projectName, IPowerShell powerShell) : + base(obj, obj.GetValue("name"), "BuildDefinitionProcessPhase", powerShell, projectName) + { + this.Steps = new List(); + + if (obj.HasValue("steps")) + { + var i = 1; + foreach (var item in obj.GetValue("steps")) + { + this.Steps.Add(new BuildDefinitionProcessPhaseStep((PSObject)item, i++, projectName)); + } + + this.StepCount = this.Steps.Count; + } + } + + protected override object[] GetChildren() + { + // Wrap in a PSObject so a type can be applied so the correct + // formatter is selected + var items = this.Steps.Select(p => PSObject.AsPSObject(p)).ToArray(); + Array.ForEach(items, i => i.AddTypeName("vsteam_lib.Provider.BuildDefinitionProcessPhaseStep")); + return items; + } + } +} diff --git a/Source/Classes/Provider/BuildDefinitionProcessPhaseStep.cs b/Source/Classes/Provider/BuildDefinitionProcessPhaseStep.cs new file mode 100644 index 000000000..54ce5f441 --- /dev/null +++ b/Source/Classes/Provider/BuildDefinitionProcessPhaseStep.cs @@ -0,0 +1,21 @@ +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class BuildDefinitionProcessPhaseStep : Leaf + { + public bool Enabled { get; set; } + public bool ContinueOnError { get; set; } + public bool AlwaysRun { get; set; } + public long TimeoutInMinutes { get; set; } + public object Inputs { get; set; } + public object Task { get; set; } + public string Condition { get; set; } + + public BuildDefinitionProcessPhaseStep(PSObject obj, int stepNumber, string projectName) : + base(obj, obj.GetValue("displayName"), stepNumber.ToString(), projectName) + { + } + } +} diff --git a/Source/Classes/Provider/ClassificationNode.cs b/Source/Classes/Provider/ClassificationNode.cs new file mode 100644 index 000000000..9b15a53b5 --- /dev/null +++ b/Source/Classes/Provider/ClassificationNode.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class ClassificationNode : Leaf + { + public Link Links { get; } + public string Url { get; set; } + public string Path { get; set; } + public Guid Identifier { get; set; } + public bool HasChildren { get; set; } + public string StructureType { get; set; } + public string ParentUrl => this.Links?.Parent; + public IList Children { get; } + public int NodeId => int.Parse(this.Id); + + public ClassificationNode(PSObject obj, string projectName) : + base(obj, obj.GetValue("name"), obj.GetValue("id"), projectName) + { + if (obj.HasValue("_links")) + { + this.Links = new Link(obj); + } + + if (obj.HasValue("children")) + { + this.Children = new List(); + + foreach (var item in obj.GetValue("children")) + { + this.Children.Add(new ClassificationNode((PSObject)item, this.ProjectName)); + } + } + } + } +} diff --git a/Source/Classes/Provider/Descriptor.cs b/Source/Classes/Provider/Descriptor.cs new file mode 100644 index 000000000..35c3010d1 --- /dev/null +++ b/Source/Classes/Provider/Descriptor.cs @@ -0,0 +1,21 @@ +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Descriptor : Leaf + { + public Link Links { get; } + + public Descriptor(PSObject obj) : + base(obj, obj.GetValue("value"), obj.GetValue("value"), null) + { + if (obj.HasValue("_links")) + { + this.Links = new Link(obj); + } + } + + public override string ToString() => base.Name; + } +} diff --git a/Source/Classes/Provider/Directory.cs b/Source/Classes/Provider/Directory.cs new file mode 100644 index 000000000..a0da8608c --- /dev/null +++ b/Source/Classes/Provider/Directory.cs @@ -0,0 +1,113 @@ +using Microsoft.PowerShell.SHiPS; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib.Provider +{ + public class Directory : SHiPSDirectory, IInternalObject + { + private string _typeName; + public string ProjectName { get; protected set; } + public PSObject InternalObject { get; } + protected IPowerShell PowerShell { get; } + + /// + /// I want the mode to resemble that of + /// a normal file system. + /// d - Directory + /// a - Archive + /// r - Read-only + /// h - Hidden + /// s - System + /// l - Reparse point, symlink, etc. + /// + public string DisplayMode { get; set; } = "d-----"; + + /// + /// The name of the command to execute to get the list of + /// child items. + /// + public string Command => ("Team" == this._typeName) ? "Get-VSTeam" : $"Get-VSTeam{this._typeName}"; + + /// + /// The type to insert into the type names so the correct format + /// is selected to display on screen. + /// + public string TypeName + { + get => $"vsteam_lib.Provider.{this._typeName}"; + set => this._typeName = value; + } + + /// + /// This version is for use with Unit tests and called by all other + /// constructors + /// + /// PowerShell object returned by REST Call + /// The name displayed by provider + /// The noun of the type to be applied to the child items + /// The PowerShell to use when calling other cmdlets + /// The name of the project used to query the child items + public Directory(PSObject obj, string name, string typeName, IPowerShell powerShell, string projectName) : + base(name) + { + Common.MoveProperties(this, obj); + + this.TypeName = typeName; + this.InternalObject = obj; + this.PowerShell = powerShell; + this.ProjectName = projectName; + } + + /// + /// This version is for use in classes still in PowerShell + /// + /// The name displayed by provider + /// The noun of the type to be applied to the child items + [ExcludeFromCodeCoverage] + public Directory(string name, string typeName, string projectName) : + this(null, name, typeName, new PowerShellWrapper(RunspaceMode.CurrentRunspace), projectName) + { + } + + /// + /// This version is for use when no Project name is required + /// + /// The name displayed by provider + /// The noun of the type to be applied to the child items + /// The PowerShell to use when calling other cmdlets + public Directory(string name, string typeName, IPowerShell powerShell) : + this(null, name, typeName, powerShell, null) + { + this.DisplayMode = "d-r-s-"; + } + + public override object[] GetChildItem() => this.GetChildren(); + + protected virtual object[] GetChildren() => this.GetPSObjects().ToArray(); + + protected virtual IEnumerable GetPSObjects() + { + this.PowerShell.Commands.Clear(); + + var cmd = this.PowerShell.AddCommand(this.Command); + + if (!string.IsNullOrEmpty(this.ProjectName)) + { + cmd = cmd.AddParameter("ProjectName", this.ProjectName); + } + + var children = cmd.AddCommand("Sort-Object") + .AddArgument("name") + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this.PowerShell, children); + + // This applies types to select correct formatter. + return children.AddTypeName(this.TypeName); + } + } +} diff --git a/Source/Classes/Provider/Environment.cs b/Source/Classes/Provider/Environment.cs new file mode 100644 index 000000000..2d3220510 --- /dev/null +++ b/Source/Classes/Provider/Environment.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Environment : Directory + { + public long Id { get; set; } + public long ReleaseId { get; } + public string Status { get; set; } + public long EnvironmentId => this.Id; + public List Attempts { get; } + + public Environment(PSObject obj, long releaseId, string projectName, IPowerShell powerShell) : + base(obj, obj.GetValue("name"), "Attempt", powerShell, projectName) + { + this.ReleaseId = releaseId; + + this.Attempts = new List(); + foreach (var item in obj.GetValue("deploySteps")) + { + this.Attempts.Add(new Attempt((PSObject)item, this.ProjectName)); + } + } + + [ExcludeFromCodeCoverage] + public Environment(PSObject obj, long releaseId, string projectName) : + this(obj, releaseId, projectName, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + + protected override object[] GetChildren() => this.Attempts.AddTypeName(this.TypeName); + } +} diff --git a/Source/Classes/Provider/Extension.cs b/Source/Classes/Provider/Extension.cs new file mode 100644 index 000000000..8c80a77f7 --- /dev/null +++ b/Source/Classes/Provider/Extension.cs @@ -0,0 +1,20 @@ +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Extension : Leaf + { + public string Version { get; set; } + public string ExtensionId { get; set; } + public string PublisherId { get; set; } + public string PublisherName { get; set; } + public InstallState InstallState { get; } + + public Extension(PSObject obj) : + base(obj, obj.GetValue("extensionName"), obj.GetValue("extensionId"), null) + { + this.InstallState = new InstallState(obj.GetValue("installState")); + } + } +} diff --git a/Source/Classes/Provider/Feed.cs b/Source/Classes/Provider/Feed.cs new file mode 100644 index 000000000..f1b73fc75 --- /dev/null +++ b/Source/Classes/Provider/Feed.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Feed : Leaf + { + public string Url { get; set; } + public string Description { get; set; } + public bool? UpstreamEnabled { get; set; } + public IList UpstreamSources { get; } + + public Feed(PSObject obj) : + base(obj, obj.GetValue("name"), obj.GetValue("id"), null) + { + var sources = new List(); + foreach (PSObject item in ((object[])obj.Properties["upstreamSources"].Value)) + { + sources.Add(new UpstreamSource(item)); + } + + this.UpstreamSources = sources; + } + } +} diff --git a/Source/Classes/Provider/GitCommitRef.cs b/Source/Classes/Provider/GitCommitRef.cs new file mode 100644 index 000000000..79d119137 --- /dev/null +++ b/Source/Classes/Provider/GitCommitRef.cs @@ -0,0 +1,29 @@ +using System.Management.Automation; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class GitCommitRef : Leaf + { + public GitUserDate Author { get; } + public GitUserDate Committer { get; } + public string Comment { get; set; } + public string CommitId { get; set; } + public string RemoteUrl { get; set; } + public string Url { get; set; } + [XmlAttribute("changeCounts.Add")] + public long Adds { get; set; } + [XmlAttribute("changeCounts.Edit")] + public long Edits { get; set; } + [XmlAttribute("changeCounts.Delete")] + public long Deletes { get; set; } + + public GitCommitRef(PSObject obj, string projectName) : + base(obj, obj.GetValue("comment"), obj.GetValue("commitId"), projectName) + { + this.Author = new GitUserDate(obj.GetValue("author"), projectName); + this.Committer = new GitUserDate(obj.GetValue("committer"), projectName); + } + } +} diff --git a/Source/Classes/Provider/GitRef.cs b/Source/Classes/Provider/GitRef.cs new file mode 100644 index 000000000..039e76cdd --- /dev/null +++ b/Source/Classes/Provider/GitRef.cs @@ -0,0 +1,22 @@ +using System.Management.Automation; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class GitRef : Leaf + { + /// The name passed to the base class is changed. For example if you pass + /// refs/heads/appcenter as the name it is converted into refs-heads-appcenter. + /// So I store it twice so I have the original value as well. + [XmlAttribute("name")] + public string RefName { get; set; } + public User Creator { get; } + + public GitRef(PSObject obj, string projectName) : + base(obj, obj.GetValue("name"), obj.GetValue("objectId"), projectName) + { + this.Creator = new User(obj.GetValue("creator")); + } + } +} diff --git a/Source/Classes/Provider/GitRepository.cs b/Source/Classes/Provider/GitRepository.cs new file mode 100644 index 000000000..e88c0a56b --- /dev/null +++ b/Source/Classes/Provider/GitRepository.cs @@ -0,0 +1,60 @@ +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class GitRepository : Directory + { + public long Size { get; set; } + public string Id { get; set; } + public string Url { get; set; } + public Project Project { get; } + public string SSHUrl { get; set; } + public string RemoteUrl { get; set; } + public string DefaultBranch { get; set; } + /// + /// Used to pass on pipeline to Get-VSTeamPermissionInheritance + /// + public string ResourceType => "Repository"; + /// + /// This is used for passing the id down the pipeline into + /// functions like Get-VSTeamGitCommit + /// + public string RepositoryID => this.Id; + + public GitRepository(PSObject obj, string projectName, IPowerShell powerShell) : + base(obj, obj.GetValue("Name"), "GitRef", powerShell, projectName) + { + if (obj.HasValue("project")) + { + this.Project = new Project(obj.GetValue("project"), powerShell); + this.ProjectName = this.Project.Name; + } + } + + [ExcludeFromCodeCoverage] + public GitRepository(PSObject obj, string projectName) : + this(obj, projectName, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + + protected override object[] GetChildren() + { + this.PowerShell.Commands.Clear(); + + var children = this.PowerShell.AddCommand(this.Command) + .AddParameter("ProjectName", this.ProjectName) + .AddParameter("RepositoryId", this.Id) + .AddCommand("Sort-Object") + .AddArgument("name") + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this.PowerShell, children); + + // This applies types to select correct formatter. + return children.AddTypeName(this.TypeName); + } + } +} diff --git a/Source/Classes/Provider/GitRepositoryPermissions.cs b/Source/Classes/Provider/GitRepositoryPermissions.cs new file mode 100644 index 000000000..b7ea1f114 --- /dev/null +++ b/Source/Classes/Provider/GitRepositoryPermissions.cs @@ -0,0 +1,25 @@ +using System; + +namespace vsteam_lib +{ + [Flags] + public enum GitRepositoryPermissions + { + Administer = 1, + GenericRead = 2, + GenericContribute = 4, + ForcePush = 8, + CreateBranch = 16, + CreateTag = 32, + ManageNote = 64, + PolicyExempt = 128, + CreateRepository = 256, + DeleteRepository = 512, + RenameRepository = 1024, + EditPolicies = 2048, + RemoveOthersLocks = 4096, + ManagePermissions = 8192, + PullRequestContribute = 16384, + PullRequestBypassPolicy = 32768 + } +} diff --git a/Source/Classes/Provider/GitUserDate.cs b/Source/Classes/Provider/GitUserDate.cs new file mode 100644 index 000000000..d2fdd5ec6 --- /dev/null +++ b/Source/Classes/Provider/GitUserDate.cs @@ -0,0 +1,17 @@ +using System; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class GitUserDate : Leaf + { + public string Email { get; set; } + public DateTime Date { get; set; } + + public GitUserDate(PSObject obj, string projectname) : + base(obj, obj.GetValue("email"), obj.GetValue("email"), projectname) + { + } + } +} diff --git a/Source/Classes/Provider/Group.cs b/Source/Classes/Provider/Group.cs new file mode 100644 index 000000000..10b12217d --- /dev/null +++ b/Source/Classes/Provider/Group.cs @@ -0,0 +1,20 @@ +using System.Management.Automation; + +namespace vsteam_lib +{ + public class Group : SecurityLeaf + { + public string Description { get; set; } + + /// + /// Used to pass down pipelines + /// + public string ContainerDescriptor => this.Descriptor; + + public Group(PSObject obj) : + base(obj) + { + this.ProjectName = this.PrincipalName.Split('\\')[0].Replace("[", string.Empty).Replace("]", string.Empty); + } + } +} diff --git a/Source/Classes/Provider/IInternalObject.cs b/Source/Classes/Provider/IInternalObject.cs new file mode 100644 index 000000000..76db72959 --- /dev/null +++ b/Source/Classes/Provider/IInternalObject.cs @@ -0,0 +1,9 @@ +using System.Management.Automation; + +namespace vsteam_lib.Provider +{ + public interface IInternalObject + { + PSObject InternalObject { get; } + } +} \ No newline at end of file diff --git a/Source/Classes/Provider/IdentityPermissions.cs b/Source/Classes/Provider/IdentityPermissions.cs new file mode 100644 index 000000000..51fe3ac11 --- /dev/null +++ b/Source/Classes/Provider/IdentityPermissions.cs @@ -0,0 +1,15 @@ +using System; + +namespace vsteam_lib +{ + [Flags] + public enum IdentityPermissions + { + Read = 1, + Write = 2, + Delete = 4, + ManageMembership = 8, + CreateScope = 16, + RestoreScope = 32 + } +} diff --git a/Source/Classes/Provider/InstallState.cs b/Source/Classes/Provider/InstallState.cs new file mode 100644 index 000000000..0bb2cb450 --- /dev/null +++ b/Source/Classes/Provider/InstallState.cs @@ -0,0 +1,22 @@ +using System; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class InstallState : IInternalObject + { + public string Flags { get; set; } + public DateTime LastUpdated { get; set; } + public PSObject InternalObject { get; } + + public InstallState(PSObject obj) + { + this.InternalObject = obj; + + Common.MoveProperties(this, obj); + } + + public override string ToString() => $"Flags: {this.Flags}, Last Updated: {this.LastUpdated}"; + } +} diff --git a/Source/Classes/Provider/JobRequest.cs b/Source/Classes/Provider/JobRequest.cs new file mode 100644 index 000000000..10bab76f4 --- /dev/null +++ b/Source/Classes/Provider/JobRequest.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class JobRequest : Leaf + { + [XmlAttribute("planType")] + public string Type { get; set; } + public string Result { get; set; } + [XmlAttribute("definition.name")] + public string Pipeline { get; set; } + public TimeSpan Duration { get; } + public DateTime QueueTime { get; set; } + [XmlAttribute("receiveTime")] + public DateTime? StartTime { get; set; } + public DateTime? FinishTime { get; set; } + [XmlAttribute("assignTime")] + public DateTime? AssignedTime { get; set; } + public IEnumerable Demands { get; } + + public JobRequest(PSObject obj) : + base(obj, obj.GetValue("owner.Name"), obj.GetValue("requestId"), null) + { + this.Demands = obj.GetValue("demands").Select(o => o.ToString()).ToArray(); + + if (!obj.HasValue("result") && !obj.HasValue("assignTime")) + { + this.Result = "queued"; + } + else if (!obj.HasValue("result") && obj.HasValue("assignTime")) + { + this.Result = "running"; + } + + if (this.FinishTime.HasValue) + { + this.Duration = this.FinishTime.Value - this.StartTime.Value; + } + } + } +} diff --git a/Source/Classes/Provider/Leaf.cs b/Source/Classes/Provider/Leaf.cs new file mode 100644 index 000000000..12202f7d7 --- /dev/null +++ b/Source/Classes/Provider/Leaf.cs @@ -0,0 +1,33 @@ +using Microsoft.PowerShell.SHiPS; +using System.Management.Automation; + +namespace vsteam_lib.Provider +{ + public class Leaf : SHiPSLeaf, IInternalObject + { + public string Id { get; protected set; } + public string ProjectName { get; protected set; } + public PSObject InternalObject { get; } + + /// + /// I want the mode to resemble that of + /// a normal file system. + /// d - Directory + /// a - Archive + /// r - Read-only + /// h - Hidden + /// s - System + /// l - Reparse point, symlink, etc. + /// + public string DisplayMode { get; } = "------"; + + public Leaf(PSObject obj, string name, string id, string projectName) : base(name) + { + Common.MoveProperties(this, obj); + + this.Id = id; + this.InternalObject = obj; + this.ProjectName = projectName; + } + } +} diff --git a/Source/Classes/Provider/Link.cs b/Source/Classes/Provider/Link.cs new file mode 100644 index 000000000..29ca064e1 --- /dev/null +++ b/Source/Classes/Provider/Link.cs @@ -0,0 +1,66 @@ +using System.Management.Automation; +using System.Text; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Link : IInternalObject + { + [XmlAttribute("_links.self.href")] + public string Self { get; set; } + + [XmlAttribute("_links.parent.href")] + public string Parent { get; set; } + + [XmlAttribute("_links.memberships.href")] + public string Memberships { get; set; } + + [XmlAttribute("_links.membershipState.href")] + public string MembershipState { get; set; } + + [XmlAttribute("_links.storageKey.href")] + public string StorageKey { get; set; } + + [XmlAttribute("_links.avatar.href")] + public string Avatar { get; set; } + + [XmlAttribute("_links.web.href")] + public string Web { get; set; } + + [XmlAttribute("_links.subject.href")] + public string Subject { get; set; } + + public PSObject InternalObject { get; } + + public Link(PSObject obj) + { + this.InternalObject = obj; + + Common.MoveProperties(this, obj); + } + + public override string ToString() + { + var sb = new StringBuilder(); + + AddLink(sb, nameof(this.Self), this.Self); + AddLink(sb, nameof(this.Parent), this.Parent); + AddLink(sb, nameof(this.MembershipState), this.MembershipState); + AddLink(sb, nameof(this.StorageKey), this.StorageKey); + AddLink(sb, nameof(this.Avatar), this.Avatar); + AddLink(sb, nameof(this.Web), this.Web); + AddLink(sb, nameof(this.Subject), this.Subject); + + return sb.ToString(); + } + + private void AddLink(StringBuilder sb, string name, string value) + { + if(!string.IsNullOrEmpty(value)) + { + sb.AppendLine($"{name}: {value}"); + } + } + } +} diff --git a/Source/Classes/Provider/PSObjectExtensionMethods.cs b/Source/Classes/Provider/PSObjectExtensionMethods.cs new file mode 100644 index 000000000..3aca9ec1d --- /dev/null +++ b/Source/Classes/Provider/PSObjectExtensionMethods.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace vsteam_lib.Provider +{ + public static class PSObjectExtensionMethods + { + public static IList GetStringArray(this PSObject obj, string name) + { + var values = new List(); + + if (obj.HasValue(name)) + { + foreach (var item in ((object[])obj.Properties[name].Value)) + { + values.Add(item.ToString()); + } + + return values; + } + + return null; + } + + public static string GetValue(this PSObject obj, string name) + { + // See if the name contains a period. If so you have to + // drill down to the object. Everything before the final + // object treat as a PSObject + var parts = name.Split('.'); + + if (parts.Length > 1) + { + var nextObj = obj; + + for (var i = 0; i < parts.Length - 1; i++) + { + nextObj = nextObj.GetValue(parts[i]); + } + + return nextObj.Properties[parts[parts.GetUpperBound(0)]]?.Value.ToString(); + } + else + { + // The property might be null and the value of the property might + // be null. Protect for both with two ?. below. + return obj.Properties[name]?.Value?.ToString(); + } + } + + /// + /// Depending on what version of an API you call not all properties are returned. + /// This method does all the testing to if the property is there and if so returns + /// the value. + /// + /// the type of the value to return + /// the PSObject returned by PowerShell + /// name of the property to get return + /// The value if present or the default value of T + public static T GetValue(this PSObject obj, string name) + { + var result = default(T); + var typeofT = typeof(T); + var baseType = Nullable.GetUnderlyingType(typeofT); + var isNullable = baseType != null; + + // See if the name contains a period. If so you have to + // drill down to the object. Everything before the final + // object treat as a PSObject + var parts = name.Split('.'); + + if (parts.Length > 1) + { + var nextObj = obj; + + for (var i = 0; i < parts.Length - 1; i++) + { + nextObj = nextObj.GetValue(parts[i]); + } + + // nextObj could be null if the property is not found + if (nextObj != null) + { + result = nextObj.GetValue(parts[parts.GetUpperBound(0)]); + } + } + else + { + if (obj.Properties.Match(name).Count > 0) + { + if (typeofT == typeof(string)) + { + object temp = obj.Properties[name].Value.ToString(); + + // This allows any type to be returned as a string + result = (T)System.Convert.ChangeType(temp, typeofT); + } + else + { + // I am using Change Type as a backup because depending on + // the version of PowerShell you are using some items are + // returned as an int32 or int64 for the same property. This + // should catch any invalid cast exceptions and still convert. + // I can't use Change Type for everything because it is + // invalid to cast from a DateTime to a null-able DateTime but + // a direct cast works. So try a direct cast and if that fails. + // I also noticed DateTimes coming across as string in + // PowerShell 5 but DateTimes in PowerShell 7. + var temp = obj.Properties[name].Value; + try + { + result = (T)temp; + } + catch (System.InvalidCastException ivce) + { + System.Diagnostics.Debug.WriteLine(ivce.Message); + + // Change Type cannot change to a null-able Type. So see if + // this is a null-able type. + if (isNullable) + { + switch (baseType.Name) + { + case "DateTime": + object tempDate = DateTime.Parse(temp.ToString()); + result = (T)tempDate; + break; + } + } + else + { + result = (T)System.Convert.ChangeType(temp, typeofT); + } + } + } + } + } + + return result; + } + + public static bool HasValue(this PSObject obj, string name) => obj.Properties.Match(name).Count > 0; + + /// + /// The type is used to identify the correct formatter to use. + /// The format for when it is returned by the function and + /// returned by the provider are different. Adding a type name + /// identifies how to format the type. + /// When returned by calling the function and not the provider. + /// This will be formatted without a mode column. + /// When returned by calling the provider. + /// This will be formatted with a mode column like a file or + /// directory. + /// + /// + /// + public static void AddTypeName(this PSObject obj, string typeName) + { + if (!obj.TypeNames.Contains(typeName)) + { + obj.TypeNames.Insert(0, typeName); + } + } + + public static PSObject[] AddTypeName(this IEnumerable list, string typeName) + { + var items = list.Select(s => PSObject.AsPSObject(s)).ToArray(); + + Array.ForEach(items, s => s.AddTypeName(typeName)); + + return items; + } + } +} diff --git a/Source/Classes/Provider/Permissions.cs b/Source/Classes/Provider/Permissions.cs new file mode 100644 index 000000000..0c99d3445 --- /dev/null +++ b/Source/Classes/Provider/Permissions.cs @@ -0,0 +1,21 @@ +using System.Management.Automation.Abstractions; + +namespace vsteam_lib.Provider +{ + internal class Permissions : Directory + { + public Permissions(string name, IPowerShell powerShell) : + base(name, null, powerShell) + { + } + + protected override object[] GetChildren() + { + return new object[] + { + new Directory("Groups", "Group", this.PowerShell), + new Directory("Users", "User", this.PowerShell), + }; + } + } +} diff --git a/Source/Classes/Provider/Process.cs b/Source/Classes/Provider/Process.cs new file mode 100644 index 000000000..7aa29357e --- /dev/null +++ b/Source/Classes/Provider/Process.cs @@ -0,0 +1,31 @@ +using System.Management.Automation; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Process : Leaf + { + public string TypeId { get; set; } + public string Description { get; set; } + public bool IsEnabled { get; set; } + public bool IsDefault { get; set; } + [XmlAttribute("customizationType")] + public string Type { get; set; } + public string ProcessTemplate => this.Name; + public string ParentProcessTypeId { get; set; } + + public Process(PSObject obj) : + base(obj, obj.GetValue("name"), obj.GetValue("id"), null) + { + // Depending on what API was used you might get and ID or a TypeId back. + // If you get a TypeId you need to set the ID now + if (string.IsNullOrEmpty(this.Id)) + { + this.Id = this.TypeId; + } + } + + public override string ToString() => this.Name; + } +} diff --git a/Source/Classes/Provider/Project.cs b/Source/Classes/Provider/Project.cs new file mode 100644 index 000000000..a0e8eb8e7 --- /dev/null +++ b/Source/Classes/Provider/Project.cs @@ -0,0 +1,64 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Project : Directory + { + public string Id { get; set; } + public string Url { get; set; } + public string State { get; set; } + public long Revision { get; set; } + public string Visibility { get; set; } + public string Description { get; set; } + + /// + /// 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. + /// + public new string ProjectName => base.ProjectName; + + /// + /// Used for testing + /// + public Project(PSObject obj, IPowerShell powerShell) : + base(obj, obj.GetValue("name"), null, powerShell, obj.GetValue("name")) + { + } + + /// + /// Used by PowerShell + /// + [ExcludeFromCodeCoverage] + public Project(PSObject obj) : + this(obj, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + + public override string ToString() => base.Name; + + protected override object[] GetChildren() => new object[] + { + new Directory(null, "Build Definitions", "BuildDefinition", this.PowerShell, this.Name), + new Directory(null, "Builds", "Build", this.PowerShell, this.Name), + new Directory(null, "Queues", "Queue", this.PowerShell, this.Name), + new Directory(null, "Release Definitions", "ReleaseDefinition", this.PowerShell, this.Name), + new Releases(this.PowerShell, this.Name), + new Directory(null, "Repositories", "GitRepository", this.PowerShell, this.Name), + new Directory(null, "Teams", "Team", this.PowerShell, this.Name), + }; + } +} diff --git a/Source/Classes/Provider/ProjectPermissions.cs b/Source/Classes/Provider/ProjectPermissions.cs new file mode 100644 index 000000000..57d0372ee --- /dev/null +++ b/Source/Classes/Provider/ProjectPermissions.cs @@ -0,0 +1,33 @@ +using System; + +namespace vsteam_lib +{ + [Flags] + public enum ProjectPermissions + { + GENERIC_READ = 1, + GENERIC_WRITE = 2, + DELETE = 4, + PUBLISH_TEST_RESULTS = 8, + ADMINISTER_BUILD = 16, + START_BUILD = 32, + EDIT_BUILD_STATUS = 64, + UPDATE_BUILD = 128, + DELETE_TEST_RESULTS = 256, + VIEW_TEST_RESULTS = 512, + MANAGE_TEST_ENVIRONMENTS = 2048, + MANAGE_TEST_CONFIGURATIONS = 4096, + WORK_ITEM_DELETE = 8192, + WORK_ITEM_MOVE = 16384, + WORK_ITEM_PERMANENTLY_DELETE = 32768, + RENAME = 65536, + MANAGE_PROPERTIES = 131072, + MANAGE_SYSTEM_PROPERTIES = 262144, + BYPASS_PROPERTY_CACHE = 524288, + BYPASS_RULES = 1048576, + SUPPRESS_NOTIFICATIONS = 2097152, + UPDATE_VISIBILITY = 4194304, + CHANGE_PROCESS = 8388608, + AGILETOOLS_BACKLOG = 16777216 + } +} diff --git a/Source/Classes/Provider/Queue.cs b/Source/Classes/Provider/Queue.cs new file mode 100644 index 000000000..5f6998768 --- /dev/null +++ b/Source/Classes/Provider/Queue.cs @@ -0,0 +1,28 @@ +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Queue : Leaf + { + public AgentPool Pool { get; } + + [XmlAttribute("pool.name")] + public string PoolName { get; set; } + + public Queue(PSObject obj, string projectName, IPowerShell powerShell) : + base(obj, obj.GetValue("name"), obj.GetValue("id"), projectName) + { + this.Pool = new AgentPool(obj.GetValue("pool"), powerShell); + } + + [ExcludeFromCodeCoverage] + public Queue(PSObject obj, string projectName) : + this(obj, projectName, new PowerShellWrapper(RunspaceMode.CurrentRunspace)) + { + } + } +} diff --git a/Source/Classes/Provider/Release.cs b/Source/Classes/Provider/Release.cs new file mode 100644 index 000000000..e73dea531 --- /dev/null +++ b/Source/Classes/Provider/Release.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Release : Directory + { + public long Id { get; set; } + public string Status { get; set; } + public User CreatedBy { get; } + public User ModifiedBy { get; } + public DateTime CreatedOn { get; set; } + public ReleaseDefinition ReleaseDefinition { get; } + public List Environments { get; private set; } + public object Variables { get; set; } + public Project Project { get; } + + // Properties below were in the old type file and are + // here to break as little as possible for those that + // upgrade. + public long ReleaseId => this.Id; + public string ProjectId => this.Project.Id; + public string DefinitionId => this.ReleaseDefinition.Id; + public string CreatedByUser => this.CreatedBy.DisplayName; + public string DefinitionName => this.ReleaseDefinition.Name; + public string ModifiedByUser => this.ModifiedBy.DisplayName; + + public Release(PSObject obj, IPowerShell powerShell, string projectName) : + base(obj, obj.GetValue("name"), "Release", powerShell, projectName) + { + this.CreatedBy = new User(obj.GetValue("createdBy")); + this.ModifiedBy = new User(obj.GetValue("modifiedBy")); + + this.Project = new Project(obj.GetValue("projectReference"), powerShell); + + this.PopulateEnvironments(obj); + + this.ReleaseDefinition = new ReleaseDefinition(obj.GetValue("releaseDefinition"), projectName); + } + + [ExcludeFromCodeCoverage] + public Release(PSObject obj, string projectName) : + this(obj, new PowerShellWrapper(RunspaceMode.CurrentRunspace), projectName) + { + } + + private void PopulateEnvironments(PSObject obj) + { + this.Environments = new List(); + if (obj.HasValue("environments")) + { + foreach (var item in obj.GetValue("environments")) + { + this.Environments.Add(PSObject.AsPSObject(new Environment((PSObject)item, this.Id, this.ProjectName, this.PowerShell))); + } + } + } + + protected override object[] GetChildren() + { + this.Environments = new List(this.GetPSObjects()); + + return this.Environments.ToArray(); + } + + protected override IEnumerable GetPSObjects() + { + this.PowerShell.Commands.Clear(); + + // We have to call this again because the amount of data you get back when you pass in the + // Id must greater than when you don't. + var children = this.PowerShell.AddCommand(this.Command) + .AddParameter("ProjectName", this.ProjectName) + .AddParameter("id", this.Id) + .AddParameter("Expand", "Environments") + .AddCommand("Select-Object") + .AddParameter("ExpandProperty", "Environments") + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this.PowerShell, children); + + // This applies types to select correct formatter. + return children.AddTypeName("vsteam_lib.Provider.Environment"); + } + } +} diff --git a/Source/Classes/Provider/ReleaseDefinition.cs b/Source/Classes/Provider/ReleaseDefinition.cs new file mode 100644 index 000000000..59c89cf2c --- /dev/null +++ b/Source/Classes/Provider/ReleaseDefinition.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class ReleaseDefinition : Leaf + { + public string Url { get; set; } + public string Path { get; set; } + public long Revision { get; set; } + public IList Tags { get; } + public string Description { get; set; } + public bool IsDeleted { get; set; } + public IList Triggers { get; set; } + public object Artifacts { get; set; } + public object Variables { get; set; } + public object Properties { get; set; } + public object Environments { get; set; } + public object VariableGroups { get; set; } + public string ReleaseNameFormat { get; set; } + public DateTime CreatedOn { get; set; } + public DateTime ModifiedOn { get; set; } + public User CreatedBy { get; } + public User ModifiedBy { get; } + public Link Links { get; } + /// + /// Used to pass on pipeline to Get-VSTeamPermissionInheritance + /// + public string ResourceType => "ReleaseDefinition"; + /// + /// Before this class was added to the provider there + /// was a type file to expose createdByUser. The type + /// was deleted when this class was added. So this + /// property is for backwards compatibility. + /// + public string CreatedByUser => this.CreatedBy.DisplayName; + + public ReleaseDefinition(PSObject obj, string projectName) : + base(obj, obj.GetValue("name"), obj.GetValue("id"), projectName) + { + this.Links = new Link(obj); + this.Tags = obj.GetStringArray("tags"); + + // These may not be present when nested in a release + if (obj.HasValue("createdBy")) + { + this.CreatedBy = new User(obj.GetValue("createdBy")); + } + + if (obj.HasValue("modifiedBy")) + { + this.ModifiedBy = new User(obj.GetValue("modifiedBy")); + } + } + } +} diff --git a/Source/Classes/Provider/Releases.cs b/Source/Classes/Provider/Releases.cs new file mode 100644 index 000000000..e57c7c8eb --- /dev/null +++ b/Source/Classes/Provider/Releases.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using System.Management.Automation; +using System.Management.Automation.Abstractions; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Releases : Directory + { + public Releases(IPowerShell powerShell, string projectName) : + base(null, "Releases", "Release", powerShell, projectName) + { + } + + protected override IEnumerable GetPSObjects() + { + this.PowerShell.Commands.Clear(); + + var children = this.PowerShell.AddCommand(this.Command) + .AddParameter("ProjectName", this.ProjectName) + .AddParameter("Expand", "Environments") + .AddCommand("Sort-Object") + .AddArgument("name") + .Invoke(); + + PowerShellWrapper.LogPowerShellError(this.PowerShell, children); + + // This applies types to select correct formatter. + return children.AddTypeName(this.TypeName); + } + } +} diff --git a/Source/Classes/Provider/SecurityLeaf.cs b/Source/Classes/Provider/SecurityLeaf.cs new file mode 100644 index 000000000..709a82db8 --- /dev/null +++ b/Source/Classes/Provider/SecurityLeaf.cs @@ -0,0 +1,27 @@ +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public abstract class SecurityLeaf : Leaf + { + public Link Links { get; } + public string Url { get; set; } + public string Domain { get; set; } + public string Origin { get; set; } + public string OriginId { get; set; } + public string Descriptor { get; set; } + public string SubjectKind { get; set; } + public string DisplayName { get; set; } + public string MailAddress { get; set; } + public string PrincipalName { get; set; } + + protected SecurityLeaf(PSObject obj) : base(obj, obj.GetValue("displayName"), obj.GetValue("descriptor"), null) + { + if (obj.HasValue("_links")) + { + this.Links = new Link(obj); + } + } + } +} diff --git a/Source/Classes/Provider/SecurityNamespace.cs b/Source/Classes/Provider/SecurityNamespace.cs new file mode 100644 index 000000000..9f3f0be9e --- /dev/null +++ b/Source/Classes/Provider/SecurityNamespace.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class SecurityNamespace : Leaf + { + public string DisplayName { get; set; } + public string SeparatorValue { get; set; } + public long ElementLength { get; set; } + public long WritePermission { get; set; } + public long ReadPermission { get; set; } + public string DataspaceCategory { get; set; } + public string StructureValue { get; set; } + public string ExtensionType { get; set; } + public bool IsRemotable { get; set; } + public bool UseTokenTranslator { get; set; } + public long SystemBitMask { get; set; } + public IList Actions { get; } + + public SecurityNamespace(PSObject obj) : + base(obj, obj.GetValue("name"), obj.GetValue("namespaceId"), null) + { + this.Actions = new List(); + + foreach (var item in obj.GetValue("actions")) + { + this.Actions.Add(new Action((PSObject)item)); + } + } + + public override string ToString() => this.Name; + } +} diff --git a/Source/Classes/Provider/Task.cs b/Source/Classes/Provider/Task.cs new file mode 100644 index 000000000..f5e0f7abc --- /dev/null +++ b/Source/Classes/Provider/Task.cs @@ -0,0 +1,17 @@ +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Task : Leaf + { + public string LogUrl { get; set; } + public string Status { get; set; } + public string AgentName { get; set; } + + public Task(PSObject obj, string projectName) : + base(obj, obj.GetValue("name"), obj.GetValue("id"), projectName) + { + } + } +} diff --git a/Source/Classes/Provider/Team.cs b/Source/Classes/Provider/Team.cs new file mode 100644 index 000000000..c16e371c5 --- /dev/null +++ b/Source/Classes/Provider/Team.cs @@ -0,0 +1,15 @@ +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class Team : Leaf + { + public string Description { get; set; } + + public Team(PSObject obj, string projectName) : + base(obj, obj.GetValue("name"), obj.GetValue("id"), projectName) + { + } + } +} diff --git a/Source/Classes/Provider/UpstreamSource.cs b/Source/Classes/Provider/UpstreamSource.cs new file mode 100644 index 000000000..736757597 --- /dev/null +++ b/Source/Classes/Provider/UpstreamSource.cs @@ -0,0 +1,24 @@ +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class UpstreamSource : IInternalObject + { + public string ID { get; set; } + public string Name { get; set; } + public string Status { get; set; } + public string Protocol { get; set; } + public string Location { get; set; } + public string DisplayLocation { get; set; } + public string UpstreamSourceType { get; set; } + public PSObject InternalObject { get; } + + public UpstreamSource(PSObject obj) + { + this.InternalObject = obj; + + Common.MoveProperties(this, obj); + } + } +} diff --git a/Source/Classes/Provider/User.cs b/Source/Classes/Provider/User.cs new file mode 100644 index 000000000..96404796b --- /dev/null +++ b/Source/Classes/Provider/User.cs @@ -0,0 +1,42 @@ +using System.Management.Automation; + +namespace vsteam_lib +{ + public class User : SecurityLeaf + { + private string uniqueName; + + public string MetaType { get; set; } + + /// + /// This might be set if read from a Build as a nested User. If + /// read from other functions this will not be set and the MailAddress + /// should be returned. + /// + public string UniqueName + { + get + { + if(string.IsNullOrEmpty(this.uniqueName)) + { + return this.MailAddress; + } + + return this.uniqueName; + } + + set => this.uniqueName = value; + } + + /// + /// Used to pass down pipelines + /// + public string MemberDescriptor => this.Descriptor; + + public User(PSObject obj) : base(obj) + { + } + + public override string ToString() => base.DisplayName; + } +} diff --git a/Source/Classes/Provider/UserEntitlement.cs b/Source/Classes/Provider/UserEntitlement.cs new file mode 100644 index 000000000..6af9fb86b --- /dev/null +++ b/Source/Classes/Provider/UserEntitlement.cs @@ -0,0 +1,38 @@ +using System; +using System.Management.Automation; +using System.Xml.Serialization; +using vsteam_lib.Provider; + +namespace vsteam_lib +{ + public class UserEntitlement : Leaf + { + public string UniqueName => this.User.UniqueName; + + public string DisplayName => this.User.DisplayName; + + public string Email => this.User.MailAddress; + + public string UserName => this.User.DisplayName; + + [XmlAttribute("accessLevel.licenseDisplayName")] + public string AccessLevelName { get; set; } + + public DateTime LastAccessedDate { get; set; } + + public User User { get; } + + public UserEntitlement(PSObject obj, string projectName) : + base(obj, null, obj.GetValue("id"), projectName) + { + this.User = new User(obj.GetValue("user")); + } + + public UserEntitlement(PSObject obj) : + this(obj, null) + { + } + + public override string ToString() => this.DisplayName; + } +} diff --git a/Source/Classes/Provider/WorkItemAreaPermissions.cs b/Source/Classes/Provider/WorkItemAreaPermissions.cs new file mode 100644 index 000000000..7a250e0c3 --- /dev/null +++ b/Source/Classes/Provider/WorkItemAreaPermissions.cs @@ -0,0 +1,17 @@ +using System; + +namespace vsteam_lib +{ + [Flags] + public enum WorkItemAreaPermissions + { + GENERIC_READ = 1, + GENERIC_WRITE = 2, + CREATE_CHILDREN = 4, + DELETE = 8, + WORK_ITEM_READ = 16, + WORK_ITEM_WRITE = 32, + MANAGE_TEST_PLANS = 64, + MANAGE_TEST_SUITES = 128 + } +} diff --git a/Source/Classes/Provider/WorkItemIterationPermissions.cs b/Source/Classes/Provider/WorkItemIterationPermissions.cs new file mode 100644 index 000000000..d456d4f43 --- /dev/null +++ b/Source/Classes/Provider/WorkItemIterationPermissions.cs @@ -0,0 +1,13 @@ +using System; + +namespace vsteam_lib +{ + [Flags] + public enum WorkItemIterationPermissions + { + GENERIC_READ = 1, + GENERIC_WRITE = 2, + CREATE_CHILDREN = 4, + DELETE = 8 + } +} diff --git a/Source/Classes/QueryCompleter.ps1 b/Source/Classes/QueryCompleter.ps1 deleted file mode 100644 index 232a1d20a..000000000 --- a/Source/Classes/QueryCompleter.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -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 explicitly 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 deleted file mode 100644 index ed283e179..000000000 --- a/Source/Classes/QueryTransformToIDAttribute.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 4a7d20dc8..000000000 --- a/Source/Classes/ReleaseDefinitionCompleter.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -using namespace System.Collections -using namespace System.Collections.Generic -using namespace System.Management.Automation - -class ReleaseDefinitionCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - # If the user has explicitly 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 (Get-VSTeamReleaseDefinition -ProjectName $projectName).name) { - if ($value -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) - } - } - } - - return $results - } -} diff --git a/Source/Classes/TeamQueueCompleter.ps1 b/Source/Classes/TeamQueueCompleter.ps1 deleted file mode 100644 index 352c5785e..000000000 --- a/Source/Classes/TeamQueueCompleter.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -using namespace System.Collections -using namespace System.Collections.Generic -using namespace System.Management.Automation - -class TeamQueueCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - # If the user has explicitly 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 (Get-VSTeamQueue -ProjectName $projectName).name) { - if ($value -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) - } - } - } - - return $results - } -} diff --git a/Source/Classes/UncachedProjectCompleter.ps1 b/Source/Classes/UncachedProjectCompleter.ps1 deleted file mode 100644 index 5cbe009ae..000000000 --- a/Source/Classes/UncachedProjectCompleter.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -using namespace System.Collections -using namespace System.Collections.Generic -using namespace System.Management.Automation - -class UncachedProjectCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - # Force an update of the cache - $cachedProjects = [VSTeamProjectCache]::GetCurrent($true) - - foreach ($value in $cachedProjects) { - if ($value -like "*$WordToComplete*") { - $results.Add([CompletionResult]::new("'$($value.replace("'","''"))'", $value, 0, $value)) - } - } - - return $results - } -} diff --git a/Source/Classes/UncachedProjectValidateAttribute.ps1 b/Source/Classes/UncachedProjectValidateAttribute.ps1 deleted file mode 100644 index fc8a8fc90..000000000 --- a/Source/Classes/UncachedProjectValidateAttribute.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -using namespace System.Management.Automation - -class UncachedProjectValidateAttribute : ValidateArgumentsAttribute { - [void] Validate( - [object] $arguments, - [EngineIntrinsics] $EngineIntrinsics) { - - $cachedProjects = [VSTeamProjectCache]::GetCurrent($true) - - if (-not $arguments -in $cachedProjects) { - throw [ValidationMetadataException]::new( - "'$arguments' is not a valid project. Valid projects are: '" + - ($cachedProjects -join "', '") + "'" ) - } - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamAccessControlEntry.ps1 b/Source/Classes/VSTeamAccessControlEntry.ps1 deleted file mode 100644 index ce63da499..000000000 --- a/Source/Classes/VSTeamAccessControlEntry.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamAccessControlEntry : VSTeamLeaf { - [string]$Descriptor = $null - [int]$Allow = 0 - [int]$Deny = 0 - [PSCustomObject]$ExtendedInfo = @{} - - VSTeamAccessControlEntry ( - [object]$obj - ) : base($obj.descriptor, $obj.descriptor, $null) { - $this.Descriptor = $obj.descriptor - $this.Allow = $obj.allow - $this.Deny = $obj.deny - - if ([bool]($obj.PSobject.Properties.name -match "extendedInfo")) - { - $this.ExtendedInfo = $obj.extendedInfo - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.AccessControlEntry') - } - - [string]ToString() { - return "Descriptor=$($this.Descriptor); Allow=$($this.Allow); Deny=$($this.Deny); ExtendedInfo=$($this.ExtendedInfo)" - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamAccessControlList.ps1 b/Source/Classes/VSTeamAccessControlList.ps1 deleted file mode 100644 index 61a4b0567..000000000 --- a/Source/Classes/VSTeamAccessControlList.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamAccessControlList : VSTeamLeaf { - [string]$Token = $null - [bool]$InheritPermissions = $false - [hashtable]$Aces = @{} - - VSTeamAccessControlList ( - [object]$obj - ) : base($obj.token, $obj.token, $null) { - $this.Token = $obj.token - $this.InheritPermissions = $obj.inheritPermissions - - $props = Get-Member -InputObject $obj.acesDictionary -MemberType NoteProperty - - foreach($prop in $props) { - $propValue = $obj.acesDictionary | Select-Object -ExpandProperty $prop.Name - $aceObject = [VSTeamAccessControlEntry]::new($propValue) - $this.Aces[$aceObject.Descriptor] = $aceObject - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.AccessControlList') - } - - [string]ToString() { - return $this.Token - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamAccount.ps1 b/Source/Classes/VSTeamAccount.ps1 deleted file mode 100644 index 906ee38f4..000000000 --- a/Source/Classes/VSTeamAccount.ps1 +++ /dev/null @@ -1,53 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamAccount : SHiPSDirectory { - - # Default constructor - VSTeamAccount( - [string]$Name - ) : base($Name) { - $this.AddTypeName('Team.Account') - - # Invalidate any cache of projects. - [VSTeamProjectCache]::Invalidate() - } - - [object[]] GetChildItem() { - $topLevelFolders = @( - [VSTeamPools]::new('Agent Pools'), - [VSTeamExtensions]::new('Extensions') - [VSTeamFeeds]::new('Feeds') - ) - - # Don't show directories not supported by the server - if (_testGraphSupport) { - $topLevelFolders += [VSTeamPermissions]::new('Permissions') - } - - $items = Get-VSTeamProject | Sort-Object Name - - foreach ($item in $items) { - $item.AddTypeName('Team.Provider.Project') - $topLevelFolders += $item - } - - return $topLevelFolders - } - - [void] hidden AddTypeName( - [string] $name - ) { - # The type is used to identify the correct formatter to use. - # The format for when it is returned by the function and - # returned by the provider are different. Adding a type name - # identifies how to format the type. - # When returned by calling the function and not the provider. - # This will be formatted without a mode column. - # When returned by calling the provider. - # This will be formatted with a mode column like a file or - # directory. - $this.PSObject.TypeNames.Insert(0, $name) - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamAgent.ps1 b/Source/Classes/VSTeamAgent.ps1 deleted file mode 100644 index 5016c6b13..000000000 --- a/Source/Classes/VSTeamAgent.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -class VSTeamAgent : VSTeamDirectory { - [string]$version - [string]$status - [string]$os - [bool]$enabled - [int]$poolId - [int]$agentId - [PSCustomObject]$systemCapabilities - - VSTeamAgent ( - [object]$obj, - [int]$poolId - ) : base($obj.name, $null) { - - $this.poolId = $poolId - $this.agentId = $obj.Id - $this.status = $obj.status - $this.enabled = $obj.enabled - $this.version = $obj.version - $this.systemCapabilities = $obj.systemCapabilities - - # Depending on TFS/VSTS this might not be returned - if ($obj.PSObject.Properties.Match('osDescription').count -gt 0) { - $this.os = $obj.osDescription - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.Agent') - } - - [object[]] GetChildItem() { - $jobRequests = Get-VSTeamJobRequest -PoolId $this.poolId -AgentId $this.agentId - - $objs = @() - - foreach ($item in $jobRequests) { - $item.AddTypeName('Team.Provider.JobRequest') - - $objs += $item - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamAttempt.ps1 b/Source/Classes/VSTeamAttempt.ps1 deleted file mode 100644 index eccf873fe..000000000 --- a/Source/Classes/VSTeamAttempt.ps1 +++ /dev/null @@ -1,48 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $false)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamAttempt: VSTeamDirectory { - [string]$Status = $null - [int]$ReleaseId = $null - [int]$Attemptid = $null - [int]$Environmentid = $null - - VSTeamAttempt ( - [string]$Name, - [string]$Status, - [string]$Projectname, - [int]$ReleaseId, - [int]$Environmentid, - [int]$Attemptid - ) : base($Name, $Projectname) { - $this.Status = $Status - $this.Attemptid = $Attemptid - $this.ReleaseId = $ReleaseId - $this.Environmentid = $Environmentid - - $this.AddTypeName('Team.Attempt') - } - - [object[]] GetChildItem() { - $Tasks = Get-VSTeamRelease -ProjectName $this.projectName -Id $this.releaseId -Expand Environments ` - | Select-Object -ExpandProperty environments ` - | Where-Object id -eq $this.environmentid ` - | Select-Object -ExpandProperty deploysteps ` - | Where-Object id -eq $this.attemptid ` - | Select-Object @{Name = "Tasks"; Expression = { $_.releaseDeployPhases.deploymentJobs.tasks}} ` - | Select-Object -ExpandProperty tasks - - $obj = @() - - foreach ($Task in $Tasks) { - $item = [VSTeamTask]::new($Task, $this.projectName) - - $item.AddTypeName('Team.Provider.Task') - - $obj += $item - } - - return $obj - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamBuild.ps1 b/Source/Classes/VSTeamBuild.ps1 deleted file mode 100644 index 733f2e827..000000000 --- a/Source/Classes/VSTeamBuild.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -class VSTeamBuild : VSTeamLeaf { - [datetime]$StartTime - [string]$Status = $null - [string]$Result = $null - [string]$BuildNumber = $null - [string]$BuildDefinition = $null - [VSTeamUserEntitlement]$RequestedBy = $null - [VSTeamUserEntitlement]$RequestedFor = $null - [VSTeamUserEntitlement]$LastChangedBy = $null - - VSTeamBuild ( - [object]$obj, - [string]$Projectname - ) : base($obj.buildNumber, $obj.id.ToString(), $Projectname) { - $this.Status = $obj.status - $this.Result = $obj.result - $this.StartTime = $obj.startTime - $this.BuildNumber = $obj.buildNumber - $this.BuildDefinition = $obj.definition.name - $this.RequestedBy = [VSTeamUserEntitlement]::new($obj.requestedBy, $Projectname) - $this.RequestedFor = [VSTeamUserEntitlement]::new($obj.requestedFor, $Projectname) - $this.LastChangedBy = [VSTeamUserEntitlement]::new($obj.lastChangedBy, $Projectname) - - $this._internalObj = $obj - - $this.AddTypeName('Team.Build') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamBuildDefinition.ps1 b/Source/Classes/VSTeamBuildDefinition.ps1 deleted file mode 100644 index adfc5f229..000000000 --- a/Source/Classes/VSTeamBuildDefinition.ps1 +++ /dev/null @@ -1,116 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $false)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamBuildDefinition : VSTeamDirectory { - - [int]$id = -1 - [int]$Revision = -1 - [string]$Path = $null - [object]$Tags = $null - [object]$Options = $null - [object]$Triggers = $null - [object]$Variables = $null - [object]$Repository = $null - [VSTeamQueue]$Queue = $null - [object]$RetentionRules = $null - [VSTeamUserEntitlement]$AuthoredBy = $null - [string]$BuildNumberFormat = $null - [int]$JobCancelTimeoutInMinutes = -1 - [string]$JobAuthorizationScope = $null - [VSTeamGitRepository]$GitRepository = $null - [datetime]$CreatedOn = [datetime]::MinValue - [VSTeamBuildDefinitionProcess]$Process = $null - [VSTeamBuildDefinitionProcessPhaseStep[]]$Steps = $null - [string[]]$Demands = $null - - VSTeamBuildDefinition ( - [object]$obj, - [string]$Projectname - ) : base($obj.name, $Projectname) { - - $this.id = $obj.id - $this.Path = $obj.path - $this.Revision = $obj.revision - if ( $obj.PSObject.Properties.name -match 'Variables' ) { - $this.Variables = $obj.variables - } - $this.CreatedOn = $obj.createdDate - $this.JobAuthorizationScope = $obj.jobAuthorizationScope - $this.AuthoredBy = [VSTeamUserEntitlement]::new($obj.authoredBy, $Projectname) - - # These might not be returned - if ($obj.PSObject.Properties.Match('queue').count -gt 0) { - $this.Queue = [VSTeamQueue]::new($obj.queue, $Projectname) - } - - # As of version 5.0 of the REST API this has moved to the Build Def from the phases - if ($obj.PSObject.Properties.Match('jobCancelTimeoutInMinutes').count -gt 0) { - $this.JobCancelTimeoutInMinutes = $obj.jobCancelTimeoutInMinutes - } - - if ($obj.PSObject.Properties.Match('triggers').count -gt 0) { - $this.Triggers = $obj.triggers - } - - if ($obj.PSObject.Properties.Match('retentionRules').count -gt 0) { - $this.RetentionRules = $obj.retentionRules - } - - if ($obj.PSObject.Properties.Match('demands').count -gt 0) { - $this.Demands = $obj.demands - } - - if ($obj.PSObject.Properties.Match('options').count -gt 0) { - $this.Options = $obj.options - } - - if ($obj.PSObject.Properties.Match('tags').count -gt 0) { - $this.Tags = $obj.tags - } - - if ($obj.PSObject.Properties.Match('repository').count -gt 0) { - if($obj.repository.type -eq "TfsGit") { - $this.GitRepository = [VSTeamGitRepository]::new($obj.repository, $Projectname) - } else { - $this.Repository = $obj.repository - } - } - - # This is only in VSTS. In TFS it is a build property - if ($obj.PSObject.Properties.Match('process').count -gt 0) { - $this.Process = [VSTeamBuildDefinitionProcess]::new($obj.process, $Projectname) - } - - # TFS 2017/2018 - if ($obj.PSObject.Properties.Match('build').count -gt 0) { - $stepNo = 0 - foreach ($step in $obj.build) { - $stepNo++ - $this.Steps += [VSTeamBuildDefinitionProcessPhaseStep]::new($step, $stepNo, $Projectname) - } - } - - if ($obj.PSObject.Properties.Match('BuildNumberFormat').count -gt 0) { - $this.BuildNumberFormat = $obj.buildNumberFormat - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.BuildDefinition') - } - - [object[]] GetChildItem() { - - if ($null -ne $this.Steps) { - return $this.Steps - } - - if ($this.Process.Type -eq 1) { - return $this.Process.Phases - } - else { - return $this.Process - } - } -} diff --git a/Source/Classes/VSTeamBuildDefinitionProcess.ps1 b/Source/Classes/VSTeamBuildDefinitionProcess.ps1 deleted file mode 100644 index 2c370eb88..000000000 --- a/Source/Classes/VSTeamBuildDefinitionProcess.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -class VSTeamBuildDefinitionProcess : VSTeamDirectory { - [int]$type - [string]$yamlFilename - [VSTeamBuildDefinitionProcessPhase[]]$Phases - - VSTeamBuildDefinitionProcess ( - [object]$obj, - [string]$Projectname - ) : base("Process", $Projectname) { - - # Is this a yaml build or not? - # Type is = 2 for yaml - $this.type = $obj.type - - if ($this.type -eq 1) { - foreach ($phase in $obj.phases) { - $this.Phases += [VSTeamBuildDefinitionProcessPhase]::new($phase, $Projectname) - } - - $this.AddTypeName('Team.BuildDefinitionPhasedProcess') - } - else { - $this.yamlFilename = $obj.yamlFilename - - $this.DisplayMode = '------' - $this.AddTypeName('Team.BuildDefinitionYamlProcess') - } - - $this._internalObj = $obj - } - - [string]ToString() { - if ($this.type -eq 1) { - return "Number of phases: $($this.Phases.Length)" - } - else { - return $this.yamlFilename - } - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1 b/Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1 deleted file mode 100644 index 4f2e705eb..000000000 --- a/Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -class VSTeamBuildDefinitionProcessPhase : VSTeamDirectory { - [string]$Condition = $null - [object]$Target = $null - [string]$JobAuthorizationScope = $null - [int]$JobCancelTimeoutInMinutes = -1 - [VSTeamBuildDefinitionProcessPhaseStep[]] $Steps - [int]$StepCount = 0 - - VSTeamBuildDefinitionProcessPhase( - [object]$obj, - [string]$Projectname - ) : base($obj.name, $Projectname) { - $this.Target = $obj.target - $this.JobAuthorizationScope = $obj.jobAuthorizationScope - - # These might not be returned - if ($obj.PSObject.Properties.Match('condition').count -gt 0) { - $this.Condition = $obj.condition - } - - # As of version 5.0 of the REST API this has moved to the Build Def - if ($obj.PSObject.Properties.Match('jobCancelTimeoutInMinutes').count -gt 0) { - $this.JobCancelTimeoutInMinutes = $obj.jobCancelTimeoutInMinutes - } - - $this.StepCount = 0 - if ( $obj.PSObject.Properties.name -match 'steps' ) { - foreach ($step in $obj.steps) { - $this.StepCount++ - $this.Steps += [VSTeamBuildDefinitionProcessPhaseStep]::new($step, $this.StepCount, $Projectname) - } - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.BuildDefinitionProcessPhase') - } - - [object[]] GetChildItem() { - return $this.Steps - } -} diff --git a/Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1 b/Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1 deleted file mode 100644 index b480f427a..000000000 --- a/Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -class VSTeamBuildDefinitionProcessPhaseStep : VSTeamLeaf { - [bool]$Enabled = $true - [bool]$ContinueOnError = $false - [bool]$AlwaysRun = $true - [int]$TimeoutInMinutes = 0 - [string]$Condition = $null - [object]$Inputs = $null - [object]$Task = $null - - VSTeamBuildDefinitionProcessPhaseStep( - [object]$obj, - [int]$stepNo, - [string]$Projectname - ) : base($obj.displayName, $stepNo.ToString(), $Projectname) { - $this.Enabled = $obj.enabled - $this.ContinueOnError = $obj.continueOnError - $this.AlwaysRun = $obj.alwaysRun - $this.TimeoutInMinutes = $obj.timeoutInMinutes - $this.Inputs = $obj.inputs - $this.Task = $obj.task - - if ($obj.PSObject.Properties.Match('condition').count -gt 0) { - $this.Condition = $obj.condition - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.BuildDefinitionProcessPhaseStep') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamBuildDefinitions.ps1 b/Source/Classes/VSTeamBuildDefinitions.ps1 deleted file mode 100644 index 05fa34b89..000000000 --- a/Source/Classes/VSTeamBuildDefinitions.ps1 +++ /dev/null @@ -1,50 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamBuildDefinitions : VSTeamDirectory { - - # Default constructor - VSTeamBuildDefinitions( - [string]$Name, - [string]$ProjectName - ) : base($Name, $ProjectName) { - $this.AddTypeName('Team.BuildDefinitions') - } - - [object[]] GetChildItem() { - $items = Get-VSTeamBuildDefinition -ProjectName $this.ProjectName - - foreach ($item in $items) { - $item.AddTypeName('Team.Provider.BuildDefinition') - - # This has to be done here becuase this is the only point - # we know if the object graph is for the provider or not. - if ($item._internalObj.PSObject.Properties.Match('process').count -gt 0) { - if ($item.Process.type -eq 1) { - $item.Process.AddTypeName('Team.Provider.BuildDefinitionPhasedProcess') - foreach ($phase in $item.Process.phases) { - $phase.AddTypeName('Team.Provider.BuildDefinitionProcessPhase') - - foreach ($step in $phase.steps) { - $step.AddTypeName('Team.Provider.BuildDefinitionProcessPhaseStep') - } - } - } - else { - $item.Process.AddTypeName('Team.Provider.BuildDefinitionProcess') - } - } - - - # TFS - if ($item._internalObj.PSObject.Properties.Match('build').count -gt 0) { - foreach ($step in $item.Steps) { - $step.AddTypeName('Team.Provider.BuildDefinitionProcessPhaseStep') - } - } - } - - return $items - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamBuilds.ps1 b/Source/Classes/VSTeamBuilds.ps1 deleted file mode 100644 index 28b43ac82..000000000 --- a/Source/Classes/VSTeamBuilds.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamBuilds : VSTeamDirectory { - - # Default constructor - VSTeamBuilds( - [string]$Name, - [string]$ProjectName - ) : base($Name, $ProjectName) { - $this.AddTypeName('Team.Builds') - } - - [object[]] GetChildItem() { - $builds = Get-VSTeamBuild -ProjectName $this.ProjectName - - $objs = @() - - foreach ($build in $builds) { - $item = [VSTeamBuild]::new( - $build, - $build.project.name) - - $item.AddTypeName('Team.Provider.Build') - - $objs += $item - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamClassificationNode.ps1 b/Source/Classes/VSTeamClassificationNode.ps1 deleted file mode 100644 index 7e3f284c6..000000000 --- a/Source/Classes/VSTeamClassificationNode.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -class VSTeamClassificationNode : VSTeamLeaf { - [guid]$Identifier - [string]$StructureType = $null - [bool]$HasChildren = $false - [VSTeamClassificationNode[]]$Children = @() - [string]$Path = $null - [string]$Url = $null - [string]$ParentUrl = $null - - VSTeamClassificationNode ( - [object]$obj, - [string]$Projectname - ) : base($obj.name, $obj.id, $Projectname) { - - Write-Verbose $obj - - $this.Identifier = $obj.identifier - $this.Name = $obj.name - $this.StructureType = $obj.structureType - $this.HasChildren = $obj.hasChildren - - if (Get-Member -inputobject $obj -name "Path" -MemberType Properties) - { - $this.Path = $obj.Path - } - - $this.Url = $obj.Url - $this.Id = $obj.id - if ($this.HasChildren -and (Get-Member -inputobject $obj -name "children" -MemberType Properties)) - { - foreach ($child in $obj.children) - { - $childObject = [VSTeamClassificationNode]::new($child, $ProjectName) - $this.Children += $childObject - } - } - - if ((Get-Member -inputobject $obj -name "_links" -MemberType Properties) -and (Get-Member -inputobject $obj._links -name "parent" -MemberType Properties)) - { - $this.ParentUrl = $obj._links.parent.href - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.ClassificationNode') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamDescriptor.ps1 b/Source/Classes/VSTeamDescriptor.ps1 deleted file mode 100644 index 2b2503d51..000000000 --- a/Source/Classes/VSTeamDescriptor.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamDescriptor : VSTeamLeaf { - - [string]$Descriptor = $null - [hashtable]$Links = $null - - VSTeamDescriptor ( - [object]$obj - ) : base($obj.value, $obj.value, $null) { - - $this.Links = @{ - 'Self' = $obj._links.self.href; - 'StorageKey' = $obj._links.storageKey.href; - 'Subject'= $obj._links.subject.href; - } - - $this.Descriptor = $obj.value - - $this._internalObj = $obj - - $this.AddTypeName('Team.Descriptor') - } - - [string]ToString() { - return $this.Descriptor - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamDirectory.ps1 b/Source/Classes/VSTeamDirectory.ps1 deleted file mode 100644 index 845cc3478..000000000 --- a/Source/Classes/VSTeamDirectory.ps1 +++ /dev/null @@ -1,53 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -class VSTeamDirectory : SHiPSDirectory { - # The object returned from the REST API call - [object] hidden $_internalObj = $null - - # I want the mode to resemble that of - # a normal file system. - # d - Directory - # a - Archive - # r - Read-only - # h - Hidden - # s - System - # l - Reparse point, symlink, etc. - [string] hidden $DisplayMode = 'd-----' - - [string]$ProjectName = $null - - # Default constructor - VSTeamDirectory( - [string]$Name, - [string]$ProjectName - ) : base($Name) { - $this.ProjectName = $ProjectName - } - - [void] hidden AddTypeName( - [string] $name - ) { - # The type is used to identify the correct formatter to use. - # The format for when it is returned by the function and - # returned by the provider are different. Adding a type name - # identifies how to format the type. - # When returned by calling the function and not the provider. - # This will be formatted without a mode column. - # When returned by calling the provider. - # This will be formatted with a mode column like a file or - # directory. - $this.PSObject.TypeNames.Insert(0, $name) - } - - [void] hidden SetProp( - [object]$other, - [string]$prop - ) { - # Some objects don't always return the same properties. This method will - # see if the property is on the other object before trying to read it - # which would error if you try to access. - if ( $other.PSObject.Properties.name -match $prop ) { - $this.PSObject.Properties[$prop].value = $other.PSObject.Properties[$prop].value - } - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamEnvironment.ps1 b/Source/Classes/VSTeamEnvironment.ps1 deleted file mode 100644 index 80eff3121..000000000 --- a/Source/Classes/VSTeamEnvironment.ps1 +++ /dev/null @@ -1,48 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $false)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamEnvironment : VSTeamDirectory { - [string]$Status = $null - [int]$ReleaseId = $null - [int]$Environmentid = $null - - VSTeamEnvironment ( - [string]$Name, - [string]$Status, - [string]$ProjectName, - [int]$ReleaseId, - [int]$Environmentid - ) : base($Name, $ProjectName) { - $this.Status = $Status - $this.ReleaseId = $ReleaseId - $this.Environmentid = $Environmentid - - $this.AddTypeName('Team.Environment') - } - - [object[]] GetChildItem() { - $attempts = Get-VSTeamRelease -ProjectName $this.ProjectName -Id $this.releaseId -Expand Environments ` - | Select-Object -ExpandProperty environments ` - | Where-Object id -eq $this.environmentid ` - | Select-Object -ExpandProperty deploysteps - - $objs = @() - - foreach ($attempt in $attempts) { - $item = [VSTeamAttempt]::new( - 'Attempt ' + $attempt.Attempt, - $attempt.status, - $this.projectname, - $this.releaseId, - $this.environmentid, - $attempt.id) - - $item.AddTypeName('Team.Provider.Attempt') - - $objs += $item - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamExtension.ps1 b/Source/Classes/VSTeamExtension.ps1 deleted file mode 100644 index 748dc01cb..000000000 --- a/Source/Classes/VSTeamExtension.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -class VSTeamExtension : VSTeamLeaf { - [string]$publisherId - [string]$extensionId - [string]$publisherName - [string]$version - [VSTeamInstallState]$installState - - VSTeamExtension ( - [object]$obj - ) : base($obj.extensionName, $obj.extensionId, $null) { - - $this.extensionId = $obj.extensionId - $this.publisherId = $obj.publisherId - $this.publisherName = $obj.publisherName - $this.version = $obj.version - $this.installState = [VSTeamInstallState]::new($obj.installState) - - $this._internalObj = $obj - - $this.AddTypeName('Team.Extension') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamExtensions.ps1 b/Source/Classes/VSTeamExtensions.ps1 deleted file mode 100644 index 5aa6bbde3..000000000 --- a/Source/Classes/VSTeamExtensions.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamExtensions : VSTeamDirectory { - - # Default constructor - VSTeamExtensions( - [string]$Name - ) : base($Name, $null) { - $this.AddTypeName('Team.Extensions') - - $this.DisplayMode = 'd-r-s-' - } - - [object[]] GetChildItem() { - $extensions = Get-VSTeamExtension | Sort-Object name - - $objs = @() - - foreach ($extension in $extensions) { - $extension.AddTypeName('Team.Provider.Extension') - - $objs += $extension - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamFeed.ps1 b/Source/Classes/VSTeamFeed.ps1 deleted file mode 100644 index b3d98dc55..000000000 --- a/Source/Classes/VSTeamFeed.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -class VSTeamFeed : VSTeamLeaf { - [string]$description - [string]$url - [bool]$upstreamEnabled = $false - [PSCustomObject]$upstreamSources - - VSTeamFeed ( - [object]$obj - ) : base($obj.name, $obj.Id, $null) { - - $this.url = $obj.url - $this.description = $obj.description - $this.upstreamSources = $obj.upstreamSources - - # These might not be returned - if ($obj.PSObject.Properties.Match('upstreamEnabled').count -gt 0) { - $this.upstreamEnabled = $obj.upstreamEnabled - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.Feed') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamFeeds.ps1 b/Source/Classes/VSTeamFeeds.ps1 deleted file mode 100644 index e4dd0b1a6..000000000 --- a/Source/Classes/VSTeamFeeds.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamFeeds : VSTeamDirectory { - - # Default constructor - VSTeamFeeds( - [string]$Name - ) : base($Name, $null) { - $this.AddTypeName('Team.Feeds') - - $this.DisplayMode = 'd-r-s-' - } - - [object[]] GetChildItem() { - $feeds = Get-VSTeamFeed | Sort-Object name - - $objs = @() - - foreach ($feed in $feeds) { - $feed.AddTypeName('Team.Provider.Feed') - - $objs += $feed - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamGitCommitRef.ps1 b/Source/Classes/VSTeamGitCommitRef.ps1 deleted file mode 100644 index 01b1f5cae..000000000 --- a/Source/Classes/VSTeamGitCommitRef.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -class VSTeamGitCommitRef : VSTeamLeaf { - [VSTeamGitUserDate]$Author = $null - [VSTeamGitUserDate]$Committer = $null - [string]$Comment=$null - [string]$CommitId = $null - [string]$RemoteUrl = $null - [string]$Url = $null - - VSTeamGitCommitRef ( - [object]$obj, - [string]$ProjectName - ) : base($obj.comment, $obj.commitId, $ProjectName) { - - $this.Author = [VSTeamGitUserDate]::new($obj.author, $ProjectName) - $this.Committer = [VSTeamGitUserDate]::new($obj.committer, $ProjectName) - $this.CommitId = $obj.commitId - $this.Comment = $obj.comment - $this.RemoteUrl = $obj.remoteUrl - $this.Url = $obj.url - - $this._internalObj = $obj - - $this.AddTypeName('Team.GitCommitRef') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamGitRepository.ps1 b/Source/Classes/VSTeamGitRepository.ps1 deleted file mode 100644 index 198823190..000000000 --- a/Source/Classes/VSTeamGitRepository.ps1 +++ /dev/null @@ -1,56 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -class VSTeamGitRepository : VSTeamDirectory { - - [long]$Size = 0 - [string]$ID = $null - [string]$URL = $null - [string]$sshURL = $null - [string]$RemoteURL = $null - [string]$DefaultBranch = $null - [VSTeamProject]$Project = $null - - VSTeamGitRepository( - [object]$obj, - [string]$ProjectName - ) : base($obj.name, $ProjectName) { - $this.ID = $obj.id - $this.URL = $obj.Url - - # Depending on TFS/VSTS these might not be returned - if ($obj.PSObject.Properties.Match('size').count -gt 0) { - $this.Size = $obj.size - } - - if ($obj.PSObject.Properties.Match('sshUrl').count -gt 0) { - $this.sshURL = $obj.sshUrl - } - - if ($obj.PSObject.Properties.Match('defaultBranch').count -gt 0) { - $this.DefaultBranch = $obj.defaultBranch - } - - if ($obj.PSObject.Properties.Match('remoteURL').count -gt 0) { - $this.RemoteURL = $obj.remoteURL - } - - if ($obj.PSObject.Properties.Match('project').count -gt 0) { - $this.Project = [VSTeamProject]::new($obj.project) - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.Repository') - } - - [object[]] GetChildItem() { - $items = Get-VSTeamGitRef -ProjectName $this.ProjectName -RepositoryID $this.id - - foreach ($item in $items) { - $item.AddTypeName('Team.Provider.GitRef') - } - - return $items - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamGitRepositoryPermissions.ps1 b/Source/Classes/VSTeamGitRepositoryPermissions.ps1 deleted file mode 100644 index dc2ef590e..000000000 --- a/Source/Classes/VSTeamGitRepositoryPermissions.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -# https://dev.azure.com//_apis/securitynamespaces?api-version=5.0 -[flags()] Enum VSTeamGitRepositoryPermissions -{ - Administer = 1 - GenericRead = 2 - GenericContribute = 4 - ForcePush = 8 - CreateBranch = 16 - CreateTag = 32 - ManageNote = 64 - PolicyExempt = 128 - CreateRepository = 256 - DeleteRepository = 512 - RenameRepository = 1024 - EditPolicies = 2048 - RemoveOthersLocks = 4096 - ManagePermissions = 8192 - PullRequestContribute = 16384 - PullRequestBypassPolicy = 32768 -} \ No newline at end of file diff --git a/Source/Classes/VSTeamGitUserDate.ps1 b/Source/Classes/VSTeamGitUserDate.ps1 deleted file mode 100644 index 702f949e0..000000000 --- a/Source/Classes/VSTeamGitUserDate.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -class VSTeamGitUserDate : VSTeamLeaf { - [DateTime]$Date = [DateTime]::MinValue - [string]$Email = $null - - VSTeamGitUserDate ( - [object]$obj, - [string]$ProjectName - ) : base($obj.email, $obj.email, $ProjectName) { - - $this.Date = $obj.date - $this.Email = $obj.email - $this.Name = $obj.name - - $this._internalObj = $obj - - $this.AddTypeName('Team.GitUserDate') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamGroup.ps1 b/Source/Classes/VSTeamGroup.ps1 deleted file mode 100644 index 97925fc8a..000000000 --- a/Source/Classes/VSTeamGroup.ps1 +++ /dev/null @@ -1,50 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamGroup : VSTeamLeaf { - - [string]$SubjectKind = $null - [string]$Description = $null - [string]$Domain = $null - [string]$PrincipalName = $null - [string]$MailAddress = $null - [string]$Origin = $null - [string]$OriginID = $null - [string]$DisplayName = $null - [string]$URL = $null - [string]$Descriptor = $null - [hashtable]$Links = $null - - VSTeamGroup ( - [object]$obj - ) : base($obj.displayName, $obj.descriptor, $null) { - $this.SubjectKind = $obj.subjectKind - $this.Description = $obj.description - $this.Domain = $obj.domain - $this.PrincipalName = $obj.principalName - $this.MailAddress = $obj.mailAddress - $this.Origin = $obj.origin - $this.OriginID = $obj.originId - $this.DisplayName = $obj.displayName - $this.ProjectName = $obj.principalName.Split('\')[0].Trim('[',']') - - $this.Links = @{ - 'Self' = $obj._links.self.href; - 'Memberships' = $obj._links.memberships.href; - 'MembershipState'= $obj._links.membershipState.href; - 'StorageKey'= $obj._links.storageKey.href; - } - - $this.URL = $obj.url - $this.Descriptor = $obj.descriptor - - $this._internalObj = $obj - - $this.AddTypeName('Team.Group') - } - - [string]ToString() { - return $this.PrincipalName - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamGroups.ps1 b/Source/Classes/VSTeamGroups.ps1 deleted file mode 100644 index 1f93649d8..000000000 --- a/Source/Classes/VSTeamGroups.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamGroups : VSTeamDirectory { - - # Default constructor - VSTeamGroups( - [string]$Name - ) : base($Name, $null) { - $this.AddTypeName('Team.Groups') - - $this.DisplayMode = 'd-r-s-' - } - - [object[]] GetChildItem() { - $Groups = Get-VSTeamGroup | Sort-Object name - - $objs = @() - - foreach ($Group in $Groups) { - $Group.AddTypeName('Team.Provider.Group') - - $objs += $Group - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamIdentityPermissions.ps1 b/Source/Classes/VSTeamIdentityPermissions.ps1 deleted file mode 100644 index 0f7dd8365..000000000 --- a/Source/Classes/VSTeamIdentityPermissions.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -# https://dev.azure.com//_apis/securitynamespaces?api-version=5.0 -[flags()] Enum VSTeamIdentityPermissions -{ - Read = 1 - Write = 2 - Delete = 4 - ManageMembership = 8 - CreateScope = 16 - RestoreScope = 32 -} \ No newline at end of file diff --git a/Source/Classes/VSTeamInstallState.ps1 b/Source/Classes/VSTeamInstallState.ps1 deleted file mode 100644 index e4c885034..000000000 --- a/Source/Classes/VSTeamInstallState.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -class VSTeamInstallState { - [string]$flags - [string]$lastUpdated - # The object returned from the REST API call - [object] hidden $_internalObj = $null - - VSTeamInstallState( - [object]$obj - ) { - - $this.flags = $obj.flags - $this.lastUpdated = $obj.lastUpdated - - $this._internalObj = $obj - - $this.PSObject.TypeNames.Insert(0, 'Team.InstallState') - } - - [string]ToString() { - return "Flags: $($this.flags), Last Updated: $($this.lastUpdated)" - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamJobRequest.ps1 b/Source/Classes/VSTeamJobRequest.ps1 deleted file mode 100644 index 2c6a61aca..000000000 --- a/Source/Classes/VSTeamJobRequest.ps1 +++ /dev/null @@ -1,51 +0,0 @@ -class VSTeamJobRequest : VSTeamLeaf { - [datetime] $QueueTime - [nullable[datetime]] $AssignTime - [nullable[datetime]] $StartTime - [nullable[datetime]] $FinishTime - [timespan] $Duration - [string] $Type - [string] $Result - [string[]] $Demands - [string] $Pipeline - VSTeamJobRequest ( - [object]$obj - ) : base($obj.owner.name, $obj.requestId, $null) { - $this.Type = $obj.planType - if ($obj.PSobject.Properties.Name -notcontains "result" -and $obj.PSobject.Properties.Name -notcontains "assignTime") { - $this.Result = 'queued' - } - elseif ($obj.PSobject.Properties.Name -notcontains "result" -and $obj.PSobject.Properties.Name -contains "assignTime") { - $this.Result = 'running' - } - else { - $this.Result = $obj.result - } - $this.Demands = $obj.demands - $this.QueueTime = $obj.queueTime - if ($obj.PSobject.Properties.Name -contains "assignTime") { - $this.AssignTime = $obj.assignTime - } - else { - $this.AssignTime = $null - } - if ($obj.PSobject.Properties.Name -contains "receiveTime") { - $this.StartTime = $obj.receiveTime - } - else { - $this.StartTime = $null - } - if ($obj.PSobject.Properties.Name -contains "finishTime") { - $this.FinishTime = $obj.finishTime - } - else { - $this.FinishTime = $null - } - $this.Pipeline = $obj.definition.name - if ($null -ne $this.FinishTime -and $null -ne $this.StartTime) { - $this.Duration = $this.FinishTime - $this.StartTime - } - $this._internalObj = $obj - $this.AddTypeName('Team.JobRequest') - } -} diff --git a/Source/Classes/VSTeamLeaf.ps1 b/Source/Classes/VSTeamLeaf.ps1 deleted file mode 100644 index 1380936d3..000000000 --- a/Source/Classes/VSTeamLeaf.ps1 +++ /dev/null @@ -1,56 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -class VSTeamLeaf : SHiPSLeaf { - # The object returned from the REST API call - [object] hidden $_internalObj = $null - - [string]$ID = $null - [string]$ProjectName = $null - - # I want the mode to resemble that of - # a normal file system. - # d - Directory - # a - Archive - # r - Read-only - # h - Hidden - # s - System - # l - Reparse point, symlink, etc. - [string] hidden $DisplayMode = '------' - - # Default constructor - VSTeamLeaf( - [string]$Name, - [string]$ID, - [string]$ProjectName - ) : base($Name) { - $this.ID = $ID - $this.ProjectName = $ProjectName - } - - [void] hidden AddTypeName( - [string] $name - ) { - # The type is used to identify the correct formatter to use. - # The format for when it is returned by the function and - # returned by the provider are different. Adding a type name - # identifies how to format the type. - # When returned by calling the function and not the provider. - # This will be formatted without a mode column. - # When returned by calling the provider. - # This will be formatted with a mode column like a file or - # directory. - $this.PSObject.TypeNames.Insert(0, $name) - } - - [void] hidden SetProp( - [object]$other, - [string]$prop - ) { - # Some objects don't always return the same properties. This method will - # see if the property is on the other object before trying to read it - # which would error if you try to access. - if ( $other.PSObject.Properties.name -match $prop ) { - $this.PSObject.Properties[$prop].value = $other.PSObject.Properties[$prop].value - } - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamPermissionInheritance.ps1 b/Source/Classes/VSTeamPermissionInheritance.ps1 deleted file mode 100644 index dd09de128..000000000 --- a/Source/Classes/VSTeamPermissionInheritance.ps1 +++ /dev/null @@ -1,66 +0,0 @@ -class VSTeamPermissionInheritance { - [string]$Token = $null - [string]$Version = $null - [string]$ProjectID = $null - [string]$SecurityNamespaceID = $null - - VSTeamPermissionInheritance( - [string]$projectName, - [string]$resourceName, - [string]$resourceType - ) { - $this.ProjectID = (Get-VSTeamProject -Name $projectName | Select-Object -ExpandProperty id) - - Switch ($resourceType) { - "Repository" { - $this.SecurityNamespaceID = "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" - - $repositoryID = (Get-VSTeamGitRepository -Name "$resourceName" -projectName $projectName | Select-Object -ExpandProperty id ) - - if ($null -eq $repositoryID) { - Write-Error "Unable to retrieve repository information. Ensure that the resourceName provided matches a repository name exactly." - Return - } - - $this.Token = "repoV2/$($this.ProjectID)/$repositoryID" - - $this.Version = "$(_getApiVersion Git)" - } - - "BuildDefinition" { - $this.SecurityNamespaceID = "33344d9c-fc72-4d6f-aba5-fa317101a7e9" - - $buildDefinitionID = (Get-VSTeamBuildDefinition -projectName $projectName | Where-Object name -eq "$resourceName" | Select-Object -ExpandProperty id ) - - if ($null -eq $buildDefinitionID) { - Write-Error "Unable to retrieve build definition information. Ensure that the resourceName provided matches a build definition name exactly." - Return - } - - $this.Token = "$($this.ProjectID)/$buildDefinitionID" - - $this.Version = "$(_getApiVersion Build)" - } - - "ReleaseDefinition" { - $this.SecurityNamespaceID = "c788c23e-1b46-4162-8f5e-d7585343b5de" - - $releaseDefinition = (Get-VSTeamReleaseDefinition -projectName $projectName | Where-Object -Property name -eq "$resourceName" ) - - if ($null -eq $releaseDefinition) { - Write-Error "Unable to retrieve release definition information. Ensure that the resourceName provided matches a release definition name exactly." - Return - } - - if (($releaseDefinition).path -eq "/") { - $this.Token = "$($this.ProjectID)/$($releaseDefinition.id)" - } - else { - $this.Token = "$($this.ProjectID)" + "$($releaseDefinition.path -replace "\\","/")" + "/$($releaseDefinition.id)" - } - - $this.Version = "$(_getApiVersion Release)" - } - } - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamPermissions.ps1 b/Source/Classes/VSTeamPermissions.ps1 deleted file mode 100644 index 66226effe..000000000 --- a/Source/Classes/VSTeamPermissions.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamPermissions : VSTeamDirectory { - - # Default constructor - VSTeamPermissions( - [string]$Name - ) : base($Name, $null) { - $this.AddTypeName('Team.Permissions') - - $this.DisplayMode = 'd-r-s-' - } - - [object[]] GetChildItem() { - $groupsAndUsers = @( - [VSTeamGroups]::new('Groups'), - [VSTeamUsers]::new('Users') - ) - - return $groupsAndUsers - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamPool.ps1 b/Source/Classes/VSTeamPool.ps1 deleted file mode 100644 index cecaf40b3..000000000 --- a/Source/Classes/VSTeamPool.ps1 +++ /dev/null @@ -1,69 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamPool : VSTeamDirectory { - - [int]$id - [bool]$isHosted = $false - [VSTeamUserEntitlement]$owner = $null - [VSTeamUserEntitlement]$CreatedBy = $null - - # The number of agents in the pool - [int]$count - - # Default constructor - VSTeamPool( - [object]$obj - ) : base($obj.Name, $null) { - - $this.id = $obj.id - - # values are not returned always - if ($obj.PSObject.Properties.Match('isHosted').count -gt 0) { - $this.isHosted = $obj.isHosted - } - - if ($obj.PSObject.Properties.Match('size').count -gt 0) { - $this.count = $obj.size - } - - # On some accounts the CreatedBy is null for hosted pools - if ($obj.PSObject.Properties.Match('createdBy').count -gt 0 -and - $null -ne $obj.createdBy) { - $this.CreatedBy = [VSTeamUserEntitlement]::new($obj.createdBy, $null) - } - - # Depending on TFS/VSTS this might not be returned - # Just becaues it exisit does not mean it is not $null - if ($obj.PSObject.Properties.Match('owner').count -gt 0 -and - $null -ne $obj.owner) { - $this.owner = [VSTeamUserEntitlement]::new($obj.owner, $null) - } - - $this.AddTypeName('Team.Pool') - - if ($this.isHosted) { - $this.DisplayMode = 'd-r-s-' - } - else { - $this.DisplayMode = 'd-----' - } - - $this._internalObj = $obj - } - - [object[]] GetChildItem() { - $agents = Get-VSTeamAgent -PoolId $this.id - - $objs = @() - - foreach ($agent in $agents) { - $agent.AddTypeName('Team.Provider.Agent') - - $objs += $agent - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamPools.ps1 b/Source/Classes/VSTeamPools.ps1 deleted file mode 100644 index 40a1381d8..000000000 --- a/Source/Classes/VSTeamPools.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamPools : VSTeamDirectory { - - # Default constructor - VSTeamPools( - [string]$Name - ) : base($Name, $null) { - $this.AddTypeName('Team.Pools') - - $this.DisplayMode = 'd-r-s-' - } - - [object[]] GetChildItem() { - $pools = Get-VSTeamPool | Sort-Object name - - $objs = @() - - foreach ($pool in $pools) { - $pool.AddTypeName('Team.Provider.Pool') - - $objs += $pool - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamProcess.ps1 b/Source/Classes/VSTeamProcess.ps1 deleted file mode 100644 index e7aef454e..000000000 --- a/Source/Classes/VSTeamProcess.ps1 +++ /dev/null @@ -1,67 +0,0 @@ -class VSTeamProcess { - - [string]$ID = $null - [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.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['description']) { - $this.Description = $obj.description - } - if ($obj.PSObject.Properties['parentProcessTypeId']) { - $this.ParentProcessTypeId = $obj.parentProcessTypeId - } - } - - [void] hidden AddTypeName( - [string] $name - ) { - # The type is used to identify the correct formatter to use. - # The format for when it is returned by the function and - # returned by the provider are different. Adding a type name - # identifies how to format the type. - # When returned by calling the function and not the provider. - # This will be formatted without a mode column. - # When returned by calling the provider. - # This will be formatted with a mode column like a file or - # directory. - $this.PSObject.TypeNames.Insert(0, $name) - } - - [string]ToString() { - return $this.Name - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamProcessCache.ps1 b/Source/Classes/VSTeamProcessCache.ps1 deleted file mode 100644 index 5041a696e..000000000 --- a/Source/Classes/VSTeamProcessCache.ps1 +++ /dev/null @@ -1,53 +0,0 @@ -# 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 = @() - static [hashtable] $urls = @{} - - static [Void] Update([object[]] $list) { - # If a list is passed in just use that - # If not call Get-VSTeamProcess - if (-not $list) { - $list = Get-VSTeamProcess - } - - if ($list) { - foreach ($process in $list) { - if ($process.psobject.Properties['url']) { - [VSTeamProcessCache]::urls[$process.name] = $process.url - } - } - [VSTeamProcessCache]::processes = @() + ($List | Select-Object -ExpandProperty Name | Sort-Object) - } - else { - [VSTeamProcessCache]::processes = @() - } - - [VSTeamProcessCache]::timestamp = (Get-Date).TimeOfDay.TotalMinutes - } - - static [object] GetCurrent() { - if (_hasProcessTemplateCacheExpired) { - [VSTeamProcessCache]::Update($null) - } - - return ([VSTeamProcessCache]::processes) - } - - static [object] GetURl([string] $ProcessName) { - if (_hasProcessTemplateCacheExpired) { - [VSTeamProcessCache]::Update($null) - } - - 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 deleted file mode 100644 index aa82a6112..000000000 --- a/Source/Classes/VSTeamProject.ps1 +++ /dev/null @@ -1,63 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamProject : VSTeamDirectory { - - [int]$Revision = 0 - [string]$ID = $null - [string]$URL = $null - [string]$State = $null - [string]$Visibility = $null - [string]$Description = $null - [string]$ProjectName = $null - - VSTeamProject ( - [object]$obj - ) : base($obj.name, $obj.name) { - $this.ID = $obj.id - $this.URL = $obj.url - $this.State = $obj.state - $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 - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.Project') - } - - [string]ToString() { - return $this.Name - } - - [object[]] GetChildItem() { - return @( - [VSTeamBuildDefinitions]::new('Build Definitions', $this.Name), - [VSTeamBuilds]::new('Builds', $this.Name), - [VSTeamQueues]::new('Queues', $this.Name), - [VSTeamReleaseDefinitions]::new('Release Definitions', $this.Name), - [VSTeamReleases]::new('Releases', $this.Name), - [VSTeamRepositories]::new('Repositories', $this.Name), - [VSTeamTeams]::new('Teams', $this.Name) - ) - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamProjectCache.ps1 b/Source/Classes/VSTeamProjectCache.ps1 deleted file mode 100644 index 8545da405..000000000 --- a/Source/Classes/VSTeamProjectCache.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -# 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. -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).TimeOfDay.TotalMinutes - } - - static [void] Invalidate() { - [VSTeamProjectCache]::timestamp = -1 - } - - static [object] GetCurrent([bool] $forceUpdate) { - if (_hasProjectCacheExpired -or $forceUpdate) { - [VSTeamProjectCache]::Update() - } - - return ([VSTeamProjectCache]::projects) - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamProjectPermissions.ps1 b/Source/Classes/VSTeamProjectPermissions.ps1 deleted file mode 100644 index 82ff98faf..000000000 --- a/Source/Classes/VSTeamProjectPermissions.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -# https://dev.azure.com//_apis/securitynamespaces?api-version=5.0 -[flags()] Enum VSTeamProjectPermissions -{ - GENERIC_READ = 1 - GENERIC_WRITE = 2 - DELETE = 4 - PUBLISH_TEST_RESULTS = 8 - ADMINISTER_BUILD = 16 - START_BUILD = 32 - EDIT_BUILD_STATUS = 64 - UPDATE_BUILD = 128 - DELETE_TEST_RESULTS = 256 - VIEW_TEST_RESULTS = 512 - MANAGE_TEST_ENVIRONMENTS = 2048 - MANAGE_TEST_CONFIGURATIONS = 4096 - WORK_ITEM_DELETE = 8192 - WORK_ITEM_MOVE = 16384 - WORK_ITEM_PERMANENTLY_DELETE = 32768 - RENAME = 65536 - MANAGE_PROPERTIES = 131072 - MANAGE_SYSTEM_PROPERTIES = 262144 - BYPASS_PROPERTY_CACHE = 524288 - BYPASS_RULES = 1048576 - SUPPRESS_NOTIFICATIONS = 2097152 - UPDATE_VISIBILITY = 4194304 - CHANGE_PROCESS = 8388608 - AGILETOOLS_BACKLOG = 16777216 -} \ No newline at end of file diff --git a/Source/Classes/VSTeamQueryCache.ps1 b/Source/Classes/VSTeamQueryCache.ps1 deleted file mode 100644 index e65f700e3..000000000 --- a/Source/Classes/VSTeamQueryCache.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -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 (_hasQueryCacheExpired) { - [VSTeamQueryCache]::Update() - } - - return ([VSTeamQueryCache]::queries) - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamQueue.ps1 b/Source/Classes/VSTeamQueue.ps1 deleted file mode 100644 index a3127d238..000000000 --- a/Source/Classes/VSTeamQueue.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamQueue : VSTeamLeaf { - - [string]$poolName - [VSTeamPool]$pool - - # Default constructor - VSTeamQueue( - [object]$obj, - [string]$Projectname - ) : base($obj.name, $obj.id, $Projectname) { - - # pool values are not returned always - if ($obj.PSObject.Properties.Match('poolName').count -gt 0) { - $this.poolName = $obj.poolName - } - - if ($obj.PSObject.Properties.Match('pool').count -gt 0) { - $this.pool = [VSTeamPool]::new($obj.pool) - $this.poolName = $obj.pool.name - } - - $this.AddTypeName('Team.Queue') - - $this._internalObj = $obj - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamQueues.ps1 b/Source/Classes/VSTeamQueues.ps1 deleted file mode 100644 index 7ead70dc7..000000000 --- a/Source/Classes/VSTeamQueues.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamQueues : VSTeamDirectory { - - # Default constructor - VSTeamQueues( - [string]$Name, - [string]$ProjectName - ) : base($Name, $ProjectName) { - $this.AddTypeName('Team.Queues') - } - - [object[]] GetChildItem() { - $items = Get-VSTeamQueue -ProjectName $this.ProjectName - - foreach ($item in $items) { - $item.AddTypeName('Team.Provider.Queue') - } - - return $items - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamRef.ps1 b/Source/Classes/VSTeamRef.ps1 deleted file mode 100644 index 2be9c167f..000000000 --- a/Source/Classes/VSTeamRef.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -class VSTeamRef : VSTeamLeaf { - [VSTeamUserEntitlement]$Creator = $null - - # The name passed to the base class is changed. For example if you pass - # refs/heads/appcenter as the name it is converted into refs-heads-appcenter. - # So I store it twice so I have the original value as well. - [string]$RefName = $null - - VSTeamRef ( - [object]$obj, - [string]$ProjectName - ) : base($obj.name, $obj.objectId, $ProjectName) { - - $this.RefName = $obj.name - $this.Creator = [VSTeamUserEntitlement]::new($obj.creator, $ProjectName) - - $this._internalObj = $obj - - $this.AddTypeName('Team.GitRef') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamRelease.ps1 b/Source/Classes/VSTeamRelease.ps1 deleted file mode 100644 index cb3e17dc0..000000000 --- a/Source/Classes/VSTeamRelease.ps1 +++ /dev/null @@ -1,54 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamRelease : VSTeamDirectory { - [string]$ID = $null - [string]$Status = $null - [object]$Environments = $null - [VSTeamUserEntitlement]$CreatedBy = $null - [VSTeamUserEntitlement]$RequestedFor = $null - [VSTeamUserEntitlement]$ModifiedBy = $null - [string]$DefinitionName = $null - [object]$releaseDefinition = $null - [datetime]$CreatedOn #DateTime is not nullable - - VSTeamRelease ( - [object]$obj, - [string]$ProjectName - ) : base($obj.name, $ProjectName) { - $this.ID = $obj.id - $this.Status = $obj.status - $this.CreatedOn = $obj.createdOn - $this.Environments = $obj.environments - $this.releaseDefinition = $obj.releaseDefinition - $this.DefinitionName = $obj.releaseDefinition.name - $this.CreatedBy = [VSTeamUserEntitlement]::new($obj.createdBy, $ProjectName) - $this.ModifiedBy = [VSTeamUserEntitlement]::new($obj.modifiedBy, $ProjectName) - - if ($obj.PSObject.Properties.Match('RequestedFor').count -gt 0) { - $this.RequestedFor = [VSTeamUserEntitlement]::new($obj.requestedFor, $ProjectName) - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.Release') - } - - [object[]] GetChildItem() { - $envs = Get-VSTeamRelease -ProjectName $this.projectName -Id $this.id -Expand Environments | Select-Object -ExpandProperty Environments - - $obj = @() - - foreach ($env in $envs) { - $obj += [VSTeamEnvironment]::new( - $env.name, - $env.status, - $this.projectname, - $this.id, - $env.Id) - } - - return $obj - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamReleaseDefinition.ps1 b/Source/Classes/VSTeamReleaseDefinition.ps1 deleted file mode 100644 index 0b33848bc..000000000 --- a/Source/Classes/VSTeamReleaseDefinition.ps1 +++ /dev/null @@ -1,78 +0,0 @@ -class VSTeamReleaseDefinition : VSTeamLeaf { - - [string]$Url = '' - [string]$Path = '' - [int]$Revision = 0 - [object]$Tags = $null - [string]$Description = '' - [bool]$isDeleted = $false - [object]$Triggers = $null - [object]$Artifacts = $null - [object]$Variables = $null - [object]$Properties = $null - [object]$Environments = $null - [object]$VariableGroups = $null - [string]$ReleaseNameFormat = '' - [VSTeamUserEntitlement]$CreatedBy = $null - [VSTeamUserEntitlement]$ModifiedBy = $null - [datetime]$CreatedOn = [datetime]::MinValue - [datetime]$ModifiedOn = [datetime]::MinValue - - # Before this class was added to the provider there - # was a type file to expose createdByUser. The type - # was deleted when this class was added. So this - # property is for backwards compatiablity - [string]$createdByUser = '' - - VSTeamReleaseDefinition( - [object]$obj, - [string]$Projectname - ) : base($obj.name, $obj.id.ToString(), $Projectname) { - - $this._internalObj = $obj - - $this.Url = $obj.url - $this.Path = $obj.path - $this.Revision = $obj.revision - $this.CreatedOn = $obj.createdOn - $this.isDeleted = $obj.isDeleted - $this.ModifiedOn = $obj.modifiedOn - $this.Properties = $obj.Properties - $this.Description = $obj.Description - $this.VariableGroups = $obj.VariableGroups - $this.ReleaseNameFormat = $obj.releaseNameFormat - $this.CreatedBy = [VSTeamUserEntitlement]::new($obj.createdBy, $null) - $this.ModifiedBy = [VSTeamUserEntitlement]::new($obj.modifiedBy, $null) - - $this.createdByUser = $this.CreatedBy.DisplayName - - # These properties are not always on the object returned. - $this.SetProp($obj, 'tags') - $this.SetProp($obj, 'variables') - $this.SetProp($obj, 'triggers') - $this.SetProp($obj, 'artifacts') - $this.SetProp($obj, 'environments') - - $this.AddTypeName('Team.ReleaseDefinition') - - $this._internalObj._links.PSObject.TypeNames.Insert(0, 'Team.Links') - $this._internalObj._links.self.PSObject.TypeNames.Insert(0, 'Team.Link') - $this._internalObj._links.web.PSObject.TypeNames.Insert(0, 'Team.Link') - $this._internalObj.createdBy.PSObject.TypeNames.Insert(0, 'Team.User') - $this._internalObj.modifiedBy.PSObject.TypeNames.Insert(0, 'Team.User') - - # This is not always returned depends on expand flag - if ($this._internalObj.PSObject.Properties.Match('artifacts').count -gt 0 -and $null -ne $this._internalObj.artifacts) { - $this._internalObj.artifacts.PSObject.TypeNames.Insert(0, 'Team.Artifacts') - } - - if ($this._internalObj.PSObject.Properties.Match('retentionPolicy').count -gt 0 -and $null -ne $this._internalObj.retentionPolicy) { - $this._internalObj.retentionPolicy.PSObject.TypeNames.Insert(0, 'Team.RetentionPolicy') - } - - if ($this._internalObj.PSObject.Properties.Match('lastRelease').count -gt 0 -and $null -ne $this._internalObj.lastRelease) { - # This is VSTS - $this._internalObj.lastRelease.PSObject.TypeNames.Insert(0, 'Team.Release') - } - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamReleaseDefinitions.ps1 b/Source/Classes/VSTeamReleaseDefinitions.ps1 deleted file mode 100644 index 62c38a940..000000000 --- a/Source/Classes/VSTeamReleaseDefinitions.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamReleaseDefinitions : VSTeamDirectory { - - # Default constructor - VSTeamReleaseDefinitions( - [string]$Name, - [string]$ProjectName - ) : base($Name, $ProjectName) { - $this.AddTypeName('Team.ReleaseDefinitions') - } - - [object[]] GetChildItem() { - $items = Get-VSTeamReleaseDefinition -ProjectName $this.ProjectName | Sort-Object name - - $objs = @() - - foreach ($item in $items) { - $item.AddTypeName('Team.Provider.ReleaseDefinition') - - $objs += $item; - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamReleases.ps1 b/Source/Classes/VSTeamReleases.ps1 deleted file mode 100644 index d2db12194..000000000 --- a/Source/Classes/VSTeamReleases.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamReleases : VSTeamDirectory { - - VSTeamReleases( - [string]$Name, - [string]$ProjectName - ) : base($Name, $ProjectName) { - $this.AddTypeName('Team.Releases') - } - - [object[]] GetChildItem() { - $releases = Get-VSTeamRelease -ProjectName $this.ProjectName -Expand Environments - - $objs = @() - - foreach ($release in $releases) { - $item = [VSTeamRelease]::new( - $release, - $this.ProjectName) - - $item.AddTypeName('Team.Provider.Release') - - $objs += $item - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamRepositories.ps1 b/Source/Classes/VSTeamRepositories.ps1 deleted file mode 100644 index e291ee57c..000000000 --- a/Source/Classes/VSTeamRepositories.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -class VSTeamRepositories : VSTeamDirectory { - - # Default constructor - VSTeamRepositories( - [string]$Name, - [string]$ProjectName - ) : base($Name, $ProjectName) { - $this.AddTypeName('Team.Repositories') - } - - [object[]] GetChildItem() { - $items = Get-VSTeamGitRepository -ProjectName $this.ProjectName - - foreach ($item in $items) { - $item.AddTypeName('Team.Provider.Repository') - } - - return $items - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamSecurityNamespace.ps1 b/Source/Classes/VSTeamSecurityNamespace.ps1 deleted file mode 100644 index 0d49a8923..000000000 --- a/Source/Classes/VSTeamSecurityNamespace.ps1 +++ /dev/null @@ -1,54 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamSecurityNamespace : VSTeamLeaf { - [string]$DisplayName = $null - [string]$SeparatorValue = $null - [int]$ElementLength = 0 - [int]$WritePermission = 0 - [int]$ReadPermission = 0 - [string]$DataspaceCategory = $null - [string]$StructureValue = $null - [string]$ExtensionType = $null - [bool]$IsRemotable = $false - [bool]$UseTokenTranslator = $false - [int]$SystemBitMask = 0 - [hashtable[]]$Actions - - VSTeamSecurityNamespace ( - [object]$obj - ) : base($obj.name, $obj.namespaceId, $null) { - $this.Name = $obj.name - $this.ID = $obj.namespaceId - $this.DisplayName = $obj.displayName - $this.SeparatorValue = $obj.separatorValue - $this.ElementLength = $obj.elementLength - $this.WritePermission = $obj.writePermission - $this.ReadPermission = $obj.readPermission - $this.DataspaceCategory = $obj.dataspaceCategory - $this.StructureValue = $obj.structureValue - $this.ExtensionType = $obj.extensionType - $this.IsRemotable = $obj.isRemotable - $this.UseTokenTranslator = $obj.useTokenTranslator - $this.SystemBitMask = $obj.systemBitMask - - $this.Actions = @() - foreach($action in $obj.actions) - { - $subAction = @{} - $subAction.Bit = $action.bit - $subAction.Name = $action.name - $subAction.DisplayName = $action.displayName - $this.Actions += $subAction - } - - $this._internalObj = $obj - - $this.AddTypeName('Team.SecurityNamespace') - } - - [string]ToString() { - return $this.Name - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamTask.ps1 b/Source/Classes/VSTeamTask.ps1 deleted file mode 100644 index 7050a536e..000000000 --- a/Source/Classes/VSTeamTask.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -class VSTeamTask : VSTeamLeaf { - [string]$LogURL = $null - [string]$Status = $null - - VSTeamTask ( - [object]$obj, - [string]$ProjectName - ) : base($obj.Name, $obj.id, $ProjectName) { - $this.LogURL = $obj.logUrl - $this.Status = $obj.status - - $this._internalObj = $obj - - $this.AddTypeName('Team.Task') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamTeam.ps1 b/Source/Classes/VSTeamTeam.ps1 deleted file mode 100644 index f559c07f9..000000000 --- a/Source/Classes/VSTeamTeam.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -class VSTeamTeam : VSTeamLeaf { - [string]$Description = $null - - VSTeamTeam ( - [object]$obj, - [string]$ProjectName - ) : base($obj.name, $obj.Id, $ProjectName) { - $this.Description = $obj.Description - - $this._internalObj = $obj - - $this.AddTypeName('Team.Team') - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamTeams.ps1 b/Source/Classes/VSTeamTeams.ps1 deleted file mode 100644 index 024d4be37..000000000 --- a/Source/Classes/VSTeamTeams.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $false)] -class VSTeamTeams : VSTeamDirectory { - VSTeamTeams( - [string]$Name, - [string]$ProjectName - ) : base($Name, $ProjectName) { - $this.AddTypeName('Team.Teams') - } - - [object[]] GetChildItem() { - Write-Verbose "Project: $($this.ProjectName)" - - $items = Get-VSTeam -ProjectName $this.ProjectName - - foreach ($item in $items) { - $item.AddTypeName('Team.Provider.Team') - } - - return $items - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamUser.ps1 b/Source/Classes/VSTeamUser.ps1 deleted file mode 100644 index 6f8ec8cd2..000000000 --- a/Source/Classes/VSTeamUser.ps1 +++ /dev/null @@ -1,54 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamUser : VSTeamLeaf { - - [string]$SubjectKind = $null - [string]$Domain = $null - [string]$PrincipalName = $null - [string]$MailAddress = $null - [string]$Origin = $null - [string]$OriginID = $null - [string]$DisplayName = $null - [string]$URL = $null - [string]$Descriptor = $null - [hashtable]$Links = $null - [string]$MetaType = $null - - VSTeamUser ( - [object]$obj - ) : base($obj.displayName, $obj.descriptor, $null) { - $this.SubjectKind = $obj.subjectKind - $this.Domain = $obj.domain - $this.PrincipalName = $obj.principalName - $this.MailAddress = $obj.mailAddress - $this.Origin = $obj.origin - $this.OriginID = $obj.originId - $this.DisplayName = $obj.displayName - - if ($this.Origin -eq "aad" -and (Get-Member -inputobject $obj -name "metaType" -MemberType Properties)) - { - $this.MetaType = $obj.metaType - } - - $this.Links = @{ - 'Self' = $obj._links.self.href; - 'Memberships' = $obj._links.memberships.href; - 'MembershipState' = $obj._links.membershipState.href; - 'StorageKey' = $obj._links.storageKey.href; - 'Avatar' = $obj._links.avatar.href; - } - - $this.URL = $obj.url - $this.Descriptor = $obj.descriptor - - $this._internalObj = $obj - - $this.AddTypeName('Team.User2') - } - - [string]ToString() { - return $this.PrincipalName - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamUserEntitlement.ps1 b/Source/Classes/VSTeamUserEntitlement.ps1 deleted file mode 100644 index 12cfd6f8c..000000000 --- a/Source/Classes/VSTeamUserEntitlement.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -class VSTeamUserEntitlement : VSTeamLeaf { - [string]$DisplayName - [string]$UniqueName - - VSTeamUserEntitlement( - [object]$obj, - [string]$ProjectName - ) : base($obj.displayName, $obj.id, $ProjectName) { - $this.UniqueName = $obj.uniqueName - $this.DisplayName = $obj.displayName - - $this._internalObj = $obj - - $this.AddTypeName('Team.UserEntitlement') - } - - [string]ToString() { - return $this.DisplayName - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamUsers.ps1 b/Source/Classes/VSTeamUsers.ps1 deleted file mode 100644 index 565397626..000000000 --- a/Source/Classes/VSTeamUsers.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -using namespace Microsoft.PowerShell.SHiPS - -[SHiPSProvider(UseCache = $true)] -[SHiPSProvider(BuiltinProgress = $false)] -class VSTeamUsers : VSTeamDirectory { - - # Default constructor - VSTeamUsers( - [string]$Name - ) : base($Name, $null) { - $this.AddTypeName('Team.Users') - - $this.DisplayMode = 'd-r-s-' - } - - [object[]] GetChildItem() { - $Users = Get-VSTeamUser | Sort-Object name - - $objs = @() - - foreach ($User in $Users) { - $User.AddTypeName('Team.Provider.User') - - $objs += $User - } - - return $objs - } -} \ No newline at end of file diff --git a/Source/Classes/VSTeamVersions.ps1 b/Source/Classes/VSTeamVersions.ps1 deleted file mode 100644 index 91fcc4cdb..000000000 --- a/Source/Classes/VSTeamVersions.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -class VSTeamVersions { - static [string] $Account = $env:TEAM_ACCT - static [string] $DefaultTimeout = $env:TEAM_TIMEOUT - 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] $DistributedTask = '3.0-preview' - static [string] $VariableGroups = '' - static [string] $TaskGroups = '3.0-preview' - static [string] $Tfvc = '3.0' - static [string] $Packaging = '3.0-preview' - static [string] $MemberEntitlementManagement = '' - static [string] $ExtensionsManagement = '' - static [string] $ServiceEndpoints = '3.0-preview' - static [string] $ModuleVersion = $null - static [string] $Graph = '' - static [string] $Policy = '3.0' - static [string] $Processes = '' -} \ No newline at end of file diff --git a/Source/Classes/VSTeamWorkItemAreaPermissions.ps1 b/Source/Classes/VSTeamWorkItemAreaPermissions.ps1 deleted file mode 100644 index 53e5f4fa0..000000000 --- a/Source/Classes/VSTeamWorkItemAreaPermissions.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -# https://dev.azure.com//_apis/securitynamespaces?api-version=5.0 -[flags()] Enum VSTeamWorkItemAreaPermissions -{ - GENERIC_READ = 1 - GENERIC_WRITE = 2 - CREATE_CHILDREN = 4 - DELETE = 8 - WORK_ITEM_READ = 16 - WORK_ITEM_WRITE = 32 - MANAGE_TEST_PLANS = 64 - MANAGE_TEST_SUITES = 128 -} \ No newline at end of file diff --git a/Source/Classes/VSTeamWorkItemIterationPermissions.ps1 b/Source/Classes/VSTeamWorkItemIterationPermissions.ps1 deleted file mode 100644 index d4c2ee8c6..000000000 --- a/Source/Classes/VSTeamWorkItemIterationPermissions.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -# https://dev.azure.com//_apis/securitynamespaces?api-version=5.0 -[flags()] Enum VSTeamWorkItemIterationPermissions -{ - GENERIC_READ = 1 - GENERIC_WRITE = 2 - CREATE_CHILDREN = 4 - DELETE = 8 -} diff --git a/Source/Classes/Versions.cs b/Source/Classes/Versions.cs new file mode 100644 index 000000000..ce426ce55 --- /dev/null +++ b/Source/Classes/Versions.cs @@ -0,0 +1,147 @@ +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib +{ + public enum APIs + { + Build, Release, Core, Git, DistributedTask, DistributedTaskReleased, + VariableGroups, Tfvc, Packaging, MemberEntitlementManagement, + ExtensionsManagement, ServiceEndpoints, Graph, TaskGroups, Policy, + Processes, Version, HierarchyQuery + } + + public static class Versions + { + public static void SetApiVersion(APIs service, string version) + { + switch (service) + { + case APIs.HierarchyQuery: + HierarchyQuery = version; + break; + case APIs.Build: + Build = version; + break; + case APIs.Release: + Release = version; + break; + case APIs.Core: + Core = version; + break; + case APIs.Git: + Git = version; + break; + case APIs.DistributedTask: + DistributedTask = version; + break; + case APIs.DistributedTaskReleased: + DistributedTaskReleased = version; + break; + case APIs.VariableGroups: + VariableGroups = version; + break; + case APIs.Tfvc: + Tfvc = version; + break; + case APIs.Packaging: + Packaging = version; + break; + case APIs.MemberEntitlementManagement: + MemberEntitlementManagement = version; + break; + case APIs.ExtensionsManagement: + ExtensionsManagement = version; + break; + case APIs.ServiceEndpoints: + ServiceEndpoints = version; + break; + case APIs.Graph: + Graph = version; + break; + case APIs.TaskGroups: + TaskGroups = version; + break; + case APIs.Policy: + Policy = version; + break; + case APIs.Processes: + Processes = version; + break; + } + } + + public static string GetApiVersion(APIs service) + { + switch (service) + { + case APIs.HierarchyQuery: + return HierarchyQuery; + case APIs.Build: + return Build; + case APIs.Release: + return Release; + case APIs.Core: + return Core; + case APIs.Git: + return Git; + case APIs.DistributedTask: + return DistributedTask; + case APIs.DistributedTaskReleased: + return DistributedTaskReleased; + case APIs.VariableGroups: + return VariableGroups; + case APIs.Tfvc: + return Tfvc; + case APIs.Packaging: + return Packaging; + case APIs.MemberEntitlementManagement: + return MemberEntitlementManagement; + case APIs.ExtensionsManagement: + return ExtensionsManagement; + case APIs.ServiceEndpoints: + return ServiceEndpoints; + case APIs.Graph: + return Graph; + case APIs.TaskGroups: + return TaskGroups; + case APIs.Policy: + return Policy; + case APIs.Processes: + return Processes; + default: + return Version; + } + } + + [ExcludeFromCodeCoverage] + public static bool TestGraphSupport() => !string.IsNullOrEmpty(Versions.GetApiVersion(APIs.Graph)); + [ExcludeFromCodeCoverage] + public static string Account { get; set; } = System.Environment.GetEnvironmentVariable("TEAM_ACCT"); + [ExcludeFromCodeCoverage] + public static string DefaultTimeout { get; set; } = System.Environment.GetEnvironmentVariable("TEAM_TIMEOUT"); + [ExcludeFromCodeCoverage] + public static string DefaultProject { get; set; } = System.Environment.GetEnvironmentVariable("TEAM_PROJECT"); + [ExcludeFromCodeCoverage] + public static string Version { get; set; } = System.Environment.GetEnvironmentVariable("TEAM_VERSION") ?? "TFS2017"; + [ExcludeFromCodeCoverage] + public static string ModuleVersion { get; set; } = null; + + public static string Git { get; set; } = "3.0"; + public static string Core { get; set; } = "3.0"; + public static string Build { get; set; } = "3.0"; + public static string HierarchyQuery { get; set; } = ""; + public static string Release { get; set; } = "3.0-preview"; + public static string DistributedTask { get; set; } = "3.0-preview"; + public static string DistributedTaskReleased { get; set; } = ""; + public static string VariableGroups { get; set; } = ""; + public static string TaskGroups { get; set; } = "3.0-preview"; + public static string Tfvc { get; set; } = "3.0"; + public static string Packaging { get; set; } = "3.0-preview"; + public static string MemberEntitlementManagement { get; set; } = ""; + public static string ExtensionsManagement { get; set; } = ""; + public static string ServiceEndpoints { get; set; } = "3.0-preview"; + public static string Graph { get; set; } = ""; + public static string Policy { get; set; } = "3.0"; + public static string Processes { get; set; } = ""; + } +} diff --git a/Source/Classes/WorkItemTypeCompleter.ps1 b/Source/Classes/WorkItemTypeCompleter.ps1 deleted file mode 100644 index fcb823723..000000000 --- a/Source/Classes/WorkItemTypeCompleter.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -using namespace System.Collections -using namespace System.Collections.Generic -using namespace System.Management.Automation - -class WorkItemTypeCompleter : IArgumentCompleter { - [IEnumerable[CompletionResult]] CompleteArgument( - [string] $CommandName, - [string] $ParameterName, - [string] $WordToComplete, - [Language.CommandAst] $CommandAst, - [IDictionary] $FakeBoundParameters) { - - $results = [List[CompletionResult]]::new() - - # If the user has explicitly 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 (_getWorkItemTypes -ProjectName $projectName)) { - 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/WorkItemTypeValidateAttribute.ps1 b/Source/Classes/WorkItemTypeValidateAttribute.ps1 deleted file mode 100644 index 5da5f957e..000000000 --- a/Source/Classes/WorkItemTypeValidateAttribute.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -using namespace System.Management.Automation - -class WorkItemTypeValidateAttribute : ValidateArgumentsAttribute { - [void] Validate( - [object] $arguments, - [EngineIntrinsics] $EngineIntrinsics) { - - if (_getDefaultProject) { - $types = _getWorkItemTypes -ProjectName $(_getDefaultProject) - - if (($null -ne $types) -and (-not ($arguments -in $types))) { - throw [ValidationMetadataException]::new( - "'$arguments' is not a valid WorkItemType. Valid WorkItemTypees are: '" + - ($types -join "', '") + "'") - } - } - } -} \ No newline at end of file diff --git a/Source/Classes/_classes.json b/Source/Classes/_classes.json deleted file mode 100644 index 2b7057139..000000000 --- a/Source/Classes/_classes.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "outputFile": "vsteam.classes.ps1", - "fileType": "classes", - "files": [ - "InvokeCompleter.ps1", - "BuildCompleter.ps1", - "BuildDefinitionCompleter.ps1", - "ProcessTemplateCompleter.ps1", - "ProjectCompleter.ps1", - "ReleaseDefinitionCompleter.ps1", - "TeamQueueCompleter.ps1", - "UncachedProjectCompleter.ps1", - "WorkItemTypeCompleter.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", - "VSTeamInstallState.ps1", - "VSTeamExtensions.ps1", - "VSTeamFeeds.ps1", - "VSTeamAgent.ps1", - "VSTeamTask.ps1", - "VSTeamAttempt.ps1", - "VSTeamUserEntitlement.ps1", - "VSTeamPool.ps1", - "VSTeamQueue.ps1", - "VSTeamEnvironment.ps1", - "VSTeamRelease.ps1", - "VSTeamReleases.ps1", - "VSTeamBuild.ps1", - "VSTeamBuildDefinitions.ps1", - "VSTeamBuilds.ps1", - "VSTeamQueues.ps1", - "VSTeamRepositories.ps1", - "VSTeamTeams.ps1", - "VSTeamProject.ps1", - "VSTeamGitRepository.ps1", - "VSTeamBuildDefinitionProcessPhaseStep.ps1", - "VSTeamBuildDefinitionProcessPhase.ps1", - "VSTeamBuildDefinitionProcess.ps1", - "VSTeamBuildDefinition.ps1", - "VSTeamExtension.ps1", - "VSTeamFeed.ps1", - "VSTeamUsers.ps1", - "VSTeamGroups.ps1", - "VSTeamPermissions.ps1", - "VSTeamProcess.ps1", - "VSTeamRef.ps1", - "VSTeamTeam.ps1", - "VSTeamAccount.ps1", - "VSTeamGitRepositoryPermissions.ps1", - "VSTeamIdentityPermissions.ps1", - "VSTeamProjectPermissions.ps1", - "VSTeamWorkItemAreaPermissions.ps1", - "VSTeamWorkItemIterationPermissions.ps1", - "VSTeamGroup.ps1", - "VSTeamDescriptor.ps1", - "VSTeamSecurityNamespace.ps1", - "VSTeamAccessControlEntry.ps1", - "VSTeamAccessControlList.ps1", - "VSTeamUser.ps1", - "VSTeamClassificationNode.ps1", - "VSTeamJobRequest.ps1", - "VSTeamReleaseDefinition.ps1", - "VSTeamReleaseDefinitions.ps1", - "VSTeamPermissionInheritance.ps1", - "VSTeamGitCommitRef.ps1", - "VSTeamGitUserDate.ps1" - ] -} \ No newline at end of file diff --git a/Source/Classes/vsteam-lib.csproj b/Source/Classes/vsteam-lib.csproj new file mode 100644 index 000000000..f66ca9202 --- /dev/null +++ b/Source/Classes/vsteam-lib.csproj @@ -0,0 +1,34 @@ + + + + netstandard2.0 + vsteam_lib + true + + Debug;Release;VS;LibOnly + + + + none + false + + + + + + + + + + ..\..\packages\ships\Microsoft.PowerShell.SHiPS.dll + + + + + + + + diff --git a/Source/Private/applyTypes.ps1 b/Source/Private/applyTypes.ps1 index 9d183be8b..0a8eddfc8 100644 --- a/Source/Private/applyTypes.ps1 +++ b/Source/Private/applyTypes.ps1 @@ -1,6 +1,7 @@ # Apply types to the returned objects so format and type files can # identify the object and act on it. function _applyTypes { + [CmdletBinding()] param( $item, $type @@ -10,45 +11,40 @@ function _applyTypes { } function _applyTypesWorkItemType { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.WorkItemType') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.WorkItemType') } function _applyTypesToWorkItem { + [CmdletBinding()] param($item) # If there are ids in the list that don't map to a work item and empty # entry is returned in its place if ErrorPolicy is Omit. if ($item) { - $item.PSObject.TypeNames.Insert(0, 'Team.WorkItem') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.WorkItem') } } function _applyTypesToWiql { + [CmdletBinding()] param($item) if ($item) { - $item.PSObject.TypeNames.Insert(0, 'Team.Wiql') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.Wiql') } } -function _applyTypesToUser { - param( - [Parameter(Mandatory = $true)] - $item - ) - - $item.PSObject.TypeNames.Insert(0, 'Team.UserEntitlement') - $item.accessLevel.PSObject.TypeNames.Insert(0, 'Team.AccessLevel') -} - function _applyTypesToTfvcBranch { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.TfvcBranch') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.TfvcBranch') } function _applyTypesToTeamMember { + [CmdletBinding()] param( [Parameter(Mandatory = $true)] $item, @@ -61,156 +57,128 @@ function _applyTypesToTeamMember { # Add the team name as a NoteProperty so we can use it further down the pipeline (it's not returned from the REST call) $item | Add-Member -MemberType NoteProperty -Name Team -Value $team $item | Add-Member -MemberType NoteProperty -Name ProjectName -Value $ProjectName - $item.PSObject.TypeNames.Insert(0, 'Team.TeamMember') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.TeamMember') } function _applyTypesToApproval { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.Approval') -} - -function _applyTypesToBuild { - param($item) - - $item.PSObject.TypeNames.Insert(0, 'Team.Build') - $item.logs.PSObject.TypeNames.Insert(0, 'Team.Logs') - $item._links.PSObject.TypeNames.Insert(0, 'Team.Links') - $item.project.PSObject.TypeNames.Insert(0, 'Team.Project') - $item.requestedBy.PSObject.TypeNames.Insert(0, 'Team.User') - $item.requestedFor.PSObject.TypeNames.Insert(0, 'Team.User') - $item.lastChangedBy.PSObject.TypeNames.Insert(0, 'Team.User') - $item.repository.PSObject.TypeNames.Insert(0, 'Team.Repository') - $item.definition.PSObject.TypeNames.Insert(0, 'Team.BuildDefinition') - - if ($item.PSObject.Properties.Match('queue').count -gt 0 -and $null -ne $item.queue) { - $item.queue.PSObject.TypeNames.Insert(0, 'Team.Queue') - } - - if ($item.PSObject.Properties.Match('orchestrationPlan').count -gt 0 -and $null -ne $item.orchestrationPlan) { - $item.orchestrationPlan.PSObject.TypeNames.Insert(0, 'Team.OrchestrationPlan') - } + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.Approval') } function _applyArtifactTypes { - $item.PSObject.TypeNames.Insert(0, "Team.Build.Artifact") + $item.PSObject.TypeNames.Insert(0, "vsteam_lib.Build.Artifact") if ($item.PSObject.Properties.Match('resource').count -gt 0 -and $null -ne $item.resource -and $item.resource.PSObject.Properties.Match('propeties').count -gt 0) { - $item.resource.PSObject.TypeNames.Insert(0, 'Team.Build.Artifact.Resource') - $item.resource.properties.PSObject.TypeNames.Insert(0, 'Team.Build.Artifact.Resource.Properties') + $item.resource.PSObject.TypeNames.Insert(0, 'vsteam_lib.Build.Artifact.Resource') + $item.resource.properties.PSObject.TypeNames.Insert(0, 'vsteam_lib.Build.Artifact.Resource.Properties') } } function _applyTypesToAzureSubscription { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.AzureSubscription') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.AzureSubscription') } function _applyTypesToPolicy { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.Policy') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.Policy') } function _applyTypesToPolicyType { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.PolicyType') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.PolicyType') } function _applyTypesToPullRequests { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.PullRequest') -} - -function _applyTypesToRelease { - param($item) - - $item.PSObject.TypeNames.Insert(0, 'Team.Release') - - if ($item.PSObject.Properties.Match('environments').count -gt 0 -and $null -ne $item.environments) { - foreach ($e in $item.environments) { - $e.PSObject.TypeNames.Insert(0, 'Team.Environment') - } - } - - $item._links.PSObject.TypeNames.Insert(0, 'Team.Links') - $item._links.self.PSObject.TypeNames.Insert(0, 'Team.Link') - $item._links.web.PSObject.TypeNames.Insert(0, 'Team.Link') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.PullRequest') } function _applyTypesToServiceEndpoint { + param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.ServiceEndpoint') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.ServiceEndpoint') - $item.createdBy.PSObject.TypeNames.Insert(0, 'Team.User') - $item.authorization.PSObject.TypeNames.Insert(0, 'Team.authorization') - $item.data.PSObject.TypeNames.Insert(0, 'Team.ServiceEndpoint.Details') + $item.createdBy.PSObject.TypeNames.Insert(0, 'vsteam_lib.User') + $item.authorization.PSObject.TypeNames.Insert(0, 'vsteam_lib.authorization') + $item.data.PSObject.TypeNames.Insert(0, 'vsteam_lib.ServiceEndpoint.Details') if ($item.PSObject.Properties.Match('operationStatus').count -gt 0 -and $null -ne $item.operationStatus) { # This is VSTS - $item.operationStatus.PSObject.TypeNames.Insert(0, 'Team.OperationStatus') + $item.operationStatus.PSObject.TypeNames.Insert(0, 'vsteam_lib.OperationStatus') } } function _applyTypesToServiceEndpointType { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.ServiceEndpointType') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.ServiceEndpointType') - $item.inputDescriptors.PSObject.TypeNames.Insert(0, 'Team.InputDescriptor[]') + $item.inputDescriptors.PSObject.TypeNames.Insert(0, 'vsteam_lib.InputDescriptor[]') foreach ($inputDescriptor in $item.inputDescriptors) { - $inputDescriptor.PSObject.TypeNames.Insert(0, 'Team.InputDescriptor') + $inputDescriptor.PSObject.TypeNames.Insert(0, 'vsteam_lib.InputDescriptor') } - $item.authenticationSchemes.PSObject.TypeNames.Insert(0, 'Team.AuthenticationScheme[]') + $item.authenticationSchemes.PSObject.TypeNames.Insert(0, 'vsteam_lib.AuthenticationScheme[]') foreach ($authenticationScheme in $item.authenticationSchemes) { - $authenticationScheme.PSObject.TypeNames.Insert(0, 'Team.AuthenticationScheme') + $authenticationScheme.PSObject.TypeNames.Insert(0, 'vsteam_lib.AuthenticationScheme') } if ($item.PSObject.Properties.Match('dataSources').count -gt 0 -and $null -ne $item.dataSources) { - $item.dataSources.PSObject.TypeNames.Insert(0, 'Team.DataSource[]') + $item.dataSources.PSObject.TypeNames.Insert(0, 'vsteam_lib.DataSource[]') foreach ($dataSource in $item.dataSources) { - $dataSource.PSObject.TypeNames.Insert(0, 'Team.DataSource') + $dataSource.PSObject.TypeNames.Insert(0, 'vsteam_lib.DataSource') } } } function _applyTypesToVariableGroup { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.VariableGroup') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.VariableGroup') - $item.createdBy.PSObject.TypeNames.Insert(0, 'Team.User') - $item.modifiedBy.PSObject.TypeNames.Insert(0, 'Team.User') + $item.createdBy.PSObject.TypeNames.Insert(0, 'vsteam_lib.User') + $item.modifiedBy.PSObject.TypeNames.Insert(0, 'vsteam_lib.User') if ($item.PSObject.Properties.Match('providerData').count -gt 0 -and $null -ne $item.providerData) { - $item.providerData.PSObject.TypeNames.Insert(0, 'Team.ProviderData') + $item.providerData.PSObject.TypeNames.Insert(0, 'vsteam_lib.ProviderData') } - $item.variables.PSObject.TypeNames.Insert(0, 'Team.Variables') + $item.variables.PSObject.TypeNames.Insert(0, 'vsteam_lib.Variables') } function _applyTypesToYamlPipelineResultType { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.YamlPipelineResult') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.YamlPipelineResult') } function _applyTypesToBuildTimelineResultType { + [CmdletBinding()] param($item) - $item.PSObject.TypeNames.Insert(0, 'Team.BuildTimeline') + $item.PSObject.TypeNames.Insert(0, 'vsteam_lib.BuildTimeline') if ($item.PSObject.Properties.Match('records').count -gt 0 -and $null -ne $item.records) { - $item.records.PSObject.TypeNames.Insert(0, 'Team.BuildTimelineRecord[]') + $item.records.PSObject.TypeNames.Insert(0, 'vsteam_lib.BuildTimelineRecord[]') foreach ($records in $item.records) { - $records.PSObject.TypeNames.Insert(0, 'Team.BuildTimelineRecord') + $records.PSObject.TypeNames.Insert(0, 'vsteam_lib.BuildTimelineRecord') } } } diff --git a/Source/Private/callMembershipAPI.ps1 b/Source/Private/callMembershipAPI.ps1 index 6e1f65f5e..05e13eb46 100644 --- a/Source/Private/callMembershipAPI.ps1 +++ b/Source/Private/callMembershipAPI.ps1 @@ -4,8 +4,10 @@ function _callMembershipAPI { param( [Parameter(Mandatory = $true)] [string] $Id, - [ValidateSet('Get', 'Post', 'Patch', 'Delete', 'Options', 'Put', 'Default', 'Head', 'Merge', 'Trace')] - [string] $Method, + + [ValidateSet('GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'PUT', 'DEFAULT', 'HEAD', 'MERGE', 'TRACE')] + [string] $Method = 'GET', + [ValidateSet('', 'Up', 'Down')] [string] $Direction ) @@ -15,17 +17,18 @@ function _callMembershipAPI { Write-Verbose "Getting members for $Id" $query = @{} + if ($Direction) { $query['direction'] = $Direction } # Call the REST API - $resp = _callAPI -Area 'graph' -Resource 'memberships' ` + $resp = _callAPI -Method $Method -SubDomain vssps ` + -Area 'graph' ` + -Resource 'memberships' ` -Id $Id ` - -SubDomain "vssps" ` - -Method $Method ` - -Version $(_getApiVersion Graph) ` - -QueryString $query + -QueryString $query ` + -Version $(_getApiVersion Graph) - return $resp + return $resp.value } \ No newline at end of file diff --git a/Source/Private/common.ps1 b/Source/Private/common.ps1 index e1359c9a7..28d05b1b7 100644 --- a/Source/Private/common.ps1 +++ b/Source/Private/common.ps1 @@ -6,6 +6,7 @@ $profilesPath = "$HOME/vsteam_profiles.json" # This is the main function for calling TFS and VSTS. It handels the auth and format of the route. # If you need to call TFS or VSTS this is the function to use. function _callAPI { + [CmdletBinding()] param( [string]$resource, [string]$area, @@ -121,9 +122,31 @@ function _testGraphSupport { (_getApiVersion Graph) -as [boolean] } +function _supportsHierarchyQuery { + _hasAccount + if ($false -eq $(_testHierarchyQuerySupport)) { + throw 'This account does not support the graph API.' + } +} + +function _testHierarchyQuerySupport { + (_getApiVersion HierarchyQuery) -as [boolean] +} + +function _supportVariableGroups { + _hasAccount + if ($false -eq $(_testVariableGroupsSupport)) { + throw 'This account does not support the variable groups.' + } +} + +function _testVariableGroupsSupport { + (_getApiVersion VariableGroups) -as [boolean] +} + function _supportsSecurityNamespace { _hasAccount - if (([VSTeamVersions]::Version -ne "VSTS") -and ([VSTeamVersions]::Version -ne "AzD")) { + if (([vsteam_lib.Versions]::Version -ne "VSTS") -and ([vsteam_lib.Versions]::Version -ne "AzD")) { throw 'Security Namespaces are currently only supported in Azure DevOps Service (Online)' } } @@ -147,9 +170,14 @@ function _testAdministrator { # built for the API call. function _getApiVersion { [CmdletBinding(DefaultParameterSetName = 'Service')] + [OutputType([string])] param ( [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 0)] - [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceEndpoints', 'Graph', 'TaskGroups', 'Policy', 'Processes')] + [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', + 'DistributedTaskReleased', 'VariableGroups', 'Tfvc', + 'Packaging', 'MemberEntitlementManagement', + 'ExtensionsManagement', 'ServiceEndpoints', 'Graph', + 'TaskGroups', 'Policy', 'Processes', 'HierarchyQuery')] [string] $Service, [parameter(ParameterSetName = 'Target')] @@ -157,68 +185,21 @@ function _getApiVersion { ) if ($Target.IsPresent) { - return [VSTeamVersions]::Version + return [vsteam_lib.Versions]::GetApiVersion("Version") } else { - - 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 - } - 'ServiceEndpoints' { - return [VSTeamVersions]::ServiceEndpoints - } - 'Graph' { - return [VSTeamVersions]::Graph - } - 'TaskGroups' { - return [VSTeamVersions]::TaskGroups - } - 'Policy' { - return [VSTeamVersions]::Policy - } - 'Processes' { - return [VSTeamVersions]::Processes - } - } + return [vsteam_lib.Versions]::GetApiVersion($Service) } } function _getInstance { - return [VSTeamVersions]::Account + return [vsteam_lib.Versions]::Account } function _getDefaultTimeout { if ($Global:PSDefaultParameterValues["*-vsteam*:vsteamApiTimeout"]) { return $Global:PSDefaultParameterValues["*-vsteam*:vsteamApiTimeout"] - } + } else { return 60 } @@ -244,8 +225,11 @@ function _buildRequestURI { [string]$version, [string]$subDomain, [object]$queryString, - [ProjectValidateAttribute()] + + [Parameter(Mandatory = $false)] + [vsteam_lib.ProjectValidateAttribute($false)] $ProjectName, + [switch]$UseProjectId, [switch]$NoProject ) @@ -420,7 +404,7 @@ function _getUserAgent { $os = Get-OperatingSystem - $result = "Team Module/$([VSTeamVersions]::ModuleVersion) ($os) PowerShell/$($PSVersionTable.PSVersion.ToString())" + $result = "Team Module/$([vsteam_lib.Versions]::ModuleVersion) ($os) PowerShell/$($PSVersionTable.PSVersion.ToString())" Write-Verbose $result @@ -448,7 +432,10 @@ function _getWorkItemTypes { # Call the REST API try { - $resp = _callAPI -ProjectName $ProjectName -area 'wit' -resource 'workitemtypes' -version $(_getApiVersion Core) + $resp = _callAPI -ProjectName $ProjectName ` + -area wit ` + -resource workitemtypes ` + -version $(_getApiVersion Core) # This call returns JSON with "": which causes the ConvertFrom-Json to fail. # To replace all the "": with "_end": @@ -464,50 +451,6 @@ function _getWorkItemTypes { } } -# When writing unit tests mock this and return false. -# This will prevent the dynamic project name parameter -# from trying to call the getProject function. -# Mock _hasProjectCacheExpired { return $false } -function _hasProjectCacheExpired { - return $([VSTeamProjectCache]::timestamp) -ne (Get-Date).TimeOfDay.TotalMinutes -} - -function _hasProcessTemplateCacheExpired { - return $([VSTeamProcessCache]::timestamp) -ne (Get-Date).TimeOfDay.TotalMinutes -} - -function _hasQueryCacheExpired { - return $([VSTeamQueryCache]::timestamp) -ne (Get-Date).TimeOfDay.TotalMinutes -} - -function _getProjects { - if (-not $(_getInstance)) { - Write-Output @() - return - } - - $resource = "/projects" - $instance = $(_getInstance) - $version = $(_getApiVersion Core) - - # Build the url to list the projects - # You CANNOT use _buildRequestURI here or you will end up - # in an infinite loop. - $listurl = $instance + '/_apis' + $resource + '?api-version=' + $version + '&stateFilter=All&$top=9999' - - # Call the REST API - try { - $resp = _callAPI -url $listurl - - if ($resp.count -gt 0) { - Write-Output ($resp.value).name - } - } - catch { - Write-Output @() - } -} - function _buildProjectNameDynamicParam { param( [string] $ParameterName = 'ProjectName', @@ -544,7 +487,7 @@ function _buildProjectNameDynamicParam { } # Generate and set the ValidateSet - $arrSet = [VSTeamProjectCache]::GetCurrent($false) + $arrSet = [vsteam_lib.ProjectCache]::GetCurrent($false) if ($arrSet) { Write-Verbose "arrSet = $arrSet" @@ -584,27 +527,6 @@ function _buildProjectNameDynamicParam { #> } -function _getProcesses { - if (-not $(_getInstance)) { - Write-Output @() - return - } - - # Call the REST API - try { - $query = @{ } - $query['stateFilter'] = 'All' - $query['$top'] = '9999' - $resp = _callAPI -area 'process' -resource 'processes' -Version $(_getApiVersion Core) -QueryString $query -NoProject - - if ($resp.count -gt 0) { - Write-Output ($resp.value).name - } - } - catch { - Write-Output @() - } -} function _buildProcessNameDynamicParam { param( [string] $ParameterName = 'ProcessName', @@ -641,14 +563,7 @@ function _buildProcessNameDynamicParam { } # Generate and set the ValidateSet - if ($([VSTeamProcessCache]::timestamp) -ne (Get-Date).TimeOfDay.TotalMinutes) { - $arrSet = _getProcesses - [VSTeamProcessCache]::processes = $arrSet - [VSTeamProcessCache]::timestamp = (Get-Date).TimeOfDay.TotalMinutes - } - else { - $arrSet = [VSTeamProcessCache]::processes - } + $arrSet = [vsteam_lib.ProcessTemplateCache]::GetCurrent() if ($arrSet) { Write-Verbose "arrSet = $arrSet" @@ -880,7 +795,7 @@ function _setEnvironmentVariables { $env:TEAM_VERSION = $Version $env:TEAM_TOKEN = $BearerToken - [VSTeamVersions]::Account = $Acct + [vsteam_lib.Versions]::Account = $Acct # This is so it can be loaded by default in the next session if ($Level -ne "Process") { @@ -899,8 +814,8 @@ function _clearEnvironmentVariables { $env:TEAM_PROJECT = $null $env:TEAM_TIMEOUT = $null - [VSTeamVersions]::DefaultProject = '' - [VSTeamVersions]::DefaultTimeout = '' + [vsteam_lib.Versions]::DefaultProject = '' + [vsteam_lib.Versions]::DefaultTimeout = '' $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") $Global:PSDefaultParameterValues.Remove("*-vsteam*:vsteamApiTimeout") @@ -946,14 +861,84 @@ function _getVSTeamIdFromDescriptor { return [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($Padded)) } +function _getPermissionInheritanceInfo { + [cmdletbinding()] + [OutputType([System.Collections.Hashtable])] + param( + [parameter(Mandatory = $true)] + [string] $projectName, + + [parameter(Mandatory = $true)] + [string] $resourceName, + [Parameter(Mandatory = $true)] + + [ValidateSet('Repository', 'BuildDefinition', 'ReleaseDefinition')] + [string] $resourceType + ) + + $projectId = (Get-VSTeamProject -Name $projectName | Select-Object -ExpandProperty id) + + Switch ($resourceType) { + "Repository" { + $securityNamespaceID = "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" + + $repositoryId = (Get-VSTeamGitRepository -Name "$resourceName" -projectName $projectName | Select-Object -ExpandProperty id ) + + if ($null -eq $repositoryId) { + Write-Error "Unable to retrieve repository information. Ensure that the resourceName provided matches a repository name exactly." + return + } + + $token = "repoV2/$($projectId)/$repositoryId" + } + + "BuildDefinition" { + $securityNamespaceID = "33344d9c-fc72-4d6f-aba5-fa317101a7e9" + + $buildDefinitionId = (Get-VSTeamBuildDefinition -projectName $projectName | Where-Object name -eq "$resourceName" | Select-Object -ExpandProperty id) + + if ($null -eq $buildDefinitionId) { + Write-Error "Unable to retrieve build definition information. Ensure that the resourceName provided matches a build definition name exactly." + return + } + + $token = "$($projectId)/$buildDefinitionId" + } + + "ReleaseDefinition" { + $securityNamespaceID = "c788c23e-1b46-4162-8f5e-d7585343b5de" + + $releaseDefinition = (Get-VSTeamReleaseDefinition -projectName $projectName | Where-Object -Property name -eq "$resourceName") + + if ($null -eq $releaseDefinition) { + Write-Error "Unable to retrieve release definition information. Ensure that the resourceName provided matches a release definition name exactly." + return + } + + if (($releaseDefinition).path -eq "/") { + $token = "$($projectId)/$($releaseDefinition.id)" + } + else { + $token = "$($projectId)" + "$($releaseDefinition.path -replace "\\","/")" + "/$($releaseDefinition.id)" + } + } + } + + return @{ + Token = $token + ProjectID = $projectId + SecurityNamespaceID = $securityNamespaceID + } +} + function _getDescriptorForACL { [cmdletbinding()] param( [parameter(Mandatory = $true, ParameterSetName = "ByUser")] - [VSTeamUser]$User, + [vsteam_lib.User]$User, [parameter(MAndatory = $true, ParameterSetName = "ByGroup")] - [VSTeamGroup]$Group + [vsteam_lib.Group]$Group ) if ($User) { diff --git a/Source/Public/Add-VSTeam.ps1 b/Source/Public/Add-VSTeam.ps1 index 467e334b2..17b40bc2c 100644 --- a/Source/Public/Add-VSTeam.ps1 +++ b/Source/Public/Add-VSTeam.ps1 @@ -1,25 +1,36 @@ +# Create a team in a team project. +# +# Get-VSTeamOption 'core' 'teams' +# id : d30a3dd1-f8ba-442a-b86a-bd0c0c383e59 +# area : core +# resourceName : teams +# routeTemplate : _apis/projects/{projectId}/{resource}/{*teamId} +# https://bit.ly/Add-VSTeam + function Add-VSTeam { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeam')] param( - [Parameter(Mandatory = $true, Position = 1)] + [Parameter(Mandatory = $true, Position = 0)] [Alias('TeamName')] [string] $Name, + [Parameter(Position = 1)] [string] $Description = '', - - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { $body = '{ "name": "' + $Name + '", "description": "' + $Description + '" }' - # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -NoProject ` - -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Core) + $resp = _callAPI -Method POST -NoProject ` + -Resource "projects/$ProjectName/teams" ` + -Body $body ` + -Version $(_getApiVersion Core) - $team = [VSTeamTeam]::new($resp, $ProjectName) + $team = [vsteam_lib.Team]::new($resp, $ProjectName) Write-Output $team } diff --git a/Source/Public/Add-VSTeamAccessControlEntry.ps1 b/Source/Public/Add-VSTeamAccessControlEntry.ps1 index 5ebf4fb9d..89ddce087 100644 --- a/Source/Public/Add-VSTeamAccessControlEntry.ps1 +++ b/Source/Public/Add-VSTeamAccessControlEntry.ps1 @@ -1,31 +1,41 @@ +# Add or update ACEs in the ACL for the provided token. The request body +# contains the target token, a list of ACEs and a optional merge parameter. +# In the case of a collision (by identity descriptor) with an existing ACE +# in the ACL, the "merge" parameter determines the behavior. If set, the +# existing ACE has its allow and deny merged with the incoming ACE's allow +# and deny. If unset, the existing ACE is displaced. +# +# Get-VSTeamOption 'Security' 'AccessControlEntries' +# id : ac08c8ff-4323-4b08-af90-bcd018d380ce +# area : Security +# resourceName : AccessControlEntries +# routeTemplate : _apis/{resource}/{securityNamespaceId} +# https://bit.ly/Add-VSTeamAccessControlEntry + function Add-VSTeamAccessControlEntry { - [CmdletBinding(DefaultParameterSetName = 'ByNamespace')] + [CmdletBinding(DefaultParameterSetName = 'ByNamespace', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamAccessControlEntry')] param( [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $true, ValueFromPipeline = $true)] - [VSTeamSecurityNamespace] $SecurityNamespace, + [vsteam_lib.SecurityNamespace] $SecurityNamespace, [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)] [guid] $SecurityNamespaceId, - [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $true)] - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)] + [Parameter(Mandatory = $true)] [string] $Token, - [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $true)] - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)] + [Parameter(Mandatory = $true)] [string] $Descriptor, - [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $true)] - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)] + [Parameter(Mandatory = $true)] [ValidateRange(0, [int]::MaxValue)] [int] $AllowMask, - [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $true)] - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)] + [Parameter(Mandatory = $true)] [ValidateRange(0, [int]::MaxValue)] [int] $DenyMask ) - process { if ($SecurityNamespace) { $SecurityNamespaceId = $SecurityNamespace.ID @@ -46,10 +56,11 @@ function Add-VSTeamAccessControlEntry { ] } "@ - # Call the REST API - $resp = _callAPI -Area 'accesscontrolentries' -id $SecurityNamespaceId -method POST -body $body ` - -Version $(_getApiVersion Core) -NoProject ` - -ContentType "application/json" + $resp = _callAPI -Method POST -NoProject ` + -Resource "accesscontrolentries" ` + -Id $SecurityNamespaceId ` + -Body $body ` + -Version $(_getApiVersion Core) if ($resp.count -ne 1) { throw "Expected 1 result, but got $($rep.count)" @@ -58,7 +69,7 @@ function Add-VSTeamAccessControlEntry { # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $acl = [VSTeamAccessControlEntry]::new($resp.value) + $acl = [vsteam_lib.AccessControlEntry]::new($resp.value[0]) Write-Output $acl } diff --git a/Source/Public/Add-VSTeamArea.ps1 b/Source/Public/Add-VSTeamArea.ps1 index 3aa057836..59b6728c5 100644 --- a/Source/Public/Add-VSTeamArea.ps1 +++ b/Source/Public/Add-VSTeamArea.ps1 @@ -1,20 +1,31 @@ +# Create new or update an existing classification node. +# +# Get-VSTeamOption 'wit' 'classificationNodes' +# id : 5a172953-1b41-49d3-840a-33f79c3ce89f +# area : wit +# resourceName : classificationNodes +# routeTemplate : {project}/_apis/{area}/{resource}/{structureGroup}/{*path} +# https://bit.ly/Add-VSTeamClassificationNode + function Add-VSTeamArea { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamArea')] param( - [Parameter(Mandatory = $true)] + [Parameter(Mandatory = $true, Position = 0)] [string] $Name, [Parameter(Mandatory = $false)] [string] $Path, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - process { - $resp = Add-VSTeamClassificationNode -Name $Name -StructureGroup "areas" -Path $Path -ProjectName $ProjectName + $resp = Add-VSTeamClassificationNode -ProjectName $ProjectName ` + -Name $Name ` + -StructureGroup areas ` + -Path $Path Write-Output $resp } diff --git a/Source/Public/Add-VSTeamAzureRMServiceEndpoint.ps1 b/Source/Public/Add-VSTeamAzureRMServiceEndpoint.ps1 index 50706a29e..c366c66ab 100644 --- a/Source/Public/Add-VSTeamAzureRMServiceEndpoint.ps1 +++ b/Source/Public/Add-VSTeamAzureRMServiceEndpoint.ps1 @@ -1,10 +1,20 @@ +# Create a service endpoint. +# +# Get-VSTeamOption 'distributedtask' 'serviceendpoints' +# id : dca61d2f-3444-410a-b5ec-db2fc4efb4c5 +# area : distributedtask +# resourceName : serviceendpoints +# routeTemplate : {project}/_apis/{area}/{resource}/{endpointId} +# https://bit.ly/Add-VSTeamServiceEndpoint + function Add-VSTeamAzureRMServiceEndpoint { - [CmdletBinding(DefaultParameterSetName = 'Automatic')] + [CmdletBinding(DefaultParameterSetName = 'Automatic', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamAzureRMServiceEndpoint')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('displayName')] [string] $subscriptionName, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $subscriptionId, @@ -19,9 +29,9 @@ function Add-VSTeamAzureRMServiceEndpoint { [string] $endpointName, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -53,10 +63,9 @@ function Add-VSTeamAzureRMServiceEndpoint { url = 'https://management.azure.com/' } - return Add-VSTeamServiceEndpoint ` - -ProjectName $ProjectName ` + return Add-VSTeamServiceEndpoint -ProjectName $ProjectName ` -endpointName $endpointName ` - -endpointType 'azurerm' ` + -endpointType azurerm ` -object $obj } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamBuild.ps1 b/Source/Public/Add-VSTeamBuild.ps1 index d997a77d4..76bc89251 100644 --- a/Source/Public/Add-VSTeamBuild.ps1 +++ b/Source/Public/Add-VSTeamBuild.ps1 @@ -1,5 +1,15 @@ +# Queues a build. +# +# Get-VSTeamOption 'build' 'Builds' +# id : 0cd358e1-9217-4d94-8269-1c1ee6f93dcf +# area : Build +# resourceName : Builds +# routeTemplate : {project}/_apis/build/{resource}/{buildId} +# https://bit.ly/Add-VSTeamBuild + function Add-VSTeamBuild { - [CmdletBinding(DefaultParameterSetName = 'ByName')] + [CmdletBinding(DefaultParameterSetName = 'ByName', + HelpUri = 'https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamBuild')] param( [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] [Int32] $BuildDefinitionId, @@ -10,15 +20,15 @@ function Add-VSTeamBuild { [Parameter(Mandatory = $false)] [hashtable] $BuildParameters, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName, - [ArgumentCompleter([TeamQueueCompleter])] + [ArgumentCompleter([vsteam_lib.QueueCompleter])] [string] $QueueName, - [ArgumentCompleter([BuildDefinitionCompleter])] + [ArgumentCompleter([vsteam_lib.BuildDefinitionCompleter])] [string] $BuildDefinitionName ) begin { @@ -31,7 +41,7 @@ function Add-VSTeamBuild { } elseif ($BuildDefinitionName) { # Find the BuildDefinition id from the name - $id = (Get-VSTeamBuildDefinition -ProjectName "$ProjectName" -Filter $BuildDefinitionName -Type All).id + $id = (Get-VSTeamBuildDefinition -ProjectName "$ProjectName" -Filter $BuildDefinitionName).id if (-not $id) { throw "'$BuildDefinitionName' is not a valid build definition. Use Get-VSTeamBuildDefinition to get a list of build names" return @@ -44,21 +54,20 @@ function Add-VSTeamBuild { } else { throw "'No build definition was given. Use Get-VSTeamBuildDefinition to get a list of builds" - return + return } - + if ($QueueName) { $queueId = (Get-VSTeamQueue -ProjectName "$ProjectName" -queueName "$QueueName").id 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 } + else { + $body["queue"] = @{id = $queueId } } } } - process { if ($SourceBranch) { $body.Add('sourceBranch', $SourceBranch) @@ -67,14 +76,15 @@ function Add-VSTeamBuild { if ($BuildParameters) { $body.Add('parameters', ($BuildParameters | ConvertTo-Json -Compress)) } - - # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' ` - -Method Post -ContentType 'application/json' -Body ($body | ConvertTo-Json) ` + + $resp = _callAPI -Method POST -ProjectName $ProjectName ` + -Area "build" ` + -Resource "builds" ` + -Body ($body | ConvertTo-Json -Compress -Depth 100) ` -Version $(_getApiVersion Build) - _applyTypesToBuild -item $resp + $build = [vsteam_lib.Build]::new($resp, $ProjectName) - return $resp + Write-Output $build } } diff --git a/Source/Public/Add-VSTeamBuildDefinition.ps1 b/Source/Public/Add-VSTeamBuildDefinition.ps1 index c5434d60a..f3aa99170 100644 --- a/Source/Public/Add-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Add-VSTeamBuildDefinition.ps1 @@ -1,16 +1,28 @@ +# Creates a new definition. +# +# Get-VSTeamOption 'build' 'Definitions' +# id : dbeaf647-6167-421a-bda9-c9327b25e2e6 +# area : Build +# resourceName : Definitions +# routeTemplate : {project}/_apis/build/{resource}/{definitionId} +# https://bit.ly/Add-VSTeamBuildDefinition + function Add-VSTeamBuildDefinition { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamBuildDefinition')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $InFile, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - process { - return _callAPI -Method Post -ProjectName $ProjectName -Area build -Resource definitions -Version $(_getApiVersion Build) -infile $InFile + return _callAPI -Method POST -ProjectName $ProjectName ` + -Area "build" ` + -Resource "definitions" ` + -infile $InFile ` + -Version $(_getApiVersion Build) } } diff --git a/Source/Public/Add-VSTeamBuildTag.ps1 b/Source/Public/Add-VSTeamBuildTag.ps1 index c0b16cfb3..a513c67cd 100644 --- a/Source/Public/Add-VSTeamBuildTag.ps1 +++ b/Source/Public/Add-VSTeamBuildTag.ps1 @@ -1,27 +1,39 @@ +# Adds a tag to a build. +# +# Get-VSTeamOption 'build' 'tags' +# id : 6e6114b2-8161-44c8-8f6c-c5505782427f +# area : build +# resourceName : tags +# routeTemplate : {project}/_apis/{area}/builds/{buildId}/{resource}/{*tag} +# http://bit.ly/Add-VSTeamBuildTag + function Add-VSTeamBuildTag { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamBuildTag')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [string[]] $Tags, - + [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] [int[]] $Id, [switch] $Force, - - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Add-VSTeamBuildTag")) { foreach ($tag in $tags) { - # Call the REST API - _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` - -Method Put -Querystring @{tag = $tag } -Version $(_getApiVersion Build) | Out-Null + _callAPI -Method PUT -ProjectName $projectName ` + -Area "build/builds/$id" ` + -Resource "tags" ` + -id $tag ` + -Version $(_getApiVersion Build) | Out-Null } } } diff --git a/Source/Public/Add-VSTeamClassificationNode.ps1 b/Source/Public/Add-VSTeamClassificationNode.ps1 index 1200a55c7..8f37fb706 100644 --- a/Source/Public/Add-VSTeamClassificationNode.ps1 +++ b/Source/Public/Add-VSTeamClassificationNode.ps1 @@ -1,33 +1,34 @@ +# Create new or update an existing classification node. +# +# Get-VSTeamOption 'wit' 'classificationNodes' +# id : 5a172953-1b41-49d3-840a-33f79c3ce89f +# area : wit +# resourceName : classificationNodes +# routeTemplate : {project}/_apis/{area}/{resource}/{structureGroup}/{*path} +# https://bit.ly/Add-VSTeamClassificationNode + function Add-VSTeamClassificationNode { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamClassificationNode')] param( - [CmdletBinding(DefaultParameterSetName = 'ByArea')] - [CmdletBinding(DefaultParameterSetName = 'ByIteration')] [Parameter(Mandatory = $true)] [string] $Name, - [CmdletBinding(DefaultParameterSetName = 'ByArea')] - [CmdletBinding(DefaultParameterSetName = 'ByIteration')] [ValidateSet("areas", "iterations")] [Parameter(Mandatory = $true)] [string] $StructureGroup, - [CmdletBinding(DefaultParameterSetName = 'ByArea')] - [CmdletBinding(DefaultParameterSetName = 'ByIteration')] [Parameter(Mandatory = $false)] [string] $Path = $null, - [CmdletBinding(DefaultParameterSetName = 'ByIteration')] [Parameter(Mandatory = $false)] [datetime] $StartDate, - [CmdletBinding(DefaultParameterSetName = 'ByIteration')] [Parameter(Mandatory = $false)] [datetime] $FinishDate, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -46,22 +47,24 @@ function Add-VSTeamClassificationNode { name = $Name } - if($StructureGroup -eq "iterations"){ + if ($StructureGroup -eq "iterations") { $body.attributes = @{ - startDate = $StartDate + startDate = $StartDate finishDate = $FinishDate - } + } } - $bodyAsJson = $body | ConvertTo-Json + $bodyAsJson = $body | ConvertTo-Json -Compress -Depth 100 # Call the REST API - $resp = _callAPI -Method "Post" -ProjectName $ProjectName -Area 'wit' -Resource "classificationnodes" -id $id ` - -ContentType 'application/json; charset=utf-8' ` + $resp = _callAPI -Method POST -ProjectName $ProjectName ` + -Area "wit" ` + -Resource "classificationnodes" ` + -id $id ` -body $bodyAsJson ` -Version $(_getApiVersion Core) - - $resp = [VSTeamClassificationNode]::new($resp, $ProjectName) + + $resp = [vsteam_lib.ClassificationNode]::new($resp, $ProjectName) Write-Output $resp } diff --git a/Source/Public/Add-VSTeamExtension.ps1 b/Source/Public/Add-VSTeamExtension.ps1 index ffaf958d5..26255cd6b 100644 --- a/Source/Public/Add-VSTeamExtension.ps1 +++ b/Source/Public/Add-VSTeamExtension.ps1 @@ -1,4 +1,14 @@ +# Install the specified extension into the account / project collection. +# +# Get-VSTeamOption 'extensionmanagement' 'installedextensionsbyname' -subDomain 'extmgmt' +# id : fb0da285-f23e-4b56-8b53-3ef5f9f6de66 +# area : ExtensionManagement +# resourceName : InstalledExtensionsByName +# routeTemplate : _apis/{area}/{resource}/{publisherName}/{extensionName}/{version} +# http://bit.ly/Add-VSTeamExtension + function Add-VSTeamExtension { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamExtension')] param( [parameter(Mandatory = $true)] [string] $PublisherId, @@ -10,15 +20,19 @@ function Add-VSTeamExtension { [string] $Version ) Process { - $resource = "extensionmanagement/installedextensionsbyname/$PublisherId/$ExtensionId" + $id = "$PublisherId/$ExtensionId" if ($version) { - $resource += '/' + $Version + $id += '/' + $Version } - $resp = _callAPI -Method Post -SubDomain 'extmgmt' -Resource $resource -Version $(_getApiVersion ExtensionsManagement) -ContentType "application/json" + $resp = _callAPI -Method POST -SubDomain 'extmgmt' ` + -Area "extensionmanagement" ` + -Resource "installedextensionsbyname" ` + -Id $id ` + -Version $(_getApiVersion ExtensionsManagement) - $item = [VSTeamExtension]::new($resp) + $item = [vsteam_lib.Extension]::new($resp) Write-Output $item } diff --git a/Source/Public/Add-VSTeamFeed.ps1 b/Source/Public/Add-VSTeamFeed.ps1 index 4e5d97d84..0ebfd4642 100644 --- a/Source/Public/Add-VSTeamFeed.ps1 +++ b/Source/Public/Add-VSTeamFeed.ps1 @@ -1,5 +1,14 @@ +# Adds a new feed to package management. +# +# Get-VSTeamOption 'packaging' 'feeds' -subDomain 'feeds' +# id : c65009a7-474a-4ad1-8b42-7d852107ef8c +# area : Packaging +# resourceName : Feeds +# routeTemplate : {project}/_apis/{area}/{resource}/{feedId} +# http://bit.ly/Add-VSTeamFeed + function Add-VSTeamFeed { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamFeed')] param ( [Parameter(Position = 0, Mandatory = $true)] [string] $Name, @@ -43,12 +52,15 @@ function Add-VSTeamFeed { ) } - $bodyAsJson = $body | ConvertTo-Json + $bodyAsJson = $body | ConvertTo-Json -Compress -Depth 100 # Call the REST API - $resp = _callAPI -subDomain feeds -Area packaging -Resource feeds ` - -Method Post -ContentType 'application/json' -body $bodyAsJson -Version $(_getApiVersion Packaging) + $resp = _callAPI -Method POST -subDomain "feeds" ` + -Area "packaging" ` + -Resource "feeds" ` + -body $bodyAsJson ` + -Version $(_getApiVersion Packaging) - return [VSTeamFeed]::new($resp) + Write-Output [vsteam_lib.Feed]::new($resp) } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamGitRepository.ps1 b/Source/Public/Add-VSTeamGitRepository.ps1 index 9cdfd4c2b..a2fc8bf4a 100644 --- a/Source/Public/Add-VSTeamGitRepository.ps1 +++ b/Source/Public/Add-VSTeamGitRepository.ps1 @@ -1,12 +1,21 @@ +# Adds a Git repository to your Azure DevOps or Team Foundation Server account. +# +# Get-VSTeamOption 'git' 'repositories' +# id : 225f7195-f9c7-4d14-ab28-a83f7ff77e1f +# area : git +# resourceName : repositories +# routeTemplate : {project}/_apis/{area}/{resource}/{repositoryId} +# http://bit.ly/Add-VSTeamGitRepository + function Add-VSTeamGitRepository { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamGitRepository')] param( [parameter(Mandatory = $true)] [string] $Name, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -14,13 +23,16 @@ function Add-VSTeamGitRepository { try { # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'git' -Resource 'repositories' ` - -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) + $resp = _callAPI -Method POST -ProjectName $ProjectName ` + -Area "git" ` + -Resource "repositories" ` + -Body $body ` + -Version $(_getApiVersion Git) # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $repo = [VSTeamGitRepository]::new($resp, $ProjectName) + $repo = [vsteam_lib.GitRepository]::new($resp, $ProjectName) Write-Output $repo } diff --git a/Source/Public/Add-VSTeamGitRepositoryPermission.ps1 b/Source/Public/Add-VSTeamGitRepositoryPermission.ps1 index b47ba3c34..d060c54bd 100644 --- a/Source/Public/Add-VSTeamGitRepositoryPermission.ps1 +++ b/Source/Public/Add-VSTeamGitRepositoryPermission.ps1 @@ -1,16 +1,23 @@ +# Add or update ACEs in the ACL for the provided token. The request body +# contains the target token, a list of ACEs and a optional merge parameter. +# In the case of a collision (by identity descriptor) with an existing ACE +# in the ACL, the "merge" parameter determines the behavior. If set, the +# existing ACE has its allow and deny merged with the incoming ACE's allow +# and deny. If unset, the existing ACE is displaced. +# +# Get-VSTeamOption 'Security' 'AccessControlEntries' +# id : ac08c8ff-4323-4b08-af90-bcd018d380ce +# area : Security +# resourceName : AccessControlEntries +# routeTemplate : _apis/{resource}/{securityNamespaceId} +# https://bit.ly/Add-VSTeamAccessControlEntry + function Add-VSTeamGitRepositoryPermission { - [CmdletBinding(DefaultParameterSetName = 'ByProjectAndUser')] + [CmdletBinding(DefaultParameterSetName = 'ByProjectAndUser', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamGitRepositoryPermission')] param( - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndDescriptor")] - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndDescriptor")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndDescriptor")] - [VSTeamProject]$Project, + [parameter(Mandatory = $true)] + [vsteam_lib.Project]$Project, [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] @@ -38,34 +45,18 @@ function Add-VSTeamGitRepositoryPermission { [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] - [VSTeamGroup]$Group, + [vsteam_lib.Group]$Group, [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] - [VSTeamUser]$User, + [vsteam_lib.User]$User, - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndDescriptor")] - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndDescriptor")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndDescriptor")] - [VSTeamGitRepositoryPermissions]$Allow, + [parameter(Mandatory = $true)] + [vsteam_lib.GitRepositoryPermissions]$Allow, - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndDescriptor")] - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndGroup")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndUser")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryIdAndDescriptor")] - [parameter(Mandatory = $true, ParameterSetName = "ByRepositoryNameAndDescriptor")] - [VSTeamGitRepositoryPermissions]$Deny + [parameter(Mandatory = $true)] + [vsteam_lib.GitRepositoryPermissions]$Deny ) process { @@ -90,14 +81,14 @@ function Add-VSTeamGitRepositoryPermission { if ($Group) { $Descriptor = _getDescriptorForACL -Group $Group } - + # Resolve User to Descriptor if ($User) { $Descriptor = _getDescriptorForACL -User $User } $token = "repoV2/$($Project.ID)" - + if ($RepositoryId) { $token += "/$($RepositoryId)" } @@ -107,6 +98,10 @@ function Add-VSTeamGitRepositoryPermission { $token += "/refs/heads/$($branchHex)" } - Add-VSTeamAccessControlEntry -SecurityNamespaceId $securityNamespaceId -Descriptor $Descriptor -Token $token -AllowMask ([int]$Allow) -DenyMask ([int]$Deny) + Add-VSTeamAccessControlEntry -SecurityNamespaceId $securityNamespaceId ` + -Descriptor $Descriptor ` + -Token $token ` + -AllowMask ([int]$Allow) ` + -DenyMask ([int]$Deny) } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamIteration.ps1 b/Source/Public/Add-VSTeamIteration.ps1 index 0fdcf1c25..41d144959 100644 --- a/Source/Public/Add-VSTeamIteration.ps1 +++ b/Source/Public/Add-VSTeamIteration.ps1 @@ -1,38 +1,48 @@ +# Create new or update an existing classification node. +# +# Get-VSTeamOption 'wit' 'classificationNodes' +# id : 5a172953-1b41-49d3-840a-33f79c3ce89f +# area : wit +# resourceName : classificationNodes +# routeTemplate : {project}/_apis/{area}/{resource}/{structureGroup}/{*path} +# https://bit.ly/Add-VSTeamClassificationNode + function Add-VSTeamIteration { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamIteration')] param( [Parameter(Mandatory = $true)] [string] $Name, - + [Parameter(Mandatory = $false)] [string] $Path, - + [Parameter(Mandatory = $false)] [datetime] $StartDate, [Parameter(Mandatory = $false)] [datetime] $FinishDate, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { $params = @{} - if($StartDate){ + if ($StartDate) { $params.StartDate = $StartDate } - if($FinishDate){ + if ($FinishDate) { $params.FinishDate = $FinishDate } - $resp = Add-VSTeamClassificationNode -Name $Name -StructureGroup "iterations" -Path $Path -ProjectName $ProjectName @params - - $resp = [VSTeamClassificationNode]::new($resp, $ProjectName) + $resp = Add-VSTeamClassificationNode @params -ProjectName $ProjectName ` + -Name $Name ` + -StructureGroup iterations ` + -Path $Path Write-Output $resp } diff --git a/Source/Public/Add-VSTeamKubernetesEndpoint.ps1 b/Source/Public/Add-VSTeamKubernetesEndpoint.ps1 index 6dbdde1bf..a7d1212ed 100644 --- a/Source/Public/Add-VSTeamKubernetesEndpoint.ps1 +++ b/Source/Public/Add-VSTeamKubernetesEndpoint.ps1 @@ -1,32 +1,41 @@ +# Create a service endpoint. +# +# Get-VSTeamOption 'distributedtask' 'serviceendpoints' +# id : dca61d2f-3444-410a-b5ec-db2fc4efb4c5 +# area : distributedtask +# resourceName : serviceendpoints +# routeTemplate : {project}/_apis/{area}/{resource}/{endpointId} +# https://bit.ly/Add-VSTeamServiceEndpoint + function Add-VSTeamKubernetesEndpoint { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamKubernetesEndpoint')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $endpointName, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $kubeconfig, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $kubernetesUrl, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $clientCertificateData, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $clientKeyData, - + [switch] $acceptUntrustedCerts, - + [switch] $generatePfx, - - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - - process { + + process { # Process switch parameters $untrustedCerts = $false if ($acceptUntrustedCerts.IsPresent) { @@ -54,10 +63,9 @@ function Add-VSTeamKubernetesEndpoint { url = $kubernetesUrl } - return Add-VSTeamServiceEndpoint ` - -ProjectName $ProjectName ` + return Add-VSTeamServiceEndpoint -ProjectName $ProjectName ` -endpointName $endpointName ` - -endpointType 'kubernetes' ` + -endpointType kubernetes ` -object $obj } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamMembership.ps1 b/Source/Public/Add-VSTeamMembership.ps1 index b9501b78a..6c94b5e46 100644 --- a/Source/Public/Add-VSTeamMembership.ps1 +++ b/Source/Public/Add-VSTeamMembership.ps1 @@ -1,14 +1,24 @@ +# Adds a membership to a container. +# +# Get-VSTeamOption 'graph' 'memberships' -subDomain 'vssps' +# id : 3fd2e6ca-fb30-443a-b579-95b19ed0934c +# area : Graph +# resourceName : Memberships +# routeTemplate : _apis/{area}/{resource}/{subjectDescriptor}/{containerDescriptor} +# http://bit.ly/Add-VSTeamMembership + function Add-VSTeamMembership { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamMembership')] param( [Parameter(Mandatory = $true)] [string] $MemberDescriptor, - + [Parameter(Mandatory = $true)] [string] $ContainerDescriptor ) process { - return _callMembershipAPI -Id "$MemberDescriptor/$ContainerDescriptor" -Method Put + return _callMembershipAPI -Method PUT ` + -Id "$MemberDescriptor/$ContainerDescriptor" } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamNuGetEndpoint.ps1 b/Source/Public/Add-VSTeamNuGetEndpoint.ps1 index 0eb50055f..3a50c2483 100644 --- a/Source/Public/Add-VSTeamNuGetEndpoint.ps1 +++ b/Source/Public/Add-VSTeamNuGetEndpoint.ps1 @@ -1,37 +1,46 @@ +# Create a service endpoint. +# +# Get-VSTeamOption 'distributedtask' 'serviceendpoints' +# id : dca61d2f-3444-410a-b5ec-db2fc4efb4c5 +# area : distributedtask +# resourceName : serviceendpoints +# routeTemplate : {project}/_apis/{area}/{resource}/{endpointId} +# https://bit.ly/Add-VSTeamServiceEndpoint + function Add-VSTeamNuGetEndpoint { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword", "")] [CmdletBinding(DefaultParameterSetName = 'SecureApiKey')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $EndpointName, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $NuGetUrl, - + [Parameter(ParameterSetName = 'ClearToken', Mandatory = $true, HelpMessage = 'Personal Access Token')] [string] $PersonalAccessToken, - + [Parameter(ParameterSetName = 'ClearApiKey', Mandatory = $true, HelpMessage = 'ApiKey')] [string] $ApiKey, - + [Parameter(ParameterSetName = 'SecurePassword', Mandatory = $true, HelpMessage = 'Username')] [string] $Username, - + [Parameter(ParameterSetName = 'SecureToken', Mandatory = $true, HelpMessage = 'Personal Access Token')] [securestring] $SecurePersonalAccessToken, - + [Parameter(ParameterSetName = 'SecureApiKey', Mandatory = $true, HelpMessage = 'ApiKey')] [securestring] $SecureApiKey, - + [Parameter(ParameterSetName = 'SecurePassword', Mandatory = $true, HelpMessage = 'Password')] [securestring] $SecurePassword, - - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { if ($PersonalAccessToken) { $Authentication = 'Token' @@ -88,10 +97,9 @@ function Add-VSTeamNuGetEndpoint { } } - return Add-VSTeamServiceEndpoint ` - -ProjectName $ProjectName ` + return Add-VSTeamServiceEndpoint -ProjectName $ProjectName ` -endpointName $endpointName ` - -endpointType 'externalnugetfeed' ` + -endpointType externalnugetfeed ` -object $obj } } diff --git a/Source/Public/Add-VSTeamPolicy.ps1 b/Source/Public/Add-VSTeamPolicy.ps1 index a0dc11b05..f198270f4 100644 --- a/Source/Public/Add-VSTeamPolicy.ps1 +++ b/Source/Public/Add-VSTeamPolicy.ps1 @@ -1,5 +1,14 @@ +# Adds a new policy to the specified project. +# +# Get-VSTeamOption 'policy' 'configurations' +# id : dad91cbe-d183-45f8-9c6e-9c1164472121 +# area : policy +# resourceName : configurations +# routeTemplate : {project}/_apis/{area}/{resource}/{configurationId} +# http://bit.ly/Add-VSTeamPolicy + function Add-VSTeamPolicy { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamPolicy')] param( [Parameter(Mandatory = $true)] [guid] $type, @@ -11,9 +20,9 @@ function Add-VSTeamPolicy { [Parameter(Mandatory = $true)] [hashtable] $settings, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -28,8 +37,11 @@ function Add-VSTeamPolicy { try { # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'policy' -Resource 'configurations' ` - -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) + $resp = _callAPI -Method POST -ProjectName $ProjectName ` + -Area "policy" ` + -Resource "configurations" ` + -Body $body ` + -Version $(_getApiVersion Policy) Write-Output $resp } diff --git a/Source/Public/Add-VSTeamProfile.ps1 b/Source/Public/Add-VSTeamProfile.ps1 index be0425e5f..c3457a802 100644 --- a/Source/Public/Add-VSTeamProfile.ps1 +++ b/Source/Public/Add-VSTeamProfile.ps1 @@ -1,5 +1,9 @@ +# Stores your account name and personal access token as a profile for use with +# the Add-TeamAccount function in this module. + function Add-VSTeamProfile { - [CmdletBinding(DefaultParameterSetName = 'Secure')] + [CmdletBinding(DefaultParameterSetName = 'Secure', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamProfile')] param( [parameter(ParameterSetName = 'Windows', Mandatory = $true, Position = 1)] [parameter(ParameterSetName = 'Secure', Mandatory = $true, Position = 1)] diff --git a/Source/Public/Add-VSTeamProject.ps1 b/Source/Public/Add-VSTeamProject.ps1 index bccb3dda4..da46cc824 100644 --- a/Source/Public/Add-VSTeamProject.ps1 +++ b/Source/Public/Add-VSTeamProject.ps1 @@ -1,4 +1,13 @@ +# Adds a Team Project to your account. +# +# id : 603fe2ac-9723-48b9-88ad-09305aa6c6e1 +# area : core +# resourceName : projects +# routeTemplate : _apis/{resource}/{*projectId} +# http://bit.ly/Add-VSTeamProject + function Add-VSTeamProject { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamProject')] param( [parameter(Mandatory = $true)] [Alias('Name')] @@ -8,11 +17,11 @@ function Add-VSTeamProject { [switch] $TFVC, - [ProcessValidateAttribute()] - [ArgumentCompleter([ProcessTemplateCompleter])] + [vsteam_lib.ProcessTemplateValidateAttribute()] + [ArgumentCompleter([vsteam_lib.ProcessTemplateCompleter])] [string] $ProcessTemplate ) - + process { if ($TFVC.IsPresent) { $srcCtrl = "Tfvc" @@ -31,17 +40,31 @@ function Add-VSTeamProject { $templateTypeId = '6b724908-ef14-45cf-84f8-768b5384da45' } - $body = '{"name": "' + $ProjectName + '", "description": "' + $Description + '", "capabilities": {"versioncontrol": { "sourceControlType": "' + $srcCtrl + '"}, "processTemplate":{"templateTypeId": "' + $templateTypeId + '"}}}' + $body = @{ + name = $ProjectName + description = $Description + capabilities = @{ + versioncontrol = @{ + sourceControlType = $srcCtrl + } + processTemplate = @{ + templateTypeId = $templateTypeId + } + } + } try { # Call the REST API - $resp = _callAPI -Area 'projects' ` - -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion Core) + $resp = _callAPI -Method POST ` + -Resource "projects" ` + -Body ($body | ConvertTo-Json -Compress -Depth 100) ` + -Version $(_getApiVersion Core) _trackProjectProgress -resp $resp -title 'Creating team project' -msg "Name: $($ProjectName), Template: $($processTemplate), Src: $($srcCtrl)" # Invalidate any cache of projects. - [VSTeamProjectCache]::Invalidate() + [vsteam_lib.ProjectCache]::Invalidate() + Start-Sleep -Seconds 5 return Get-VSTeamProject $ProjectName } diff --git a/Source/Public/Add-VSTeamProjectPermission.ps1 b/Source/Public/Add-VSTeamProjectPermission.ps1 index 57f896407..a23c28c69 100644 --- a/Source/Public/Add-VSTeamProjectPermission.ps1 +++ b/Source/Public/Add-VSTeamProjectPermission.ps1 @@ -1,29 +1,38 @@ +# Add or update ACEs in the ACL for the provided token. The request body +# contains the target token, a list of ACEs and a optional merge parameter. +# In the case of a collision (by identity descriptor) with an existing ACE +# in the ACL, the "merge" parameter determines the behavior. If set, the +# existing ACE has its allow and deny merged with the incoming ACE's allow +# and deny. If unset, the existing ACE is displaced. +# +# Get-VSTeamOption 'Security' 'AccessControlEntries' +# id : ac08c8ff-4323-4b08-af90-bcd018d380ce +# area : Security +# resourceName : AccessControlEntries +# routeTemplate : _apis/{resource}/{securityNamespaceId} +# https://bit.ly/Add-VSTeamAccessControlEntry + function Add-VSTeamProjectPermission { - [CmdletBinding(DefaultParameterSetName = 'ByProjectAndUser')] + [CmdletBinding(DefaultParameterSetName = 'ByProjectAndUser', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamProjectPermission')] param( - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndUser")] - [VSTeamProject]$Project, + [parameter(Mandatory = $true)] + [vsteam_lib.Project]$Project, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndDescriptor")] [string]$Descriptor, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndGroup")] - [VSTeamGroup]$Group, + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndGroup")] + [vsteam_lib.Group]$Group, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndUser")] - [VSTeamUser]$User, + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndUser")] + [vsteam_lib.User]$User, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndUser")] - [VSTeamProjectPermissions]$Allow, + [parameter(Mandatory = $true)] + [vsteam_lib.ProjectPermissions]$Allow, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndUser")] - [VSTeamProjectPermissions]$Deny + [parameter(Mandatory = $true)] + [vsteam_lib.ProjectPermissions]$Deny ) process { @@ -33,19 +42,21 @@ function Add-VSTeamProjectPermission { $securityNamespaceId = "52d39943-cb85-4d7f-8fa8-c6baac873819" # Resolve Group to Descriptor - if ($Group) - { + if ($Group) { $Descriptor = _getDescriptorForACL -Group $Group } # Resolve User to Descriptor - if ($User) - { + if ($User) { $Descriptor = _getDescriptorForACL -User $User } $token = "`$PROJECT:vstfs:///Classification/TeamProject/$($Project.ID)" - - Add-VSTeamAccessControlEntry -SecurityNamespaceId $securityNamespaceId -Descriptor $Descriptor -Token $token -AllowMask ([int]$Allow) -DenyMask ([int]$Deny) + + Add-VSTeamAccessControlEntry -SecurityNamespaceId $securityNamespaceId ` + -Descriptor $Descriptor ` + -Token $token ` + -AllowMask ([int]$Allow) ` + -DenyMask ([int]$Deny) } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamPullRequest.ps1 b/Source/Public/Add-VSTeamPullRequest.ps1 index 0bf33ccff..9645797ee 100644 --- a/Source/Public/Add-VSTeamPullRequest.ps1 +++ b/Source/Public/Add-VSTeamPullRequest.ps1 @@ -1,5 +1,14 @@ +# Creates a new Pull Request. +# +# id : 88aea7e8-9501-45dd-ac58-b069aa73b926 +# area : git +# resourceName : repositories +# routeTemplate : _apis/{area}/{projectId}/{resource}/{repositoryId} +# http://bit.ly/Add-VSTeamPullRequest + function Add-VSTeamPullRequest { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamPullRequest')] param( [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Alias('Id')] @@ -25,15 +34,15 @@ function Add-VSTeamPullRequest { [Parameter()] [switch] $Force, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { Write-Verbose "Add-VSTeamPullRequest" - + $body = '{"sourceRefName": "' + $SourceRefName + '", "targetRefName": "' + $TargetRefName + '", "title": "' + $Title + '", "description": "' + $Description + '", "isDraft": ' + $Draft.ToString().ToLower() + '}' Write-Verbose $body @@ -43,8 +52,12 @@ function Add-VSTeamPullRequest { try { Write-Debug 'Add-VSTeamPullRequest Call the REST API' - $resp = _callAPI -ProjectName $ProjectName -Area 'git' -Resource 'repositories' -Id "$RepositoryId/pullrequests" ` - -Method Post -ContentType 'application/json;charset=utf-8' -Body $body -Version $(_getApiVersion Git) + $resp = _callAPI -Method POST -ProjectName $ProjectName ` + -Area "git" ` + -Resource "repositories" ` + -Id "$RepositoryId/pullrequests" ` + -Body $body ` + -Version $(_getApiVersion Git) _applyTypesToPullRequests -item $resp diff --git a/Source/Public/Add-VSTeamRelease.ps1 b/Source/Public/Add-VSTeamRelease.ps1 index b8ecdbf1f..ecc617bf2 100644 --- a/Source/Public/Add-VSTeamRelease.ps1 +++ b/Source/Public/Add-VSTeamRelease.ps1 @@ -1,5 +1,15 @@ +# Queues a new release. +# +# Get-VSTeamOption 'release' 'releases' -subDomain 'vsrm' +# id : a166fde7-27ad-408e-ba75-703c2cc9d500 +# area : Release +# resourceName : releases +# routeTemplate : {project}/_apis/{area}/{resource}/{releaseId} +# http://bit.ly/Add-VSTeamRelease + function Add-VSTeamRelease { - [CmdletBinding(DefaultParameterSetName = 'ById', SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(DefaultParameterSetName = 'ById', SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamRelease')] param( [Parameter(ParameterSetName = 'ById', Mandatory = $true)] [int] $DefinitionId, @@ -16,7 +26,7 @@ function Add-VSTeamRelease { [Parameter(ParameterSetName = 'ById', Mandatory = $true)] [string] $BuildId, - [ArgumentCompleter([BuildCompleter])] + [ArgumentCompleter([vsteam_lib.BuildCompleter])] [Parameter(ParameterSetName = 'ByName', Mandatory = $true)] [string] $BuildNumber, @@ -25,12 +35,12 @@ function Add-VSTeamRelease { [switch] $Force, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName, - [ArgumentCompleter([ReleaseDefinitionCompleter])] + [ArgumentCompleter([vsteam_lib.ReleaseDefinitionCompleter])] [string] $DefinitionName ) @@ -39,7 +49,7 @@ function Add-VSTeamRelease { $buildID = (Get-VSTeamBuild -ProjectName $ProjectName -BuildNumber $BuildNumber).id if (-not $buildID) { throw "'$BuildnNumber' is not a valid build Use Get-VsTeamBuild to get a list of valid build numbers." } } - + if ($DefinitionName -and -not $artifactAlias) { $def = Get-VSTeamReleaseDefinition -ProjectName $ProjectName | Where-Object { $_.name -eq $DefinitionName } $DefinitionId = $def.id @@ -50,17 +60,18 @@ function Add-VSTeamRelease { process { $body = '{"definitionId": ' + $DefinitionId + ', "description": "' + $description + '", "artifacts": [{"alias": "' + $artifactAlias + '", "instanceReference": {"id": "' + $buildId + '", "name": "' + $Name + '", "sourceBranch": "' + $SourceBranch + '"}}]}' Write-Verbose $body - + # Call the REST API if ($force -or $pscmdlet.ShouldProcess($description, "Add Release")) { try { Write-Debug 'Add-VSTeamRelease Call the REST API' - $resp = _callAPI -SubDomain 'vsrm' -ProjectName $ProjectName -Area 'release' -Resource 'releases' ` - -Method Post -ContentType 'application/json' -Body $body -Version $(_getApiVersion Release) - - _applyTypesToRelease $resp - - Write-Output $resp + $resp = _callAPI -Method POST -SubDomain "vsrm" -ProjectName $ProjectName ` + -Area "release" ` + -Resource "releases" ` + -Body $body ` + -Version $(_getApiVersion Release) + + Write-Output $([vsteam_lib.Release]::new($resp, $ProjectName)) } catch { _handleException $_ diff --git a/Source/Public/Add-VSTeamReleaseDefinition.ps1 b/Source/Public/Add-VSTeamReleaseDefinition.ps1 index df0980841..49efac650 100644 --- a/Source/Public/Add-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Add-VSTeamReleaseDefinition.ps1 @@ -1,18 +1,30 @@ +# Creates a new release definition from a JSON file. +# +# Get-VSTeamOption 'release' 'definitions' -subDomain vsrm +# id : d8f96f24-8ea7-4cb6-baab-2df8fc515665 +# area : Release +# resourceName : definitions +# routeTemplate : {project}/_apis/{area}/{resource}/{definitionId} +# http://bit.ly/Add-VSTeamReleaseDefinition + function Add-VSTeamReleaseDefinition { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamReleaseDefinition')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $inFile, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { - $resp = _callAPI -Method Post -subDomain vsrm -Area release -Resource definitions -ProjectName $ProjectName ` - -Version $(_getApiVersion Release) -inFile $inFile -ContentType 'application/json' + $resp = _callAPI -Method POST -subDomain "vsrm" -ProjectName $ProjectName ` + -Area "release" ` + -Resource "definitions" ` + -inFile $inFile ` + -Version $(_getApiVersion Release) Write-Output $resp } diff --git a/Source/Public/Add-VSTeamServiceEndpoint.ps1 b/Source/Public/Add-VSTeamServiceEndpoint.ps1 index 2114b115e..6544f76ae 100644 --- a/Source/Public/Add-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Add-VSTeamServiceEndpoint.ps1 @@ -1,5 +1,15 @@ +# Create a service endpoint. +# +# Get-VSTeamOption 'distributedtask' 'serviceendpoints' +# id : dca61d2f-3444-410a-b5ec-db2fc4efb4c5 +# area : distributedtask +# resourceName : serviceendpoints +# routeTemplate : {project}/_apis/{area}/{resource}/{endpointId} +# https://bit.ly/Add-VSTeamServiceEndpoint + function Add-VSTeamServiceEndpoint { - [CmdletBinding(DefaultParameterSetName = 'Secure')] + [CmdletBinding(DefaultParameterSetName = 'Secure', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamServiceEndpoint')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $endpointName, @@ -10,9 +20,9 @@ function Add-VSTeamServiceEndpoint { [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [hashtable] $object, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -22,8 +32,11 @@ function Add-VSTeamServiceEndpoint { $body = $object | ConvertTo-Json # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'serviceendpoints' ` - -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion ServiceEndpoints) + $resp = _callAPI -Method POST -ProjectName $projectName ` + -Area "distributedtask" ` + -Resource "serviceendpoints" ` + -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 59e53102e..19cee6097 100644 --- a/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 +++ b/Source/Public/Add-VSTeamServiceFabricEndpoint.ps1 @@ -1,10 +1,20 @@ +# Create a service endpoint. +# +# Get-VSTeamOption 'distributedtask' 'serviceendpoints' +# id : dca61d2f-3444-410a-b5ec-db2fc4efb4c5 +# area : distributedtask +# resourceName : serviceendpoints +# routeTemplate : {project}/_apis/{area}/{resource}/{endpointId} +# https://bit.ly/Add-VSTeamServiceEndpoint + function Add-VSTeamServiceFabricEndpoint { - [CmdletBinding(DefaultParameterSetName = 'Certificate')] + [CmdletBinding(DefaultParameterSetName = 'Certificate', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamServiceFabricEndpoint')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('displayName')] [string] $endpointName, - + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $url, @@ -30,12 +40,12 @@ function Add-VSTeamServiceFabricEndpoint { [Parameter(ParameterSetName = 'None', Mandatory = $false, ValueFromPipelineByPropertyName = $true)] [bool] $useWindowsSecurity, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { switch ($PSCmdlet.ParameterSetName) { "Certificate" { @@ -82,10 +92,9 @@ function Add-VSTeamServiceFabricEndpoint { url = $url } - return Add-VSTeamServiceEndpoint ` - -ProjectName $ProjectName ` + return Add-VSTeamServiceEndpoint -ProjectName $ProjectName ` -endpointName $endpointName ` - -endpointType 'servicefabric' ` + -endpointType servicefabric ` -object $obj } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamSonarQubeEndpoint.ps1 b/Source/Public/Add-VSTeamSonarQubeEndpoint.ps1 index cfd2caafc..898f28664 100644 --- a/Source/Public/Add-VSTeamSonarQubeEndpoint.ps1 +++ b/Source/Public/Add-VSTeamSonarQubeEndpoint.ps1 @@ -1,5 +1,15 @@ +# Create a service endpoint. +# +# Get-VSTeamOption 'distributedtask' 'serviceendpoints' +# id : dca61d2f-3444-410a-b5ec-db2fc4efb4c5 +# area : distributedtask +# resourceName : serviceendpoints +# routeTemplate : {project}/_apis/{area}/{resource}/{endpointId} +# https://bit.ly/Add-VSTeamServiceEndpoint + function Add-VSTeamSonarQubeEndpoint { - [CmdletBinding(DefaultParameterSetName = 'Secure')] + [CmdletBinding(DefaultParameterSetName = 'Secure', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamSonarQubeEndpoint')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $endpointName, @@ -13,9 +23,9 @@ function Add-VSTeamSonarQubeEndpoint { [parameter(ParameterSetName = 'Secure', Mandatory = $true, HelpMessage = 'Personal Access Token')] [securestring] $securePersonalAccessToken, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -43,10 +53,9 @@ function Add-VSTeamSonarQubeEndpoint { } try { - return Add-VSTeamServiceEndpoint ` - -ProjectName $ProjectName ` + return Add-VSTeamServiceEndpoint -ProjectName $ProjectName ` -endpointName $endpointName ` - -endpointType 'sonarqube' ` + -endpointType sonarqube ` -object $obj } catch [System.Net.WebException] { diff --git a/Source/Public/Add-VSTeamTaskGroup.ps1 b/Source/Public/Add-VSTeamTaskGroup.ps1 index 0bc1b8517..fc328358e 100644 --- a/Source/Public/Add-VSTeamTaskGroup.ps1 +++ b/Source/Public/Add-VSTeamTaskGroup.ps1 @@ -1,5 +1,14 @@ +# Adds a task group. +# +# Get-VSTeamOption 'distributedtask' 'taskgroups' +# id : 6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7 +# area : distributedtask +# resourceName : taskgroups +# routeTemplate : {project}/_apis/{area}/{resource}/{taskGroupId} +# http://bit.ly/Add-VSTeamTaskGroup + function Add-VSTeamTaskGroup { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamTaskGroup')] param( [Parameter(ParameterSetName = 'ByFile', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $InFile, @@ -7,17 +16,25 @@ function Add-VSTeamTaskGroup { [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Body, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { + $commonArgs = @{ + Method = 'Post' + Area = 'distributedtask' + Resource = 'taskgroups' + ProjectName = $ProjectName + Version = $(_getApiVersion TaskGroups) + } + if ($InFile) { - $resp = _callAPI -Method Post -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -InFile $InFile -ContentType 'application/json' + $resp = _callAPI @commonArgs -InFile $InFile } else { - $resp = _callAPI -Method Post -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -ContentType 'application/json' -Body $Body + $resp = _callAPI @commonArgs -Body $Body } return $resp diff --git a/Source/Public/Add-VSTeamUserEntitlement.ps1 b/Source/Public/Add-VSTeamUserEntitlement.ps1 index 14104c0e2..e9b977cae 100644 --- a/Source/Public/Add-VSTeamUserEntitlement.ps1 +++ b/Source/Public/Add-VSTeamUserEntitlement.ps1 @@ -1,5 +1,15 @@ +# Add a user, assign license and extensions and make them a member of a +# project group in an account. +# +# Get-VSTeamOption 'MemberEntitlementManagement' 'UserEntitlements' -subDomain 'vsaex' +# id : 387f832c-dbf2-4643-88e9-c1aa94dbb737 +# area : MemberEntitlementManagement +# resourceName : UserEntitlements +# routeTemplate : _apis/{resource}/{userDescriptor} +# http://bit.ly/Add-VSTeamUserEntitlement + function Add-VSTeamUserEntitlement { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamUserEntitlement')] param( [Parameter(Mandatory = $true)] [Alias('UserEmail')] @@ -17,9 +27,9 @@ function Add-VSTeamUserEntitlement { [ValidateSet('eligible', 'enterprise', 'none', 'platforms', 'premium', 'professional', 'testProfessional', 'ultimate')] [string]$MSDNLicenseType = "none", - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -49,6 +59,9 @@ function Add-VSTeamUserEntitlement { $body = $obj | ConvertTo-Json # Call the REST API - _callAPI -Method Post -Body $body -SubDomain 'vsaex' -Resource 'userentitlements' -Version $(_getApiVersion MemberEntitlementManagement) -ContentType "application/json" + _callAPI -Method POST -SubDomain "vsaex" ` + -Resource "userentitlements" ` + -Body $body ` + -Version $(_getApiVersion MemberEntitlementManagement) } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamVariableGroup.ps1 b/Source/Public/Add-VSTeamVariableGroup.ps1 index 96cce5640..96f41664e 100644 --- a/Source/Public/Add-VSTeamVariableGroup.ps1 +++ b/Source/Public/Add-VSTeamVariableGroup.ps1 @@ -1,4 +1,14 @@ +# Adds a variable group. +# +# Get-VSTeamOption 'distributedtask' 'variablegroups' +# id : f5b09dd5-9d54-45a1-8b5a-1c8287d634cc +# area : distributedtask +# resourceName : variablegroups +# routeTemplate : {project}/_apis/{area}/{resource}/{groupId} +# http://bit.ly/Add-VSTeamVariableGroup + function Add-VSTeamVariableGroup { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamVariableGroup')] param( [Parameter(ParameterSetName = 'ByHashtable', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Name, @@ -12,15 +22,15 @@ function Add-VSTeamVariableGroup { [Parameter(ParameterSetName = 'ByBody', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Body, - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) DynamicParam { $dp = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - if ([VSTeamVersions]::Version -ne "TFS2017" -and $PSCmdlet.ParameterSetName -eq "ByHashtable") { + if ([vsteam_lib.Versions]::Version -ne "TFS2017" -and $PSCmdlet.ParameterSetName -eq "ByHashtable") { $ParameterName = 'Type' $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet ('Vsts', 'AzureKeyVault') -Mandatory $true $dp.Add($ParameterName, $rp) @@ -34,29 +44,34 @@ function Add-VSTeamVariableGroup { } Process { - if ([string]::IsNullOrWhiteSpace($Body)) - { + # This will throw if this account does not support the variable groups + _supportVariableGroups + + if ([string]::IsNullOrWhiteSpace($Body)) { $bodyAsHashtable = @{ - name = $Name - description = $Description - variables = $Variables - } - if ([VSTeamVersions]::Version -ne "TFS2017") { - $Type = $PSBoundParameters['Type'] + name = $Name + description = $Description + variables = $Variables + } + if ([vsteam_lib.Versions]::Version -ne "TFS2017") { + $Type = $PSBoundParameters['Type'] $bodyAsHashtable.Add("type", $Type) - $ProviderData = $PSBoundParameters['ProviderData'] - if ($null -ne $ProviderData) { + $ProviderData = $PSBoundParameters['ProviderData'] + if ($null -ne $ProviderData) { $bodyAsHashtable.Add("providerData", $ProviderData) + } } - } $body = $bodyAsHashtable | ConvertTo-Json } # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' ` - -Method Post -ContentType 'application/json' -body $body -Version $(_getApiVersion VariableGroups) + $resp = _callAPI -Method POST -ProjectName $projectName ` + -Area "distributedtask" ` + -Resource "variablegroups" ` + -body $body ` + -Version $(_getApiVersion VariableGroups) return Get-VSTeamVariableGroup -ProjectName $ProjectName -id $resp.id } diff --git a/Source/Public/Add-VSTeamWorkItem.ps1 b/Source/Public/Add-VSTeamWorkItem.ps1 index eeb417a16..0a8b3660b 100644 --- a/Source/Public/Add-VSTeamWorkItem.ps1 +++ b/Source/Public/Add-VSTeamWorkItem.ps1 @@ -1,5 +1,14 @@ +# Adds a work item to your project. +# +# Get-VSTeamOption 'wit' 'workItems' +# id : 62d3d110-0047-428c-ad3c-4fe872c91c74 +# area : wit +# resourceName : workItems +# routeTemplate : {project}/_apis/{area}/{resource}/${type} +# http://bit.ly/Add-VSTeamWorkItem + function Add-VSTeamWorkItem { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamWorkItem')] param( [Parameter(Mandatory = $true)] [string] $Title, @@ -19,14 +28,14 @@ function Add-VSTeamWorkItem { [Parameter(Mandatory = $false)] [hashtable] $AdditionalFields, - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName, - + [Parameter(Mandatory = $true)] - [WorkItemTypeValidateAttribute()] - [ArgumentCompleter([WorkItemTypeCompleter])] + [vsteam_lib.WorkItemTypeValidateAttribute()] + [ArgumentCompleter([vsteam_lib.WorkItemTypeCompleter])] [string] $WorkItemType ) @@ -100,9 +109,13 @@ function Add-VSTeamWorkItem { $json = ConvertTo-Json @($body) -Compress # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitems' ` - -Version $(_getApiVersion Core) -id $fullWorkItemType -Method Post ` - -ContentType 'application/json-patch+json' -Body $json + $resp = _callAPI -Method POST -ProjectName $ProjectName ` + -Area "wit" ` + -Resource "workitems" ` + -id $fullWorkItemType ` + -Body $json ` + -ContentType 'application/json-patch+json' ` + -Version $(_getApiVersion Core) _applyTypesToWorkItem -item $resp diff --git a/Source/Public/Add-VSTeamWorkItemAreaPermission.ps1 b/Source/Public/Add-VSTeamWorkItemAreaPermission.ps1 index e55b6b062..6fe2a8a8b 100644 --- a/Source/Public/Add-VSTeamWorkItemAreaPermission.ps1 +++ b/Source/Public/Add-VSTeamWorkItemAreaPermission.ps1 @@ -1,51 +1,51 @@ +# Add or update ACEs in the ACL for the provided token. The request body +# contains the target token, a list of ACEs and a optional merge parameter. +# In the case of a collision (by identity descriptor) with an existing ACE +# in the ACL, the "merge" parameter determines the behavior. If set, the +# existing ACE has its allow and deny merged with the incoming ACE's allow +# and deny. If unset, the existing ACE is displaced. +# +# Get-VSTeamOption 'Security' 'AccessControlEntries' +# id : ac08c8ff-4323-4b08-af90-bcd018d380ce +# area : Security +# resourceName : AccessControlEntries +# routeTemplate : _apis/{resource}/{securityNamespaceId} +# https://bit.ly/Add-VSTeamAccessControlEntry + function Add-VSTeamWorkItemAreaPermission { - [CmdletBinding(DefaultParameterSetName = 'ByProjectAndAreaIdAndUser')] + [CmdletBinding(DefaultParameterSetName = 'ByProjectAndAreaIdAndUser', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamWorkItemAreaPermission')] param( - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndGroup")] - [VSTeamProject]$Project, - - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndUser")] + [parameter(Mandatory = $true)] + [vsteam_lib.Project]$Project, + + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaIdAndUser")] [int]$AreaID, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaPathAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaPathAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaPathAndGroup")] [string]$AreaPath, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaPathAndDescriptor")] [string]$Descriptor, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndGroup")] - [VSTeamGroup]$Group, - - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndUser")] - [VSTeamUser]$User, - - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndGroup")] - [VSTeamWorkItemAreaPermissions]$Allow, - - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndAreaPathAndGroup")] - [VSTeamWorkItemAreaPermissions]$Deny + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaPathAndGroup")] + [vsteam_lib.Group]$Group, + + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaPathAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndAreaIdAndUser")] + [vsteam_lib.User]$User, + + [parameter(Mandatory = $true)] + [vsteam_lib.WorkItemAreaPermissions]$Allow, + + [parameter(Mandatory = $true)] + [vsteam_lib.WorkItemAreaPermissions]$Deny ) process { @@ -55,60 +55,57 @@ function Add-VSTeamWorkItemAreaPermission { $securityNamespaceId = "83e28ad4-2d72-4ceb-97b0-c7726d5502c3" - if ($AreaID) - { - $area = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -Ids $AreaID + if ($AreaID) { + $area = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -Id $AreaID } - if ($AreaPath) - { + if ($AreaPath) { $area = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -Path $AreaPath -StructureGroup "areas" } - if (-not $area) - { + if (-not $area) { throw "Area not found" } - if ($area.StructureType -ne "area") - { + if ($area.StructureType -ne "area") { throw "This is not an Area" } $nodes = @() $nodes += $area - while ($area.ParentUrl) - { + while ($area.ParentUrl) { $path = $area.ParentUrl -ireplace ".*(classificationNodes/Areas)\/?" - if ($path.length -gt 0) - { + if ($path.length -gt 0) { # We have a Path to resolve $area = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -Path $path -StructureGroup "Areas" - } else { + } + else { # We need to get the "root" node now $area = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -StructureGroup "Areas" } - + $nodes += $area } # Build Token from Path [array]::Reverse($nodes) - $token = ($nodes | ForEach-Object { "vstfs:///Classification/Node/$($_.Identifier)" }) -join ":" + $token = ($nodes | ForEach-Object { "vstfs:///Classification/Node/$($_.Identifier)" }) -join ":" # Resolve Group to Descriptor - if ($Group) - { + if ($Group) { $Descriptor = _getDescriptorForACL -Group $Group } # Resolve User to Descriptor - if ($User) - { + if ($User) { $Descriptor = _getDescriptorForACL -User $User } - Add-VSTeamAccessControlEntry -SecurityNamespaceId $securityNamespaceId -Descriptor $Descriptor -Token $token -AllowMask ([int]$Allow) -DenyMask ([int]$Deny) + Add-VSTeamAccessControlEntry -SecurityNamespaceId $securityNamespaceId ` + -Descriptor $Descriptor ` + -Token $token ` + -AllowMask ([int]$Allow) ` + -DenyMask ([int]$Deny) } } \ No newline at end of file diff --git a/Source/Public/Add-VSTeamWorkItemIterationPermission.ps1 b/Source/Public/Add-VSTeamWorkItemIterationPermission.ps1 index a627ddc4b..493b1c256 100644 --- a/Source/Public/Add-VSTeamWorkItemIterationPermission.ps1 +++ b/Source/Public/Add-VSTeamWorkItemIterationPermission.ps1 @@ -1,51 +1,51 @@ +# Add or update ACEs in the ACL for the provided token. The request body +# contains the target token, a list of ACEs and a optional merge parameter. +# In the case of a collision (by identity descriptor) with an existing ACE +# in the ACL, the "merge" parameter determines the behavior. If set, the +# existing ACE has its allow and deny merged with the incoming ACE's allow +# and deny. If unset, the existing ACE is displaced. +# +# Get-VSTeamOption 'Security' 'AccessControlEntries' +# id : ac08c8ff-4323-4b08-af90-bcd018d380ce +# area : Security +# resourceName : AccessControlEntries +# routeTemplate : _apis/{resource}/{securityNamespaceId} +# https://bit.ly/Add-VSTeamAccessControlEntry + function Add-VSTeamWorkItemIterationPermission { - [CmdletBinding(DefaultParameterSetName = 'ByProjectAndIterationIdAndUser')] + [CmdletBinding(DefaultParameterSetName = 'ByProjectAndIterationIdAndUser', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Add-VSTeamWorkItemIterationPermission')] param( - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndGroup")] - [VSTeamProject]$Project, - - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndUser")] + [parameter(Mandatory = $true)] + [vsteam_lib.Project]$Project, + + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationIdAndUser")] [int]$IterationID, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationPathAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationPathAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationPathAndGroup")] [string]$IterationPath, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationIdAndDescriptor")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationPathAndDescriptor")] [string]$Descriptor, - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndGroup")] - [VSTeamGroup]$Group, - - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndUser")] - [VSTeamUser]$User, - - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndGroup")] - [VSTeamWorkItemIterationPermissions]$Allow, - - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndGroup")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationIdAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndDescriptor")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndUser")] - [parameter(Mandatory=$true,ParameterSetName="ByProjectAndIterationPathAndGroup")] - [VSTeamWorkItemIterationPermissions]$Deny + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationIdAndGroup")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationPathAndGroup")] + [vsteam_lib.Group]$Group, + + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationPathAndUser")] + [parameter(Mandatory = $true, ParameterSetName = "ByProjectAndIterationIdAndUser")] + [vsteam_lib.User]$User, + + [parameter(Mandatory = $true)] + [vsteam_lib.WorkItemIterationPermissions]$Allow, + + [parameter(Mandatory = $true)] + [vsteam_lib.WorkItemIterationPermissions]$Deny ) process { @@ -55,60 +55,57 @@ function Add-VSTeamWorkItemIterationPermission { $securityNamespaceId = "bf7bfa03-b2b7-47db-8113-fa2e002cc5b1" - if ($IterationID) - { - $iteration = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -Ids $IterationID + if ($IterationID) { + $iteration = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -Id $IterationID } - if ($IterationPath) - { + if ($IterationPath) { $iteration = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -Path $IterationPath -StructureGroup "iterations" } - if (-not $iteration) - { + if (-not $iteration) { throw "Iteration not found" } - if ($iteration.StructureType -ne "iteration") - { + if ($iteration.StructureType -ne "iteration") { throw "This is not an Iteration" } $nodes = @() $nodes += $iteration - while ($iteration.ParentUrl) - { + while ($iteration.ParentUrl) { $path = $iteration.ParentUrl -ireplace ".*(classificationNodes/Iterations)\/?" - if ($path.length -gt 0) - { + if ($path.length -gt 0) { # We have a Path to resolve $iteration = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -Path $path -StructureGroup "Iterations" - } else { + } + else { # We need to get the "root" node now $iteration = Get-VSTeamClassificationNode -ProjectName $Project.Name -Depth 0 -StructureGroup "Iterations" } - + $nodes += $iteration } # Build Token from Path [array]::Reverse($nodes) - $token = ($nodes | ForEach-Object { "vstfs:///Classification/Node/$($_.Identifier)" }) -join ":" + $token = ($nodes | ForEach-Object { "vstfs:///Classification/Node/$($_.Identifier)" }) -join ":" # Resolve Group to Descriptor - if ($Group) - { + if ($Group) { $Descriptor = _getDescriptorForACL -Group $Group } # Resolve User to Descriptor - if ($User) - { + if ($User) { $Descriptor = _getDescriptorForACL -User $User } - Add-VSTeamAccessControlEntry -SecurityNamespaceId $securityNamespaceId -Descriptor $Descriptor -Token $token -AllowMask ([int]$Allow) -DenyMask ([int]$Deny) + Add-VSTeamAccessControlEntry -SecurityNamespaceId $securityNamespaceId ` + -Descriptor $Descriptor ` + -Token $token ` + -AllowMask ([int]$Allow) ` + -DenyMask ([int]$Deny) } } \ No newline at end of file diff --git a/Source/Public/Clear-VSTeamDefaultAPITimeout.ps1 b/Source/Public/Clear-VSTeamDefaultAPITimeout.ps1 index 0493c624f..283e75436 100644 --- a/Source/Public/Clear-VSTeamDefaultAPITimeout.ps1 +++ b/Source/Public/Clear-VSTeamDefaultAPITimeout.ps1 @@ -2,7 +2,7 @@ function Clear-VSTeamDefaultAPITimeout { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] [CmdletBinding()] param() - + DynamicParam { # # Only add these options on Windows Machines if (_isOnWindows) { @@ -67,7 +67,7 @@ function Clear-VSTeamDefaultAPITimeout { [System.Environment]::SetEnvironmentVariable("TEAM_TIMEOUT", $null, $Level) } - [VSTeamVersions]::DefaultTimeout = '' + [vsteam_lib.Versions]::DefaultTimeout = '' $Global:PSDefaultParameterValues.Remove("*-vsteam*:vsteamApiTimeout") Write-Output "Removed default timeout" diff --git a/Source/Public/Clear-VSTeamDefaultProject.ps1 b/Source/Public/Clear-VSTeamDefaultProject.ps1 index 36c365e6a..90402731c 100644 --- a/Source/Public/Clear-VSTeamDefaultProject.ps1 +++ b/Source/Public/Clear-VSTeamDefaultProject.ps1 @@ -2,7 +2,7 @@ function Clear-VSTeamDefaultProject { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")] [CmdletBinding()] param() - + DynamicParam { # # Only add these options on Windows Machines if (_isOnWindows) { @@ -67,7 +67,7 @@ function Clear-VSTeamDefaultProject { [System.Environment]::SetEnvironmentVariable("TEAM_PROJECT", $null, $Level) } - [VSTeamVersions]::DefaultProject = '' + [vsteam_lib.Versions]::DefaultProject = '' $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") Write-Output "Removed default project" diff --git a/Source/Public/Disable-VSTeamAgent.ps1 b/Source/Public/Disable-VSTeamAgent.ps1 index cf048c75f..a61a18355 100644 --- a/Source/Public/Disable-VSTeamAgent.ps1 +++ b/Source/Public/Disable-VSTeamAgent.ps1 @@ -1,21 +1,42 @@ +# Disables an agent in a pool. +# +# Get-VSTeamOption 'distributedtask' 'agents' +# id : e298ef32-5878-4cab-993c-043836571f42 +# area : distributedtask +# resourceName : agents +# routeTemplate : _apis/{area}/pools/{poolId}/{resource}/{agentId} +# http://bit.ly/Disable-VSTeamAgent + function Disable-VSTeamAgent { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Disable-VSTeamAgent')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [int] $PoolId, [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 1)] [Alias('AgentID')] - [int[]] $Id + [int[]] $Id, + + [switch] $Force ) process { - foreach ($item in $Id) { - try { - _callAPI -Method Patch -Area "distributedtask/pools/$PoolId" -NoProject -Resource agents -Id $item -Version $(_getApiVersion DistributedTask) -ContentType "application/json" -Body "{'enabled':false,'id':$item,'maxParallelism':1}" | Out-Null - Write-Output "Disabled agent $item" - } - catch { - _handleException $_ + if ($Force -or $pscmdlet.ShouldProcess("Agent $Id", "Disable Agent")) { + foreach ($item in $Id) { + try { + _callAPI -Method PATCH -NoProject ` + -Area "distributedtask/pools/$PoolId" ` + -Resource "agents" ` + -Id $item ` + -Body "{'enabled':false,'id':$item,'maxParallelism':1}" ` + -Version $(_getApiVersion DistributedTask) | Out-Null + + Write-Output "Disabled agent $item" + } + catch { + _handleException $_ + } } } } diff --git a/Source/Public/Enable-VSTeamAgent.ps1 b/Source/Public/Enable-VSTeamAgent.ps1 index 99c8df0f8..013c5f3e1 100644 --- a/Source/Public/Enable-VSTeamAgent.ps1 +++ b/Source/Public/Enable-VSTeamAgent.ps1 @@ -1,4 +1,5 @@ function Enable-VSTeamAgent { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Enable-VSTeamAgent')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [int] $PoolId, @@ -11,7 +12,13 @@ function Enable-VSTeamAgent { process { foreach ($item in $Id) { try { - _callAPI -Method Patch -Area "distributedtask/pools/$PoolId" -NoProject -Resource agents -Id $item -Version $(_getApiVersion DistributedTask) -ContentType "application/json" -Body "{'enabled':true,'id':$item,'maxParallelism':1}" | Out-Null + _callAPI -Method PATCH -NoProject ` + -Area "distributedtask/pools/$PoolId" ` + -Resource agents ` + -Id $item ` + -Body "{'enabled':true,'id':$item,'maxParallelism':1}" ` + -Version $(_getApiVersion DistributedTask) | Out-Null + Write-Output "Enabled agent $item" } catch { diff --git a/Source/Public/Get-VSTeam.ps1 b/Source/Public/Get-VSTeam.ps1 index 45d628ebe..922a563d2 100644 --- a/Source/Public/Get-VSTeam.ps1 +++ b/Source/Public/Get-VSTeam.ps1 @@ -1,5 +1,6 @@ function Get-VSTeam { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeam')] param ( [Parameter(ParameterSetName = 'List')] [int] $Top, @@ -7,28 +8,33 @@ function Get-VSTeam { [Parameter(ParameterSetName = 'List')] [int] $Skip, + [Parameter(ParameterSetName = 'ByName', Position = 0)] + [Alias('TeamName')] + [string[]] $Name, + [Parameter(ParameterSetName = 'ByID')] [Alias('TeamId')] [string[]] $Id, - [Parameter(ParameterSetName = 'ByName')] - [Alias('TeamName')] - [string[]] $Name, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { + $commonArgs = @{ + Area = 'projects' + Resource = "$ProjectName/teams" + Version = $(_getApiVersion Core) + } + if ($Id) { foreach ($item in $Id) { # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -id $item ` - -Version $(_getApiVersion Core) + $resp = _callAPI @commonArgs -id $item - $team = [VSTeamTeam]::new($resp, $ProjectName) + $team = [vsteam_lib.Team]::new($resp, $ProjectName) Write-Output $team } @@ -36,18 +42,16 @@ function Get-VSTeam { elseif ($Name) { foreach ($item in $Name) { # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -id $item ` - -Version $(_getApiVersion Core) + $resp = _callAPI @commonArgs -id $item - $team = [VSTeamTeam]::new($resp, $ProjectName) + $team = [vsteam_lib.Team]::new($resp, $ProjectName) Write-Output $team } } else { # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" ` - -Version $(_getApiVersion Core) ` + $resp = _callAPI @commonArgs ` -QueryString @{ '$top' = $top '$skip' = $skip @@ -57,7 +61,7 @@ function Get-VSTeam { # Create an instance for each one foreach ($item in $resp.value) { - $obj += [VSTeamTeam]::new($item, $ProjectName) + $obj += [vsteam_lib.Team]::new($item, $ProjectName) } Write-Output $obj diff --git a/Source/Public/Get-VSTeamAPIVersion.ps1 b/Source/Public/Get-VSTeamAPIVersion.ps1 index e7cbce61b..4dc3dfadd 100644 --- a/Source/Public/Get-VSTeamAPIVersion.ps1 +++ b/Source/Public/Get-VSTeamAPIVersion.ps1 @@ -1,9 +1,9 @@ function Get-VSTeamAPIVersion { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamAPIVersion')] [OutputType([System.Collections.Hashtable])] param( [Parameter(Mandatory = $false, Position = 0)] - [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceEndpoints', 'Graph', 'TaskGroups', 'Policy', 'Processes')] + [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', 'DistributedTaskReleased', 'VariableGroups', 'Tfvc', 'Packaging', 'MemberEntitlementManagement', 'ExtensionsManagement', 'ServiceEndpoints', 'Graph', 'TaskGroups', 'Policy', 'Processes', 'HierarchyQuery')] [string] $Service ) @@ -18,6 +18,7 @@ function Get-VSTeamAPIVersion { Core = $(_getApiVersion Core) Git = $(_getApiVersion Git) DistributedTask = $(_getApiVersion DistributedTask) + DistributedTaskReleased = $(_getApiVersion DistributedTaskReleased) VariableGroups = $(_getApiVersion VariableGroups) Tfvc = $(_getApiVersion Tfvc) Packaging = $(_getApiVersion Packaging) @@ -28,6 +29,7 @@ function Get-VSTeamAPIVersion { Graph = $(_getApiVersion Graph) Policy = $(_getApiVersion Policy) Processes = $(_getApiVersion Processes) + HierarchyQuery = $(_getApiVersion HierarchyQuery) } } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamAccessControlList.ps1 b/Source/Public/Get-VSTeamAccessControlList.ps1 index 122dc1ec5..fef05f451 100644 --- a/Source/Public/Get-VSTeamAccessControlList.ps1 +++ b/Source/Public/Get-VSTeamAccessControlList.ps1 @@ -1,27 +1,20 @@ function Get-VSTeamAccessControlList { - [CmdletBinding(DefaultParameterSetName = 'ByNamespace')] + [CmdletBinding(DefaultParameterSetName = 'ByNamespace', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamAccessControlList')] param( [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $true, ValueFromPipeline = $true)] - [VSTeamSecurityNamespace] $SecurityNamespace, + [vsteam_lib.SecurityNamespace] $SecurityNamespace, [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('ID')] [guid] $SecurityNamespaceId, - [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $false)] - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $false)] [string] $Token, - [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $false)] - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $false)] [string[]] $Descriptors, - [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $false)] - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $false)] [switch] $IncludeExtendedInfo, - [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $false)] - [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $false)] [switch] $Recurse ) @@ -49,15 +42,17 @@ function Get-VSTeamAccessControlList { } # Call the REST API - $resp = _callAPI -Area 'accesscontrollists' -id $SecurityNamespaceId -method GET ` - -Version $(_getApiVersion Core) -NoProject ` - -QueryString $queryString + $resp = _callAPI -NoProject ` + -Resource accesscontrollists ` + -id $SecurityNamespaceId ` + -QueryString $queryString ` + -Version $(_getApiVersion Core) try { $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamAccessControlList]::new($item) + $objs += [vsteam_lib.AccessControlList]::new($item) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamAgent.ps1 b/Source/Public/Get-VSTeamAgent.ps1 index 0ed489316..0e4708169 100644 --- a/Source/Public/Get-VSTeamAgent.ps1 +++ b/Source/Public/Get-VSTeamAgent.ps1 @@ -1,35 +1,41 @@ function Get-VSTeamAgent { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamAgent')] param( - [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [int] $PoolId, - [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 1)] + [Parameter(ParameterSetName = 'ByID', Mandatory = $true, Position = 1)] [Alias('AgentID')] [int] $Id ) process { + $commonArgs = @{ + NoProject = $true + Area = "distributedtask/pools/$PoolId" + Resource = 'agents' + Body = @{ includeCapabilities = 'true' } + Version = $(_getApiVersion DistributedTaskReleased) + } if ($id) { - $resp = _callAPI -Area "distributedtask/pools/$PoolId" -Resource agents -Id $id -NoProject ` - -Body @{includeCapabilities = 'true'} -Version $(_getApiVersion DistributedTask) + $resp = _callAPI @commonArgs -Id $id # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $item = [VSTeamAgent]::new($resp, $PoolId) + $item = [vsteam_lib.Agent]::new($resp, $PoolId) Write-Output $item } else { - $resp = _callAPI -Area "distributedtask/pools/$PoolId" -Resource agents -NoProject ` - -Body @{includeCapabilities = 'true'} -Version $(_getApiVersion DistributedTask) + $resp = _callAPI @commonArgs $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamAgent]::new($item, $PoolId) + $objs += [vsteam_lib.Agent]::new($item, $PoolId) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamApproval.ps1 b/Source/Public/Get-VSTeamApproval.ps1 index 35a2e4723..d2b03a7fa 100644 --- a/Source/Public/Get-VSTeamApproval.ps1 +++ b/Source/Public/Get-VSTeamApproval.ps1 @@ -1,24 +1,24 @@ function Get-VSTeamApproval { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamApproval')] param( [ValidateSet('Approved', 'ReAssigned', 'Rejected', 'Canceled', 'Pending', 'Rejected', 'Skipped', 'Undefined')] [string] $StatusFilter, - [Alias('ReleaseIdFilter')] - [int[]] $ReleaseIdsFilter, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [int[]] $ReleaseId, [string] $AssignedToFilter, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { try { # Build query string and determine if the includeMyGroupApprovals should be added. - $queryString = @{statusFilter = $StatusFilter; assignedtoFilter = $AssignedToFilter; releaseIdsFilter = ($ReleaseIdsFilter -join ',') } + $queryString = @{statusFilter = $StatusFilter; assignedtoFilter = $AssignedToFilter; releaseIdsFilter = ($ReleaseId -join ',') } # The support in TFS and VSTS are not the same. $instance = $(_getInstance) @@ -31,14 +31,18 @@ function Get-VSTeamApproval { # For TFS all three parameters must be set before you can add # includeMyGroupApprovals. if ([string]::IsNullOrEmpty($AssignedToFilter) -eq $false -and - [string]::IsNullOrEmpty($ReleaseIdsFilter) -eq $false -and + [string]::IsNullOrEmpty($ReleaseId) -eq $false -and $StatusFilter -eq 'Pending') { $queryString.includeMyGroupApprovals = 'true'; } } # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area release -Resource approvals -SubDomain vsrm -Version $(_getApiVersion Release) -QueryString $queryString + $resp = _callAPI -SubDomain vsrm -ProjectName $ProjectName ` + -Area release ` + -Resource approvals ` + -QueryString $queryString ` + -Version $(_getApiVersion Release) # 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-VSTeamArea.ps1 b/Source/Public/Get-VSTeamArea.ps1 index e18d518a3..36645b26d 100644 --- a/Source/Public/Get-VSTeamArea.ps1 +++ b/Source/Public/Get-VSTeamArea.ps1 @@ -1,28 +1,32 @@ function Get-VSTeamArea { - [CmdletBinding(DefaultParameterSetName = 'ByIds')] + [CmdletBinding(DefaultParameterSetName = 'ByPath', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamArea')] param( [Parameter(Mandatory = $false, ParameterSetName = "ByPath")] [string] $Path, [Parameter(Mandatory = $false, ParameterSetName = "ByIds")] - [int[]] $Ids, + [int[]] $Id, - [Parameter(Mandatory = $false, ParameterSetName = "ByPath")] - [Parameter(Mandatory = $false, ParameterSetName = "ByIds")] [int] $Depth, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { - if ($PSCmdlet.ParameterSetName -eq "ByPath") { - $resp = Get-VSTeamClassificationNode -StructureGroup "areas" -ProjectName $ProjectName -Path $Path -Depth $Depth - }else { - $resp = Get-VSTeamClassificationNode -ProjectName $ProjectName -Depth $Depth -Ids $Ids + $resp = Get-VSTeamClassificationNode -ProjectName $ProjectName ` + -StructureGroup "areas" ` + -Path $Path ` + -Depth $Depth + } + else { + $resp = Get-VSTeamClassificationNode -ProjectName $ProjectName ` + -Depth $Depth ` + -Id $Id } Write-Output $resp diff --git a/Source/Public/Get-VSTeamBuild.ps1 b/Source/Public/Get-VSTeamBuild.ps1 index 59df86cb2..31a8fb845 100644 --- a/Source/Public/Get-VSTeamBuild.ps1 +++ b/Source/Public/Get-VSTeamBuild.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamBuild { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuild')] param ( [Parameter(ParameterSetName = 'List')] [int] $Top, @@ -22,7 +23,7 @@ function Get-VSTeamBuild { [Parameter(ParameterSetName = 'List')] [int[]] $Definitions, - [ArgumentCompleter([BuildCompleter])] + [ArgumentCompleter([vsteam_lib.BuildCompleter])] [Parameter(ParameterSetName = 'List')] [string] $BuildNumber, @@ -41,9 +42,9 @@ function Get-VSTeamBuild { [int[]] $Id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -52,19 +53,20 @@ function Get-VSTeamBuild { if ($id) { foreach ($item in $id) { # Build the url to return the single build - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource 'builds' -id $item ` + $resp = _callAPI -ProjectName $projectName ` + -Area build ` + -Resource builds ` + -id $item ` -Version $(_getApiVersion Build) - _applyTypesToBuild -item $resp + $build = [vsteam_lib.Build]::new($resp, $ProjectName) - Write-Output $resp + Write-Output $build } } else { # Build the url to list the builds - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource 'builds' ` - -Version $(_getApiVersion Build) ` - -Querystring @{ + $querystring = @{ '$top' = $top 'type' = $type 'buildNumber' = $buildNumber @@ -77,12 +79,19 @@ function Get-VSTeamBuild { 'definitions' = ($definitions -join ',') } - # Apply a Type Name so we can use custom format view and custom type extensions + $resp = _callAPI -ProjectName $projectName ` + -Area build ` + -Resource builds ` + -Querystring $queryString ` + -Version $(_getApiVersion Build) + + $objs = @() + foreach ($item in $resp.value) { - _applyTypesToBuild -item $item + $objs += [vsteam_lib.Build]::new($item, $ProjectName) } - Write-Output $resp.value + Write-Output $objs } } catch { diff --git a/Source/Public/Get-VSTeamBuildArtifact.ps1 b/Source/Public/Get-VSTeamBuildArtifact.ps1 index 4fcdb6e10..d5d037017 100644 --- a/Source/Public/Get-VSTeamBuildArtifact.ps1 +++ b/Source/Public/Get-VSTeamBuildArtifact.ps1 @@ -1,16 +1,20 @@ function Get-VSTeamBuildArtifact { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuildArtifact')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] [int] $Id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/artifacts" ` + $resp = _callAPI -ProjectName $projectName ` + -Area build ` + -Resource builds ` + -Id "$Id/artifacts" ` -Version $(_getApiVersion Build) foreach ($item in $resp.value) { diff --git a/Source/Public/Get-VSTeamBuildDefinition.ps1 b/Source/Public/Get-VSTeamBuildDefinition.ps1 index fffe5ada8..d8d15ff95 100644 --- a/Source/Public/Get-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Get-VSTeamBuildDefinition.ps1 @@ -1,54 +1,47 @@ function Get-VSTeamBuildDefinition { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuildDefinition')] param( [Parameter(ParameterSetName = 'List')] [string] $Filter, - [ValidateSet('build', 'xaml', 'All')] - [Parameter(ParameterSetName = 'List')] - [string] $Type = 'All', - [Alias('BuildDefinitionID')] [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdRaw')] - [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdJson')] [Parameter(Position = 0, ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [int[]] $Id, [Parameter(ParameterSetName = 'ByID')] [Parameter(ParameterSetName = 'ByIdRaw')] - [Parameter(ParameterSetName = 'ByIdJson')] [int] $Revision, - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] [switch] $JSON, [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] [switch] $raw, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - - process { - # The REST API ignores Top and Skip but allows them to be specified & the function does the same. - if ($PSBoundParameters['Type'] -gt 0) { - Write-Warning "You specified -Type $type. This parameters is ignored and will be removed in future" - } + process { if ($id) { foreach ($item in $id) { - $resp = _callAPI -ProjectName $ProjectName -Id $item -Area build -Resource definitions -Version $(_getApiVersion Build) ` - -QueryString @{revision = $revision } + $resp = _callAPI -ProjectName $ProjectName ` + -Area build ` + -Resource definitions ` + -Id $item ` + -QueryString @{revision = $revision } ` + -Version $(_getApiVersion Build) if ($JSON.IsPresent) { $resp | ConvertTo-Json -Depth 99 } else { if (-not $raw.IsPresent) { - $item = [VSTeamBuildDefinition]::new($resp, $ProjectName) - + $item = [vsteam_lib.BuildDefinition]::new($resp, $ProjectName) + Write-Output $item } else { @@ -58,16 +51,24 @@ function Get-VSTeamBuildDefinition { } } else { - $resp = _callAPI -ProjectName $ProjectName -Area build -Resource definitions -Version $(_getApiVersion Build) ` - -QueryString @{type = $type; name = $filter; includeAllProperties = $true } - - $objs = @() + $resp = _callAPI -ProjectName $ProjectName ` + -Area build ` + -Resource definitions ` + -Version $(_getApiVersion Build) ` + -QueryString @{name = $filter; includeAllProperties = $true } - foreach ($item in $resp.value) { - $objs += [VSTeamBuildDefinition]::new($item, $ProjectName) + if ($JSON.IsPresent) { + $resp | ConvertTo-Json -Depth 99 } + else { + $objs = @() - Write-Output $objs + foreach ($item in $resp.value) { + $objs += [vsteam_lib.BuildDefinition]::new($item, $ProjectName) + } + + Write-Output $objs + } } } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamBuildLog.ps1 b/Source/Public/Get-VSTeamBuildLog.ps1 index d2419836a..d68eda86c 100644 --- a/Source/Public/Get-VSTeamBuildLog.ps1 +++ b/Source/Public/Get-VSTeamBuildLog.ps1 @@ -1,15 +1,16 @@ function Get-VSTeamBuildLog { - [CmdletBinding(DefaultParameterSetName = 'ByID')] + [CmdletBinding(DefaultParameterSetName = 'ByID', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuildLog')] param ( [Parameter(Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] [int[]] $Id, [int] $Index, - - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -17,10 +18,13 @@ function Get-VSTeamBuildLog { if (-not $Index) { # Build the url to return the logs of the build # Call the REST API to get the number of logs for the build - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$item/logs" ` + $resp = _callAPI -ProjectName $projectName ` + -Area build ` + -Resource builds ` + -Id "$item/logs" ` -Version $(_getApiVersion Build) - $fullLogIndex = $($resp.count - 1) + $fullLogIndex = $($resp.count) } else { $fullLogIndex = $Index @@ -29,7 +33,10 @@ function Get-VSTeamBuildLog { # Now call REST API with the index for the fullLog # Build the url to return the single build # Call the REST API to get the number of logs for the build - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$item/logs" -id $fullLogIndex ` + $resp = _callAPI -ProjectName $projectName ` + -Area build ` + -Resource builds ` + -Id "$item/logs/$fullLogIndex" ` -Version $(_getApiVersion Build) Write-Output $resp diff --git a/Source/Public/Get-VSTeamBuildTag.ps1 b/Source/Public/Get-VSTeamBuildTag.ps1 index 59513b922..aacbd241c 100644 --- a/Source/Public/Get-VSTeamBuildTag.ps1 +++ b/Source/Public/Get-VSTeamBuildTag.ps1 @@ -1,17 +1,21 @@ function Get-VSTeamBuildTag { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuildTag')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] [int] $Id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` + $resp = _callAPI -ProjectName $projectName ` + -Area build ` + -Resource builds ` + -ID "$Id/tags" ` -Version $(_getApiVersion Build) return $resp.value diff --git a/Source/Public/Get-VSTeamBuildTimeline.ps1 b/Source/Public/Get-VSTeamBuildTimeline.ps1 index abcd8e423..b0e393504 100644 --- a/Source/Public/Get-VSTeamBuildTimeline.ps1 +++ b/Source/Public/Get-VSTeamBuildTimeline.ps1 @@ -1,48 +1,43 @@ function Get-VSTeamBuildTimeline { - [CmdletBinding(DefaultParameterSetName = 'ByID')] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuildTimeline')] param ( - [Parameter(ParameterSetName = 'ByID', ValueFromPipeline = $true, Mandatory= $true, Position=0)] - [int[]] $BuildID, + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 1)] + [int[]] $Id, - [Parameter(ParameterSetName = 'ByID')] - [Alias('TimelineId')] - [Guid] $Id, + [Guid] $TimelineId, - [Parameter(ParameterSetName = 'ByID')] [int] $ChangeId, - [Parameter(ParameterSetName = 'ByID')] - [Guid] $PlanId - ) + [Guid] $PlanId, - DynamicParam { - _buildProjectNameDynamicParam - } + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] + [string] $ProjectName + ) Process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["ProjectName"] - - foreach ($item in $BuildID) { + foreach ($item in $Id) { # Build the url to return the single build $resource = "builds/$item/timeline" - if($Id){ - $resource = "builds/$item/timeline/$Id" + if ($TimelineId) { + $resource = "builds/$item/timeline/$TimelineId" } - $resp = _callAPI -method Get -ProjectName $projectName -Area 'build' -Resource $resource ` - -Version $([VSTeamVersions]::Build) ` + $resp = _callAPI -ProjectName $projectName ` + -Area 'build' ` + -Resource $resource ` + -Version $([vsteam_lib.Versions]::Build) ` -Querystring @{ - 'changeId' = $ChangeId - 'planId' = $PlanId - } + 'changeId' = $ChangeId + 'planId' = $PlanId + } _applyTypesToBuildTimelineResultType -item $resp Write-Output $resp } - } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamClassificationNode.ps1 b/Source/Public/Get-VSTeamClassificationNode.ps1 index a258fbf10..56e70eed1 100644 --- a/Source/Public/Get-VSTeamClassificationNode.ps1 +++ b/Source/Public/Get-VSTeamClassificationNode.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamClassificationNode { - [CmdletBinding(DefaultParameterSetName = 'ByIds')] + [CmdletBinding(DefaultParameterSetName = 'ById', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamClassificationNode')] param( [ValidateSet("areas", "iterations")] [Parameter(Mandatory = $true, ParameterSetName = "ByPath")] @@ -8,61 +9,63 @@ function Get-VSTeamClassificationNode { [Parameter(Mandatory = $false, ParameterSetName = "ByPath")] [string] $Path, - [Parameter(Mandatory = $false, ParameterSetName = "ByIds")] - [int[]] $Ids, + [Parameter(Mandatory = $true, ParameterSetName = "ById")] + [int[]] $Id, - [Parameter(Mandatory = $false, ParameterSetName = "ByPath")] - [Parameter(Mandatory = $false, ParameterSetName = "ByIds")] [int] $Depth, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { - $id = $StructureGroup + $idArg = $StructureGroup $Path = [uri]::UnescapeDataString($Path) if ($Path) { $Path = [uri]::EscapeUriString($Path) $Path = $Path.TrimStart("/") - $id += "/$Path" + $idArg += "/$Path" } $queryString = @{ } - + if ($Depth) { $queryString.Add("`$Depth", $Depth) } - if ($Ids) { - $queryString.Add("Ids", $Ids -join ",") + if ($Id) { + $queryString.Add("ids", $Id -join ",") + } + + $commonArgs = @{ + ProjectName = $ProjectName + Area = 'wit' + Resource = "classificationnodes" + id = $idArg + Version = $(_getApiVersion Core) } if ($queryString.Count -gt 0) { # Call the REST API - $resp = _callAPI -Method "Get" -ProjectName $ProjectName -Area 'wit' -Resource "classificationnodes" -id $id ` - -Version $(_getApiVersion Core) ` - -QueryString $queryString + $resp = _callAPI @commonArgs -QueryString $queryString } else { # Call the REST API - $resp = _callAPI -Method "Get" -ProjectName $ProjectName -Area 'wit' -Resource "classificationnodes" -id $id ` - -Version $(_getApiVersion Core) ` - + $resp = _callAPI @commonArgs } if ([bool]($resp.PSobject.Properties.name -match "value")) { try { $objs = @() - + foreach ($item in $resp.value) { - $objs += [VSTeamClassificationNode]::new($item, $ProjectName) + $objs += [vsteam_lib.ClassificationNode]::new($item, $ProjectName) } - + Write-Output $objs } catch { @@ -76,7 +79,7 @@ function Get-VSTeamClassificationNode { # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $classificationNode = [VSTeamClassificationNode]::new($resp, $ProjectName) + $classificationNode = [vsteam_lib.ClassificationNode]::new($resp, $ProjectName) Write-Output $classificationNode } diff --git a/Source/Public/Get-VSTeamCloudSubscription.ps1 b/Source/Public/Get-VSTeamCloudSubscription.ps1 index ee3763768..9559295d8 100644 --- a/Source/Public/Get-VSTeamCloudSubscription.ps1 +++ b/Source/Public/Get-VSTeamCloudSubscription.ps1 @@ -1,10 +1,12 @@ function Get-VSTeamCloudSubscription { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamCloudSubscription')] param() # Call the REST API - $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpointproxy/azurermsubscriptions' ` - -Version $(_getApiVersion DistributedTask) -NoProject + $resp = _callAPI -NoProject ` + -Area distributedtask ` + -Resource 'serviceendpointproxy/azurermsubscriptions' ` + -Version $(_getApiVersion DistributedTask) # 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-VSTeamDescriptor.ps1 b/Source/Public/Get-VSTeamDescriptor.ps1 index 61c6244d7..8dfa1f5c8 100644 --- a/Source/Public/Get-VSTeamDescriptor.ps1 +++ b/Source/Public/Get-VSTeamDescriptor.ps1 @@ -1,7 +1,8 @@ function Get-VSTeamDescriptor { - [CmdletBinding(DefaultParameterSetName = 'ByStorageKey')] + [CmdletBinding(DefaultParameterSetName = 'ByStorageKey', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamDescriptor')] param( - [Parameter(ParameterSetName = 'ByStorageKey', Mandatory = $true)] + [Parameter(ParameterSetName = 'ByStorageKey', Mandatory = $true, Position = 0)] [string] $StorageKey ) @@ -10,14 +11,16 @@ function Get-VSTeamDescriptor { _supportsGraph # Call the REST API - $resp = _callAPI -Area 'graph' -Resource 'descriptors' -id $StorageKey ` - -Version $(_getApiVersion Graph) ` - -SubDomain 'vssps' -NoProject + $resp = _callAPI -SubDomain vssps -NoProject ` + -Area graph ` + -Resource descriptors ` + -id $StorageKey ` + -Version $(_getApiVersion Graph) # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $descriptor = [VSTeamDescriptor]::new($resp) + $descriptor = [vsteam_lib.Descriptor]::new($resp) Write-Output $descriptor } diff --git a/Source/Public/Get-VSTeamExtension.ps1 b/Source/Public/Get-VSTeamExtension.ps1 index 69e59198f..f969f3c36 100644 --- a/Source/Public/Get-VSTeamExtension.ps1 +++ b/Source/Public/Get-VSTeamExtension.ps1 @@ -1,4 +1,5 @@ function Get-VSTeamExtension { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamExtension')] param ( [Parameter(ParameterSetName = 'List', Mandatory = $false)] [switch] $IncludeInstallationIssues, @@ -15,7 +16,7 @@ function Get-VSTeamExtension { [Parameter(ParameterSetName = 'GetById', Mandatory = $true)] [string] $ExtensionId ) - + Process { if ($PublisherId -and $ExtensionId) { @@ -27,7 +28,7 @@ function Get-VSTeamExtension { -Id $id ` -Version $(_getApiVersion ExtensionsManagement) - $item = [VSTeamExtension]::new($resp) + $item = [vsteam_lib.Extension]::new($resp) Write-Output $item } @@ -46,15 +47,15 @@ function Get-VSTeamExtension { } $resp = _callAPI -SubDomain 'extmgmt' ` - -Area 'extensionmanagement' ` - -Resource 'installedextensions' ` + -Area extensionmanagement ` + -Resource installedextensions ` -QueryString $queryString ` -Version $(_getApiVersion ExtensionsManagement) $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamExtension]::new($item) + $objs += [vsteam_lib.Extension]::new($item) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamFeed.ps1 b/Source/Public/Get-VSTeamFeed.ps1 index c6ef5dc74..34c28241c 100644 --- a/Source/Public/Get-VSTeamFeed.ps1 +++ b/Source/Public/Get-VSTeamFeed.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamFeed { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamFeed')] param ( [Parameter(ParameterSetName = 'ByID', Position = 0)] [Alias('FeedId')] @@ -7,24 +8,32 @@ function Get-VSTeamFeed { ) process { + $commonArgs = @{ + subDomain = 'feeds' + area = 'packaging' + resource = 'feeds' + NoProject = $true + version = $(_getApiVersion Packaging) + } + if ($id) { foreach ($item in $id) { - $resp = _callAPI -NoProject -subDomain feeds -Id $item -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) + $resp = _callAPI @commonArgs -Id $item Write-Verbose $resp - $item = [VSTeamFeed]::new($resp) + $item = [vsteam_lib.Feed]::new($resp) Write-Output $item } } else { - $resp = _callAPI -NoProject -subDomain feeds -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) + $resp = _callAPI @commonArgs $objs = @() foreach ($item in $resp.value) { Write-Verbose $item - $objs += [VSTeamFeed]::new($item) + $objs += [vsteam_lib.Feed]::new($item) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamGitCommit.ps1 b/Source/Public/Get-VSTeamGitCommit.ps1 index c56904568..d6cdccd3b 100644 --- a/Source/Public/Get-VSTeamGitCommit.ps1 +++ b/Source/Public/Get-VSTeamGitCommit.ps1 @@ -1,12 +1,12 @@ function Get-VSTeamGitCommit { - [CmdletBinding(DefaultParameterSetName = 'All')] + [CmdletBinding(DefaultParameterSetName = 'All', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamGitCommit')] param ( [Parameter(ParameterSetName = 'All', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Parameter(ParameterSetName = 'ItemVersion', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Parameter(ParameterSetName = 'CompareVersion', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Parameter(ParameterSetName = 'ByIds', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Parameter(ParameterSetName = 'ItemPath', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] - [Alias('Id')] [Guid] $RepositoryID, [Parameter(ParameterSetName = 'All', HelpMessage = "FromDate, in UTC")] @@ -14,106 +14,106 @@ function Get-VSTeamGitCommit { [Parameter(ParameterSetName = 'CompareVersion', HelpMessage = "FromDate, in UTC")] [Parameter(ParameterSetName = 'ItemPath', HelpMessage = "FromDate, in UTC")] [DateTime] $FromDate, - + [Parameter(ParameterSetName = 'All', HelpMessage = "ToDate, in UTC")] [Parameter(ParameterSetName = 'ItemVersion', HelpMessage = "ToDate, in UTC")] [Parameter(ParameterSetName = 'CompareVersion', HelpMessage = "ToDate, in UTC")] [Parameter(ParameterSetName = 'ItemPath', HelpMessage = "ToDate, in UTC")] [DateTime] $ToDate, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion', Mandatory = $true)] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('branch', 'commit', 'tag')] [string] $ItemVersionVersionType, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion', Mandatory = $true)] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $ItemVersionVersion, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion', Mandatory = $false)] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('firstParent', 'none', 'previousChange')] [string] $ItemVersionVersionOptions, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'CompareVersion', Mandatory = $true)] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('branch', 'commit', 'tag')] [string] $CompareVersionVersionType, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'CompareVersion', Mandatory = $true)] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $CompareVersionVersion, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'CompareVersion', Mandatory = $false)] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('firstParent', 'none', 'previousChange')] [string] $CompareVersionVersionOptions, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $FromCommitId, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $ToCommitId, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $Author, - + [Parameter(ParameterSetName = "ByIds")] - [string[]] $Ids, - + [string[]] $Id, + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemPath', Mandatory = $true)] [string] $ItemPath, - + [Parameter(ParameterSetName = 'ItemPath')] [switch] $ExcludeDeletes, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [int] $Top, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [int] $Skip, - + [Parameter(ParameterSetName = 'ItemPath')] [ValidateSet('firstParent', 'fullHistory', 'fullHistorySimplifyMerges', 'simplifiedHistory')] [string] $HistoryMode, - + [Parameter(ParameterSetName = 'All')] [Parameter(ParameterSetName = 'ItemVersion')] [Parameter(ParameterSetName = 'CompareVersion')] [Parameter(ParameterSetName = 'ItemPath')] [string] $User, - - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -139,7 +139,7 @@ function Get-VSTeamGitCommit { 'searchCriteria.fromCommitId' = $FromCommitId 'searchCriteria.toCommitId' = $ToCommitId 'searchCriteria.author' = $Author - 'searchCriteria.ids' = $Ids + 'searchCriteria.ids' = $Id 'searchCriteria.itemPath' = $ItemPath 'searchCriteria.excludeDeletes' = $ExcludeDeletes 'searchCriteria.historyMode' = $HistoryMode @@ -153,7 +153,7 @@ function Get-VSTeamGitCommit { $obj = @() foreach ($item in $resp.value) { - $obj += [VSTeamGitCommitRef]::new($item, $ProjectName) + $obj += [vsteam_lib.GitCommitRef]::new($item, $ProjectName) } Write-Output $obj diff --git a/Source/Public/Get-VSTeamGitRef.ps1 b/Source/Public/Get-VSTeamGitRef.ps1 index 43823df01..ad2dbf12d 100644 --- a/Source/Public/Get-VSTeamGitRef.ps1 +++ b/Source/Public/Get-VSTeamGitRef.ps1 @@ -1,5 +1,5 @@ function Get-VSTeamGitRef { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamGitRef')] param ( [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Alias('Id')] @@ -14,8 +14,8 @@ function Get-VSTeamGitRef { [string] $ContinuationToken, [Parameter(Mandatory = $true, Position = 1, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -34,7 +34,7 @@ function Get-VSTeamGitRef { $obj = @() foreach ($item in $resp.value) { - $obj += [VSTeamRef]::new($item, $ProjectName) + $obj += [vsteam_lib.GitRef]::new($item, $ProjectName) } Write-Output $obj diff --git a/Source/Public/Get-VSTeamGitRepository.ps1 b/Source/Public/Get-VSTeamGitRepository.ps1 index cef9991a2..9f5a70faf 100644 --- a/Source/Public/Get-VSTeamGitRepository.ps1 +++ b/Source/Public/Get-VSTeamGitRepository.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamGitRepository { - [CmdletBinding(DefaultParameterSetName = 'ByID')] + [CmdletBinding(DefaultParameterSetName = 'ByID', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamGitRepository')] param ( [Parameter(ParameterSetName = 'ByID', ValueFromPipeline = $true)] [Alias('RepositoryID')] @@ -8,9 +9,9 @@ function Get-VSTeamGitRepository { [Parameter(ParameterSetName = 'ByName', ValueFromPipeline = $true)] [string[]] $Name, - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -23,7 +24,7 @@ function Get-VSTeamGitRepository { # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $item = [VSTeamGitRepository]::new($resp, $ProjectName) + $item = [vsteam_lib.GitRepository]::new($resp, $ProjectName) Write-Output $item } @@ -40,7 +41,7 @@ function Get-VSTeamGitRepository { # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $item = [VSTeamGitRepository]::new($resp, $ProjectName) + $item = [vsteam_lib.GitRepository]::new($resp, $ProjectName) Write-Output $item } @@ -59,7 +60,7 @@ function Get-VSTeamGitRepository { $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamGitRepository]::new($item, $ProjectName) + $objs += [vsteam_lib.GitRepository]::new($item, $ProjectName) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamGitStat.ps1 b/Source/Public/Get-VSTeamGitStat.ps1 index e21c41fdd..57f1a09d8 100644 --- a/Source/Public/Get-VSTeamGitStat.ps1 +++ b/Source/Public/Get-VSTeamGitStat.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamGitStat { - [CmdletBinding(DefaultParameterSetName = "ByOptionalName")] + [CmdletBinding(DefaultParameterSetName = "ByOptionalName", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamGitStat')] param ( [Parameter(ParameterSetName = "ByVersion", ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [Parameter(ParameterSetName = "ByOptionalName", ValueFromPipelineByPropertyName = $true, Mandatory = $true)] @@ -20,10 +21,10 @@ function Get-VSTeamGitStat { [Parameter(ParameterSetName = 'ByVersion', Mandatory = $true)] [ValidateSet("branch", "commit", "tag")] [string] $VersionType, - - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -45,13 +46,13 @@ function Get-VSTeamGitStat { $hasValueProp = $resp.PSObject.Properties.Match('value') if (0 -eq $hasValueProp.count) { - _applyTypes $resp "VSTeam.GitStat" + _applyTypes $resp "vsteam_lib.GitStat" Write-Output $resp } else { $obj = @() foreach ($item in $resp.value) { - _applyTypes $item "VSTeam.GitStat" + _applyTypes $item "vsteam_lib.GitStat" $obj += $item } diff --git a/Source/Public/Get-VSTeamGroup.ps1 b/Source/Public/Get-VSTeamGroup.ps1 index 736e43bcb..412708b2c 100644 --- a/Source/Public/Get-VSTeamGroup.ps1 +++ b/Source/Public/Get-VSTeamGroup.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamGroup { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamGroup')] param( [Parameter(ParameterSetName = 'List')] [Parameter(ParameterSetName = 'ListByProjectName')] @@ -9,37 +10,44 @@ function Get-VSTeamGroup { [Parameter(ParameterSetName = 'List')] [string] $ScopeDescriptor, - [Parameter(ParameterSetName = 'ByGroupDescriptor', Mandatory = $true)] + [Parameter(ParameterSetName = 'ByGroupDescriptor', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('GroupDescriptor')] + [Alias('containerDescriptor')] [string] $Descriptor, [Parameter(ParameterSetName = 'ListByProjectName', Mandatory = $true)] - [UncachedProjectValidateAttribute()] - [ArgumentCompleter([UncachedProjectCompleter])] + [vsteam_lib.ProjectValidateAttribute($true)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { # This will throw if this account does not support the graph API _supportsGraph + $commonArgs = @{ + subDomain = 'vssps' + area = 'graph' + resource = 'groups' + noProject = $true + version = $(_getApiVersion Graph) + } + if ($Descriptor) { # Call the REST API - $resp = _callAPI -NoProject -Area 'graph' -Resource 'groups' -id $Descriptor ` - -Version $(_getApiVersion Graph) ` - -SubDomain 'vssps' + $resp = _callAPI @commonArgs -id $Descriptor # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $group = [VSTeamGroup]::new($resp) + $group = [vsteam_lib.Group]::new($resp) Write-Output $group } else { if ($ProjectName) { $project = Get-VSTeamProject -Name $ProjectName - $ScopeDescriptor = Get-VSTeamDescriptor -StorageKey $project.id | Select-Object -ExpandProperty Descriptor + $ScopeDescriptor = Get-VSTeamDescriptor -StorageKey $project.id | Select-Object -ExpandProperty Name } $queryString = @{ } @@ -53,15 +61,12 @@ function Get-VSTeamGroup { try { # Call the REST API - $resp = _callAPI -NoProject -Area 'graph' -id 'groups' ` - -Version $(_getApiVersion Graph) ` - -QueryString $queryString ` - -SubDomain 'vssps' + $resp = _callAPI @commonArgs -QueryString $queryString $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamGroup]::new($item) + $objs += [vsteam_lib.Group]::new($item) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamInfo.ps1 b/Source/Public/Get-VSTeamInfo.ps1 index 9d6097a2a..59d1c05f4 100644 --- a/Source/Public/Get-VSTeamInfo.ps1 +++ b/Source/Public/Get-VSTeamInfo.ps1 @@ -1,8 +1,10 @@ function Get-VSTeamInfo { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamInfo')] + param () return @{ Account = _getInstance Version = $(_getApiVersion -Target) - ModuleVersion = [VSTeamVersions]::ModuleVersion + ModuleVersion = [vsteam_lib.Versions]::ModuleVersion DefaultProject = $Global:PSDefaultParameterValues['*-vsteam*:projectName'] DefaultTimeout = $Global:PSDefaultParameterValues['*-vsteam*:vsteamApiTimeout'] } diff --git a/Source/Public/Get-VSTeamIteration.ps1 b/Source/Public/Get-VSTeamIteration.ps1 index ac4f6c16c..480d489c8 100644 --- a/Source/Public/Get-VSTeamIteration.ps1 +++ b/Source/Public/Get-VSTeamIteration.ps1 @@ -1,27 +1,32 @@ function Get-VSTeamIteration { - [CmdletBinding(DefaultParameterSetName = 'ByIds')] + [CmdletBinding(DefaultParameterSetName = 'ByPath', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamIteration')] param( [Parameter(Mandatory = $false, ParameterSetName = "ByPath")] [string] $Path, - [Parameter(Mandatory = $false, ParameterSetName = "ByIds")] - [int[]] $Ids, + [Parameter(Mandatory = $false, ParameterSetName = "ById")] + [int[]] $Id, - [Parameter(Mandatory = $false, ParameterSetName = "ByPath")] - [Parameter(Mandatory = $false, ParameterSetName = "ByIds")] [int] $Depth, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { if ($PSCmdlet.ParameterSetName -eq "ByPath") { - $resp = Get-VSTeamClassificationNode -StructureGroup "iterations" -ProjectName $ProjectName -Path $Path -Depth $Depth - }else { - $resp = Get-VSTeamClassificationNode -ProjectName $ProjectName -Depth $Depth -Ids $Ids + $resp = Get-VSTeamClassificationNode -ProjectName $ProjectName ` + -StructureGroup "iterations" ` + -Path $Path ` + -Depth $Depth + } + else { + $resp = Get-VSTeamClassificationNode -ProjectName $ProjectName ` + -Depth $Depth ` + -Id $Id } Write-Output $resp } diff --git a/Source/Public/Get-VSTeamJobRequest.ps1 b/Source/Public/Get-VSTeamJobRequest.ps1 index db5192518..3a4d2989c 100644 --- a/Source/Public/Get-VSTeamJobRequest.ps1 +++ b/Source/Public/Get-VSTeamJobRequest.ps1 @@ -1,5 +1,5 @@ function Get-VSTeamJobRequest { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamJobRequest')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [int] $PoolId, @@ -7,7 +7,7 @@ function Get-VSTeamJobRequest { [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ValueFromPipeline = $true, Position = 1)] [Alias('ID')] [int] $AgentID, - + [int] $completedRequestCount ) @@ -21,15 +21,17 @@ function Get-VSTeamJobRequest { } else { $body = @{agentid = $AgentID } - } + } - $resp = _callAPI -Area "distributedtask/pools/$PoolId" -Resource "jobrequests" ` - -QueryString $body -Version $(_getApiVersion DistributedTask) + $resp = _callAPI -Area "distributedtask/pools/$PoolId" ` + -Resource jobrequests ` + -QueryString $body ` + -Version $(_getApiVersion DistributedTaskReleased) $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamJobRequest]::new($item) + $objs += [vsteam_lib.JobRequest]::new($item) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamMember.ps1 b/Source/Public/Get-VSTeamMember.ps1 index 2b16a8fe2..f234f8d82 100644 --- a/Source/Public/Get-VSTeamMember.ps1 +++ b/Source/Public/Get-VSTeamMember.ps1 @@ -1,5 +1,5 @@ function Get-VSTeamMember { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamMember')] param ( [Parameter()] [int] $Top, @@ -12,14 +12,16 @@ function Get-VSTeamMember { [Alias('Id')] [string] $TeamId, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true )] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true )] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { - $resp = _callAPI -Id "$TeamId/members" -Area 'projects' -Resource "$ProjectName/teams" -Version $(_getApiVersion Core) ` - -QueryString @{'$top' = $top; '$skip' = $skip} + $resp = _callAPI -Resource "projects/$ProjectName/teams" ` + -Id "$TeamId/members" ` + -QueryString @{ '$top' = $top; '$skip' = $skip } ` + -Version $(_getApiVersion Core) # 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-VSTeamMembership.ps1 b/Source/Public/Get-VSTeamMembership.ps1 index 36b2ab329..832db0bb3 100644 --- a/Source/Public/Get-VSTeamMembership.ps1 +++ b/Source/Public/Get-VSTeamMembership.ps1 @@ -1,18 +1,23 @@ function Get-VSTeamMembership { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamMembership')] param( [Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName, ParameterSetName = "ByContainerId")] [string] $ContainerDescriptor, + [Parameter(Mandatory = $true, ValueFromPipeline, ValueFromPipelineByPropertyName, ParameterSetName = "ByMemberId")] [string] $MemberDescriptor ) process { if ($MemberDescriptor) { - return _callMembershipAPI -Id $MemberDescriptor -Method Get -Direction Up + Write-Verbose 'Up with MemberDescriptor' + + Write-Output $(_callMembershipAPI -Id $MemberDescriptor -Direction Up) } else { - return _callMembershipAPI -Id $ContainerDescriptor -Method Get -Direction Down + Write-Verbose 'Down with ContainerDescriptor' + + Write-Output $(_callMembershipAPI -Id $ContainerDescriptor -Direction Down) } } } diff --git a/Source/Public/Get-VSTeamOption.ps1 b/Source/Public/Get-VSTeamOption.ps1 index 1ce45fada..f8fa344a4 100644 --- a/Source/Public/Get-VSTeamOption.ps1 +++ b/Source/Public/Get-VSTeamOption.ps1 @@ -1,12 +1,14 @@ function Get-VSTeamOption { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamOption')] param( [string] $subDomain, + [ArgumentCompleter([vsteam_lib.InvokeCompleter])] [Parameter(Position = 0)] [Alias("Service")] [string] $area, + [ArgumentCompleter([vsteam_lib.InvokeCompleter])] [Parameter(Position = 1)] [string] $resource ) @@ -31,7 +33,7 @@ function Get-VSTeamOption { # Apply a Type Name so we can use custom format view and custom type extensions foreach ($item in $resp.value) { - _applyTypes -item $item -type 'Team.Option' + _applyTypes -item $item -type 'vsteam_lib.Option' } Write-Output $resp.value diff --git a/Source/Public/Get-VSTeamPermissionInheritance.ps1 b/Source/Public/Get-VSTeamPermissionInheritance.ps1 index 037d3cc7f..6fd217873 100644 --- a/Source/Public/Get-VSTeamPermissionInheritance.ps1 +++ b/Source/Public/Get-VSTeamPermissionInheritance.ps1 @@ -1,25 +1,35 @@ -function Get-VSTeamPermissionInheritance { +# Returns true or false. +# Get-VSTeamOption -area Contribution -resource HierarchyQuery +# id : 3353e165-a11e-43aa-9d88-14f2bb09b6d9 +# area : Contribution +# resourceName : HierarchyQuery +# routeTemplate : _apis/{area}/{resource}/{scopeName}/{scopeValue} +# This is an undocumented API + +function Get-VSTeamPermissionInheritance { [OutputType([System.String])] [CmdletBinding()] param( [Parameter(Mandatory, ValueFromPipelineByPropertyName = $true, ValueFromPipeline = $true)] [string] $Name, - [Parameter(Mandatory)] + [Parameter(Mandatory, ValueFromPipelineByPropertyName = $true)] [ValidateSet('Repository', 'BuildDefinition', 'ReleaseDefinition')] [string] $resourceType, - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { + # This will throw if this account does not support the HierarchyQuery API + _supportsHierarchyQuery + Write-Verbose "Creating VSTeamPermissionInheritance" - $item = [VSTeamPermissionInheritance]::new($ProjectName, $Name, $resourceType) + $item = _getPermissionInheritanceInfo -projectName $ProjectName -resourceName $Name -resourceType $resourceType $token = $item.Token - $version = $item.Version $projectID = $item.ProjectID $securityNamespaceID = $item.SecurityNamespaceID @@ -46,9 +56,14 @@ } "@ - $resp = _callAPI -method POST -area "Contribution" -resource "HierarchyQuery/project" -id $projectID -Version $version -ContentType "application/json" -Body $body + $resp = _callAPI -method POST ` + -area Contribution ` + -resource HierarchyQuery ` + -id "project/$projectID" ` + -Body $body ` + -Version $(_getApiVersion HierarchyQuery) - Write-Verbose $($resp | ConvertTo-Json -Depth 99) + Write-Verbose $($resp | ConvertTo-Json -Depth 99) Write-Output ($resp | Select-Object -ExpandProperty dataProviders | diff --git a/Source/Public/Get-VSTeamPolicy.ps1 b/Source/Public/Get-VSTeamPolicy.ps1 index 0541c1590..5b0d2d155 100644 --- a/Source/Public/Get-VSTeamPolicy.ps1 +++ b/Source/Public/Get-VSTeamPolicy.ps1 @@ -1,19 +1,23 @@ function Get-VSTeamPolicy { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamPolicy')] param ( [Parameter(ValueFromPipeline = $true)] [int[]] $Id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { if ($id) { foreach ($item in $id) { try { - $resp = _callAPI -ProjectName $ProjectName -Id $item -Area policy -Resource configurations -Version $(_getApiVersion Git) + $resp = _callAPI -ProjectName $ProjectName ` + -Area policy ` + -Resource configurations ` + -Id $item ` + -Version $(_getApiVersion Policy) _applyTypesToPolicy -item $resp @@ -26,7 +30,10 @@ function Get-VSTeamPolicy { } else { try { - $resp = _callAPI -ProjectName $ProjectName -Area policy -Resource configurations -Version $(_getApiVersion Git) + $resp = _callAPI -ProjectName $ProjectName ` + -Area policy ` + -Resource configurations ` + -Version $(_getApiVersion Policy) # 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-VSTeamPolicyType.ps1 b/Source/Public/Get-VSTeamPolicyType.ps1 index 03354e59f..ed094bb2e 100644 --- a/Source/Public/Get-VSTeamPolicyType.ps1 +++ b/Source/Public/Get-VSTeamPolicyType.ps1 @@ -1,12 +1,12 @@ function Get-VSTeamPolicyType { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamPolicyType')] param ( [Parameter(ValueFromPipeline = $true)] [guid[]] $Id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) diff --git a/Source/Public/Get-VSTeamPool.ps1 b/Source/Public/Get-VSTeamPool.ps1 index 02017e8ae..8f6b2e254 100644 --- a/Source/Public/Get-VSTeamPool.ps1 +++ b/Source/Public/Get-VSTeamPool.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamPool { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamPool')] param( [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 1)] [Alias('PoolID')] @@ -7,24 +8,30 @@ function Get-VSTeamPool { ) process { + $commonArgs = @{ + NoProject = $true + Area = 'distributedtask' + Resource = 'pools' + Version = $(_getApiVersion DistributedTaskReleased) + } if ($id) { - $resp = _callAPI -NoProject -Area distributedtask -Resource pools -Id $id -Version $(_getApiVersion DistributedTask) + $resp = _callAPI @commonArgs -Id $id # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $item = [VSTeamPool]::new($resp) + $item = [vsteam_lib.AgentPool]::new($resp) Write-Output $item } else { - $resp = _callAPI -NoProject -Area distributedtask -Resource pools -Version $(_getApiVersion DistributedTask) + $resp = _callAPI @commonArgs $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamPool]::new($item) + $objs += [vsteam_lib.AgentPool]::new($item) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamProcess.ps1 b/Source/Public/Get-VSTeamProcess.ps1 index b84215b60..9d398037e 100644 --- a/Source/Public/Get-VSTeamProcess.ps1 +++ b/Source/Public/Get-VSTeamProcess.ps1 @@ -17,58 +17,56 @@ # releasedVersion : 0.0 function Get-VSTeamProcess { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamProcess')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')] param( [Parameter(ParameterSetName = 'ByName', Position = 0)] - [ArgumentCompleter([ProcessTemplateCompleter])] + [ArgumentCompleter([vsteam_lib.ProcessTemplateCompleter])] [Alias('ProcessName', 'ProcessTemplate')] $Name = '*', - [Parameter(DontShow = $true, ParameterSetName = 'List')] - [int] $Top = 100, - - [Parameter(DontShow = $true, ParameterSetName = 'List')] - [int] $Skip = 0, - [Parameter(ParameterSetName = 'ByID')] [Alias('ProcessTemplateID')] [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" + $commonArgs = @{ + # In later APIs you can get the process templates from the 'work' + # area. For older APIs the process templates are in the 'processes' + # area. Default to the newer way of accessing process templates. + # Get-VSTeamOption -area 'work' -resource 'processes' returns nothing + # this is odd but the call works. + area = 'work' + resource = 'processes' + NoProject = $true + version = $(_getApiVersion Processes) } - # In later APIs you can get the process templates from the 'work' area. For older APIs the process templates are - # in the 'process' area. - # Default to the newer way of accessing process templates - $area = 'work' - # If this returns an empty string use the old area of 'process' - if (-not $(_getApiVersion Processes)) { - $area = 'process' + if (-not $commonArgs.version) { + $commonArgs.area = 'process' } # Return either a single process by ID or a list of processes if ($id) { # Call the REST API with an ID - $resp = _callAPI -NoProject -Area $area -resource 'processes' -id $id -Version $(_getApiVersion Processes) + $resp = _callAPI @commonArgs -id $id - $process = [VSTeamProcess]::new($resp) + $process = [vsteam_lib.Process]::new($resp) Write-Output $process } else { try { # Call the REST API - $resp = _callAPI -NoProject -Area $area -resource 'processes' -Version (_getApiVersion Processes) + $resp = _callAPI @commonArgs # We just fetched all the processes so let's update the cache. Also, cache the URLS for processes - [VSTeamProcessCache]::Update($resp.value) + [vsteam_lib.ProcessTemplateCache]::Update([string[]]$($resp.value | Select-Object -ExpandProperty Name | Sort-Object)) $resp.value | ForEach-Object { - [VSTeamProcess]::new($_) + [vsteam_lib.Process]::new($_) } | Where-Object { $_.name -like $Name } | Sort-Object -Property Name } catch { diff --git a/Source/Public/Get-VSTeamProfile.ps1 b/Source/Public/Get-VSTeamProfile.ps1 index 8ad4331b9..552cf10a2 100644 --- a/Source/Public/Get-VSTeamProfile.ps1 +++ b/Source/Public/Get-VSTeamProfile.ps1 @@ -1,5 +1,5 @@ function Get-VSTeamProfile { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamProfile')] param( # Name is an array so I can pass an array after -Name # I can also use pipe @@ -29,7 +29,7 @@ function Get-VSTeamProfile { if ($result) { $result | ForEach-Object { # Setting the type lets me format it - $_.PSObject.TypeNames.Insert(0, 'Team.Profile') + $_.PSObject.TypeNames.Insert(0, 'vsteam_lib.Profile') if ($_.PSObject.Properties.Match('Token').count -eq 0) { # This is a profile that was created before the module supported diff --git a/Source/Public/Get-VSTeamProject.ps1 b/Source/Public/Get-VSTeamProject.ps1 index 8401e6b34..d53c8d74d 100644 --- a/Source/Public/Get-VSTeamProject.ps1 +++ b/Source/Public/Get-VSTeamProject.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamProject { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamProject')] param( [Parameter(ParameterSetName = 'List')] [ValidateSet('WellFormed', 'CreatePending', 'Deleting', 'New', 'All')] @@ -14,12 +15,12 @@ function Get-VSTeamProject { [Parameter(ParameterSetName = 'ByID')] [Alias('ProjectID')] [string] $Id, - + [switch] $IncludeCapabilities, - [Parameter(ParameterSetName = 'ByName', Mandatory = $true, Position = 0)] - [UncachedProjectValidateAttribute()] - [ArgumentCompleter([UncachedProjectCompleter])] + [Parameter(ParameterSetName = 'ByName', Position = 0, Mandatory = $true)] + [vsteam_lib.ProjectValidateAttribute($true)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $Name ) @@ -31,6 +32,12 @@ function Get-VSTeamProject { $ProjectName = $id } + $commonArgs = @{ + Resource = 'projects' + IgnoreDefaultProject = $true + Version = $(_getApiVersion Core) + } + if ($ProjectName) { $queryString = @{ } if ($includeCapabilities.IsPresent) { @@ -38,22 +45,20 @@ function Get-VSTeamProject { } # Call the REST API - $resp = _callAPI -Area 'projects' -id $ProjectName ` - -Version $(_getApiVersion Core) -IgnoreDefaultProject ` + $resp = _callAPI @commonArgs -id $ProjectName ` -QueryString $queryString # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $project = [VSTeamProject]::new($resp) + $project = [vsteam_lib.Project]::new($resp) Write-Output $project } else { try { # Call the REST API - $resp = _callAPI -Area 'projects' ` - -Version $(_getApiVersion Core) -IgnoreDefaultProject ` + $resp = _callAPI @commonArgs ` -QueryString @{ stateFilter = $stateFilter '$top' = $top @@ -61,11 +66,11 @@ function Get-VSTeamProject { } $objs = @() - + foreach ($item in $resp.value) { - $objs += [VSTeamProject]::new($item) + $objs += [vsteam_lib.Project]::new($item) } - + Write-Output $objs } catch { diff --git a/Source/Public/Get-VSTeamPullRequest.ps1 b/Source/Public/Get-VSTeamPullRequest.ps1 index 1e2bb2821..7b3fd305a 100644 --- a/Source/Public/Get-VSTeamPullRequest.ps1 +++ b/Source/Public/Get-VSTeamPullRequest.ps1 @@ -1,11 +1,12 @@ function Get-VSTeamPullRequest { - [CmdletBinding(DefaultParameterSetName = "SearchCriteriaWithStatus")] + [CmdletBinding(DefaultParameterSetName = "SearchCriteriaWithStatus", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamPullRequest')] param ( [Alias('PullRequestId')] [Parameter(ParameterSetName = "ById")] [Parameter(ParameterSetName = "IncludeCommits")] [string] $Id, - + [Parameter(ParameterSetName = "SearchCriteriaWithStatus")] [Parameter(ParameterSetName = "SearchCriteriaWithAll")] [Parameter(ParameterSetName = "ById")] @@ -44,12 +45,12 @@ function Get-VSTeamPullRequest { [Parameter(ParameterSetName = "SearchCriteriaWithStatus")] [int] $Skip, - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { try { if ($Id) { @@ -57,7 +58,7 @@ function Get-VSTeamPullRequest { $queryString = @{ 'includeCommits' = $IncludeCommits } - $resp = _callAPI -Id "$RepositoryId/pullRequests/$Id" -Area git -Resource repositories -Version $(_getApiVersion Git) -QueryString $queryString + $resp = _callAPI -Id "$RepositoryId/pullRequests/$Id" -Area git -Resource repositories -Version $(_getApiVersion Git) -QueryString $queryString } elseif ($ProjectName) { $resp = _callAPI -ProjectName $ProjectName -Area git -Resource pullRequests -Version $(_getApiVersion Git) -Id $Id @@ -112,4 +113,3 @@ function Get-VSTeamPullRequest { } } } - diff --git a/Source/Public/Get-VSTeamQuery.ps1 b/Source/Public/Get-VSTeamQuery.ps1 new file mode 100644 index 000000000..aa450169f --- /dev/null +++ b/Source/Public/Get-VSTeamQuery.ps1 @@ -0,0 +1,37 @@ +function Get-VSTeamQuery { + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamQuery')] + param( + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] + [string] $ProjectName, + + [int] $Depth = 1, + + [switch] $IncludeDeleted, + + [ValidateSet('all', 'clauses', 'minimal', 'none', 'wiql')] + [string] $Expand = 'none' + ) + + process { + $resp = _callAPI -ProjectName $projectName ` + -Area wit ` + -Resource queries ` + -QueryString @{ + '$depth' = $Depth + '$expand' = $Expand + '$includeDeleted' = $IncludeDeleted.IsPresent + } ` + -Version $(_getApiVersion Core) + + $obj = @() + + foreach ($item in $resp.value) { + _applyTypes $item "vsteam_lib.Query" + $obj += $item + } + + Write-Output $obj + } +} diff --git a/Source/Public/Get-VSTeamQueue.ps1 b/Source/Public/Get-VSTeamQueue.ps1 index 18cfc9c72..59a5882b3 100644 --- a/Source/Public/Get-VSTeamQueue.ps1 +++ b/Source/Public/Get-VSTeamQueue.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamQueue { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamQueue')] param( [Parameter(ParameterSetName = 'List')] [string] $queueName, @@ -12,31 +13,36 @@ function Get-VSTeamQueue { [Alias('QueueID')] [string] $id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { + $commonArgs = @{ + ProjectName = $projectName + Area = 'distributedtask' + Resource = 'queues' + Version = $(_getApiVersion DistributedTask) + } + if ($id) { - $resp = _callAPI -ProjectName $ProjectName -Id $id -Area distributedtask -Resource queues ` - -Version $(_getApiVersion DistributedTask) + $resp = _callAPI @commonArgs -Id $id - $item = [VSTeamQueue]::new($resp, $ProjectName) + $item = [vsteam_lib.Queue]::new($resp, $ProjectName) Write-Output $item } else { - $resp = _callAPI -ProjectName $projectName -Area distributedtask -Resource queues ` - -QueryString @{ queueName = $queueName; actionFilter = $actionFilter } -Version $(_getApiVersion DistributedTask) + $resp = _callAPI @commonArgs -QueryString @{ queueName = $queueName; actionFilter = $actionFilter } $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamQueue]::new($item, $ProjectName) + $objs += [vsteam_lib.Queue]::new($item, $ProjectName) } - + Write-Output $objs } } diff --git a/Source/Public/Get-VSTeamRelease.ps1 b/Source/Public/Get-VSTeamRelease.ps1 index 966fb5813..26d15fdac 100644 --- a/Source/Public/Get-VSTeamRelease.ps1 +++ b/Source/Public/Get-VSTeamRelease.ps1 @@ -1,8 +1,8 @@ function Get-VSTeamRelease { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamRelease')] param( [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdRaw')] - [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByIdJson')] [Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] [Alias('ReleaseID')] [int[]] $id, @@ -34,51 +34,56 @@ function Get-VSTeamRelease { [Parameter(ParameterSetName = 'List')] [ValidateSet('ascending', 'descending')] - [string] $queryOrder, - [Parameter(ParameterSetName = 'List')] + [Parameter(ParameterSetName = 'List')] [string] $continuationToken, - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] [switch] $JSON, - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] [switch] $raw, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { + $commonArgs = @{ + subDomain = 'vsrm' + area = 'release' + resource = 'releases' + version = $(_getApiVersion Release) + } + if ($id) { foreach ($item in $id) { - $resp = _callAPI -SubDomain vsrm -ProjectName $ProjectName -Area release -id $item -Resource releases -Version $(_getApiVersion Release) + $resp = _callAPI @commonArgs -ProjectName $ProjectName -id $item if ($JSON.IsPresent) { $resp | ConvertTo-Json -Depth 99 } else { if (-not $raw.IsPresent) { - # Apply a Type Name so we can use custom format view and custom type extensions - _applyTypesToRelease -item $resp + Write-Output $([vsteam_lib.Release]::new($resp, $ProjectName)) + } + else { + Write-Output $resp } - - Write-Output $resp } } } else { if ($ProjectName) { - $listurl = _buildRequestURI -SubDomain vsrm -ProjectName $ProjectName -Area release -Resource releases -Version $(_getApiVersion Release) + $listurl = _buildRequestURI @commonArgs -ProjectName $ProjectName } else { - $listurl = _buildRequestURI -SubDomain vsrm -Area release -Resource releases -Version $(_getApiVersion Release) + $listurl = _buildRequestURI @commonArgs } - $QueryString = @{ + $queryString = @{ '$top' = $top '$expand' = $expand 'createdBy' = $createdBy @@ -89,18 +94,23 @@ function Get-VSTeamRelease { 'minCreatedTime' = $minCreatedTime 'maxCreatedTime' = $maxCreatedTime 'continuationToken' = $continuationToken - } # Call the REST API - $resp = _callAPI -url $listurl -QueryString $QueryString - - # Apply a Type Name so we can use custom format view and custom type extensions - foreach ($item in $resp.value) { - _applyTypesToRelease -item $item + $resp = _callAPI -url $listurl -QueryString $queryString + + if ($JSON.IsPresent) { + $resp | ConvertTo-Json -Depth 99 + } + else { + $objs = @() + + foreach ($item in $resp.value) { + $objs += [vsteam_lib.Release]::new($item, $ProjectName) + } + + Write-Output $objs } - - Write-Output $resp.value } } } diff --git a/Source/Public/Get-VSTeamReleaseDefinition.ps1 b/Source/Public/Get-VSTeamReleaseDefinition.ps1 index ee030376d..28be75e44 100644 --- a/Source/Public/Get-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Get-VSTeamReleaseDefinition.ps1 @@ -1,38 +1,45 @@ function Get-VSTeamReleaseDefinition { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamReleaseDefinition')] param( [Parameter(ParameterSetName = 'List')] [ValidateSet('environments', 'artifacts', 'none')] [string] $Expand = 'none', - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw', ValueFromPipelineByPropertyName = $true)] - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson', ValueFromPipelineByPropertyName = $true)] [Parameter(Mandatory = $true, ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw', ValueFromPipelineByPropertyName = $true)] [Alias('ReleaseDefinitionID')] [int[]] $Id, - [Parameter(Mandatory = $true, ParameterSetName = 'ByIdJson')] [switch]$JSON, [Parameter(Mandatory = $true, ParameterSetName = 'ByIdRaw')] [switch]$raw, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { + $commonArgs = @{ + subDomain = 'vsrm' + area = 'release' + resource = 'definitions' + projectName = $ProjectName + version = $(_getApiVersion Release) + } + if ($id) { foreach ($item in $id) { - $resp = _callAPI -subDomain vsrm -Area release -resource definitions -Version $(_getApiVersion Release) -projectName $projectName -id $item + $resp = _callAPI @commonArgs -id $item if ($JSON.IsPresent) { $resp | ConvertTo-Json -Depth 99 } else { if (-not $raw.IsPresent) { - $item = [VSTeamReleaseDefinition]::new($resp, $ProjectName) + $item = [vsteam_lib.ReleaseDefinition]::new($resp, $ProjectName) Write-Output $item } @@ -43,22 +50,27 @@ function Get-VSTeamReleaseDefinition { } } else { - $listurl = _buildRequestURI -subDomain vsrm -Area release -resource 'definitions' -Version $(_getApiVersion Release) -projectName $ProjectName - + $listurl = _buildRequestURI @commonArgs + if ($expand -ne 'none') { $listurl += "&`$expand=$($expand)" } - + # Call the REST API $resp = _callAPI -url $listurl - - $objs = @() - - foreach ($item in $resp.value) { - $objs += [VSTeamReleaseDefinition]::new($item, $ProjectName) + + if ($JSON.IsPresent) { + $resp | ConvertTo-Json -Depth 99 + } + else { + $objs = @() + + foreach ($item in $resp.value) { + $objs += [vsteam_lib.ReleaseDefinition]::new($item, $ProjectName) + } + + Write-Output $objs } - - Write-Output $objs } } } diff --git a/Source/Public/Get-VSTeamResourceArea.ps1 b/Source/Public/Get-VSTeamResourceArea.ps1 index f9eac585e..da49b6c9e 100644 --- a/Source/Public/Get-VSTeamResourceArea.ps1 +++ b/Source/Public/Get-VSTeamResourceArea.ps1 @@ -1,5 +1,5 @@ function Get-VSTeamResourceArea { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamResourceArea')] param() # Call the REST API @@ -7,7 +7,7 @@ function Get-VSTeamResourceArea { # Apply a Type Name so we can use custom format view and custom type extensions foreach ($item in $resp.value) { - _applyTypes -item $item -type 'Team.ResourceArea' + _applyTypes -item $item -type 'vsteam_lib.ResourceArea' } Write-Output $resp.value diff --git a/Source/Public/Get-VSTeamSecurityNamespace.ps1 b/Source/Public/Get-VSTeamSecurityNamespace.ps1 index 1591bc98f..1f5918084 100644 --- a/Source/Public/Get-VSTeamSecurityNamespace.ps1 +++ b/Source/Public/Get-VSTeamSecurityNamespace.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamSecurityNamespace { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamSecurityNamespace')] param( [Parameter(ParameterSetName = 'ByNamespaceName', Mandatory = $true)] [string] $Name, @@ -14,11 +15,15 @@ function Get-VSTeamSecurityNamespace { process { _supportsSecurityNamespace + $commonArgs = @{ + Resource = 'securitynamespaces' + NoProject = $true + Version = $(_getApiVersion Core) + } + if ($Id) { # Call the REST API - $resp = _callAPI -Area 'securitynamespaces' -id $Id ` - -Version $(_getApiVersion Core) -NoProject ` - + $resp = _callAPI @commonArgs -id $Id } else { $queryString = @{ } @@ -26,9 +31,7 @@ function Get-VSTeamSecurityNamespace { $queryString.localOnly = $true } - $resp = _callAPI -Area 'securitynamespaces' ` - -Version $(_getApiVersion Core) -NoProject ` - -QueryString $queryString + $resp = _callAPI @commonArgs -QueryString $queryString } Write-Verbose $resp | Select-Object -ExpandProperty value @@ -42,17 +45,17 @@ function Get-VSTeamSecurityNamespace { if ($Name) { $selected = $resp.value | Where-Object { $_.name -eq $Name } if ($selected) { - return [VSTeamSecurityNamespace]::new($selected) + Write-Output [vsteam_lib.SecurityNamespace]::new($selected) } else { - return $null + Write-Output $null } } try { $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamSecurityNamespace]::new($item) + $objs += [vsteam_lib.SecurityNamespace]::new($item) } Write-Output $objs @@ -68,7 +71,7 @@ function Get-VSTeamSecurityNamespace { # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $acl = [VSTeamSecurityNamespace]::new($resp.value) + $acl = [vsteam_lib.SecurityNamespace]::new($resp.value[0]) Write-Output $acl } diff --git a/Source/Public/Get-VSTeamServiceEndpoint.ps1 b/Source/Public/Get-VSTeamServiceEndpoint.ps1 index 7b43b1f71..38dda4eb3 100644 --- a/Source/Public/Get-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Get-VSTeamServiceEndpoint.ps1 @@ -1,19 +1,23 @@ function Get-VSTeamServiceEndpoint { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamServiceEndpoint')] param( [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $id, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { if ($id) { # Call the REST API - $resp = _callAPI -Area 'distributedtask' -Resource 'serviceendpoints' -Id $id ` - -Version $(_getApiVersion ServiceEndpoints) -ProjectName $ProjectName + $resp = _callAPI -ProjectName $ProjectName ` + -Area 'distributedtask' ` + -Resource 'serviceendpoints' ` + -Id $id ` + -Version $(_getApiVersion ServiceEndpoints) _applyTypesToServiceEndpoint -item $resp @@ -21,7 +25,9 @@ function Get-VSTeamServiceEndpoint { } else { # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'serviceendpoints' ` + $resp = _callAPI -ProjectName $ProjectName ` + -Area 'distributedtask' ` + -Resource 'serviceendpoints' ` -Version $(_getApiVersion ServiceEndpoints) # Apply a Type Name so we can use custom format view and custom type extensions diff --git a/Source/Public/Get-VSTeamServiceEndpointType.ps1 b/Source/Public/Get-VSTeamServiceEndpointType.ps1 index 78d6abb59..54ad78f57 100644 --- a/Source/Public/Get-VSTeamServiceEndpointType.ps1 +++ b/Source/Public/Get-VSTeamServiceEndpointType.ps1 @@ -1,5 +1,5 @@ function Get-VSTeamServiceEndpointType { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamServiceEndpointType')] param( [Parameter(ParameterSetName = 'ByType')] [string] $Type, diff --git a/Source/Public/Get-VSTeamTaskGroup.ps1 b/Source/Public/Get-VSTeamTaskGroup.ps1 index c70d2b0ac..dfc0e73e9 100644 --- a/Source/Public/Get-VSTeamTaskGroup.ps1 +++ b/Source/Public/Get-VSTeamTaskGroup.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamTaskGroup { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamTaskGroup')] param( [Parameter(ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Id, @@ -7,38 +8,47 @@ function Get-VSTeamTaskGroup { [Parameter(ParameterSetName = 'ByName', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Name, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { + $commonArgs = @{ + Area = 'distributedtask' + Resource = 'taskgroups' + ProjectName = $ProjectName + Version = $(_getApiVersion TaskGroups) + } + if ($Id) { - $resp = _callAPI -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Id $Id -Method Get + $resp = _callAPI @commonArgs -Id $Id + + _applyTypes -item $($resp.value) -type 'vsteam_lib.TaskGroup' Write-Output $resp.value } else { - $resp = _callAPI -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Method Get - + $resp = _callAPI @commonArgs + if ($Name) { if ($resp.value) { foreach ($item in $resp.value) { if ($item.PSObject.Properties.name -contains "name") { if ($Name -eq $item.name) { + _applyTypes -item $item -type 'vsteam_lib.TaskGroup' + return $item } } } - return $null - } - else { - return $null } } else { foreach ($item in $resp.value) { + _applyTypes -item $item -type 'vsteam_lib.TaskGroup' + Write-Output $item } } diff --git a/Source/Public/Get-VSTeamTfvcBranch.ps1 b/Source/Public/Get-VSTeamTfvcBranch.ps1 index 4edff24c5..1ced6fa0a 100644 --- a/Source/Public/Get-VSTeamTfvcBranch.ps1 +++ b/Source/Public/Get-VSTeamTfvcBranch.ps1 @@ -1,7 +1,16 @@ +# Gets a branch for a given path from TFVC source control. +# +# id : bc1f417e-239d-42e7-85e1-76e80cb2d6eb +# area : tfvc +# resourceName : branches +# routeTemplate : {project}/_apis/{area}/{resource}/{*path} +# http://bit.ly/Get-VSTeamTfvcBranch + function Get-VSTeamTfvcBranch { - [CmdletBinding()] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamTfvcBranch')] param( - [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [parameter(ParameterSetName = 'ByPath', Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string[]] $Path, [parameter(Mandatory = $false)] @@ -11,22 +20,46 @@ function Get-VSTeamTfvcBranch { [switch] $IncludeParent = $false, [parameter(Mandatory = $false)] - [switch] $IncludeDeleted = $false + [switch] $IncludeDeleted = $false, + + [Parameter(ParameterSetName = 'List', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] + [string] $ProjectName ) process { - foreach ($item in $Path) { - $queryString = [ordered]@{ - includeChildren = $IncludeChildren; - includeParent = $IncludeParent; - includeDeleted = $IncludeDeleted; + $queryString = [ordered]@{ + includeChildren = $IncludeChildren; + includeParent = $IncludeParent; + includeDeleted = $IncludeDeleted; + } + + if ($null -eq $Path) { + $resp = _callAPI -ProjectName $ProjectName ` + -Area "tfvc" ` + -Resource "branches" ` + -QueryString $queryString ` + -Version $(_getApiVersion Tfvc) + + foreach ($item in $resp.value) { + _applyTypesToTfvcBranch -item $item } - $resp = _callAPI -Area tfvc -Resource branches -Id $item -QueryString $queryString -Version $(_getApiVersion Tfvc) + Write-Output $resp.value + } + else { + foreach ($item in $Path) { + $resp = _callAPI -Area "tfvc" ` + -Resource "branches" ` + -Id $item ` + -QueryString $queryString ` + -Version $(_getApiVersion Tfvc) - _applyTypesToTfvcBranch -item $resp + _applyTypesToTfvcBranch -item $resp - Write-Output $resp + Write-Output $resp + } } } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamTfvcRootBranch.ps1 b/Source/Public/Get-VSTeamTfvcRootBranch.ps1 index 74bca13a9..1a018c4a0 100644 --- a/Source/Public/Get-VSTeamTfvcRootBranch.ps1 +++ b/Source/Public/Get-VSTeamTfvcRootBranch.ps1 @@ -1,5 +1,5 @@ function Get-VSTeamTfvcRootBranch { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamTfvcRootBranch')] param( [parameter(Mandatory = $false)] [switch] $IncludeChildren = $false, @@ -11,10 +11,13 @@ function Get-VSTeamTfvcRootBranch { process { $queryString = [ordered]@{ includeChildren = $IncludeChildren; - includeDeleted = $IncludeDeleted; + includeDeleted = $IncludeDeleted; } - $resp = _callAPI -Area tfvc -Resource branches -QueryString $queryString -Version $(_getApiVersion Tfvc) + $resp = _callAPI -Area tfvc ` + -Resource branches ` + -QueryString $queryString ` + -Version $(_getApiVersion Tfvc) if ($resp | Get-Member -Name value -MemberType Properties) { foreach ($item in $resp.value) { diff --git a/Source/Public/Get-VSTeamUser.ps1 b/Source/Public/Get-VSTeamUser.ps1 index 2f02d032a..e19d3dcfa 100644 --- a/Source/Public/Get-VSTeamUser.ps1 +++ b/Source/Public/Get-VSTeamUser.ps1 @@ -1,12 +1,14 @@ function Get-VSTeamUser { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamUser')] param( [Parameter(ParameterSetName = 'List')] [ValidateSet('msa', 'aad', 'svc', 'imp', 'vss')] [string[]] $SubjectTypes, - [Parameter(ParameterSetName = 'ByUserDescriptor', Mandatory = $true)] + [Parameter(ParameterSetName = 'ByUserDescriptor', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('UserDescriptor')] + [Alias('memberDescriptor')] [string] $Descriptor ) @@ -14,16 +16,22 @@ function Get-VSTeamUser { # This will throw if this account does not support the graph API _supportsGraph + $commonArgs = @{ + subDomain = 'vssps' + area = 'graph' + resource = 'users' + noProject = $true + version = $(_getApiVersion Graph) + } + if ($Descriptor) { # Call the REST API - $resp = _callAPI -Area 'graph' -Resource 'users' -id $Descriptor ` - -Version $(_getApiVersion Graph) ` - -SubDomain 'vssps' -NoProject + $resp = _callAPI @commonArgs -id $Descriptor # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $user = [VSTeamUser]::new($resp) + $user = [vsteam_lib.User]::new($resp) Write-Output $user } @@ -35,15 +43,12 @@ function Get-VSTeamUser { try { # Call the REST API - $resp = _callAPI -Area 'graph' -id 'users' ` - -Version $(_getApiVersion Graph) ` - -QueryString $queryString ` - -SubDomain 'vssps' -NoProject + $resp = _callAPI @commonArgs -QueryString $queryString $objs = @() foreach ($item in $resp.value) { - $objs += [VSTeamUser]::new($item) + $objs += [vsteam_lib.User]::new($item) } Write-Output $objs diff --git a/Source/Public/Get-VSTeamUserEntitlement.ps1 b/Source/Public/Get-VSTeamUserEntitlement.ps1 index 0fb95e4a7..735a0f795 100644 --- a/Source/Public/Get-VSTeamUserEntitlement.ps1 +++ b/Source/Public/Get-VSTeamUserEntitlement.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamUserEntitlement { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri = 'https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamUserEntitlement')] param ( [Parameter(ParameterSetName = 'List')] [int] $Top = 100, @@ -20,22 +21,24 @@ function Get-VSTeamUserEntitlement { # This will throw if this account does not support MemberEntitlementManagement _supportsMemberEntitlementManagement + $commonArgs = @{ + subDomain = 'vsaex' + resource = 'userentitlements' + version = $(_getApiVersion MemberEntitlementManagement) + } + if ($Id) { foreach ($item in $Id) { # Build the url to return the single build # Call the REST API - $resp = _callAPI -SubDomain 'vsaex' -Version $(_getApiVersion MemberEntitlementManagement) -Resource 'userentitlements' -id $item + $resp = _callAPI @commonArgs -id $item - _applyTypesToUser -item $resp - - Write-Output $resp + Write-Output $([vsteam_lib.UserEntitlement]::new($resp)) } } else { # Build the url to list the teams - # $listurl = _buildUserURL - $listurl = _buildRequestURI -SubDomain 'vsaex' -Resource 'userentitlements' ` - -Version $(_getApiVersion MemberEntitlementManagement) + $listurl = _buildRequestURI @commonArgs $listurl += _appendQueryString -name "top" -value $top -retainZero $listurl += _appendQueryString -name "skip" -value $skip -retainZero @@ -44,12 +47,13 @@ function Get-VSTeamUserEntitlement { # Call the REST API $resp = _callAPI -url $listurl - # Apply a Type Name so we can use custom format view and custom type extensions + $objs = @() + foreach ($item in $resp.members) { - _applyTypesToUser -item $item + $objs += [vsteam_lib.UserEntitlement]::new($item) } - Write-Output $resp.members + Write-Output $objs } } } \ No newline at end of file diff --git a/Source/Public/Get-VSTeamVariableGroup.ps1 b/Source/Public/Get-VSTeamVariableGroup.ps1 index 390bbe9c6..2f2f4759e 100644 --- a/Source/Public/Get-VSTeamVariableGroup.ps1 +++ b/Source/Public/Get-VSTeamVariableGroup.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamVariableGroup { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamVariableGroup')] param( [Parameter(Position = 0, ParameterSetName = 'ByID', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Id, @@ -8,16 +9,22 @@ function Get-VSTeamVariableGroup { [string] $Name, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter]) ] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter]) ] [string] $ProjectName ) process { + $commonArgs = @{ + ProjectName = $ProjectName + Area = 'distributedtask' + Resource = 'variablegroups' + Version = $(_getApiVersion VariableGroups) + } + if ($Id) { # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` - -Version $(_getApiVersion VariableGroups) -Id $Id + $resp = _callAPI @commonArgs -Id $Id _applyTypesToVariableGroup -item $resp @@ -25,23 +32,21 @@ function Get-VSTeamVariableGroup { } else { if ($Name) { - $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' -Version $(_getApiVersion VariableGroups) -Method Get ` - -QueryString @{groupName = $Name } + $resp = _callAPI @commonArgs -QueryString @{groupName = $Name } _applyTypesToVariableGroup -item $resp.value - + Write-Output $resp.value } else { # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'distributedtask' -Resource 'variablegroups' ` - -Version $(_getApiVersion VariableGroups) - - # Apply a Type Name so we can use custom format view and custom type extensions + $resp = _callAPI @commonArgs + + # Apply a Type Name so we can use custom format view and custom type extensions foreach ($item in $resp.value) { _applyTypesToVariableGroup -item $item } - + return $resp.value } } diff --git a/Source/Public/Get-VSTeamWiql.ps1 b/Source/Public/Get-VSTeamWiql.ps1 index 3c0ccff83..cba45757c 100644 --- a/Source/Public/Get-VSTeamWiql.ps1 +++ b/Source/Public/Get-VSTeamWiql.ps1 @@ -1,8 +1,9 @@ function Get-VSTeamWiql { - [CmdletBinding(DefaultParameterSetName = 'ByID')] + [CmdletBinding(DefaultParameterSetName = 'ByID', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamWiql')] param( - [QueryTransformToIDAttribute()] - [ArgumentCompleter([QueryCompleter])] + [vsteam_lib.QueryTransformToIDAttribute()] + [ArgumentCompleter([vsteam_lib.QueryCompleter])] [Parameter(ParameterSetName = 'ByID', Mandatory = $true, Position = 0)] [string] $Id, @@ -11,9 +12,9 @@ function Get-VSTeamWiql { [string] $Team, - [Parameter(Position = 2)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $false, Position = 2)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] $ProjectName, [int] $Top = 100, @@ -26,7 +27,7 @@ function Get-VSTeamWiql { ProjectName = $ProjectName Area = 'wit' Resource = 'wiql' - Version = [VSTeamVersions]::Core + Version = [vsteam_lib.Versions]::Core QueryString = @{ '$top' = $Top timePrecision = $TimePrecision @@ -68,7 +69,7 @@ function Get-VSTeamWiql { Get-VSTeamWorkItem -Id $Ids[$beginRange..$endRange] } else { - Get-VSTeamWorkItem -Id $Ids[$beginRange..$endRange] -Fields $resp.columns.referenceName + Get-VSTeamWorkItem -Id $Ids[$beginRange..$endRange] -Fields $resp.columns.referenceName } } } diff --git a/Source/Public/Get-VSTeamWorkItem.ps1 b/Source/Public/Get-VSTeamWorkItem.ps1 index c627b66a1..9053e3df7 100644 --- a/Source/Public/Get-VSTeamWorkItem.ps1 +++ b/Source/Public/Get-VSTeamWorkItem.ps1 @@ -1,5 +1,6 @@ function Get-VSTeamWorkItem { - [CmdletBinding(DefaultParameterSetName = 'ByID')] + [CmdletBinding(DefaultParameterSetName = 'ByID', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamWorkItem')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [int[]] $Id, @@ -16,9 +17,14 @@ function Get-VSTeamWorkItem { Process { # Call the REST API + $commonArgs = @{ + NoProject = $true + Area = 'wit' + Resource = 'workitems' + Version = $(_getApiVersion Core) + } if ($Id.Length -gt 1) { - $resp = _callAPI -NoProject -Area 'wit' -Resource 'workitems' ` - -Version $(_getApiVersion Core) ` + $resp = _callAPI @commonArgs ` -Querystring @{ '$Expand' = $Expand fields = ($Fields -join ',') @@ -34,8 +40,7 @@ function Get-VSTeamWorkItem { } else { $a = $Id[0] - $resp = _callAPI -NoProject -Area 'wit' -Resource 'workitems' ` - -Version $(_getApiVersion Core) -id "$a" ` + $resp = _callAPI @commonArgs -id "$a" ` -Querystring @{ '$Expand' = $Expand fields = ($Fields -join ',') diff --git a/Source/Public/Get-VSTeamWorkItemType.ps1 b/Source/Public/Get-VSTeamWorkItemType.ps1 index 6bacc1cad..39d280a85 100644 --- a/Source/Public/Get-VSTeamWorkItemType.ps1 +++ b/Source/Public/Get-VSTeamWorkItemType.ps1 @@ -1,22 +1,29 @@ function Get-VSTeamWorkItemType { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamWorkItemType')] param( - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName, [Parameter()] - [WorkItemTypeValidateAttribute()] - [ArgumentCompleter([WorkItemTypeCompleter])] + [vsteam_lib.WorkItemTypeValidateAttribute()] + [ArgumentCompleter([vsteam_lib.WorkItemTypeCompleter])] [string] $WorkItemType ) Process { # Call the REST API + $commonArgs = @{ + ProjectName = $ProjectName + Area = 'wit' + Resource = 'workitemtypes' + Version = $(_getApiVersion Core) + } + if ($WorkItemType) { - $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitemtypes' ` - -Version $(_getApiVersion Core) -id $WorkItemType + $resp = _callAPI @commonArgs -id $WorkItemType # This call returns JSON with "": which causes the ConvertFrom-Json to fail. # To replace all the "": with "_end": @@ -27,8 +34,7 @@ function Get-VSTeamWorkItemType { return $resp } else { - $resp = _callAPI -ProjectName $ProjectName -Area 'wit' -Resource 'workitemtypes' ` - -Version $(_getApiVersion Core) + $resp = _callAPI @commonArgs # This call returns JSON with "": which causes the ConvertFrom-Json to fail. # To replace all the "": with "_end": diff --git a/Source/Public/Invoke-VSTeamRequest.ps1 b/Source/Public/Invoke-VSTeamRequest.ps1 index fce837002..2b35a99df 100644 --- a/Source/Public/Invoke-VSTeamRequest.ps1 +++ b/Source/Public/Invoke-VSTeamRequest.ps1 @@ -1,10 +1,10 @@ function Invoke-VSTeamRequest { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Invoke-VSTeamRequest')] param( - [ArgumentCompleter([InvokeCompleter])] + [ArgumentCompleter([vsteam_lib.InvokeCompleter])] [string] $resource, - [ArgumentCompleter([InvokeCompleter])] + [ArgumentCompleter([vsteam_lib.InvokeCompleter])] [string] $area, [string] $id, @@ -34,14 +34,14 @@ function Invoke-VSTeamRequest { [object] $QueryString, [string] $Team, - - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName, - + [switch] $UseProjectId, - + [switch] $NoProject) process { diff --git a/Source/Public/Remove-VSTeam.ps1 b/Source/Public/Remove-VSTeam.ps1 index bf9e66ac4..01db4b119 100644 --- a/Source/Public/Remove-VSTeam.ps1 +++ b/Source/Public/Remove-VSTeam.ps1 @@ -1,23 +1,26 @@ function Remove-VSTeam { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeam')] param( - [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $True, Position = 0, ValueFromPipelineByPropertyName = $true)] [Alias('Name', 'TeamId', 'TeamName')] [string]$Id, [switch]$Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { if ($Force -or $PSCmdlet.ShouldProcess($Id, "Delete team")) { # Call the REST API - _callAPI -Area 'projects' -Resource "$ProjectName/teams" -Id $Id ` - -Method Delete -Version $(_getApiVersion Core) | Out-Null + _callAPI -Method DELETE ` + -Resource "projects/$ProjectName/teams" ` + -Id $Id ` + -Version $(_getApiVersion Core) | Out-Null Write-Output "Deleted team $Id" } diff --git a/Source/Public/Remove-VSTeamAccessControlEntry.ps1 b/Source/Public/Remove-VSTeamAccessControlEntry.ps1 index 60ac82d3e..ffb76c60b 100644 --- a/Source/Public/Remove-VSTeamAccessControlEntry.ps1 +++ b/Source/Public/Remove-VSTeamAccessControlEntry.ps1 @@ -1,25 +1,36 @@ +# Removes specified ACEs in the ACL for the provided token. The request URI +# contains the namespace ID, the target token, and a single or list of +# descriptors that should be removed. Only supports removing AzD based +# users/groups. +# +# Get-VSTeamOption 'Security' 'AccessControlEntries' +# id : ac08c8ff-4323-4b08-af90-bcd018d380ce +# area : Security +# resourceName : AccessControlEntries +# routeTemplate : _apis/{resource}/{securityNamespaceId} +# https://bit.ly/Add-VSTeamAccessControlEntry + function Remove-VSTeamAccessControlEntry { - [CmdletBinding(DefaultParameterSetName = 'byNamespace', SupportsShouldProcess = $true, ConfirmImpact = 'High')] + [CmdletBinding(DefaultParameterSetName = 'byNamespace', SupportsShouldProcess = $true, ConfirmImpact = 'High', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamAccessControlEntry')] [OutputType([System.String])] param( [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true, ValueFromPipeline = $true)] - [VSTeamSecurityNamespace] $securityNamespace, - + [vsteam_lib.SecurityNamespace] $securityNamespace, + [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] [guid] $securityNamespaceId, - - [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true)] - [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] + [string] $token, - - [Parameter(ParameterSetName = 'byNamespace', Mandatory = $true)] - [Parameter(ParameterSetName = 'byNamespaceId', Mandatory = $true)] - [System.Array] $descriptor + + [System.Array] $descriptor, + + [switch] $force ) - + process { if ($securityNamespace) { - $securityNamespaceId = ($securityNamespace | Select-Object -ExpandProperty id -ErrorAction SilentlyContinue) + $securityNamespaceId = ($securityNamespace | Select-Object -ExpandProperty id) } if (($descriptor).count -gt 1) { @@ -27,19 +38,21 @@ function Remove-VSTeamAccessControlEntry { foreach ($uniqueDescriptor in $descriptor) { $uniqueDescriptor = ($uniqueDescriptor).split(".")[1] + try { - + $uniqueDescriptor = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("$uniqueDescriptor")) } catch [FormatException] { Write-Error "Could not convert base64 string to string." continue } + $uniqueDescriptor = "Microsoft.TeamFoundation.Identity;" + "$uniqueDescriptor" $descriptor += $uniqueDescriptor } - + if (($descriptor).count -eq 0) { Write-Error "No valid descriptors provided." return @@ -58,13 +71,17 @@ function Remove-VSTeamAccessControlEntry { Write-Error "Could not convert base64 string to string." return } - + $descriptor = "Microsoft.TeamFoundation.Identity;" + "$descriptor" } - - if ($PSCmdlet.ShouldProcess("$token")) { + + if ($Force -or $pscmdlet.ShouldProcess($token, "Remove ACE from ACL")) { # Call the REST API - $resp = _callAPI -method DELETE -Area "accesscontrolentries" -id $securityNamespaceId -ContentType "application/json" -Version $(_getApiVersion Core) -QueryString @{token = $token; descriptors = $descriptor } -ErrorAction SilentlyContinue + $resp = _callAPI -Method DELETE ` + -Resource "accesscontrolentries" ` + -id $securityNamespaceId ` + -QueryString @{ token = $token; descriptors = $descriptor } ` + -Version $(_getApiVersion Core) } switch ($resp) { @@ -76,6 +93,7 @@ function Remove-VSTeamAccessControlEntry { Write-Error "Removal of ACE from ACL failed. Ensure descriptor and token are correct." return } + { ($resp -ne $true) -and ($resp -ne $false) } { Write-Error "Unexpected response from REST API." return diff --git a/Source/Public/Remove-VSTeamAccessControlList.ps1 b/Source/Public/Remove-VSTeamAccessControlList.ps1 index 1354677fd..d27545f80 100644 --- a/Source/Public/Remove-VSTeamAccessControlList.ps1 +++ b/Source/Public/Remove-VSTeamAccessControlList.ps1 @@ -1,8 +1,9 @@ function Remove-VSTeamAccessControlList { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ByNamespace')] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ByNamespace', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamAccessControlList')] param( [Parameter(ParameterSetName = 'ByNamespace', Mandatory = $true, ValueFromPipeline = $true)] - [VSTeamSecurityNamespace] $SecurityNamespace, + [vsteam_lib.SecurityNamespace] $SecurityNamespace, [Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)] [guid] $SecurityNamespaceId, @@ -35,9 +36,11 @@ function Remove-VSTeamAccessControlList { if ($Force -or $pscmdlet.ShouldProcess($queryString.tokens, "Delete ACL")) { # Call the REST API - $resp = _callAPI -Area 'accesscontrollists' -id $SecurityNamespaceId -method DELETE ` - -Version $(_getApiVersion Core) ` - -QueryString $queryString + $resp = _callAPI -Method DELETE ` + -Resource accesscontrollists ` + -id $SecurityNamespaceId ` + -QueryString $queryString ` + -Version $(_getApiVersion Core) Write-Output $resp } diff --git a/Source/Public/Remove-VSTeamAccount.ps1 b/Source/Public/Remove-VSTeamAccount.ps1 index 875d9e294..b7c38fa13 100644 --- a/Source/Public/Remove-VSTeamAccount.ps1 +++ b/Source/Public/Remove-VSTeamAccount.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamAccount { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamAccount')] param( [switch] $Force ) diff --git a/Source/Public/Remove-VSTeamAgent.ps1 b/Source/Public/Remove-VSTeamAgent.ps1 index 5a211879f..229c522e6 100644 --- a/Source/Public/Remove-VSTeamAgent.ps1 +++ b/Source/Public/Remove-VSTeamAgent.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamAgent { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamAgent')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [int] $PoolId, @@ -13,9 +14,14 @@ function Remove-VSTeamAgent { process { foreach ($item in $Id) { - if ($force -or $pscmdlet.ShouldProcess($item,"Delete agent")) { + if ($force -or $pscmdlet.ShouldProcess($item, "Delete agent")) { try { - _callAPI -Method Delete -Area "distributedtask/pools/$PoolId" -Resource agents -Id $item -Version $(_getApiVersion DistributedTask) | Out-Null + _callAPI -Method DELETE ` + -Area "distributedtask/pools/$PoolId" ` + -Resource agents ` + -Id $item ` + -Version $(_getApiVersion DistributedTaskReleased) | Out-Null + Write-Output "Deleted agent $item" } catch { diff --git a/Source/Public/Remove-VSTeamArea.ps1 b/Source/Public/Remove-VSTeamArea.ps1 index ef92985db..93ade6136 100644 --- a/Source/Public/Remove-VSTeamArea.ps1 +++ b/Source/Public/Remove-VSTeamArea.ps1 @@ -1,15 +1,17 @@ function Remove-VSTeamArea { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamArea')] param( - [Parameter(Mandatory = $false)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [Alias('NodeId')] [int] $ReClassifyId, - - [Parameter(Mandatory = $false)] + + [Parameter(Mandatory = $true, Position = 0)] [string] $Path, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName, [switch] $Force @@ -17,7 +19,11 @@ function Remove-VSTeamArea { process { if ($force -or $pscmdlet.ShouldProcess($Path, "Delete area")) { - $null = Remove-VSTeamClassificationNode -StructureGroup 'areas' -ProjectName $ProjectName -Path $Path -ReClassifyId $ReClassifyId -Force + $null = Remove-VSTeamClassificationNode -ProjectName $ProjectName ` + -StructureGroup 'areas' ` + -Path $Path ` + -ReClassifyId $ReClassifyId ` + -Force } } } \ No newline at end of file diff --git a/Source/Public/Remove-VSTeamBuild.ps1 b/Source/Public/Remove-VSTeamBuild.ps1 index b8e7de0e3..0ac49042a 100644 --- a/Source/Public/Remove-VSTeamBuild.ps1 +++ b/Source/Public/Remove-VSTeamBuild.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamBuild { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamBuild')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] @@ -7,17 +8,20 @@ function Remove-VSTeamBuild { [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Build")) { try { - _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' -id $item ` - -Method Delete -Version $(_getApiVersion Build) | Out-Null + _callAPI -Method DELETE -ProjectName $ProjectName ` + -Area build ` + -Resource builds ` + -id $item ` + -Version $(_getApiVersion Build) | Out-Null Write-Output "Deleted build $item" } diff --git a/Source/Public/Remove-VSTeamBuildDefinition.ps1 b/Source/Public/Remove-VSTeamBuildDefinition.ps1 index 909bf0317..218bced0e 100644 --- a/Source/Public/Remove-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Remove-VSTeamBuildDefinition.ps1 @@ -1,14 +1,15 @@ function Remove-VSTeamBuildDefinition { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamBuildDefinition')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [int[]] $Id, [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -16,7 +17,11 @@ function Remove-VSTeamBuildDefinition { foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Build Definition")) { # Call the REST API - _callAPI -Method Delete -ProjectName $ProjectName -Area build -Resource definitions -Id $item -Version $(_getApiVersion Build) | Out-Null + _callAPI -Method DELETE -ProjectName $ProjectName ` + -Area build ` + -Resource definitions ` + -Id $item ` + -Version $(_getApiVersion Build) | Out-Null Write-Output "Deleted build definition $item" } diff --git a/Source/Public/Remove-VSTeamBuildTag.ps1 b/Source/Public/Remove-VSTeamBuildTag.ps1 index 63d1e7d9b..fd5ae9f66 100644 --- a/Source/Public/Remove-VSTeamBuildTag.ps1 +++ b/Source/Public/Remove-VSTeamBuildTag.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamBuildTag { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamBuildTag')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [string[]] $Tags, @@ -10,19 +11,23 @@ function Remove-VSTeamBuildTag { [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Remove-VSTeamBuildTag")) { foreach ($tag in $tags) { # Call the REST API - _callAPI -ProjectName $projectName -Area 'build' -Resource "builds/$Id/tags" ` - -Method Delete -Querystring @{tag = $tag } -Version $(_getApiVersion Build) | Out-Null + _callAPI -Method DELETE -ProjectName $projectName ` + -Area build ` + -Resource builds ` + -Id "$Id/tags" ` + -Querystring @{tag = $tag } ` + -Version $(_getApiVersion Build) | Out-Null } } } diff --git a/Source/Public/Remove-VSTeamClassificationNode.ps1 b/Source/Public/Remove-VSTeamClassificationNode.ps1 index 9b9522dc4..b473ed9cb 100644 --- a/Source/Public/Remove-VSTeamClassificationNode.ps1 +++ b/Source/Public/Remove-VSTeamClassificationNode.ps1 @@ -1,19 +1,20 @@ function Remove-VSTeamClassificationNode { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamClassificationNode')] param( [Parameter(Mandatory = $false)] [int] $ReClassifyId, - + [ValidateSet("areas", "iterations")] [Parameter(Mandatory = $true)] [string] $StructureGroup, - + [Parameter(Mandatory = $false)] [string] $Path, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName, [switch] $Force @@ -37,8 +38,10 @@ function Remove-VSTeamClassificationNode { # Call the REST API if ($force -or $pscmdlet.ShouldProcess($Path, "Delete classification node")) { - $null = _callAPI -Method "Delete" -ProjectName $ProjectName -Area 'wit' -Resource "classificationnodes" -id $id ` - -ContentType 'application/json; charset=utf-8' ` + $null = _callAPI -Method DELETE -ProjectName $ProjectName ` + -Area wit ` + -Resource classificationnodes ` + -id $id ` -QueryString $queryString ` -Version $(_getApiVersion Core) } diff --git a/Source/Public/Remove-VSTeamExtension.ps1 b/Source/Public/Remove-VSTeamExtension.ps1 index a0a056d44..9d694fb8a 100644 --- a/Source/Public/Remove-VSTeamExtension.ps1 +++ b/Source/Public/Remove-VSTeamExtension.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamExtension { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamExtension')] param ( [parameter(Mandatory = $true)] [string] $PublisherId, @@ -11,9 +12,13 @@ function Remove-VSTeamExtension { ) if ($Force -or $pscmdlet.ShouldProcess($ExtensionId, "Remove extension")) { - $resource = "extensionmanagement/installedextensionsbyname/$PublisherId/$ExtensionId" + $id = "$PublisherId/$ExtensionId" - $resp = _callAPI -NoProject -Method Delete -SubDomain 'extmgmt' -Resource $resource -Version $(_getApiVersion ExtensionsManagement) + $resp = _callAPI -Method DELETE -NoProject -SubDomain extmgmt ` + -Area extensionmanagement ` + -Resource installedextensionsbyname ` + -Id $id ` + -Version $(_getApiVersion ExtensionsManagement) Write-Output $resp } diff --git a/Source/Public/Remove-VSTeamFeed.ps1 b/Source/Public/Remove-VSTeamFeed.ps1 index 75ed061a6..96999bda7 100644 --- a/Source/Public/Remove-VSTeamFeed.ps1 +++ b/Source/Public/Remove-VSTeamFeed.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamFeed { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamFeed')] param ( [Parameter(ParameterSetName = 'ByID', Position = 0, Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('FeedId')] @@ -11,7 +12,11 @@ function Remove-VSTeamFeed { foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Package Feed")) { # Call the REST API - _callAPI -subDomain feeds -Method Delete -Id $item -Area packaging -Resource feeds -Version $(_getApiVersion Packaging) | Out-Null + _callAPI -Method DELETE -subDomain feeds ` + -Area packaging ` + -Resource feeds ` + -Id $item ` + -Version $(_getApiVersion Packaging) | Out-Null Write-Output "Deleted Feed $item" } diff --git a/Source/Public/Remove-VSTeamGitRepository.ps1 b/Source/Public/Remove-VSTeamGitRepository.ps1 index 3fbdb5281..8cc8605c2 100644 --- a/Source/Public/Remove-VSTeamGitRepository.ps1 +++ b/Source/Public/Remove-VSTeamGitRepository.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamGitRepository { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamGitRepository')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [guid[]] $Id, @@ -10,7 +11,7 @@ function Remove-VSTeamGitRepository { foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Repository")) { try { - _callAPI -Method Delete -Id $item -Area git -Resource repositories -Version $(_getApiVersion Git) | Out-Null + _callAPI -Method DELETE -Id $item -Area git -Resource repositories -Version $(_getApiVersion Git) | Out-Null Write-Output "Deleted repository $item" } diff --git a/Source/Public/Remove-VSTeamIteration.ps1 b/Source/Public/Remove-VSTeamIteration.ps1 index 00177d871..ef56241a8 100644 --- a/Source/Public/Remove-VSTeamIteration.ps1 +++ b/Source/Public/Remove-VSTeamIteration.ps1 @@ -1,15 +1,16 @@ function Remove-VSTeamIteration { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamIteration')] param( - [Parameter(Mandatory = $false)] + [Parameter(Mandatory = $true)] [int] $ReClassifyId, - - [Parameter(Mandatory = $false)] + + [Parameter(Mandatory = $true)] [string] $Path, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName, [switch] $Force @@ -17,7 +18,11 @@ function Remove-VSTeamIteration { process { if ($force -or $pscmdlet.ShouldProcess($Path, "Delete iteration")) { - $null = Remove-VSTeamClassificationNode -StructureGroup 'iterations' -ProjectName $ProjectName -Path $Path -ReClassifyId $ReClassifyId -Force + $null = Remove-VSTeamClassificationNode -ProjectName $ProjectName ` + -StructureGroup 'iterations' ` + -Path $Path ` + -ReClassifyId $ReClassifyId ` + -Force } } } \ No newline at end of file diff --git a/Source/Public/Remove-VSTeamMembership.ps1 b/Source/Public/Remove-VSTeamMembership.ps1 index 094783d13..57070d57c 100644 --- a/Source/Public/Remove-VSTeamMembership.ps1 +++ b/Source/Public/Remove-VSTeamMembership.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamMembership { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamMembership')] param( [Parameter(Mandatory = $true)] [string] $MemberDescriptor, @@ -10,7 +11,7 @@ function Remove-VSTeamMembership { process { if ($Force -or $PSCmdlet.ShouldProcess("$MemberDescriptor/$ContainerDescriptor", "Delete Membership")) { - return _callMembershipAPI -Id "$MemberDescriptor/$ContainerDescriptor" -Method Delete + return _callMembershipAPI -Id "$MemberDescriptor/$ContainerDescriptor" -Method DELETE } } } diff --git a/Source/Public/Remove-VSTeamPolicy.ps1 b/Source/Public/Remove-VSTeamPolicy.ps1 index 71efb5f86..b586a67ea 100644 --- a/Source/Public/Remove-VSTeamPolicy.ps1 +++ b/Source/Public/Remove-VSTeamPolicy.ps1 @@ -1,14 +1,15 @@ function Remove-VSTeamPolicy { - [CmdletBinding(SupportsShouldProcess = $true)] + [CmdletBinding(SupportsShouldProcess = $true, + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamPolicy')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [int[]] $Id, [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -16,7 +17,11 @@ function Remove-VSTeamPolicy { foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Policy")) { try { - _callAPI -ProjectName $ProjectName -Method Delete -Id $item -Area policy -Resource configurations -Version $(_getApiVersion Git) | Out-Null + _callAPI -Method DELETE -ProjectName $ProjectName ` + -Area policy ` + -Resource configurations ` + -Id $item ` + -Version $(_getApiVersion Policy) | Out-Null Write-Output "Deleted policy $item" } diff --git a/Source/Public/Remove-VSTeamProfile.ps1 b/Source/Public/Remove-VSTeamProfile.ps1 index 66ae2c387..a90849abd 100644 --- a/Source/Public/Remove-VSTeamProfile.ps1 +++ b/Source/Public/Remove-VSTeamProfile.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamProfile { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamProfile')] param( # Name is an array so I can pass an array after -Name # I can also use pipe diff --git a/Source/Public/Remove-VSTeamProject.ps1 b/Source/Public/Remove-VSTeamProject.ps1 index a5f4529ae..6e5a5054e 100644 --- a/Source/Public/Remove-VSTeamProject.ps1 +++ b/Source/Public/Remove-VSTeamProject.ps1 @@ -1,28 +1,31 @@ function Remove-VSTeamProject { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamProject')] param( [switch] $Force, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('ProjectName')] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $Name ) - + Process { # Bind the parameter to a friendly variable $ProjectName = $PSBoundParameters["Name"] if ($Force -or $pscmdlet.ShouldProcess($ProjectName, "Delete Project")) { # Call the REST API - $resp = _callAPI -Area 'projects' -Id (Get-VSTeamProject $ProjectName).id ` - -Method Delete -Version $(_getApiVersion Core) + $resp = _callAPI -Method DELETE ` + -Resource projects ` + -Id (Get-VSTeamProject $ProjectName).id ` + -Version $(_getApiVersion Core) _trackProjectProgress -resp $resp -title 'Deleting team project' -msg "Deleting $ProjectName" # Invalidate any cache of projects. - [VSTeamProjectCache]::Invalidate() + [vsteam_lib.ProjectCache]::Invalidate() Write-Output "Deleted $ProjectName" } diff --git a/Source/Public/Remove-VSTeamRelease.ps1 b/Source/Public/Remove-VSTeamRelease.ps1 index 58e1e636e..387e21f49 100644 --- a/Source/Public/Remove-VSTeamRelease.ps1 +++ b/Source/Public/Remove-VSTeamRelease.ps1 @@ -1,14 +1,15 @@ function Remove-VSTeamRelease { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamRelease')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [int[]] $Id, [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { @@ -16,7 +17,11 @@ function Remove-VSTeamRelease { if ($force -or $pscmdlet.ShouldProcess($item, "Delete Release")) { try { # Call the REST API - _callAPI -Method Delete -SubDomain vsrm -Area release -Resource releases -ProjectName $ProjectName -id $item -Version $(_getApiVersion Release) | Out-Null + _callAPI -Method DELETE -SubDomain vsrm -ProjectName $ProjectName ` + -Area release ` + -Resource releases ` + -id $item ` + -Version $(_getApiVersion Release) | Out-Null Write-Output "Deleted release $item" } diff --git a/Source/Public/Remove-VSTeamReleaseDefinition.ps1 b/Source/Public/Remove-VSTeamReleaseDefinition.ps1 index 87fe4c9e3..081217392 100644 --- a/Source/Public/Remove-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Remove-VSTeamReleaseDefinition.ps1 @@ -1,14 +1,15 @@ function Remove-VSTeamReleaseDefinition { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamReleaseDefinition')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [int[]] $Id, [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -17,7 +18,11 @@ function Remove-VSTeamReleaseDefinition { foreach ($item in $id) { if ($force -or $pscmdlet.ShouldProcess($item, "Delete Release Definition")) { - _callAPI -Method Delete -subDomain vsrm -Area release -Resource definitions -Version $(_getApiVersion Release) -projectName $ProjectName -id $item | Out-Null + _callAPI -Method DELETE -subDomain vsrm -projectName $ProjectName ` + -Area release ` + -Resource definitions ` + -id $item ` + -Version $(_getApiVersion Release) | Out-Null Write-Output "Deleted release definition $item" } diff --git a/Source/Public/Remove-VSTeamServiceEndpoint.ps1 b/Source/Public/Remove-VSTeamServiceEndpoint.ps1 index 7309e663e..b43461d71 100644 --- a/Source/Public/Remove-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Remove-VSTeamServiceEndpoint.ps1 @@ -1,14 +1,15 @@ function Remove-VSTeamServiceEndpoint { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamServiceEndpoint')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string[]] $id, [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -17,7 +18,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 ServiceEndpoints) | Out-Null + -Method DELETE -Version $(_getApiVersion ServiceEndpoints) | Out-Null Write-Output "Deleted service endpoint $item" } diff --git a/Source/Public/Remove-VSTeamTaskGroup.ps1 b/Source/Public/Remove-VSTeamTaskGroup.ps1 index 12957f0d6..d59dcca32 100644 --- a/Source/Public/Remove-VSTeamTaskGroup.ps1 +++ b/Source/Public/Remove-VSTeamTaskGroup.ps1 @@ -1,21 +1,26 @@ function Remove-VSTeamTaskGroup { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamTaskGroup')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string[]] $Id, [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { foreach ($item in $Id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Task Group")) { # Call the REST API - _callAPI -Method Delete -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Id $item | Out-Null + _callAPI -Method DELETE -ProjectName $ProjectName ` + -Area distributedtask ` + -Resource taskgroups ` + -Id $item ` + -Version $(_getApiVersion TaskGroups) | Out-Null Write-Output "Deleted task group $item" } diff --git a/Source/Public/Remove-VSTeamUserEntitlement.ps1 b/Source/Public/Remove-VSTeamUserEntitlement.ps1 index 5184805f5..72549cdd3 100644 --- a/Source/Public/Remove-VSTeamUserEntitlement.ps1 +++ b/Source/Public/Remove-VSTeamUserEntitlement.ps1 @@ -1,40 +1,45 @@ function Remove-VSTeamUserEntitlement { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ById')] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ById', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamUserEntitlement')] param( - [Parameter(ParameterSetName = 'ById', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] - [Alias('UserId')] - [string]$Id, + [Parameter(ParameterSetName = 'ById', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] + [Alias('UserId')] + [string]$Id, - [Parameter(ParameterSetName = 'ByEmail', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] - [Alias('UserEmail')] - [string]$Email, + [Parameter(ParameterSetName = 'ByEmail', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] + [Alias('UserEmail')] + [string]$Email, - [switch]$Force + [switch]$Force ) process { - # This will throw if this account does not support MemberEntitlementManagement - _supportsMemberEntitlementManagement + # This will throw if this account does not support MemberEntitlementManagement + _supportsMemberEntitlementManagement - if ($email) { - # We have to go find the id - $user = Get-VSTeamUserEntitlement | Where-Object email -eq $email + if ($email) { + # We have to go find the id + $user = Get-VSTeamUserEntitlement | Where-Object email -eq $email - if (-not $user) { - throw "Could not find user with an email equal to $email" - } + if (-not $user) { + throw "Could not find user with an email equal to $email" + } - $id = $user.id + $id = $user.id - } else { - $user = Get-VSTeamUserEntitlement -Id $id - } + } + else { + $user = Get-VSTeamUserEntitlement -Id $id + } - if ($Force -or $PSCmdlet.ShouldProcess("$($user.userName) ($($user.email))", "Delete user")) { - # Call the REST API - _callAPI -Method Delete -SubDomain 'vsaex' -Resource 'userentitlements' -Id $Id -Version $(_getApiVersion MemberEntitlementManagement) | Out-Null + if ($Force -or $PSCmdlet.ShouldProcess("$($user.userName) ($($user.email))", "Delete user")) { + # Call the REST API + _callAPI -Method DELETE -SubDomain vsaex ` + -Resource userentitlements ` + -Id $Id ` + -Version $(_getApiVersion MemberEntitlementManagement) | Out-Null - Write-Output "Deleted user $($user.userName) ($($user.email))" - } + Write-Output "Deleted user $($user.userName) ($($user.email))" + } } } \ No newline at end of file diff --git a/Source/Public/Remove-VSTeamVariableGroup.ps1 b/Source/Public/Remove-VSTeamVariableGroup.ps1 index 418f2a977..774f2c8dd 100644 --- a/Source/Public/Remove-VSTeamVariableGroup.ps1 +++ b/Source/Public/Remove-VSTeamVariableGroup.ps1 @@ -1,14 +1,15 @@ function Remove-VSTeamVariableGroup { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamVariableGroup')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string[]] $id, [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -16,8 +17,11 @@ function Remove-VSTeamVariableGroup { foreach ($item in $id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Variable Group")) { # Call the REST API - _callAPI -projectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $item ` - -Method Delete -Version $(_getApiVersion VariableGroups) | Out-Null + _callAPI -Method DELETE -ProjectName $projectName ` + -Area distributedtask ` + -Resource variablegroups ` + -Id $item ` + -Version $(_getApiVersion VariableGroups) | Out-Null Write-Output "Deleted variable group $item" } diff --git a/Source/Public/Remove-VSTeamWorkItem.ps1 b/Source/Public/Remove-VSTeamWorkItem.ps1 index d449e1e0a..ddfe806ac 100644 --- a/Source/Public/Remove-VSTeamWorkItem.ps1 +++ b/Source/Public/Remove-VSTeamWorkItem.ps1 @@ -1,5 +1,6 @@ function Remove-VSTeamWorkItem { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ByID')] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ByID', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Remove-VSTeamWorkItem')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [int[]] $Id, @@ -14,11 +15,12 @@ function Remove-VSTeamWorkItem { foreach ($item in $Id) { if ($Force -or $pscmdlet.ShouldProcess($item, "Delete Work Item")) { try { - _callAPI -Method Delete -Area wit -Resource workitems ` - -Version $(_getApiVersion Core) -id $item ` - -Querystring @{ - destroy = $Destroy - } | Out-Null + _callAPI -Method DELETE ` + -Area "wit" ` + -Resource "workitems" ` + -id $item ` + -Querystring @{ destroy = $Destroy } ` + -Version $(_getApiVersion Core) | Out-Null Write-Output "Deleted Work item with ID $item" } diff --git a/Source/Public/Set-VSTeamAPIVersion.ps1 b/Source/Public/Set-VSTeamAPIVersion.ps1 index 9d17a7546..a97f63719 100644 --- a/Source/Public/Set-VSTeamAPIVersion.ps1 +++ b/Source/Public/Set-VSTeamAPIVersion.ps1 @@ -1,12 +1,19 @@ function Set-VSTeamAPIVersion { - [CmdletBinding(DefaultParameterSetName = 'Target', SupportsShouldProcess = $true, ConfirmImpact = "Low")] + [CmdletBinding(DefaultParameterSetName = 'Target', SupportsShouldProcess = $true, ConfirmImpact = "Low", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Set-VSTeamAPIVersion')] param( [parameter(ParameterSetName = 'Target', Mandatory = $false, Position = 0)] - [ValidateSet('TFS2017', 'TFS2018', 'AzD2019', 'VSTS', 'AzD', 'TFS2017U1', 'TFS2017U2', 'TFS2017U3', 'TFS2018U1', 'TFS2018U2', 'TFS2018U3', 'AzD2019U1')] + [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', 'ServiceEndpoints', 'Graph', 'TaskGroups', 'Policy')] + [ValidateSet('Build', 'Release', 'Core', 'Git', 'DistributedTask', + 'DistributedTaskReleased', 'VariableGroups', 'Tfvc', + 'Packaging', 'MemberEntitlementManagement', + 'ExtensionsManagement', 'ServiceEndpoints', 'Graph', + 'TaskGroups', 'Policy', 'HierarchyQuery')] [string] $Service, [parameter(ParameterSetName = 'Service', Mandatory = $true, Position = 1)] @@ -17,221 +24,261 @@ 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 - } - 'ServiceEndpoints' { - [VSTeamVersions]::ServiceEndpoints = $Version - } - 'Graph' { - [VSTeamVersions]::Graph = $Version - } - 'TaskGroups' { - [VSTeamVersions]::TaskGroups = $Version - } - 'Policy' { - [VSTeamVersions]::Policy = $Version - } - } + [vsteam_lib.Versions]::SetApiVersion($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' - [VSTeamVersions]::Git = '5.0' - [VSTeamVersions]::Core = '5.0' - [VSTeamVersions]::Build = '5.0' - [VSTeamVersions]::Release = '5.0' - [VSTeamVersions]::DistributedTask = '5.0-preview' - [VSTeamVersions]::VariableGroups = '5.0-preview' - [VSTeamVersions]::Tfvc = '5.0' - [VSTeamVersions]::Packaging = '5.0-preview' - [VSTeamVersions]::TaskGroups = '5.0-preview' - [VSTeamVersions]::MemberEntitlementManagement = '' - [VSTeamVersions]::ServiceEndpoints = '5.0-preview' - [VSTeamVersions]::ExtensionsManagement = '5.0-preview' - [VSTeamVersions]::Graph = '' - [VSTeamVersions]::Policy = '5.0' - [VSTeamVersions]::Processes = '5.0-preview' + [vsteam_lib.Versions]::Version = 'AzD2019' + [vsteam_lib.Versions]::Git = '5.0' + [vsteam_lib.Versions]::Core = '5.0' + [vsteam_lib.Versions]::Build = '5.0' + [vsteam_lib.Versions]::Release = '5.0' + [vsteam_lib.Versions]::DistributedTask = '5.0-preview' + [vsteam_lib.Versions]::DistributedTaskReleased = '' + [vsteam_lib.Versions]::HierarchyQuery = '5.0-preview' + [vsteam_lib.Versions]::VariableGroups = '5.0-preview' + [vsteam_lib.Versions]::Tfvc = '5.0' + [vsteam_lib.Versions]::Packaging = '5.0-preview' + [vsteam_lib.Versions]::TaskGroups = '5.0-preview' + [vsteam_lib.Versions]::MemberEntitlementManagement = '' + [vsteam_lib.Versions]::ServiceEndpoints = '5.0-preview' + [vsteam_lib.Versions]::ExtensionsManagement = '5.0-preview' + [vsteam_lib.Versions]::Graph = '' + [vsteam_lib.Versions]::Policy = '5.0' + [vsteam_lib.Versions]::Processes = '5.0-preview' } '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]::Processes = '5.1-preview' + [vsteam_lib.Versions]::Version = 'AzD2019' + [vsteam_lib.Versions]::Git = '5.1' + [vsteam_lib.Versions]::Core = '5.1' + [vsteam_lib.Versions]::Build = '5.1' + [vsteam_lib.Versions]::Release = '5.1' + [vsteam_lib.Versions]::DistributedTask = '5.1-preview' + [vsteam_lib.Versions]::DistributedTaskReleased = '' + [vsteam_lib.Versions]::HierarchyQuery = '5.1-preview' + [vsteam_lib.Versions]::VariableGroups = '5.1-preview' + [vsteam_lib.Versions]::Tfvc = '5.1' + [vsteam_lib.Versions]::Packaging = '5.1-preview' + [vsteam_lib.Versions]::TaskGroups = '5.1-preview' + [vsteam_lib.Versions]::MemberEntitlementManagement = '' + [vsteam_lib.Versions]::ServiceEndpoints = '5.0-preview' + [vsteam_lib.Versions]::ExtensionsManagement = '5.1-preview' + [vsteam_lib.Versions]::Graph = '' + [vsteam_lib.Versions]::Policy = '5.1' + [vsteam_lib.Versions]::Processes = '5.1-preview' } { $_ -eq 'TFS2018' -or $_ -eq 'TFS2018U1' } { - [VSTeamVersions]::Version = 'TFS2018' - [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 = '4.0' - [VSTeamVersions]::Packaging = '4.0-preview' - [VSTeamVersions]::TaskGroups = '4.0-preview' - [VSTeamVersions]::MemberEntitlementManagement = '' - [VSTeamVersions]::ServiceEndpoints = '4.0-preview' - [VSTeamVersions]::ExtensionsManagement = '4.0-preview' - [VSTeamVersions]::Graph = '' - [VSTeamVersions]::Policy = '4.0' - [VSTeamVersions]::Processes = '4.0-preview' + [vsteam_lib.Versions]::Version = 'TFS2018' + [vsteam_lib.Versions]::Git = '4.0' + [vsteam_lib.Versions]::Core = '4.0' + [vsteam_lib.Versions]::Build = '4.0' + [vsteam_lib.Versions]::Release = '4.0-preview' + [vsteam_lib.Versions]::DistributedTask = '4.0-preview' + [vsteam_lib.Versions]::DistributedTaskReleased = '' + [vsteam_lib.Versions]::HierarchyQuery = '' + [vsteam_lib.Versions]::VariableGroups = '4.0-preview' + [vsteam_lib.Versions]::Tfvc = '4.0' + [vsteam_lib.Versions]::Packaging = '4.0-preview' + [vsteam_lib.Versions]::TaskGroups = '4.0-preview' + [vsteam_lib.Versions]::MemberEntitlementManagement = '' + [vsteam_lib.Versions]::ServiceEndpoints = '4.0-preview' + [vsteam_lib.Versions]::ExtensionsManagement = '4.0-preview' + [vsteam_lib.Versions]::Graph = '' + [vsteam_lib.Versions]::Policy = '4.0' + [vsteam_lib.Versions]::Processes = '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]::Processes = '4.1-preview' + [vsteam_lib.Versions]::Version = 'TFS2018' + [vsteam_lib.Versions]::Git = '4.1' + [vsteam_lib.Versions]::Core = '4.1' + [vsteam_lib.Versions]::Build = '4.1' + [vsteam_lib.Versions]::Release = '4.1-preview' + [vsteam_lib.Versions]::DistributedTask = '4.1-preview' + [vsteam_lib.Versions]::DistributedTaskReleased = '' + [vsteam_lib.Versions]::HierarchyQuery = '' + [vsteam_lib.Versions]::VariableGroups = '4.1-preview' + [vsteam_lib.Versions]::Tfvc = '4.1' + [vsteam_lib.Versions]::Packaging = '4.1-preview' + [vsteam_lib.Versions]::TaskGroups = '4.1-preview' + [vsteam_lib.Versions]::MemberEntitlementManagement = '' + [vsteam_lib.Versions]::ServiceEndpoints = '4.1-preview' + [vsteam_lib.Versions]::ExtensionsManagement = '4.1-preview' + [vsteam_lib.Versions]::Graph = '' + [vsteam_lib.Versions]::Policy = '4.1' + [vsteam_lib.Versions]::Processes = '4.1-preview' } 'TFS2017' { - [VSTeamVersions]::Version = 'TFS2017' - [VSTeamVersions]::Git = '3.0' - [VSTeamVersions]::Core = '3.0' - [VSTeamVersions]::Build = '3.0' - [VSTeamVersions]::Release = '3.0-preview' - [VSTeamVersions]::DistributedTask = '3.0-preview' - [VSTeamVersions]::VariableGroups = '' # Was introduced in Update 1 - [VSTeamVersions]::TaskGroups = '3.0-preview' - [VSTeamVersions]::ServiceEndpoints = '3.0-preview' - [VSTeamVersions]::Tfvc = '3.0' - [VSTeamVersions]::Packaging = '3.0-preview' - [VSTeamVersions]::MemberEntitlementManagement = '' - [VSTeamVersions]::ExtensionsManagement = '3.0-preview' - [VSTeamVersions]::Graph = '' - [VSTeamVersions]::Policy = '3.0' - [VSTeamVersions]::Processes = '' + [vsteam_lib.Versions]::Version = 'TFS2017' + [vsteam_lib.Versions]::Git = '3.0' + [vsteam_lib.Versions]::Core = '3.0' + [vsteam_lib.Versions]::Build = '3.0' + [vsteam_lib.Versions]::Release = '3.0-preview' + [vsteam_lib.Versions]::DistributedTask = '3.0-preview' + [vsteam_lib.Versions]::DistributedTaskReleased = '' + [vsteam_lib.Versions]::HierarchyQuery = '' + [vsteam_lib.Versions]::VariableGroups = '' # Was introduced in Update 1 + [vsteam_lib.Versions]::TaskGroups = '3.0-preview' + [vsteam_lib.Versions]::ServiceEndpoints = '3.0-preview' + [vsteam_lib.Versions]::Tfvc = '3.0' + [vsteam_lib.Versions]::Packaging = '3.0-preview' + [vsteam_lib.Versions]::MemberEntitlementManagement = '' + [vsteam_lib.Versions]::ExtensionsManagement = '3.0-preview' + [vsteam_lib.Versions]::Graph = '' + [vsteam_lib.Versions]::Policy = '3.0' + [vsteam_lib.Versions]::Processes = '' } '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]::Processes = '' + [vsteam_lib.Versions]::Version = 'TFS2017' + [vsteam_lib.Versions]::Git = '3.1' + [vsteam_lib.Versions]::Core = '3.1' + [vsteam_lib.Versions]::Build = '3.1' + [vsteam_lib.Versions]::Release = '3.1-preview' + [vsteam_lib.Versions]::DistributedTask = '3.1-preview' + [vsteam_lib.Versions]::DistributedTaskReleased = '' + [vsteam_lib.Versions]::HierarchyQuery = '' + [vsteam_lib.Versions]::VariableGroups = '3.1-preview' # Resource of DistributedTask area + [vsteam_lib.Versions]::TaskGroups = '3.1-preview' # Resource of DistributedTask area + [vsteam_lib.Versions]::ServiceEndpoints = '3.1-preview' # The serviceendpoints resource of DistributedTask area + [vsteam_lib.Versions]::Tfvc = '3.1' + [vsteam_lib.Versions]::Packaging = '3.1-preview' + [vsteam_lib.Versions]::MemberEntitlementManagement = '' # SubDomain vsaex + [vsteam_lib.Versions]::ExtensionsManagement = '3.1-preview' # Actual area is extensionmanagement + [vsteam_lib.Versions]::Graph = '' # SubDomain vssps + [vsteam_lib.Versions]::Policy = '3.1' + [vsteam_lib.Versions]::Processes = '' } # 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]::Processes = '' + [vsteam_lib.Versions]::Version = 'TFS2017' + [vsteam_lib.Versions]::Git = '3.2' + [vsteam_lib.Versions]::Core = '3.2' + [vsteam_lib.Versions]::Build = '3.2' + [vsteam_lib.Versions]::Release = '3.2-preview' + [vsteam_lib.Versions]::DistributedTask = '3.2-preview' + [vsteam_lib.Versions]::DistributedTaskReleased = '' + [vsteam_lib.Versions]::HierarchyQuery = '' + [vsteam_lib.Versions]::VariableGroups = '3.2-preview' # Resource of DistributedTask area + [vsteam_lib.Versions]::TaskGroups = '3.2-preview' # Resource of DistributedTask area + [vsteam_lib.Versions]::ServiceEndpoints = '3.2-preview' # The serviceendpoints resource of DistributedTask area + [vsteam_lib.Versions]::Tfvc = '3.2' + [vsteam_lib.Versions]::Packaging = '3.2-preview' + [vsteam_lib.Versions]::MemberEntitlementManagement = '' # SubDomain vsaex + [vsteam_lib.Versions]::ExtensionsManagement = '3.2-preview' # Actual area is extensionmanagement + [vsteam_lib.Versions]::Graph = '' # SubDomain vssps + [vsteam_lib.Versions]::Policy = '3.2' + [vsteam_lib.Versions]::Processes = '' } # AZD, VSTS Default { - [VSTeamVersions]::Version = $Target - [VSTeamVersions]::Git = '5.1' - [VSTeamVersions]::Core = '5.1' - [VSTeamVersions]::Build = '5.1' - [VSTeamVersions]::Release = '5.1' - [VSTeamVersions]::DistributedTask = '6.0-preview' - [VSTeamVersions]::VariableGroups = '5.1-preview.1' - [VSTeamVersions]::TaskGroups = '6.0-preview' - [VSTeamVersions]::Tfvc = '5.1' - [VSTeamVersions]::Packaging = '6.0-preview' # SubDoman feeds - [VSTeamVersions]::MemberEntitlementManagement = '6.0-preview' + [vsteam_lib.Versions]::Version = $Target + [vsteam_lib.Versions]::Git = '5.1' + [vsteam_lib.Versions]::Core = '5.1' + [vsteam_lib.Versions]::Build = '5.1' + [vsteam_lib.Versions]::Release = '5.1' + [vsteam_lib.Versions]::DistributedTask = '6.0-preview' + [vsteam_lib.Versions]::DistributedTaskReleased = '5.1' + [vsteam_lib.Versions]::HierarchyQuery = '5.1-preview' + [vsteam_lib.Versions]::VariableGroups = '5.1-preview.1' + [vsteam_lib.Versions]::TaskGroups = '6.0-preview' + [vsteam_lib.Versions]::Tfvc = '5.1' + [vsteam_lib.Versions]::Packaging = '6.0-preview' # SubDoman feeds + [vsteam_lib.Versions]::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]::ServiceEndpoints = '5.0-preview' - [VSTeamVersions]::ExtensionsManagement = '6.0-preview' # SubDomain extmgmt - [VSTeamVersions]::Graph = '6.0-preview' # SubDomain vssps - [VSTeamVersions]::Policy = '5.1' - [VSTeamVersions]::Processes = '6.0-preview' + [vsteam_lib.Versions]::ServiceEndpoints = '5.0-preview' + [vsteam_lib.Versions]::ExtensionsManagement = '6.0-preview' # SubDomain extmgmt + [vsteam_lib.Versions]::Graph = '6.0-preview' # SubDomain vssps + [vsteam_lib.Versions]::Policy = '5.1' + [vsteam_lib.Versions]::Processes = '6.0-preview' } } } } - Write-Verbose [VSTeamVersions]::Version - Write-Verbose "Git: $([VSTeamVersions]::Git)" - Write-Verbose "Core: $([VSTeamVersions]::Core)" - Write-Verbose "Build: $([VSTeamVersions]::Build)" - Write-Verbose "Release: $([VSTeamVersions]::Release)" - Write-Verbose "DistributedTask: $([VSTeamVersions]::DistributedTask)" - Write-Verbose "VariableGroups: $([VSTeamVersions]::VariableGroups)" - Write-Verbose "Tfvc: $([VSTeamVersions]::Tfvc)" - Write-Verbose "Packaging: $(_getApiVersion Packaging)" - Write-Verbose "TaskGroups: $([VSTeamVersions]::TaskGroups)" - Write-Verbose "MemberEntitlementManagement: $([VSTeamVersions]::MemberEntitlementManagement)" - Write-Verbose "ServiceEndpoints: $([VSTeamVersions]::ServiceEndpoints)" - Write-Verbose "ExtensionsManagement: $([VSTeamVersions]::ExtensionsManagement)" - Write-Verbose "Graph: $([VSTeamVersions]::Graph)" - Write-Verbose "Policy: $([VSTeamVersions]::Policy)" - Write-Verbose "Processes: $([VSTeamVersions]::Processes)" + Write-Verbose [vsteam_lib.Versions]::Version + + # The Get-VSTeamOption comments above each version are the + # calls you can use to see if the versions match. Once the + # resources under an area deviates we have to introduce a + # new version. For example the calls for Service Endpoints + # used to use DistributedTask until they were no longer the + # same and the ServiceEndpoints version was added. + + # Get-VSTeamOption -area 'git' -resource 'repositories' + # Get-VSTeamOption -area 'git' -resource 'pullRequests' + Write-Verbose "Git: $([vsteam_lib.Versions]::Git)" + + # Get-VSTeamOption -area 'core' -resource 'teams' + # Get-VSTeamOption -area 'core' -resource 'members' + # Get-VSTeamOption -area 'core' -resource 'projects' + # Get-VSTeamOption -area 'wit' -resource 'queries' + # Get-VSTeamOption -area 'wit' -resource 'workItems' + # Get-VSTeamOption -area 'wit' -resource 'workItemTypes' + # Get-VSTeamOption -area 'wit' -resource 'classificationNodes' + # Get-VSTeamOption -area 'Security' -resource 'SecurityNamespaces' + # Get-VSTeamOption -area 'Security' -resource 'AccessControlLists' + # Get-VSTeamOption -area 'Security' -resource 'AccessControlEntries' + Write-Verbose "Core: $([vsteam_lib.Versions]::Core)" + + # Get-VSTeamOption -area 'build' -resource 'Builds' + # Get-VSTeamOption -area 'build' -resource 'Definitions' + Write-Verbose "Build: $([vsteam_lib.Versions]::Build)" + + # Get-VSTeamOption -subDomain vsrm -area 'Release' -resource 'releases' + # Get-VSTeamOption -subDomain vsrm -area 'Release' -resource 'approvals' + # Get-VSTeamOption -subDomain vsrm -area 'Release' -resource 'definitions' + Write-Verbose "Release: $([vsteam_lib.Versions]::Release)" + + # These are distributed task, resources that have released versions + # Get-VSTeamOption -area 'distributedtask' -resource 'pools' + # Get-VSTeamOption -area 'distributedtask' -resource 'agents' + # Get-VSTeamOption -area 'distributedtask' -resource 'messages' + # Get-VSTeamOption -area 'distributedtask' -resource 'jobrequests' + Write-Verbose "DistributedTaskReleased: $([vsteam_lib.Versions]::DistributedTaskReleased)" + + # Get-VSTeamOption -area 'Contribution' -resource 'HierarchyQuery' + Write-Verbose "HierarchyQuery: $([vsteam_lib.Versions]::HierarchyQuery)" + + # These are distributed task, resources that are in preview + # Get-VSTeamOption -area 'distributedtask' -resource 'queues' + # Get-VSTeamOption -area 'distributedtask' -resource 'serviceendpoints' + # Get-VSTeamOption -area 'distributedtask' -resource 'azurermsubscriptions' + Write-Verbose "DistributedTask: $([vsteam_lib.Versions]::DistributedTask)" + + # Get-VSTeamOption -area 'distributedtask' -resource 'variablegroups' + Write-Verbose "VariableGroups: $([vsteam_lib.Versions]::VariableGroups)" + + # Get-VSTeamOption -area 'tfvc' -resource 'branches' + Write-Verbose "Tfvc: $([vsteam_lib.Versions]::Tfvc)" + + # Get-VSTeamOption -subDomain feeds -area 'Packaging' -resource 'Feeds' + Write-Verbose "Packaging: $([vsteam_lib.Versions]::Packaging)" + + # Get-VSTeamOption -area 'distributedtask' -resource 'taskgroups' + Write-Verbose "TaskGroups: $([vsteam_lib.Versions]::TaskGroups)" + + # Get-VSTeamOption -subDomain vsaex -area 'MemberEntitlementManagement' -resource 'UserEntitlements' + Write-Verbose "MemberEntitlementManagement: $([vsteam_lib.Versions]::MemberEntitlementManagement)" + + # Get-VSTeamOption -area 'distributedtask' -resource 'serviceendpoints' + Write-Verbose "ServiceEndpoints: $([vsteam_lib.Versions]::ServiceEndpoints)" + + # Get-VSTeamOption -subDomain 'extmgmt' -area 'ExtensionManagement' -resource 'InstalledExtensions' + # Get-VSTeamOption -subDomain 'extmgmt' -area 'ExtensionManagement' -resource 'InstalledExtensionsByName' + Write-Verbose "ExtensionsManagement: $([vsteam_lib.Versions]::ExtensionsManagement)" + + # Get-VSTeamOption -subDomain vssps -area 'Graph' -resource 'Users' + # Get-VSTeamOption -subDomain vssps -area 'Graph' -resource 'Groups' + # Get-VSTeamOption -subDomain vssps -area 'Graph' -resource 'Memberships' + # Get-VSTeamOption -subDomain vssps -area 'Graph' -resource 'Descriptors' + Write-Verbose "Graph: $([vsteam_lib.Versions]::Graph)" + + # Get-VSTeamOption -area 'policy' -resource 'configurations' + Write-Verbose "Policy: $([vsteam_lib.Versions]::Policy)" + + # Get-VSTeamOption -area 'processes' -resource 'processes' + Write-Verbose "Processes: $([vsteam_lib.Versions]::Processes)" } \ No newline at end of file diff --git a/Source/Public/Set-VSTeamAccount.ps1 b/Source/Public/Set-VSTeamAccount.ps1 index 8f1149d10..a62d7cdb5 100644 --- a/Source/Public/Set-VSTeamAccount.ps1 +++ b/Source/Public/Set-VSTeamAccount.ps1 @@ -1,5 +1,6 @@ function Set-VSTeamAccount { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", DefaultParameterSetName = 'Secure')] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", DefaultParameterSetName = 'Secure', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Set-VSTeamAccount')] param( [parameter(ParameterSetName = 'Windows', Mandatory = $true, Position = 1)] [parameter(ParameterSetName = 'Secure', Mandatory = $true, Position = 1)] @@ -66,7 +67,7 @@ function Set-VSTeamAccount { process { # invalidate cache when changing account/collection # otherwise dynamic parameters being picked for a wrong collection - [VSTeamProjectCache]::Invalidate() + [vsteam_lib.ProjectCache]::Invalidate() # Bind the parameter to a friendly variable $vsteamProfile = $PSBoundParameters['Profile'] @@ -150,7 +151,7 @@ function Set-VSTeamAccount { if ($Drive) { # Assign to null so nothing is writen to output. - Write-Output "# To map a drive run the following command or pipe to iex:`nNew-PSDrive -Name $Drive -PSProvider SHiPS -Root 'VSTeam#VSTeamAccount'" + Write-Output "# To map a drive run the following command or pipe to iex:`nNew-PSDrive -Name $Drive -PSProvider SHiPS -Root 'VSTeam#vsteam_lib.Provider.Account' -Description $account" } } } diff --git a/Source/Public/Set-VSTeamAlias.ps1 b/Source/Public/Set-VSTeamAlias.ps1 index 73c9319a9..e55ecf530 100644 --- a/Source/Public/Set-VSTeamAlias.ps1 +++ b/Source/Public/Set-VSTeamAlias.ps1 @@ -1,5 +1,6 @@ function Set-VSTeamAlias { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Set-VSTeamAlias')] param( [switch] $Force ) diff --git a/Source/Public/Set-VSTeamApproval.ps1 b/Source/Public/Set-VSTeamApproval.ps1 index c95165458..547bbde39 100644 --- a/Source/Public/Set-VSTeamApproval.ps1 +++ b/Source/Public/Set-VSTeamApproval.ps1 @@ -1,5 +1,6 @@ function Set-VSTeamApproval { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Set-VSTeamApproval')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [int[]] $Id, @@ -14,9 +15,9 @@ function Set-VSTeamApproval { [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -29,8 +30,12 @@ function Set-VSTeamApproval { if ($force -or $pscmdlet.ShouldProcess($item, "Set Approval Status")) { try { # Call the REST API - _callAPI -Method Patch -SubDomain vsrm -ProjectName $ProjectName -Area release -Resource approvals ` - -Id $item -Version $(_getApiVersion Release) -body $body -ContentType 'application/json' | Out-Null + _callAPI -Method PATCH -SubDomain vsrm -ProjectName $ProjectName ` + -Area release ` + -Resource approvals ` + -Id $item ` + -body $body ` + -Version $(_getApiVersion Release) | Out-Null Write-Output "Approval $item status changed to $status" } diff --git a/Source/Public/Set-VSTeamDefaultAPITimeout.ps1 b/Source/Public/Set-VSTeamDefaultAPITimeout.ps1 index c1035dd86..3219ab282 100644 --- a/Source/Public/Set-VSTeamDefaultAPITimeout.ps1 +++ b/Source/Public/Set-VSTeamDefaultAPITimeout.ps1 @@ -55,7 +55,7 @@ function Set-VSTeamDefaultAPITimeout { # You always have to set at the process level or they will Not # be seen in your current session. $env:TEAM_TIMEOUT = $TimeoutSec - [VSTeamVersions]::DefaultTimeout = $TimeoutSec + [vsteam_lib.Versions]::DefaultTimeout = $TimeoutSec [System.Environment]::SetEnvironmentVariable("TEAM_TIMEOUT", $TimeoutSec, $Level) } diff --git a/Source/Public/Set-VSTeamDefaultProject.ps1 b/Source/Public/Set-VSTeamDefaultProject.ps1 index 6d0b881de..71c8323f1 100644 --- a/Source/Public/Set-VSTeamDefaultProject.ps1 +++ b/Source/Public/Set-VSTeamDefaultProject.ps1 @@ -4,9 +4,9 @@ function Set-VSTeamDefaultProject { param( [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $Project ) DynamicParam { @@ -57,7 +57,7 @@ function Set-VSTeamDefaultProject { # You always have to set at the process level or they will Not # be seen in your current session. $env:TEAM_PROJECT = $Project - [VSTeamVersions]::DefaultProject = $Project + [vsteam_lib.Versions]::DefaultProject = $Project [System.Environment]::SetEnvironmentVariable("TEAM_PROJECT", $Project, $Level) } diff --git a/Source/Public/Set-VSTeamEnvironmentStatus.ps1 b/Source/Public/Set-VSTeamEnvironmentStatus.ps1 index efeeb2eb1..1817a5ffb 100644 --- a/Source/Public/Set-VSTeamEnvironmentStatus.ps1 +++ b/Source/Public/Set-VSTeamEnvironmentStatus.ps1 @@ -1,5 +1,6 @@ function Set-VSTeamEnvironmentStatus { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Set-VSTeamEnvironmentStatus')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('Id')] @@ -20,8 +21,8 @@ function Set-VSTeamEnvironmentStatus { [switch] $Force, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter]) ] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter]) ] [string] $ProjectName ) @@ -32,8 +33,12 @@ function Set-VSTeamEnvironmentStatus { if ($force -or $pscmdlet.ShouldProcess($item, "Set Status on Environment")) { try { # Call the REST API - _callAPI -Method Patch -SubDomain vsrm -Area release -Resource "releases/$ReleaseId/environments" -projectName $ProjectName -id $item ` - -body $body -ContentType 'application/json' -Version $(_getApiVersion Release) | Out-Null + _callAPI -Method PATCH -SubDomain vsrm -projectName $ProjectName ` + -Area release ` + -Resource releases ` + -id "$ReleaseId/environments/$item" ` + -body $body ` + -Version $(_getApiVersion Release) | Out-Null Write-Output "Environment $item status changed to $status" } diff --git a/Source/Public/Set-VSTeamPermissionInheritance.ps1 b/Source/Public/Set-VSTeamPermissionInheritance.ps1 index 7725219f0..d574d4e86 100644 --- a/Source/Public/Set-VSTeamPermissionInheritance.ps1 +++ b/Source/Public/Set-VSTeamPermissionInheritance.ps1 @@ -1,35 +1,42 @@ -function Set-VSTeamPermissionInheritance { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] +# Sets the permission inheritance to true or false. +# Get-VSTeamOption -area Contribution -resource HierarchyQuery +# id : 3353e165-a11e-43aa-9d88-14f2bb09b6d9 +# area : Contribution +# resourceName : HierarchyQuery +# routeTemplate : _apis/{area}/{resource}/{scopeName}/{scopeValue} +# This is an undocumented API + +function Set-VSTeamPermissionInheritance { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Set-VSTeamPermissionInheritance')] [OutputType([System.String])] param( - [Parameter(Mandatory, ValueFromPipelineByPropertyName = $true, ValueFromPipeline = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ValueFromPipeline = $true)] [string] $Name, - [Parameter(Mandatory)] + [Parameter(Mandatory = $true)] [ValidateSet('Repository', 'BuildDefinition', 'ReleaseDefinition')] [string] $ResourceType, - [Parameter(Mandatory)] + [Parameter(Mandatory = $true)] [bool] $NewState, [switch] $Force, - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { Write-Verbose "Creating VSTeamPermissionInheritance" - $item = [VSTeamPermissionInheritance]::new($ProjectName, $Name, $ResourceType) + $item = _getPermissionInheritanceInfo -projectName $ProjectName -resourceName $Name -resourceType $resourceType $token = $item.Token - $version = $item.Version $projectID = $item.ProjectID $securityNamespaceID = $item.SecurityNamespaceID Write-Verbose "Token = $token" - Write-Verbose "Version = $Version" Write-Verbose "ProjectID = $ProjectID" Write-Verbose "SecurityNamespaceID = $SecurityNamespaceID" @@ -51,7 +58,12 @@ } "@ # Call the REST API to change the inheritance state - $resp = _callAPI -NoProject -method POST -area "Contribution" -resource "HierarchyQuery" -id $projectID -Version $version -ContentType "application/json" -Body $body + $resp = _callAPI -method POST -NoProject ` + -area Contribution ` + -resource HierarchyQuery ` + -id $projectID ` + -Body $body ` + -Version $(_getApiVersion HierarchyQuery) } Write-Verbose "Result: $(ConvertTo-Json -InputObject $resp -Depth 100)" diff --git a/Source/Public/Set-VSTeamReleaseStatus.ps1 b/Source/Public/Set-VSTeamReleaseStatus.ps1 index e309074cc..887e558b6 100644 --- a/Source/Public/Set-VSTeamReleaseStatus.ps1 +++ b/Source/Public/Set-VSTeamReleaseStatus.ps1 @@ -1,5 +1,6 @@ function Set-VSTeamReleaseStatus { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Set-VSTeamReleaseStatus')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [int[]] $Id, @@ -9,9 +10,9 @@ function Set-VSTeamReleaseStatus { [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -23,8 +24,12 @@ function Set-VSTeamReleaseStatus { try { # Call the REST API - _callAPI -Method Patch -SubDomain vsrm -Area release -Resource releases -projectName $ProjectName -id $item ` - -body $body -ContentType 'application/json' -Version $(_getApiVersion Release) | Out-Null + _callAPI -Method PATCH -SubDomain vsrm -ProjectName $ProjectName ` + -Area release ` + -Resource releases ` + -id $item ` + -body $body ` + -Version $(_getApiVersion Release) | Out-Null Write-Output "Release $item status changed to $status" } diff --git a/Source/Public/Show-VSTeam.ps1 b/Source/Public/Show-VSTeam.ps1 index fa190107d..1ed2140e1 100644 --- a/Source/Public/Show-VSTeam.ps1 +++ b/Source/Public/Show-VSTeam.ps1 @@ -1,5 +1,5 @@ function Show-VSTeam { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeam')] param () process { diff --git a/Source/Public/Show-VSTeamApproval.ps1 b/Source/Public/Show-VSTeamApproval.ps1 index 0c872bfc1..9b5d4f98b 100644 --- a/Source/Public/Show-VSTeamApproval.ps1 +++ b/Source/Public/Show-VSTeamApproval.ps1 @@ -1,13 +1,13 @@ function Show-VSTeamApproval { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamApproval')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [Alias('Id')] [int] $ReleaseDefinitionId, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) diff --git a/Source/Public/Show-VSTeamBuild.ps1 b/Source/Public/Show-VSTeamBuild.ps1 index 4bb9d6caf..ed16c5c54 100644 --- a/Source/Public/Show-VSTeamBuild.ps1 +++ b/Source/Public/Show-VSTeamBuild.ps1 @@ -1,13 +1,13 @@ function Show-VSTeamBuild { - [CmdletBinding(DefaultParameterSetName = 'ByID')] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamBuild')] param ( - [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] + [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] [int[]] $Id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, Position = 1, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) diff --git a/Source/Public/Show-VSTeamBuildDefinition.ps1 b/Source/Public/Show-VSTeamBuildDefinition.ps1 index 53ff6c69c..43ce29844 100644 --- a/Source/Public/Show-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Show-VSTeamBuildDefinition.ps1 @@ -1,5 +1,6 @@ function Show-VSTeamBuildDefinition { - [CmdletBinding(DefaultParameterSetName = 'List')] + [CmdletBinding(DefaultParameterSetName = 'List', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamBuildDefinition')] param( [Parameter(ParameterSetName = 'List')] [ValidateSet('Mine', 'All', 'Queued', 'XAML')] @@ -12,9 +13,9 @@ function Show-VSTeamBuildDefinition { [Parameter(ParameterSetName = 'List')] [string] $Path = '\', - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { diff --git a/Source/Public/Show-VSTeamFeed.ps1 b/Source/Public/Show-VSTeamFeed.ps1 index 6ccce191a..a030fd521 100644 --- a/Source/Public/Show-VSTeamFeed.ps1 +++ b/Source/Public/Show-VSTeamFeed.ps1 @@ -1,5 +1,5 @@ function Show-VSTeamFeed { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamFeed')] param( [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Alias('ID')] diff --git a/Source/Public/Show-VSTeamGitRepository.ps1 b/Source/Public/Show-VSTeamGitRepository.ps1 index b23b73e4a..92255379c 100644 --- a/Source/Public/Show-VSTeamGitRepository.ps1 +++ b/Source/Public/Show-VSTeamGitRepository.ps1 @@ -1,12 +1,12 @@ function Show-VSTeamGitRepository { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamGitRepository')] param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [string] $RemoteUrl, - [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) diff --git a/Source/Public/Show-VSTeamProject.ps1 b/Source/Public/Show-VSTeamProject.ps1 index 73b64be64..b6e12a4a2 100644 --- a/Source/Public/Show-VSTeamProject.ps1 +++ b/Source/Public/Show-VSTeamProject.ps1 @@ -1,13 +1,14 @@ function Show-VSTeamProject { - [CmdletBinding(DefaultParameterSetName = 'ByName')] + [CmdletBinding(DefaultParameterSetName = 'ByName', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamProject')] param( [Parameter(ParameterSetName = 'ByID')] [Alias('ProjectID')] [string] $Id, [Parameter(ParameterSetName = 'ByName', Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter]) ] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter]) ] [Alias('ProjectName')] [string] $Name ) diff --git a/Source/Public/Show-VSTeamPullRequest.ps1 b/Source/Public/Show-VSTeamPullRequest.ps1 index 4461f328e..c9c72a788 100644 --- a/Source/Public/Show-VSTeamPullRequest.ps1 +++ b/Source/Public/Show-VSTeamPullRequest.ps1 @@ -1,5 +1,5 @@ function Show-VSTeamPullRequest { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamPullRequest')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Alias('PullRequestId')] diff --git a/Source/Public/Show-VSTeamRelease.ps1 b/Source/Public/Show-VSTeamRelease.ps1 index 8954d8847..c6ee9b37b 100644 --- a/Source/Public/Show-VSTeamRelease.ps1 +++ b/Source/Public/Show-VSTeamRelease.ps1 @@ -1,13 +1,14 @@ function Show-VSTeamRelease { - [CmdletBinding(DefaultParameterSetName = 'ById')] + [CmdletBinding(DefaultParameterSetName = 'ById', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamRelease')] param( [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 1)] [Alias('ReleaseID')] [int] $id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) diff --git a/Source/Public/Show-VSTeamReleaseDefinition.ps1 b/Source/Public/Show-VSTeamReleaseDefinition.ps1 index 802f5f58e..8d632d7ae 100644 --- a/Source/Public/Show-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Show-VSTeamReleaseDefinition.ps1 @@ -1,13 +1,13 @@ function Show-VSTeamReleaseDefinition { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamReleaseDefinition')] param( [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] [Alias('ReleaseDefinitionID')] [int] $Id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) diff --git a/Source/Public/Show-VSTeamWorkItem.ps1 b/Source/Public/Show-VSTeamWorkItem.ps1 index 1232308c4..5faca2c35 100644 --- a/Source/Public/Show-VSTeamWorkItem.ps1 +++ b/Source/Public/Show-VSTeamWorkItem.ps1 @@ -1,13 +1,13 @@ function Show-VSTeamWorkItem { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Show-VSTeamWorkItem')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Alias('WorkItemID')] [int] $Id, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) diff --git a/Source/Public/Stop-VSTeamBuild.ps1 b/Source/Public/Stop-VSTeamBuild.ps1 index 94b39e272..d55e2212e 100644 --- a/Source/Public/Stop-VSTeamBuild.ps1 +++ b/Source/Public/Stop-VSTeamBuild.ps1 @@ -1,35 +1,40 @@ function Stop-VSTeamBuild { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Stop-VSTeamBuild')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] [Int] $Id, - - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + + [switch] $Force, + + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) - + process { - if ($pscmdlet.ShouldProcess($Id, "Stop-VSTeamBuild")) { - - try { - - $body = @{ - "status" = "Cancelling" - } - - $bodyAsJson = $body | ConvertTo-Json -Compress -Depth 50 - - # Call the REST API - _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' -Id $Id ` - -Method Patch -ContentType 'application/json' -body $bodyAsJson -Version $(_getApiVersion Build) | Out-Null - } - - catch { - _handleException $_ - } - } + if ($Force -or $pscmdlet.ShouldProcess($Id, "Stop-VSTeamBuild")) { + try { + $body = @{ + "status" = "Cancelling" + } + + $bodyAsJson = $body | ConvertTo-Json -Compress -Depth 50 + + # Call the REST API + _callAPI -Method PATCH -ProjectName $ProjectName ` + -Area build ` + -Resource builds ` + -Id $Id ` + -body $bodyAsJson ` + -Version $(_getApiVersion Build) | Out-Null + } + + catch { + _handleException $_ + } + } } - } \ No newline at end of file +} \ No newline at end of file diff --git a/Source/Public/Test-VSTeamMembership.ps1 b/Source/Public/Test-VSTeamMembership.ps1 index 752d88a6d..f010cb9b5 100644 --- a/Source/Public/Test-VSTeamMembership.ps1 +++ b/Source/Public/Test-VSTeamMembership.ps1 @@ -1,5 +1,5 @@ function Test-VSTeamMembership { - [CmdletBinding()] + [CmdletBinding(HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Test-VSTeamMembership')] [OutputType([System.Boolean])] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = "MemberDescriptor")] @@ -12,21 +12,23 @@ function Test-VSTeamMembership { $PrevWarningPreference = $WarningPreference try { $WarningPreference = "SilentlyContinue" # avoid 404 warning, since that indicates it doesn't exist - $null = _callMembershipAPI -Id "$MemberDescriptor/$ContainerDescriptor" -Method Head + $null = _callMembershipAPI -Id "$MemberDescriptor/$ContainerDescriptor" -Method HEAD return $true - } catch { + } + catch { $WarningPreference = $PrevWarningPreference $e = $_ try { - if ($e.Exception -and $e.Exception.Response -and $e.Exception.Response.StatusCode -eq [System.Net.HttpStatusCode]::NotFound) - { + if ($e.Exception -and $e.Exception.Response -and $e.Exception.Response.StatusCode -eq [System.Net.HttpStatusCode]::NotFound) { return $false } - } catch { + } + catch { Write-Warning "Nested exception $_" } throw $e - } finally { + } + finally { $WarningPreference = $PrevWarningPreference } } diff --git a/Source/Public/Test-VSTeamYamlPipeline.ps1 b/Source/Public/Test-VSTeamYamlPipeline.ps1 index 31d1aa14f..4fd2b3e3e 100644 --- a/Source/Public/Test-VSTeamYamlPipeline.ps1 +++ b/Source/Public/Test-VSTeamYamlPipeline.ps1 @@ -1,5 +1,6 @@ function Test-VSTeamYamlPipeline { - [CmdletBinding(DefaultParameterSetName = 'WithFilePath')] + [CmdletBinding(DefaultParameterSetName = 'WithFilePath', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Test-VSTeamYamlPipeline')] param( [Parameter(ParameterSetName = 'WithFilePath', Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 1)] [Parameter(ParameterSetName = 'WithYamlOverride', Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 1)] @@ -30,8 +31,10 @@ function Test-VSTeamYamlPipeline { try { # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'pipelines' -Resource "$PipelineId" -id "runs" ` - -Method Post -ContentType 'application/json; charset=utf-8' -Body ($body | ConvertTo-Json) ` + $resp = _callAPI -Method POST -ProjectName $ProjectName ` + -Area pipelines ` + -id "$PipelineId/runs" ` + -Body ($body | ConvertTo-Json -Compress -Depth 100) ` -Version $(_getApiVersion Build) } catch { diff --git a/Source/Public/Update-VSTeam.ps1 b/Source/Public/Update-VSTeam.ps1 index 70a2d3a43..0e18ba20f 100644 --- a/Source/Public/Update-VSTeam.ps1 +++ b/Source/Public/Update-VSTeam.ps1 @@ -1,27 +1,28 @@ function Update-VSTeam { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(DefaultParameterSetName = 'UpdateDescription', + SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri = 'https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeam')] param( - [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $True, Position = 0, ValueFromPipelineByPropertyName = $true)] [Alias('TeamName', 'TeamId', 'TeamToUpdate', 'Id')] - [string]$Name, + [string] $Name, - [string]$NewTeamName, + [Parameter(ParameterSetName = 'UpdateName', Mandatory = $true)] + [string] $NewTeamName, - [string]$Description, + [Parameter(ParameterSetName = 'UpdateName', Mandatory = $false)] + [Parameter(ParameterSetName = 'UpdateDescription', Mandatory = $true)] + [string] $Description, [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) process { - if (-not $NewTeamName -and -not $Description) { - throw 'You must provide a new team name or description, or both.' - } - if ($Force -or $pscmdlet.ShouldProcess($Name, "Update-VSTeam")) { if (-not $NewTeamName) { $body = '{"description": "' + $Description + '" }' @@ -36,15 +37,18 @@ function Update-VSTeam { } # Call the REST API - $resp = _callAPI -Area 'projects' -Resource "$ProjectName/teams" -Id $Name ` - -Method Patch -ContentType 'application/json' -Body $body -Version $(_getApiVersion Core) + $resp = _callAPI -Method PATCH ` + -Resource "projects/$ProjectName/teams" ` + -Id $Name ` + -Body $body ` + -Version $(_getApiVersion Core) # Storing the object before you return it cleaned up the pipeline. # When I just write the object from the constructor each property # seemed to be written - $team = [VSTeamTeam]::new($resp, $ProjectName) + $team = [vsteam_lib.Team]::new($resp, $ProjectName) Write-Output $team } } -} +} \ No newline at end of file diff --git a/Source/Public/Update-VSTeamAgent.ps1 b/Source/Public/Update-VSTeamAgent.ps1 index bc5dae7fd..cca244559 100644 --- a/Source/Public/Update-VSTeamAgent.ps1 +++ b/Source/Public/Update-VSTeamAgent.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamAgent { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamAgent')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [int] $PoolId, @@ -15,7 +16,12 @@ function Update-VSTeamAgent { foreach ($item in $Id) { try { if ($Force -or $pscmdlet.ShouldProcess($item, "Update-VSTeamAgent")) { - _callAPI -Method Post -Area "distributedtask/pools/$PoolId" -Resource messages -QueryString @{agentId = $item} -Version $(_getApiVersion DistributedTask) -ContentType "application/json" | Out-Null + _callAPI -Method POST ` + -Area "distributedtask/pools/$PoolId" ` + -Resource messages ` + -QueryString @{agentId = $item } ` + -Version $(_getApiVersion DistributedTaskReleased) | Out-Null + Write-Output "Update agent $item" } } diff --git a/Source/Public/Update-VSTeamBuild.ps1 b/Source/Public/Update-VSTeamBuild.ps1 index 2febae294..69392fa41 100644 --- a/Source/Public/Update-VSTeamBuild.ps1 +++ b/Source/Public/Update-VSTeamBuild.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamBuild { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamBuild')] param( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('BuildID')] @@ -13,9 +14,9 @@ function Update-VSTeamBuild { [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -41,8 +42,12 @@ function Update-VSTeamBuild { $body += '}' # Call the REST API - _callAPI -ProjectName $ProjectName -Area 'build' -Resource 'builds' -Id $Id ` - -Method Patch -ContentType 'application/json' -body $body -Version $(_getApiVersion Build) | Out-Null + _callAPI -Method PATCH -ProjectName $ProjectName ` + -Area build ` + -Resource builds ` + -Id $Id ` + -body $body ` + -Version $(_getApiVersion Build) | Out-Null } } } diff --git a/Source/Public/Update-VSTeamBuildDefinition.ps1 b/Source/Public/Update-VSTeamBuildDefinition.ps1 index d8cdc2fd1..8dc6ad16b 100644 --- a/Source/Public/Update-VSTeamBuildDefinition.ps1 +++ b/Source/Public/Update-VSTeamBuildDefinition.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamBuildDefinition { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", DefaultParameterSetName = 'JSON')] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", DefaultParameterSetName = 'JSON', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamBuildDefinition')] Param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [int] $Id, @@ -12,9 +13,9 @@ function Update-VSTeamBuildDefinition { [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -23,10 +24,20 @@ function Update-VSTeamBuildDefinition { # Call the REST API if ($InFile) { - _callAPI -Method Put -ProjectName $ProjectName -Area build -Resource definitions -Id $Id -Version $(_getApiVersion Build) -InFile $InFile | Out-Null + _callAPI -Method PUT -ProjectName $ProjectName ` + -Area build ` + -Resource definitions ` + -Id $Id ` + -InFile $InFile ` + -Version $(_getApiVersion Build) | Out-Null } else { - _callAPI -Method Put -ProjectName $ProjectName -Area build -Resource definitions -Id $Id -Version $(_getApiVersion Build) -Body $BuildDefinition | Out-Null + _callAPI -Method PUT -ProjectName $ProjectName ` + -Area build ` + -Resource definitions ` + -Id $Id ` + -Body $BuildDefinition ` + -Version $(_getApiVersion Build) | Out-Null } } } diff --git a/Source/Public/Update-VSTeamExtension.ps1 b/Source/Public/Update-VSTeamExtension.ps1 index 1105851f1..0e7663a47 100644 --- a/Source/Public/Update-VSTeamExtension.ps1 +++ b/Source/Public/Update-VSTeamExtension.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamExtension { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamExtension')] param ( [parameter(Mandatory = $true)] [string] $PublisherId, @@ -25,9 +26,13 @@ function Update-VSTeamExtension { $body = $obj | ConvertTo-Json - $resp = _callAPI -Method Patch -body $body -SubDomain 'extmgmt' -Area 'extensionmanagement' -Resource 'installedextensions' -Version $(_getApiVersion ExtensionsManagement) -ContentType "application/json" + $resp = _callAPI -Method PATCH -SubDomain extmgmt ` + -Area extensionmanagement ` + -Resource installedextensions ` + -Body $body ` + -Version $(_getApiVersion ExtensionsManagement) - $item = [VSTeamExtension]::new($resp) + $item = [vsteam_lib.Extension]::new($resp) Write-Output $item } diff --git a/Source/Public/Update-VSTeamPolicy.ps1 b/Source/Public/Update-VSTeamPolicy.ps1 index b3193c051..3476ac702 100644 --- a/Source/Public/Update-VSTeamPolicy.ps1 +++ b/Source/Public/Update-VSTeamPolicy.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamPolicy { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamPolicy')] param( [Parameter(Mandatory = $true)] [int] $id, @@ -16,9 +17,9 @@ function Update-VSTeamPolicy { [switch] $Force, - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -40,8 +41,12 @@ function Update-VSTeamPolicy { try { if ($Force -or $pscmdlet.ShouldProcess($id, "Update Policy")) { # Call the REST API - $resp = _callAPI -ProjectName $ProjectName -Area 'policy' -id $id -Resource 'configurations' ` - -Method Put -ContentType 'application/json' -Body $body -Version $(_getApiVersion Git) + $resp = _callAPI -Method PUT -ProjectName $ProjectName ` + -Area policy ` + -Resource configurations ` + -id $id ` + -Body $body ` + -Version $(_getApiVersion Policy) Write-Output $resp } diff --git a/Source/Public/Update-VSTeamProfile.ps1 b/Source/Public/Update-VSTeamProfile.ps1 index cdad96204..c675394be 100644 --- a/Source/Public/Update-VSTeamProfile.ps1 +++ b/Source/Public/Update-VSTeamProfile.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamProfile { - [CmdletBinding(DefaultParameterSetName = 'Secure', SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(DefaultParameterSetName = 'Secure', SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamProfile')] param( [parameter(ParameterSetName = 'Plain', Mandatory = $true, HelpMessage = 'Personal Access Token')] [string] $PersonalAccessToken, diff --git a/Source/Public/Update-VSTeamProject.ps1 b/Source/Public/Update-VSTeamProject.ps1 index 4d134d420..460c85e68 100644 --- a/Source/Public/Update-VSTeamProject.ps1 +++ b/Source/Public/Update-VSTeamProject.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamProject { - [CmdletBinding(DefaultParameterSetName = 'ByName', SupportsShouldProcess = $true, ConfirmImpact = "High")] + [CmdletBinding(DefaultParameterSetName = 'ByName', SupportsShouldProcess = $true, ConfirmImpact = "High", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamProject')] param( [string] $NewName = '', @@ -10,16 +11,13 @@ function Update-VSTeamProject { [Parameter(ParameterSetName = 'ByID', ValueFromPipelineByPropertyName = $true)] [string] $Id, - [Alias('ProjectName')] - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter]) ] [Parameter(ParameterSetName = 'ByName', Position = 0, ValueFromPipelineByPropertyName = $true)] - [string] $Name + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter]) ] + [Alias('Name')] + [string] $ProjectName ) process { - # Bind the parameter to a friendly variable - $ProjectName = $PSBoundParameters["Name"] - if ($id) { $ProjectName = $id } @@ -54,13 +52,16 @@ function Update-VSTeamProject { } # Call the REST API - $resp = _callAPI -Area 'projects' -id $id -NoProject ` - -Method Patch -ContentType 'application/json' -body $body -Version $(_getApiVersion Core) + $resp = _callAPI -Method PATCH -NoProject ` + -Resource projects ` + -id $id ` + -body $body ` + -Version $(_getApiVersion Core) _trackProjectProgress -resp $resp -title 'Updating team project' -msg $msg # Invalidate any cache of projects. - [VSTeamProjectCache]::Invalidate() + [vsteam_lib.ProjectCache]::Invalidate() # Return the project now that it has been updated return Get-VSTeamProject -Id $finalName diff --git a/Source/Public/Update-VSTeamPullRequest.ps1 b/Source/Public/Update-VSTeamPullRequest.ps1 index 024e8cd1a..1d4de06ff 100644 --- a/Source/Public/Update-VSTeamPullRequest.ps1 +++ b/Source/Public/Update-VSTeamPullRequest.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamPullRequest { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'Draft')] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'Draft', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamPullRequest')] param( [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [Alias('Id')] @@ -16,7 +17,7 @@ function Update-VSTeamPullRequest { [Switch] $EnableAutoComplete, [Parameter(ParameterSetName = "EnableAutoComplete", Mandatory = $true)] - [VSTeamUser] $AutoCompleteIdentity, + [vsteam_lib.User] $AutoCompleteIdentity, [Parameter(ParameterSetName = "DisableAutoComplete", Mandatory = $true)] [Switch] $DisableAutoComplete, @@ -50,7 +51,7 @@ function Update-VSTeamPullRequest { # Call the REST API $resp = _callAPI -Area git -Resource repositories -iD "$RepositoryId/pullrequests/$PullRequestId" ` - -Method Patch -ContentType 'application/json' -body $body -Version $(_getApiVersion Git) + -Method PATCH -ContentType 'application/json' -body $body -Version $(_getApiVersion Git) _applyTypesToPullRequests -item $resp diff --git a/Source/Public/Update-VSTeamRelease.ps1 b/Source/Public/Update-VSTeamRelease.ps1 index bc58e8207..3ef7eae8a 100644 --- a/Source/Public/Update-VSTeamRelease.ps1 +++ b/Source/Public/Update-VSTeamRelease.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamRelease { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamRelease')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [int] $Id, @@ -9,9 +10,9 @@ function Update-VSTeamRelease { [switch] $Force, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -20,8 +21,12 @@ function Update-VSTeamRelease { if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Release")) { # Call the REST API - $resp = _callAPI -ProjectName $projectName -SubDomain vsrm -Area release -Resource releases -Id $id ` - -Method Put -body $body -Version $(_getApiVersion Release) + $resp = _callAPI -Method PUT -SubDomain vsrm -ProjectName $projectName ` + -Area release ` + -Resource releases ` + -Id $id ` + -body $body ` + -Version $(_getApiVersion Release) Write-Output $resp } diff --git a/Source/Public/Update-VSTeamReleaseDefinition.ps1 b/Source/Public/Update-VSTeamReleaseDefinition.ps1 index bf96bc131..ac8803562 100644 --- a/Source/Public/Update-VSTeamReleaseDefinition.ps1 +++ b/Source/Public/Update-VSTeamReleaseDefinition.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamReleaseDefinition { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", DefaultParameterSetName = 'JSON')] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", DefaultParameterSetName = 'JSON', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamReleaseDefinition')] Param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'File')] [string] $InFile, @@ -9,20 +10,29 @@ function Update-VSTeamReleaseDefinition { [switch] $Force, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) Process { + $commonArgs = @{ + Method = 'Put' + subDomain = 'vsrm' + area = 'release' + resource = 'definitions' + ProjectName = $ProjectName + version = $(_getApiVersion Release) + } + if ($Force -or $pscmdlet.ShouldProcess('', "Update Release Definition")) { # Call the REST API if ($InFile) { - _callAPI -Method Put -ProjectName $ProjectName -SubDomain vsrm -Area Release -Resource definitions -Version $(_getApiVersion Release) -InFile $InFile | Out-Null + _callAPI @commonArgs -InFile $InFile | Out-Null } else { - _callAPI -Method Put -ProjectName $ProjectName -SubDomain vsrm -Area Release -Resource definitions -Version $(_getApiVersion Release) -Body $ReleaseDefinition | Out-Null + _callAPI @commonArgs -Body $ReleaseDefinition | Out-Null } } } diff --git a/Source/Public/Update-VSTeamServiceEndpoint.ps1 b/Source/Public/Update-VSTeamServiceEndpoint.ps1 index 2a2c5e792..5a248f09d 100644 --- a/Source/Public/Update-VSTeamServiceEndpoint.ps1 +++ b/Source/Public/Update-VSTeamServiceEndpoint.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamServiceEndpoint { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamServiceEndpoint')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $id, @@ -9,9 +10,9 @@ function Update-VSTeamServiceEndpoint { [switch] $Force, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -21,7 +22,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 ServiceEndpoints) + -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/Public/Update-VSTeamTaskGroup.ps1 b/Source/Public/Update-VSTeamTaskGroup.ps1 index 0c7803dab..411c05cb7 100644 --- a/Source/Public/Update-VSTeamTaskGroup.ps1 +++ b/Source/Public/Update-VSTeamTaskGroup.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamTaskGroup { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Low", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamTaskGroup')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Id, @@ -12,19 +13,28 @@ function Update-VSTeamTaskGroup { [switch] $Force, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) Process { + $commonArgs = @{ + Id = $Id + Method = 'Put' + Area = 'distributedtask' + Resource = 'taskgroups' + ProjectName = $ProjectName + Version = $(_getApiVersion TaskGroups) + } + if ($Force -or $pscmdlet.ShouldProcess("Update Task Group")) { if ($InFile) { - $resp = _callAPI -Method Put -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -InFile $InFile -ContentType 'application/json' -Id $Id + $resp = _callAPI @commonArgs -InFile $InFile } else { - $resp = _callAPI -Method Put -ProjectName $ProjectName -Area distributedtask -Resource taskgroups -Version $(_getApiVersion TaskGroups) -Body $Body -ContentType 'application/json' -Id $Id + $resp = _callAPI @commonArgs -Body $Body } } diff --git a/Source/Public/Update-VSTeamUserEntitlement.ps1 b/Source/Public/Update-VSTeamUserEntitlement.ps1 index 8e3c9b5c1..ae0e0e430 100644 --- a/Source/Public/Update-VSTeamUserEntitlement.ps1 +++ b/Source/Public/Update-VSTeamUserEntitlement.ps1 @@ -1,6 +1,6 @@ -function Update-VSTeamUserEntitlement -{ - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ByEmailLicenseOnly')] +function Update-VSTeamUserEntitlement { + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High", DefaultParameterSetName = 'ByEmailLicenseOnly', + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamUserEntitlement')] param ( [Parameter(ParameterSetName = 'ByIdLicenseOnly', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] [Parameter(ParameterSetName = 'ByIdWithSource', Mandatory = $True, ValueFromPipelineByPropertyName = $true)] @@ -36,20 +36,17 @@ function Update-VSTeamUserEntitlement # This will throw if this account does not support MemberEntitlementManagement _supportsMemberEntitlementManagement - if ($email) - { + if ($email) { # We have to go find the id $user = Get-VSTeamUserEntitlement -Top 10000 | Where-Object email -eq $email - if (-not $user) - { + if (-not $user) { throw "Could not find user with an email equal to $email" } $id = $user.id } - else - { + else { $user = Get-VSTeamUserEntitlement -Id $id } @@ -62,13 +59,13 @@ function Update-VSTeamUserEntitlement $newMSDNLicenseType = if ($MSDNLicenseType) { $MSDNLicenseType } else { $msdnLicenseTypeOriginal } $obj = @{ - from = "" - op = "replace" - path = "/accessLevel" + from = "" + op = "replace" + path = "/accessLevel" value = @{ accountLicenseType = $newLicenseType - licensingSource = $newLicenseSource - msdnLicenseType = $newMSDNLicenseType + licensingSource = $newLicenseSource + msdnLicenseType = $newMSDNLicenseType } } @@ -76,10 +73,14 @@ function Update-VSTeamUserEntitlement $msg = "$( $user.userName ) ($( $user.email ))" - if ($Force -or $PSCmdlet.ShouldProcess($msg, "Update user")) - { + if ($Force -or $PSCmdlet.ShouldProcess($msg, "Update user")) { # Call the REST API - _callAPI -Method Patch -NoProject -Body $body -SubDomain 'vsaex' -Resource 'userentitlements' -Id $id -Version $(_getApiVersion MemberEntitlementManagement) -ContentType 'application/json-patch+json' | Out-Null + _callAPI -Method PATCH -SubDomain vsaex -NoProject ` + -Resource userentitlements ` + -Id $id ` + -ContentType 'application/json-patch+json' ` + -Body $body ` + -Version $(_getApiVersion MemberEntitlementManagement) | Out-Null Write-Output "Updated user license for $( $user.userName ) ($( $user.email )) from LicenseType: ($licenseTypeOriginal) to ($newLicenseType)" Write-Output "Updated user license for $( $user.userName ) ($( $user.email )) from LicenseSource: ($licenseSourceOriginal) to ($newLicenseSource)" diff --git a/Source/Public/Update-VSTeamVariableGroup.ps1 b/Source/Public/Update-VSTeamVariableGroup.ps1 index a5c892c3a..2056c7e16 100644 --- a/Source/Public/Update-VSTeamVariableGroup.ps1 +++ b/Source/Public/Update-VSTeamVariableGroup.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamVariableGroup { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamVariableGroup')] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [string] $Id, @@ -18,9 +19,9 @@ function Update-VSTeamVariableGroup { [switch] $Force, - [ProjectValidateAttribute()] - [ArgumentCompleter([ProjectCompleter])] - [Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [vsteam_lib.ProjectValidateAttribute($false)] + [ArgumentCompleter([vsteam_lib.ProjectCompleter])] [string] $ProjectName ) @@ -48,7 +49,7 @@ function Update-VSTeamVariableGroup { variables = $Variables } - if ([VSTeamVersions]::Version -ne "TFS2017") { + if ([vsteam_lib.Versions]::Version -ne "TFS2017") { $Type = $PSBoundParameters['Type'] $bodyAsHashtable.Add("type", $Type) @@ -63,8 +64,12 @@ function Update-VSTeamVariableGroup { if ($Force -or $pscmdlet.ShouldProcess($Id, "Update Variable Group")) { # Call the REST API - $resp = _callAPI -ProjectName $projectName -Area 'distributedtask' -Resource 'variablegroups' -Id $Id ` - -Method Put -ContentType 'application/json' -body $body -Version $(_getApiVersion VariableGroups) + $resp = _callAPI -Method PUT -ProjectName $projectName ` + -Area distributedtask ` + -Resource variablegroups ` + -Id $Id ` + -body $body ` + -Version $(_getApiVersion VariableGroups) Write-Verbose $resp diff --git a/Source/Public/Update-VSTeamWorkItem.ps1 b/Source/Public/Update-VSTeamWorkItem.ps1 index 411c80c7d..e21108edd 100644 --- a/Source/Public/Update-VSTeamWorkItem.ps1 +++ b/Source/Public/Update-VSTeamWorkItem.ps1 @@ -1,5 +1,6 @@ function Update-VSTeamWorkItem { - [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")] + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium", + HelpUri='https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Update-VSTeamWorkItem')] param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [int] $Id, @@ -77,9 +78,13 @@ function Update-VSTeamWorkItem { # Call the REST API if ($Force -or $pscmdlet.ShouldProcess($Id, "Update-WorkItem")) { - $resp = _callAPI -Area 'wit' -Resource 'workitems' ` - -Version $(_getApiVersion Core) -id $Id -Method Patch ` - -ContentType 'application/json-patch+json' -Body $json -NoProject + $resp = _callAPI -Method PATCH -NoProject ` + -Area wit ` + -Resource workitems ` + -id $Id ` + -ContentType 'application/json-patch+json' ` + -Body $json ` + -Version $(_getApiVersion Core) _applyTypesToWorkItem -item $resp diff --git a/Source/VSTeam.psd1 b/Source/VSTeam.psd1 index de530b99a..0cfdb9dc8 100644 --- a/Source/VSTeam.psd1 +++ b/Source/VSTeam.psd1 @@ -12,7 +12,7 @@ RootModule = 'VSTeam.psm1' # Version number of this module. - ModuleVersion = '6.5.1' + ModuleVersion = '7.0.0' # Supported PSEditions CompatiblePSEditions = @('Core', 'Desktop') @@ -66,7 +66,7 @@ FormatsToProcess = @('.\vsteam.format.ps1xml') # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess - # NestedModules = @() + NestedModules = @('.\bin\vsteam-lib.dll') # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. # This wildcard will be replaced during the build process in AzD diff --git a/Source/VSTeam.psm1 b/Source/VSTeam.psm1 index 14d09d904..1eebfc227 100644 --- a/Source/VSTeam.psm1 +++ b/Source/VSTeam.psm1 @@ -7,14 +7,13 @@ # and alias so you only have to name the files correctly. # Files are built using a script in the root folder -. "$PSScriptRoot\vsteam.classes.ps1" . "$PSScriptRoot\vsteam.functions.ps1" # Set the module version -[VSTeamVersions]::ModuleVersion = _getModuleVersion +[vsteam_lib.Versions]::ModuleVersion = _getModuleVersion # Load the correct version of the environment variable -Set-VSTeamAPIVersion -Target $([VSTeamVersions]::Version) +Set-VSTeamAPIVersion -Target $([vsteam_lib.Versions]::Version) # Check to see if the user stored the default project in an environment variable if ($null -ne $env:TEAM_PROJECT) { diff --git a/Source/en-US/VSTeam-Help.xml b/Source/en-US/VSTeam-Help.xml deleted file mode 100644 index 022766f1a..000000000 --- a/Source/en-US/VSTeam-Help.xml +++ /dev/null @@ -1,28228 +0,0 @@ - - - - - Add-VSTeam - Add - VSTeam - - Adds a team to a team project. - - - - Adds a team to a team project. - - - - Add-VSTeam - - 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 - - - Description - - The description of the team. - - String - - String - - - None - - - Name - - The name of the team - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Description - - The description of the team. - - String - - String - - - None - - - Name - - The name of the team - - String - - String - - - None - - - - - - - - - - - - - Get-VSTeam - - - - Remove-VSTeam - - - - Show-VSTeam - - - - Update-VSTeam - - - - - - - Add-VSTeamAccessControlEntry - Add - VSTeamAccessControlEntry - - Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. - Note: This is a low-level function. You should really use a high level function (Add-VSTeam Permission / Set-VSTeam Permission / Get-VSTeam*Permission) unless you know what you are doing. - - - - Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. - Note: This is a low-level function. You should really use a high level function (Add-VSTeam Permission / Set-VSTeam Permission / Get-VSTeam*Permission) unless you know what you are doing. - - - - Add-VSTeamAccessControlEntry - - 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 - - - SecurityNamespaceName - - Security Namespace Name. Valid names are: - AzD: - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) - - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) - - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) - - ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) - - Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) - - WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) - - DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) - - WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) - - GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) - - VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) - - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) - - WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) - - ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) - - ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) - - Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) - - Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) - - Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) - - Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) - - Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) - - AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) - - Library (b7e84409-6553-448a-bbb2-af228e07cbeb) - - Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) - - Project (52d39943-cb85-4d7f-8fa8-c6baac873819) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) - - CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) - - TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) - - ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) - - Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) - - MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) - - Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) - - Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) - - ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) - - WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) - - TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) - - BuildAdministration (302acaca-b667-436d-a946-87133492041c) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) - - Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) - - UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) - - WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) - - VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) - - Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) - - CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) - - WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) - - Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) - - BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) - - Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) - - Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) - - DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) - - VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) - - VSSPS: - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) - - Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) - - SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) - - CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) - - GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) - - RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) - - String - - String - - - None - - - SecurityNamespace - - Security namespace identifier. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - - String - - String - - - None - - - Token - - The security Token - - String - - String - - - None - - - AllowMask - - Bitmask for Allow Permissions - - Int - - Int - - - None - - - DenyMask - - Bitmask for Deny Permissions - - Int - - Int - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - SecurityNamespaceName - - Security Namespace Name. Valid names are: - AzD: - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) - - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) - - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) - - ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) - - Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) - - WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) - - DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) - - WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) - - GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) - - VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) - - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) - - WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) - - ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) - - ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) - - Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) - - Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) - - Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) - - Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) - - Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) - - AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) - - Library (b7e84409-6553-448a-bbb2-af228e07cbeb) - - Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) - - Project (52d39943-cb85-4d7f-8fa8-c6baac873819) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) - - CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) - - TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) - - ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) - - Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) - - MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) - - Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) - - Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) - - ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) - - WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) - - TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) - - BuildAdministration (302acaca-b667-436d-a946-87133492041c) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) - - Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) - - UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) - - WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) - - VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) - - Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) - - CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) - - WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) - - Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) - - BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) - - Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) - - Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) - - DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) - - VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) - - VSSPS: - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) - - Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) - - SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) - - CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) - - GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) - - RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) - - String - - String - - - None - - - SecurityNamespace - - Security namespace identifier. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - - String - - String - - - None - - - Token - - The security Token - - String - - String - - - None - - - AllowMask - - Bitmask for Allow Permissions - - Int - - Int - - - None - - - DenyMask - - Bitmask for Deny Permissions - - Int - - Int - - - None - - - - - - - VSTeamAccessControlEntry - - - - - - - - - - - - - - - - - Add-VSTeamArea - Add - VSTeamArea - - Adds a new area to the project - - - - Adds a new area to the project - - - - Add-VSTeamArea - - 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 - - - Name - - Name of the new area. - - string - - string - - - None - - - Path - - Path of the existing area under where the new one will be created. - - string - - string - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Name - - Name of the new area. - - string - - string - - - None - - - Path - - Path of the existing area under where the new one will be created. - - string - - string - - - None - - - - - - - System.Object - - - - - - - - - This function is a wrapper of the base function Add-VSTeamClassificationNode. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamArea -ProjectName Demo -Name "NewArea" -Path "MyArea/Path" - - This command adds a new area named NewArea to the Demo project under the area path MyArea/Path. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Add-VSTeamArea -ProjectName Demo -Name "NewArea" - - This command adds a new area named NewArea to the Demo project. - - - - - - Add-VSTeamClassificationNode - - - - Add-VSTeamIteration - - - - - - - Add-VSTeamAzureRMServiceEndpoint - Add - VSTeamAzureRMServiceEndpoint - - Adds a new Azure Resource Manager service endpoint. - - - - The cmdlet adds a new connection between TFS/AzD and Azure using the Azure Resource Manager connection type. - - - - Add-VSTeamAzureRMServiceEndpoint - - 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 - - - SubscriptionName - - The name of the Azure Subscription. - - String - - String - - - None - - - SubscriptionId - - The id of the Azure subscription to use. - - String - - String - - - None - - - SubscriptionTenantId - - The id of the Azure tenant to use. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - ServicePrincipalId - - The ID of the Azure Service Principal to use with this service endpoint. - - String - - String - - - None - - - ServicePrincipalKey - - The key of the Azure Service Principal to use with this service endpoint. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - SubscriptionName - - The name of the Azure Subscription. - - String - - String - - - None - - - SubscriptionId - - The id of the Azure subscription to use. - - String - - String - - - None - - - SubscriptionTenantId - - The id of the Azure tenant to use. - - String - - String - - - None - - - ServicePrincipalId - - The ID of the Azure Service Principal to use with this service endpoint. - - String - - String - - - None - - - ServicePrincipalKey - - The key of the Azure Service Principal to use with this service endpoint. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - - - - - - - - - - - Get-VSTeamServiceEndpoint - - - - Get-VSTeamServiceEndpointType - - - - Remove-VSTeamServiceEndpoint - - - - - - - Add-VSTeamBuild - Add - VSTeamBuild - - Queues a new build. - - - - Add-VSTeamBuild will queue a new build. - You can override the queue in the build definition by using the QueueName parameter. You can override the default source branch by using the SourceBranch parameter. You can also set specific build parameters by using the BuildParameters parameter. - To have the BuildDefinition and QueueNames tab complete you must set a default project by calling Set-VSTeamDefaultProject before you call Add-VSTeamBuild. - - - - Add-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 - - - BuildDefinitionName - - The name of the build definition to use to queue to build. - - String - - String - - - None - - - QueueName - - The name of the queue to use for this build. - - String - - String - - - None - - - SourceBranch - - Which source branch to use for this build. Overrides default branch in build definition. - - String - - String - - - None - - - BuildParameters - - A hashtable with build parameters. - - System.Collection.Hashtable - - System.Collection.Hashtable - - - None - - - - Add-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 - - - QueueName - - The name of the queue to use for this build. - - String - - String - - - None - - - BuildDefinitionId - - The Id of the build definition to use to queue to build. - - Int32 - - Int32 - - - None - - - SourceBranch - - Which source branch to use for this build. Overrides default branch in build definition. - - String - - String - - - None - - - BuildParameters - - A hashtable with build parameters. - - System.Collection.Hashtable - - System.Collection.Hashtable - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - BuildDefinitionName - - The name of the build definition to use to queue to build. - - String - - String - - - None - - - QueueName - - The name of the queue to use for this build. - - String - - String - - - None - - - BuildDefinitionId - - The Id of the build definition to use to queue to build. - - Int32 - - Int32 - - - None - - - SourceBranch - - Which source branch to use for this build. Overrides default branch in build definition. - - String - - String - - - None - - - BuildParameters - - A hashtable with build parameters. - - System.Collection.Hashtable - - System.Collection.Hashtable - - - None - - - - - - System.String - - - ProjectName - BuildDefinitionName - QueueName - SourceBranch - - - - - System.Int32 - - - BuildDefinitionId - - - - - System.Collections.Hashtable - - - Build Parameters - - - - - - - Team.Build - - - - - - - - - BuildDefinition and QueueName are dynamic parameters and use the default project value to query their validate set. - If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamBuild you will have to type in the names. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted - - This example sets the default project so you can tab complete the BuildDefinition parameter. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -SourceBranch refs/heads/develop - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted - - This example queues the build for the 'develop' branch, overriding the default branch in the build definition. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -BuildParameters @{msg="hello world!"; 'system.debug'='true'} - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted - - This example queues the build and sets the system.debug variable to true and msg to 'hello world!'. - - - - - - - - Add-VSTeamBuildDefinition - Add - VSTeamBuildDefinition - - Creates a new build definition from a JSON file. - - - - Reads a JSON file off disk and uses that file to create a new build definition in the provided project. - You must call Set-VSTeamAccount before calling this function. - - - - Add-VSTeamBuildDefinition - - 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 - - - InFile - - Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - InFile - - Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. - - String - - String - - - None - - - - - - System.String - - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamBuildDefinition -ProjectName Demo -InFile build.json - - This command reads build.json and creates a new build definition from it on the demo team project. - - - - - - - - Add-VSTeamBuildTag - Add - VSTeamBuildTag - - Adds a tag to a build. - - - - Adds a tag to a build. - - - - Add-VSTeamBuildTag - - 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 - - - Tags - - One or more tags. To specify multiple, use commas to separate. - - String[] - - String[] - - - None - - - Id - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - 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 - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Tags - - One or more tags. To specify multiple, use commas to separate. - - String[] - - String[] - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - System.Object - - - - - - - - - - - - - - - - - Add-VSTeamClassificationNode - Add - VSTeamClassificationNode - - Adds either a new iteration or area to the project - - - - Adds either a new iteration or area to the project - - - - Add-VSTeamClassificationNode - - 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 - - - Name - - Name of the new classification node. - - string - - string - - - None - - - StructureGroup - - Structure group of the classification node. - - - iterations - areas - - string - - string - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - StartDate - - Start date of the classification node. - - datetime - - datetime - - - None - - - FinishDate - - Finish date of the classification node. - - datetime - - datetime - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Name - - Name of the new classification node. - - string - - string - - - None - - - StructureGroup - - Structure group of the classification node. - - string - - string - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - StartDate - - Start date of the classification node. - - datetime - - datetime - - - None - - - FinishDate - - Finish date of the classification node. - - datetime - - datetime - - - None - - - - - - - System.Object - - - - - - - - - This function is the base function for Add-VSTeamArea and Add-VSTeamIteration. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamClassificationNode -ProjectName Demo -Name "NewIteration" -StructureGroup "iteration" -Path "MyIteration/Path" - - This command adds a new iteration named NewIteration to the Demo project under the iteration path MyIteration/Path. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Add-VSTeamClassificationNode -ProjectName "Demo" -FinishDate (Get-Date "31.01.2020") -StartDate (Get-Date "01.01.2020") -Name "NewIteration" -StructureGroup "iterations" - - This command adds a new iteration named NewIteration to the Demo project with the start date 01.01.2020 and finish date 31.01.2020. - - - - - - Add-VSTeamArea - - - - Add-VSTeamIteration - - - - - - - Add-VSTeamExtension - Add - VSTeamExtension - - Install the specified extension into the account / project collection. - - - - Install the specified extension into the account / project collection. - - - - Add-VSTeamExtension - - PublisherId - - The id of the publisher. - - String - - String - - - None - - - ExtensionId - - The id of the extension. - - String - - String - - - None - - - Version - - The version of the extension. Example: "0.1.35". - - String - - String - - - None - - - - - - PublisherId - - The id of the publisher. - - String - - String - - - None - - - ExtensionId - - The id of the extension. - - String - - String - - - None - - - Version - - The version of the extension. Example: "0.1.35". - - String - - String - - - None - - - - - - - - - - - - - Add-VSTeamExtension - - - - Get-VSTeamExtension - - - - Remove-VSTeamExtension - - - - Update-VSTeamExtension - - - - - - - Add-VSTeamFeed - Add - VSTeamFeed - - Adds a new feed to package management. - - - - Adds a new feed to package management. - - - - Add-VSTeamFeed - - Name - - Name of the feed - - string - - string - - - None - - - Description - - Description of the feed - - string - - string - - - None - - - EnableUpstreamSources - - Enables npm and nuget upstream sources for the feed - - - SwitchParameter - - - False - - - showDeletedPackageVersions - - The feed will show deleted version in the feed - - - SwitchParameter - - - False - - - - - - Name - - Name of the feed - - string - - string - - - None - - - Description - - Description of the feed - - string - - string - - - None - - - EnableUpstreamSources - - Enables npm and nuget upstream sources for the feed - - SwitchParameter - - SwitchParameter - - - False - - - showDeletedPackageVersions - - The feed will show deleted version in the feed - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamFeed -Name test -Description 'Test Description' - - This command adds a new package feed to the account. - - - - - - - - Add-VSTeamGitRepository - Add - VSTeamGitRepository - - Adds a Git repository to your Azure DevOps or Team Foundation Server account. - - - - Add-VSTeamGitRepository adds a Git repository to your Azure DevOps or Team Foundation Server account. - - - - Add-VSTeamGitRepository - - 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 - - - Name - - Specifies the name of the repository. - - System.String - - System.String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Name - - Specifies the name of the repository. - - System.String - - System.String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamGitRepository -ProjectName Demo -Name Temp - - This command adds a new repository named Temp to the Demo project. - - - - - - - - Add-VSTeamGitRepositoryPermission - Add - VSTeamGitRepositoryPermission - - Add permissions to a git repository, all repositories in a project, or a specific branch - - - - Add permissions to a git repository, all repositories in a project, or a specific branch - - - - Add-VSTeamGitRepositoryPermission - - 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 - - - RepositoryId - - - - String - - String - - - None - - - RepositoryName - - - - String - - String - - - None - - - BranchName - - - - String - - String - - - None - - - Descriptor - - - - String - - String - - - None - - - User - - - - VSTeamUser - - VSTeamUser - - - None - - - Group - - - - VSTeamGroup - - VSTeamGroup - - - None - - - Allow - - - - VSTeamGitRepositoryPermissions - - VSTeamGitRepositoryPermissions - - - None - - - Deny - - - - VSTeamGitRepositoryPermissions - - VSTeamGitRepositoryPermissions - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - RepositoryId - - - - String - - String - - - None - - - RepositoryName - - - - String - - String - - - None - - - BranchName - - - - String - - String - - - None - - - Descriptor - - - - String - - String - - - None - - - User - - - - VSTeamUser - - VSTeamUser - - - None - - - Group - - - - VSTeamGroup - - VSTeamGroup - - - None - - - Allow - - - - VSTeamGitRepositoryPermissions - - VSTeamGitRepositoryPermissions - - - None - - - Deny - - - - VSTeamGitRepositoryPermissions - - VSTeamGitRepositoryPermissions - - - None - - - - - - - System.Object - - - - - - - - - - - - - - - - - Add-VSTeamIteration - Add - VSTeamIteration - - Adds a new iteration to the project - - - - Adds a new iteration to the project - - - - Add-VSTeamIteration - - 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 - - - Name - - Name of the new iteration. - - string - - string - - - None - - - Path - - Path of the existing iteration under where the new one will be created. - - string - - string - - - None - - - StartDate - - Start date of the iteration. - - datetime - - datetime - - - None - - - FinishDate - - Finish date of the iteration. - - datetime - - datetime - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Name - - Name of the new iteration. - - string - - string - - - None - - - Path - - Path of the existing iteration under where the new one will be created. - - string - - string - - - None - - - StartDate - - Start date of the iteration. - - datetime - - datetime - - - None - - - FinishDate - - Finish date of the iteration. - - datetime - - datetime - - - None - - - - - - - System.Object - - - - - - - - - This function is a wrapper of the base function Add-VSTeamClassificationNode. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamIteration -ProjectName Demo -Name "NewIteration" -Path "MyIteration/Path" - - This command adds a new iteration named NewIteration to the Demo project under the iteration path MyIteration/Path. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Add-VSTeamIteration -ProjectName "Demo" -FinishDate (Get-Date "31.01.2020") -StartDate (Get-Date "01.01.2020") -Name "NewIteration" - - This command adds a new iteration named NewIteration to the Demo project with the start date 01.01.2020 and finish date 31.01.2020. - - - - - - Add-VSTeamArea - - - - Add-VSTeamClassificationNode - - - - - - - Add-VSTeamKubernetesEndpoint - Add - VSTeamKubernetesEndpoint - - Adds connections to Kubernetes clusters - - - - The cmdlet adds a new connection between TFS/AzD and a Kubernetes cluster using kubeconfig json. - This is only used when using the Kubernetes tasks. - - - - Add-VSTeamKubernetesEndpoint - - 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 - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - Kubeconfig - - kubeconfig as JSON string - - String - - String - - - None - - - KubernetesUrl - - URL of Kubernetes cluster - - String - - String - - - None - - - ClientCertificateData - - Client certificate from Kubeconfig - - String - - String - - - None - - - ClientKeyData - - Client private key from Kubeconfig - - String - - String - - - None - - - AcceptUntrustedCerts - - Accept untrusted certificates for cluster - - - SwitchParameter - - - False - - - GeneratePfx - - Generate pfx file - - - 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 - - - Kubeconfig - - kubeconfig as JSON string - - String - - String - - - None - - - KubernetesUrl - - URL of Kubernetes cluster - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - ClientCertificateData - - Client certificate from Kubeconfig - - String - - String - - - None - - - ClientKeyData - - Client private key from Kubeconfig - - String - - String - - - None - - - AcceptUntrustedCerts - - Accept untrusted certificates for cluster - - SwitchParameter - - SwitchParameter - - - False - - - GeneratePfx - - Generate pfx file - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - - Get-VSTeamServiceEndpoint - - - - Get-VSTeamServiceEndpointType - - - - Remove-VSTeamServiceEndpoint - - - - - - - Add-VSTeamMembership - Add - VSTeamMembership - - Adds a membership to a container. - - - - Adds a membership to a container. - - - - Add-VSTeamMembership - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - - - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> $user = Get-VSTeamUser | ? DisplayName -eq 'Test User' -PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' -PS C:\> Add-VSTeamMembership -MemberDescriptor $user.Descriptor -ContainerDescriptor $group.Descriptor - - Adds Test User to the Endpoint Administrators group. - - - - - - Get-VsTeamUser - - - - Get-VsTeamGroup - - - - Get-VsTeamMembership - - - - Remove-VsTeamMembership - - - - Test-VsTeamMembership - - - - - - - Add-VSTeamNuGetEndpoint - Add - VSTeamNuGetEndpoint - - Adds a new NuGet service endpoint. - - - - The cmdlet adds a new connection between TFS/AzD and a NuGet server using the NuGet connection type. - This is only used when using the NuGet tasks. - - - - Add-VSTeamNuGetEndpoint - - 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 - - - NuGetUrl - - URL of the NuGet server. - - String - - String - - - None - - - PersonalAccessToken - - Authentication Token generated by NuGet. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - - Add-VSTeamNuGetEndpoint - - 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 - - - NuGetUrl - - URL of the NuGet server. - - String - - String - - - None - - - ApiKey - - Authentication ApiKey generated by NuGet. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - - Add-VSTeamNuGetEndpoint - - 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 - - - NuGetUrl - - URL of the NuGet server. - - String - - String - - - None - - - SecurePassword - - A secured string to capture your sensitive information. - - SecureString - - SecureString - - - None - - - Username - - Username to use with basic authentication. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - - Add-VSTeamNuGetEndpoint - - 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 - - - NuGetUrl - - URL of the NuGet server. - - String - - String - - - None - - - SecureApiKey - - A secured string to capture your sensitive information. - This will allow you to provide your information without displaying it in plain text. - - SecureString - - SecureString - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - - Add-VSTeamNuGetEndpoint - - 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 - - - NuGetUrl - - URL of the NuGet server. - - String - - String - - - None - - - SecurePersonalAccessToken - - A secured string to capture your sensitive information. - You must provide on the command line. You will not be prompted for this value. - You can use $p = Read-Host -AsSecureString to capture to pass in as parameter. - - SecureString - - SecureString - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - NuGetUrl - - URL of the NuGet server. - - String - - String - - - None - - - PersonalAccessToken - - Authentication Token generated by NuGet. - - String - - String - - - None - - - ApiKey - - Authentication ApiKey generated by NuGet. - - String - - String - - - None - - - Username - - Username to use with basic authentication. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - SecureApiKey - - A secured string to capture your sensitive information. - This will allow you to provide your information without displaying it in plain text. - - SecureString - - SecureString - - - None - - - SecurePersonalAccessToken - - A secured string to capture your sensitive information. - You must provide on the command line. You will not be prompted for this value. - You can use $p = Read-Host -AsSecureString to capture to pass in as parameter. - - SecureString - - SecureString - - - None - - - SecurePassword - - A secured string to capture your sensitive information. - - SecureString - - SecureString - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> $apikey = Read-Host -Prompt 'ApiKey' -AsSecureString -ApiKey: ************************************ -PS C:\> Add-NuGetEndpoint -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -SecureApiKey $apikey - - This will add a project name MyProject with no description using the Scrum process template and Git source control. - - - - - - Get-VSTeamServiceEndpoint - - - - Get-VSTeamServiceEndpointType - - - - Remove-VSTeamServiceEndpoint - - - - - - - Add-VSTeamPolicy - Add - VSTeamPolicy - - Adds a new policy to the specified project. - - - - Adds a new policy to the specified project. - - - - Add-VSTeamPolicy - - 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 - - - type - - Specifies the id of the type of policy to be created. - - Guid - - Guid - - - None - - - enabled - - Enables the policy - - - SwitchParameter - - - False - - - blocking - - Determines if the policy will block pushes to the branch if the policy is not adhered to. - - - SwitchParameter - - - False - - - settings - - The settings for the policy. - Each policy type has it's own settings that will need to be set. - - Hashtable - - Hashtable - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - type - - Specifies the id of the type of policy to be created. - - Guid - - Guid - - - None - - - enabled - - Enables the policy - - SwitchParameter - - SwitchParameter - - - False - - - blocking - - Determines if the policy will block pushes to the branch if the policy is not adhered to. - - SwitchParameter - - SwitchParameter - - - False - - - settings - - The settings for the policy. - Each policy type has it's own settings that will need to be set. - - Hashtable - - Hashtable - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamPolicy -ProjectName Demo -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} - - This command adds a new policy to the Demo project's repository specified. The policy added requires a minimum number of reviewers and applies to the master branch. Specifying `-blocking` will block pushes to master directly. - - - - - - Get-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Get-VSTeamPolicyType - - - - - - - Add-VSTeamProfile - Add - VSTeamProfile - - Stores your account name and personal access token as a profile for use with the Add-TeamAccount function in this module. - - - - - - - - Add-VSTeamProfile - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - Name - - Optional name for the profile. If this parameter is not provided the account will also serve as the name. - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - PAT - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Add-VSTeamProfile command. - - SecureString - - SecureString - - - None - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - - SwitchParameter - - - False - - - - Add-VSTeamProfile - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - PersonalAccessToken - - The personal access token from AzD/TFS to use to access this account. - - String - - String - - - None - - - Name - - Optional name for the profile. If this parameter is not provided the account will also serve as the name. - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - - SwitchParameter - - - False - - - - Add-VSTeamProfile - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - Name - - Optional name for the profile. If this parameter is not provided the account will also serve as the name. - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - UseWindowsAuthentication - - Allows the use of the current user's Windows credentials to authenticate against a local TFS. - - - SwitchParameter - - - False - - - - - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - PAT - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Add-VSTeamProfile command. - - SecureString - - SecureString - - - None - - - PersonalAccessToken - - The personal access token from AzD/TFS to use to access this account. - - String - - String - - - None - - - UseWindowsAuthentication - - Allows the use of the current user's Windows credentials to authenticate against a local TFS. - - SwitchParameter - - SwitchParameter - - - False - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - SwitchParameter - - SwitchParameter - - - False - - - Name - - Optional name for the profile. If this parameter is not provided the account will also serve as the name. - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamProfile - - You will be prompted for the account name and personal access token. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Add-VSTeamProfile -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Version TFS2018 - - Allows you to provide all the information on the command line. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Add-VSTeamProfile -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication - - On Windows, allows you use to use Windows authentication against a local TFS server. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - - - - Add-VSTeamProject - Add - VSTeamProject - - Adds a Team Project to your account. - - - - This will create a new Team Project in your Team Foundation Server or Team Services account. - - - - Add-VSTeamProject - - ProjectName - - The name of the project to create. - - String - - String - - - None - - - ProcessTemplate - - The name of the process template to use for the project. - You can tab complete from a list of available projects. - - String - - String - - - Scrum - - - Description - - The description of the team project. - - String - - String - - - None - - - TFVC - - Switches the source control from Git to TFVC. - - - SwitchParameter - - - False - - - - - - ProjectName - - The name of the project to create. - - String - - String - - - None - - - ProcessTemplate - - The name of the process template to use for the project. - You can tab complete from a list of available projects. - - String - - String - - - Scrum - - - Description - - The description of the team project. - - String - - String - - - None - - - TFVC - - Switches the source control from Git to TFVC. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamProject 'MyProject' - - This will add a project name MyProject with no description using the Scrum process template and Git source control. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Add-VSTeamProject 'MyProject' -TFVC -ProcessTemplate Agile - - This will add a project name MyProject with no description using the Agile process template and TFVC source control. - - - - - - Set-VSTeamAccount - - - - Remove-VSTeamProject - - - - Get-VSTeamProcess - - - - - - - Add-VSTeamProjectPermission - Add - VSTeamProjectPermission - - Add Permissions on Project Level - - - - Add Permissions on Project Level - - - - Add-VSTeamProjectPermission - - 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 - - - Descriptor - - - - String - - String - - - None - - - User - - - - VSTeamUser - - VSTeamUser - - - None - - - Group - - - - VSTeamGroup - - VSTeamGroup - - - None - - - Allow - - - - VSTeamProjectPermissions - - VSTeamProjectPermissions - - - None - - - Deny - - - - VSTeamProjectPermissions - - VSTeamProjectPermissions - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Descriptor - - - - String - - String - - - None - - - User - - - - VSTeamUser - - VSTeamUser - - - None - - - Group - - - - VSTeamGroup - - VSTeamGroup - - - None - - - Allow - - - - VSTeamProjectPermissions - - VSTeamProjectPermissions - - - None - - - Deny - - - - VSTeamProjectPermissions - - VSTeamProjectPermissions - - - None - - - - - - - System.Object - - - - - - - - - - - - - - - - - Add-VSTeamPullRequest - Add - VSTeamPullRequest - - Create a new Pull Request - - - - Create a new Pull Request - - - - Add-VSTeamPullRequest - - 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 - - - RepositoryId - - Specifies the ID of the repository - - Guid - - Guid - - - None - - - SourceRefName - - A source reference, like a branch or commit Needs to be in ref format like refs/heads/MyBranch - - String - - String - - - None - - - TargetRefName - - A target reference, like a branch or commit Needs to be in ref format like refs/heads/MyBranch - - String - - String - - - None - - - Title - - The title of the pull request - - String - - String - - - None - - - Description - - The description of the pull request - - String - - String - - - None - - - Draft - - Mark the new pull request as a draft - - - SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - 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 - - - RepositoryId - - Specifies the ID of the repository - - Guid - - Guid - - - None - - - SourceRefName - - A source reference, like a branch or commit Needs to be in ref format like refs/heads/MyBranch - - String - - String - - - None - - - TargetRefName - - A target reference, like a branch or commit Needs to be in ref format like refs/heads/MyBranch - - String - - String - - - None - - - Title - - The title of the pull request - - String - - String - - - None - - - Description - - The description of the pull request - - String - - String - - - None - - - Draft - - Mark the new pull request as a draft - - SwitchParameter - - SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - Team.PullRequest - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Add-VSTeamPullRequest -ProjectName project -RepositoryId $r.RepositoryId -SourceRefName "refs/heads/mybranch" -TargetRefName "refs/heads/master" -Title "My PR" -Description "My Description" -Draft - - Create a new pull request as a draft - - - - - - - - Add-VSTeamRelease - Add - VSTeamRelease - - Queues a new release - - - - Add-VSTeamRelease will queue a new release. - The environments will deploy according to how the release definition is configured in the Triggers tab. - You must call Set-VSTeamAccount before calling this function. - - - - Add-VSTeamRelease - - 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 - - - DefinitionId - - The id of the release definition to use. - - Int32 - - Int32 - - - None - - - Description - - The description to use on the release. - - String - - String - - - None - - - ArtifactAlias - - The alias of the artifact to use with this release. - - String - - String - - - None - - - Name - - The name of this release. - - String - - String - - - None - - - BuildId - - The id of the build to use with this release. - - String - - String - - - None - - - SourceBranch - - The branch of the artifact - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - Add-VSTeamRelease - - 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 - - - Description - - The description to use on the release. - - String - - String - - - None - - - Name - - The name of this release. - - String - - String - - - None - - - DefinitionName - - The name of the release definition to use. - - String - - String - - - None - - - SourceBranch - - The branch of the artifact - - String - - String - - - None - - - BuildNumber - - The number of the build to use. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - 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 - - - DefinitionId - - The id of the release definition to use. - - Int32 - - Int32 - - - None - - - Description - - The description to use on the release. - - String - - String - - - None - - - ArtifactAlias - - The alias of the artifact to use with this release. - - String - - String - - - None - - - Name - - The name of this release. - - String - - String - - - None - - - BuildId - - The id of the build to use with this release. - - String - - String - - - None - - - DefinitionName - - The name of the release definition to use. - - String - - String - - - None - - - SourceBranch - - The branch of the artifact - - String - - String - - - None - - - BuildNumber - - The number of the build to use. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamBuild | ft id,name - -id name --- ---- -44 Demo-CI-44 - -PS C:\> Get-VSTeamReleaseDefinition -Expand artifacts | ft id,name,@{l='Alias';e={$_.artifacts[0].alias}} - -id name Alias --- ---- ----- - 1 Demo-CD Demo-CI - -PS C:\> Add-VSTeamRelease -DefinitionId 1 -Description Test -ArtifactAlias Demo-CI -BuildId 44 - - This example shows how to find the Build ID, Artifact Alias, and Release definition ID required to start a release. If you call Set-VSTeamDefaultProject you can use Example 2 which is much easier. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Add-VSTeamRelease -DefinitionName Demo-CD -Description Test -BuildNumber Demo-CI-44 - - This command starts a new release using the Demo-CD release definition and the build with build number Demo-CI-44. - You must set a default project to tab complete DefinitionName and BuildNumber. - - - - - - - - Add-VSTeamReleaseDefinition - Add - VSTeamReleaseDefinition - - Creates a new release definition from a JSON file. - - - - Reads a JSON file off disk and uses that file to create a new release definition in the provided project. - You must call Set-VSTeamAccount before calling this function. - - - - Add-VSTeamReleaseDefinition - - 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 - - - InFile - - Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - InFile - - Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. - - String - - String - - - None - - - - - - System.String - - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamReleaseDefinition -ProjectName demo -inFile release.json - - This command reads release.json and creates a new release definition from it on the demo team project. - - - - - - - - Add-VSTeamServiceEndpoint - Add - VSTeamServiceEndpoint - - Adds a generic service connection - - - - The cmdlet adds a new generic connection between TFS/AzD and a third party service (see AzD for available connections). - - - - Add-VSTeamServiceEndpoint - - 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 - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - EndpointType - - Type of endpoint (eg. `kubernetes`, `sonarqube`). See AzD service page for supported endpoints. - - String - - String - - - None - - - Object - - Hashtable of Payload for REST call - - Hashtable - - Hashtable - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Object - - Hashtable of Payload for REST call - - Hashtable - - Hashtable - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - EndpointType - - Type of endpoint (eg. `kubernetes`, `sonarqube`). See AzD service page for supported endpoints. - - String - - String - - - None - - - - - - - Team.ServiceEndpoint - - - - - - - - - - - - - - - Get-VSTeamServiceEndpoint - - - - Get-VSTeamServiceEndpointType - - - - Remove-VSTeamServiceEndpoint - - - - - - - Add-VSTeamServiceFabricEndpoint - Add - VSTeamServiceFabricEndpoint - - Adds a new Service Fabric service endpoint. - - - - The cmdlet adds a new Service Fabric service endpoint to an existing project. - - - - Add-VSTeamServiceFabricEndpoint - - 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 - - - url - - The url of the Service Fabric management endpoint. - - String - - String - - - None - - - useWindowsSecurity - - If windows integrated authentication should be enabled. If set to false, all authentication is disabled. - - Boolean - - Boolean - - - None - - - endpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - clusterSpn - - Specify the cluster service principal name, for use with windows integrated authentication. - - String - - String - - - None - - - serverCertThumbprint - - The server certificate thumbprint, used for communicating with the Service Fabric cluster. - - String - - String - - - None - - - username - - The Azure AD Username, used for communicating with the Service Fabric cluster. - - String - - String - - - None - - - password - - The Password for the Azure AD User, used for communicating with the Service Fabric cluster. - - SecureString - - SecureString - - - None - - - - Add-VSTeamServiceFabricEndpoint - - 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 - - - url - - The url of the Service Fabric management endpoint. - - String - - String - - - None - - - useWindowsSecurity - - If windows integrated authentication should be enabled. If set to false, all authentication is disabled. - - Boolean - - Boolean - - - None - - - endpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - clusterSpn - - Specify the cluster service principal name, for use with windows integrated authentication. - - String - - String - - - None - - - serverCertThumbprint - - The server certificate thumbprint, used for communicating with the Service Fabric cluster. - - String - - String - - - None - - - certificate - - The certificate used for communicating with the Service Fabric cluster. - - String - - String - - - None - - - certificatePassword - - The Password for the certificate used for communicating with the Service Fabric cluster. - - SecureString - - SecureString - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - url - - The url of the Service Fabric management endpoint. - - String - - String - - - None - - - useWindowsSecurity - - If windows integrated authentication should be enabled. If set to false, all authentication is disabled. - - Boolean - - Boolean - - - None - - - clusterSpn - - Specify the cluster service principal name, for use with windows integrated authentication. - - String - - String - - - None - - - serverCertThumbprint - - The server certificate thumbprint, used for communicating with the Service Fabric cluster. - - String - - String - - - None - - - username - - The Azure AD Username, used for communicating with the Service Fabric cluster. - - String - - String - - - None - - - password - - The Password for the Azure AD User, used for communicating with the Service Fabric cluster. - - SecureString - - SecureString - - - None - - - certificate - - The certificate used for communicating with the Service Fabric cluster. - - String - - String - - - None - - - certificatePassword - - The Password for the certificate used for communicating with the Service Fabric cluster. - - SecureString - - SecureString - - - None - - - endpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - - - - - Team.ServiceEndpoint - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "NoAuthTest" -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false - - Adds a Service Fabric Endpoint for a non-secure cluster - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "AzureAdAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -username "someUser@someplace.com" -password $password - - Adds a Service Fabric Endpoint for an Azure AD secured cluster. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force -PS C:\> $pathToPFX = "C:\someFolder\theCertificateFile.pfx" -PS C:\> $base64Cert = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes($pathToPFX)) -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "CertificateAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -certificate $base64Cert -certificatePassword $password - - Adds a Service Fabric Endpoint for a certificate secured cluster. - - - - - - Get-VSTeamServiceEndpoint - - - - Get-VSTeamServiceEndpointType - - - - Remove-VSTeamServiceEndpoint - - - - - - - Add-VSTeamSonarQubeEndpoint - Add - VSTeamSonarQubeEndpoint - - Adds a new SonarQube service endpoint. - - - - The cmdlet adds a new connection between TFS/AzD and a SonarQube server using the SonarQube connection type. - This is only used when using the SonarQube tasks. - Using SonarQube with the Maven tasks uses a Generic Connection type. - - - - Add-VSTeamSonarQubeEndpoint - - 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 - - - SonarQubeUrl - - URL of the sonarqube server. - - String - - String - - - None - - - PersonalAccessToken - - Authentication Token generated by SonarQube. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - - Add-VSTeamSonarQubeEndpoint - - 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 - - - SonarQubeUrl - - URL of the sonarqube server. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - SecurePersonalAccessToken - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Set-VSTeamAccount command. - - SecureString - - SecureString - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - SonarQubeUrl - - URL of the sonarqube server. - - String - - String - - - None - - - PersonalAccessToken - - Authentication Token generated by SonarQube. - - String - - String - - - None - - - EndpointName - - The name displayed on the services page. In AzD this is the Connection Name. - - String - - String - - - None - - - SecurePersonalAccessToken - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Set-VSTeamAccount command. - - SecureString - - SecureString - - - None - - - - - - - - - - - - - Get-VSTeamServiceEndpoint - - - - Get-VSTeamServiceEndpointType - - - - Remove-VSTeamServiceEndpoint - - - - - - - Add-VSTeamTaskGroup - Add - VSTeamTaskGroup - - Adds a task group. - - - - Adds a task group. - - - - Add-VSTeamTaskGroup - - 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 - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - SwitchParameter - - - False - - - InFile - - The path to the json file that represents the task group - - String - - String - - - None - - - - Add-VSTeamTaskGroup - - 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 - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - SwitchParameter - - - False - - - Body - - The json that represents the task group as a string - - String - - String - - - None - - - - - - ProjectName - - - - - - - - - None - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - False - - - InFile - - The path to the json file that represents the task group - - String - - String - - - None - - - Body - - The json that represents the task group as a string - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $taskGroup = Get-VSTeamTaskGroup -Name "taskGroupName" -ProjectName "sourceProjectName" - -# Set the ID and revision to null, so AzD is happy. -$taskGroup.id = $null -$taskGroup.revision = $null - -$taskGroupJson = ConvertTo-Json -InputObject $taskGroup -Depth 10 - -Add-VSTeamTaskGroup -Body $taskGroupJson -ProjectName "destinationProjectName" - - This example is useful for when one wants to copy an existing task group in one project into another project. - - - - - - Update-VSTeamTaskGroup - - - - Get-VSTeamTaskGroup - - - - Remove-VSTeamTaskGroup - - - - - - - Add-VSTeamUserEntitlement - Add - VSTeamUserEntitlement - - Add a user, assign license and extensions and make them a member of a project group in an account. - - - - Add a user, assign license and extensions and make them a member of a project group in an account. - - - - Add-VSTeamUserEntitlement - - 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 - - - License - - Type of Account License. The acceptable values for this parameter are: - - Advanced - - EarlyAdopter - - Express - - None - - Professional - - StakeHolder - - String - - String - - - EarlyAdopter - - - Group - - The acceptable values for this parameter are: - - Custom - - ProjectAdministrator - - ProjectContributor - - ProjectReader - - ProjectStakeholder - - String - - String - - - ProjectContributor - - - LicensingSource - - Licensing Source (e.g. Account. MSDN etc.). The acceptable values for this parameter are: - - account - - auto - - msdn - - none - - profile - - trial - - String - - String - - - account - - - MSDNLicenseType - - Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.). The acceptable values for this parameter are: - - eligible - - enterprise - - none - - platforms - - premium - - professional - - testProfessional - - ultimate - - String - - String - - - none - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - License - - Type of Account License. The acceptable values for this parameter are: - - Advanced - - EarlyAdopter - - Express - - None - - Professional - - StakeHolder - - String - - String - - - EarlyAdopter - - - Group - - The acceptable values for this parameter are: - - Custom - - ProjectAdministrator - - ProjectContributor - - ProjectReader - - ProjectStakeholder - - String - - String - - - ProjectContributor - - - LicensingSource - - Licensing Source (e.g. Account. MSDN etc.). The acceptable values for this parameter are: - - account - - auto - - msdn - - none - - profile - - trial - - String - - String - - - account - - - MSDNLicenseType - - Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.). The acceptable values for this parameter are: - - eligible - - enterprise - - none - - platforms - - premium - - professional - - testProfessional - - ultimate - - String - - String - - - none - - - - - - - System.Object - - - - - - - - - - - - - - - - - Add-VSTeamVariableGroup - Add - VSTeamVariableGroup - - Adds a variable group. - - - - Adds a variable group. - - - - Add-VSTeamVariableGroup - - 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 - - - Description - - The variable group description - - String - - String - - - None - - - Name - - The variable group name - - String - - String - - - None - - - ProviderData - - The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. - - Hashtable - - Hashtable - - - None - - - Type - - The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. - - - Vsts - AzureKeyVault - - String - - String - - - None - - - Variables - - The variable group variables. - - Hashtable - - Hashtable - - - None - - - - Add-VSTeamVariableGroup - - 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 - - - Body - - The json that represents the variable group as a string - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Description - - The variable group description - - String - - String - - - None - - - Name - - The variable group name - - String - - String - - - None - - - ProviderData - - The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. - - Hashtable - - Hashtable - - - None - - - Type - - The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. - - String - - String - - - None - - - Variables - - The variable group variables. - - Hashtable - - Hashtable - - - None - - - Body - - The json that represents the variable group as a string - - String - - String - - - None - - - - - - System.String - - - System.Collections.Hashtable - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "Vsts" - Variables = @{ - key1 = @{ - value = "value1" - } - key2 = @{ - value = "value2" - isSecret = $true - } - } -} - -Add-VSTeamVariableGroup @methodParameters - - - - - - -------------------------- EXAMPLE 2 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "AzureKeyVault" - Variables = @{ - name_of_existing_secret = @{ - enabled = $true - contentType = "" - value = "" - isSecret = $true - } - } - ProviderData = @{ - serviceEndpointId = "AzureRMServiceEndpointGuid" - vault = "name_of_existing_key_vault" - } -} - -Add-VSTeamVariableGroup @methodParameters - - - - - - -------------------------- EXAMPLE 3 -------------------------- - # Copy variable group varGroupName from project sourceProjectName to project targetProjectName. If varGroupName already exists, we'll update it; else, we'll add it. - -$Name = "varGroupName" -$FromProject = "sourceProjectName" -$ToProject = "targetProjectName" - -$FromVariableGroupObject = Get-VSTeamVariableGroup -Name $Name -ProjectName $FromProject -$body = ConvertTo-Json -InputObject $FromVariableGroupObject -Depth 100 -Compress -$toVariableGroupObject = Get-VSTeamVariableGroup -Name $Name -ProjectName $ToProject -if ($toVariableGroupObject) { - Update-VSTeamVariableGroup -Body $body -ProjectName $ToProject -Id $toVariableGroupObject.id -} -else { - Add-VSTeamVariableGroup -Body $body -ProjectName $ToProject -} - - - - - - - - Update-VSTeamVariableGroup - - - - Get-VSTeamVariableGroup - - - - Remove-VSTeamVariableGroup - - - - - - - Add-VSTeamWorkItem - Add - VSTeamWorkItem - - Adds a work item to your project. - - - - Add-VSTeamWorkItem will add a new work item to your project. - - - - Add-VSTeamWorkItem - - 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 - - - Title - - The title of the work item - - String - - String - - - None - - - Description - - The Description of the work item - - String - - String - - - None - - - IterationPath - - The IterationPath of the work item - - String - - String - - - None - - - AssignedTo - - The email address of the user this work item will be assigned to. - - String - - String - - - None - - - WorkItemType - - The type of work item to add. - You can tab complete from a list of available work item types. - You must use Set-VSTeamDefaultProject to set a default project to enable the tab completion. - - String - - String - - - None - - - ParentId - - The Id of the parent work item that this work item will be related to. - - Int - - Int - - - None - - - AdditionalFields - - Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'. - - Hashtable - - Hashtable - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Title - - The title of the work item - - String - - String - - - None - - - Description - - The Description of the work item - - String - - String - - - None - - - IterationPath - - The IterationPath of the work item - - String - - String - - - None - - - AssignedTo - - The email address of the user this work item will be assigned to. - - String - - String - - - None - - - WorkItemType - - The type of work item to add. - You can tab complete from a list of available work item types. - You must use Set-VSTeamDefaultProject to set a default project to enable the tab completion. - - String - - String - - - None - - - ParentId - - The Id of the parent work item that this work item will be related to. - - Int - - Int - - - None - - - AdditionalFields - - Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'. - - Hashtable - - Hashtable - - - None - - - - - - System.String - - - ProjectName - WorkItemType - - - - - - - WorkItemType is a dynamic parameter and use the default project value to query their validate set. - If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamWorkItem you will have to type in the names. - Any of the basic work item parameters defined in this method, will cause an exception if also added to the parameter AdditionalFields, since it is redundant. Either only use the parameter OR define them in the AdditionalFields parameter. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task - -ID Title Status --- ----- ------ -6 New Work Item To Do - - - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" - -ID Title Status --- ----- ------ -6 New Work Item To Do - - - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> $additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"} -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields - -ID Title Status --- ----- ------ -6 New Work Item To Do - - - - - - - - - - Add-VSTeamWorkItemAreaPermission - Add - VSTeamWorkItemAreaPermission - - Add Permissions to a Work Item Area - - - - Add Permissions to a Work Item Area - - - - Add-VSTeamWorkItemAreaPermission - - 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 - - - AreaID - - - - Int32 - - Int32 - - - None - - - AreaPath - - - - String - - String - - - None - - - Descriptor - - - - String - - String - - - None - - - User - - - - VSTeamUser - - VSTeamUser - - - None - - - Group - - - - VSTeamGroup - - VSTeamGroup - - - None - - - Allow - - - - VSTeamWorkItemAreaPermissions - - VSTeamWorkItemAreaPermissions - - - None - - - Deny - - - - VSTeamWorkItemAreaPermissions - - VSTeamWorkItemAreaPermissions - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - AreaID - - - - Int32 - - Int32 - - - None - - - AreaPath - - - - String - - String - - - None - - - Descriptor - - - - String - - String - - - None - - - User - - - - VSTeamUser - - VSTeamUser - - - None - - - Group - - - - VSTeamGroup - - VSTeamGroup - - - None - - - Allow - - - - VSTeamWorkItemAreaPermissions - - VSTeamWorkItemAreaPermissions - - - None - - - Deny - - - - VSTeamWorkItemAreaPermissions - - VSTeamWorkItemAreaPermissions - - - None - - - - - - - System.Object - - - - - - - - - - - - - - - - - Add-VSTeamWorkItemIterationPermission - Add - VSTeamWorkItemIterationPermission - - Add Permissions to an Iteration - - - - Add Permissions to an Iteration - - - - Add-VSTeamWorkItemIterationPermission - - 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 - - - IterationID - - - - Int32 - - Int32 - - - None - - - IterationPath - - - - String - - String - - - None - - - Descriptor - - - - String - - String - - - None - - - User - - - - VSTeamUser - - VSTeamUser - - - None - - - Group - - - - VSTeamGroup - - VSTeamGroup - - - None - - - Allow - - - - VSTeamWorkItemIterationPermissions - - VSTeamWorkItemIterationPermissions - - - None - - - Deny - - - - VSTeamWorkItemIterationPermissions - - VSTeamWorkItemIterationPermissions - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - IterationID - - - - Int32 - - Int32 - - - None - - - IterationPath - - - - String - - String - - - None - - - Descriptor - - - - String - - String - - - None - - - User - - - - VSTeamUser - - VSTeamUser - - - None - - - Group - - - - VSTeamGroup - - VSTeamGroup - - - None - - - Allow - - - - VSTeamWorkItemIterationPermissions - - VSTeamWorkItemIterationPermissions - - - None - - - Deny - - - - VSTeamWorkItemIterationPermissions - - VSTeamWorkItemIterationPermissions - - - None - - - - - - - System.Object - - - - - - - - - - - - - - - - - Clear-VSTeamDefaultAPITimeout - Clear - VSTeamDefaultAPITimeout - - Clears the value stored in the default timeout parameter value. - - - - Clears the value stored in the default timeout parameter value. - - - - Clear-VSTeamDefaultAPITimeout - - Level - - On Windows allows you to clear your default timeout at the Process, User or Machine levels. - - String - - String - - - None - - - - - - Level - - On Windows allows you to clear your default timeout at the Process, User or Machine levels. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Clear-VSTeamDefaultAPITimeout - - This will clear the default timeout parameter value. - - - - - - Set-VSTeamDefaultAPITimeout - - - - Set-VSTeamAccount - - - - - - - Clear-VSTeamDefaultProject - Clear - VSTeamDefaultProject - - Clears the value stored in the default project parameter value. - - - - Clears the value stored in the default project parameter value. - - - - Clear-VSTeamDefaultProject - - Level - - On Windows allows you to clear your default project at the Process, User or Machine levels. - - String - - String - - - None - - - - - - Level - - On Windows allows you to clear your default project at the Process, User or Machine levels. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Clear-VSTeamDefaultProject - - This will clear the default project parameter value. You will now have to provide a project for any functions that require a project. - - - - - - Set-VSTeamDefaultProject - - - - Set-VSTeamAccount - - - - - - - Disable-VSTeamAgent - Disable - VSTeamAgent - - Disables an agent in a pool. - - - - Disables an agent in a pool. - - - - Disable-VSTeamAgent - - PoolId - - Id of the pool. - - int - - int - - - None - - - Id - - Id of the agent to disable. - - int[] - - int[] - - - None - - - - - - PoolId - - Id of the pool. - - int - - int - - - None - - - Id - - Id of the agent to disable. - - int[] - - int[] - - - None - - - - - - System.String - - - - - - - - - - - - - - - - - - Enable-VSTeamAgent - Enable - VSTeamAgent - - Enables an agent in a pool. - - - - Enables an agent in a pool. - - - - Enable-VSTeamAgent - - PoolId - - Id of the pool. - - int - - int - - - None - - - Id - - Id of the agent to enable. - - int[] - - int[] - - - None - - - - - - PoolId - - Id of the pool. - - int - - int - - - None - - - Id - - Id of the agent to enable. - - int[] - - int[] - - - None - - - - - - System.String - - - - - - - - - - - - - - - - - - Get-VSTeam - Get - VSTeam - - Returns a team. - - - - Returns a team. - - - - Get-VSTeam - - 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 - - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - - Get-VSTeam - - 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 - - - TeamId - - The id of the team to retrieve. - - String[] - - String[] - - - None - - - - Get-VSTeam - - 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 - - - Name - - The name of the team to retrieve. - - String[] - - String[] - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - - - TeamId - - The id of the team to retrieve. - - String[] - - String[] - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - Name - - The name of the team to retrieve. - - String[] - - String[] - - - None - - - - - - - Team.Team - - - - - - - - - - - - - - - - - Get-VSTeamAccessControlList - Get - VSTeamAccessControlList - - Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. - - - - Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. - - - - Get-VSTeamAccessControlList - - SecurityNamespace - - Security namespace identifier. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - - String - - String - - - None - - - Token - - Security token - - String - - String - - - None - - - Descriptors - - An optional filter string containing a list of identity descriptors whose ACEs should be retrieved. If this is not set entire ACLs will be returned. - - String - - String - - - None - - - IncludeExtendedInfo - - If set, populate the extended information properties for the access control entries contained in the returned lists. - - - SwitchParameter - - - False - - - Recurse - - If true and this is a hierarchical namespace, return child ACLs of the specified token. - - - SwitchParameter - - - False - - - - - - SecurityNamespace - - Security namespace identifier. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - - String - - String - - - None - - - Token - - Security token - - String - - String - - - None - - - Descriptors - - An optional filter string containing a list of identity descriptors whose ACEs should be retrieved. If this is not set entire ACLs will be returned. - - String - - String - - - None - - - IncludeExtendedInfo - - If set, populate the extended information properties for the access control entries contained in the returned lists. - - SwitchParameter - - SwitchParameter - - - False - - - Recurse - - If true and this is a hierarchical namespace, return child ACLs of the specified token. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - VSTeamAccessControlList - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList - - - - - - - - - - Get-VSTeamAgent - Get - VSTeamAgent - - Returns the agents in a pool. - - - - Returns the agents in a pool. - - - - Get-VSTeamAgent - - PoolId - - Id of the pool. - - String - - String - - - None - - - Id - - Id of the agent to return. - - String - - String - - - None - - - - - - PoolId - - Id of the pool. - - String - - String - - - None - - - Id - - Id of the agent to return. - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - To read system capabilities that contain dots you have to use the PSObject Properties property. - (Get-VSTeamAgent 1 91).systemCapabilities.PSObject.Properties['Agent.OS'].Value - - - - - - - - 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 - Get - VSTeamApproval - - Gets a list of approvals for all releases for a team project. - - - - The Get-VSTeamApproval function gets the approvals for all releases for a team project. - With just a project name, this function gets all of the pending approvals for that team project. - When using with AzD "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter is not empty. - When using with TFS "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter, Release Id Filter are not empty and Status Filter equals Pending. - The Team.Approval type has three custom table formats: - - Pending: ID, Status, Release Name, Environment, Type, Approver Name, Release Definitions - - Approved: Release Name, Environment, Is Automated, Approval Type, Approver Name, Release Definitions, Comments - - Rejected: Release Name, Environment, Approval Type, Approver Name, Release Definition, Comments - - - - Get-VSTeamApproval - - 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 - - - StatusFilter - - By default the function returns Pending approvals. - Using this filter you can return Approved, ReAssigned or Rejected approvals. - There is a custom table view for each status. - - String - - String - - - None - - - ReleaseIdsFilter - - Only approvals for the release ids provided will be returned. - - Int32[] - - Int32[] - - - None - - - AssignedToFilter - - Approvals are filtered to only those assigned to this user. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - StatusFilter - - By default the function returns Pending approvals. - Using this filter you can return Approved, ReAssigned or Rejected approvals. - There is a custom table view for each status. - - String - - String - - - None - - - ReleaseIdsFilter - - Only approvals for the release ids provided will be returned. - - Int32[] - - Int32[] - - - None - - - AssignedToFilter - - Approvals are filtered to only those assigned to this user. - - String - - String - - - None - - - - - - - Team.BuildDefinition - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build definition IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamApproval -ProjectName Demo - - This command gets a list of all pending approvals. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamApproval -ProjectName Demo -StatusFilter Approved | Format-Table -View Approved - - This command gets a list of all approved approvals using a custom table format. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamApproval -ProjectName Demo -AssignedToFilter Administrator -StatusFilter Rejected | FT -View Rejected - - This command gets a list of all approvals rejected by Administrator using a custom table format. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamBuildDefinition - - - - Remove-VSTeamBuildDefinition - - - - - - - Get-VSTeamArea - Get - VSTeamArea - - Gets the area node for a given area path. - - - - Gets the area node for a given area path. - - - - Get-VSTeamArea - - 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 - - - Depth - - Depth of children to fetch. - - int32 - - int32 - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - Ids - - Integer classification nodes ids. - - int32[] - - int32[] - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Depth - - Depth of children to fetch. - - int32 - - int32 - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - Ids - - Integer classification nodes ids. - - int32[] - - int32[] - - - None - - - - - - - System.Object - - - - - - - - - This is a wrapper function for Get-VSTeamClassificationNode - - - - - - Get-VSTeamClassificationNode - - - - Get-VSTeamIteration - - - - - - - Get-VSTeamBuild - Get - VSTeamBuild - - Gets the builds for a team project. - - - - The Get-VSTeamBuild function gets the builds for a team project. - With just a project name, this function gets all of the builds for that team project. - You can also specify a particular build by ID. - - - - Get-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 - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - 0 - - - ResultFilter - - Specifies the result of the builds to return Succeeded, PartiallySucceeded, Failed, or Canceled. - - String - - String - - - None - - - ReasonFilter - - Specifies the reason the build was created of the builds to return Manual, IndividualCI, BatchedCI, Schedule, UserCreated, ValidateShelveSet, CheckInShelveSet, Triggered, or All. - - String - - String - - - None - - - StatusFilter - - Specifies the status of the builds to return InProgress, Completed, Cancelling, Postponed, NotStarted, or All. - - String - - String - - - None - - - Queues - - A comma-delimited list of queue IDs that specifies the builds to return. - - Int32[] - - Int32[] - - - None - - - Definitions - - A comma-delimited list of build definition IDs that specifies the builds to return. - - Int32[] - - Int32[] - - - None - - - BuildNumber - - Returns the build with this build number. - You can also use * for a starts with search. For example: 2015* Will return all build numbers that start with 2015. - - String - - String - - - None - - - Type - - The type of builds to retrieve. - - String - - String - - - None - - - MaxBuildsPerDefinition - - The maximum number of builds to retrieve for each definition. - This is only valid when definitions is also specified. - - Int32 - - Int32 - - - None - - - Properties - - A comma-delimited list of extended properties to retrieve. - - String[] - - String[] - - - None - - - Id - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - - Get-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 - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - SwitchParameter - - - False - - - - Get-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 - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - 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 - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - 0 - - - ResultFilter - - Specifies the result of the builds to return Succeeded, PartiallySucceeded, Failed, or Canceled. - - String - - String - - - None - - - ReasonFilter - - Specifies the reason the build was created of the builds to return Manual, IndividualCI, BatchedCI, Schedule, UserCreated, ValidateShelveSet, CheckInShelveSet, Triggered, or All. - - String - - String - - - None - - - StatusFilter - - Specifies the status of the builds to return InProgress, Completed, Cancelling, Postponed, NotStarted, or All. - - String - - String - - - None - - - Queues - - A comma-delimited list of queue IDs that specifies the builds to return. - - Int32[] - - Int32[] - - - None - - - Definitions - - A comma-delimited list of build definition IDs that specifies the builds to return. - - Int32[] - - Int32[] - - - None - - - BuildNumber - - Returns the build with this build number. - You can also use * for a starts with search. For example: 2015* Will return all build numbers that start with 2015. - - String - - String - - - None - - - Type - - The type of builds to retrieve. - - String - - String - - - None - - - MaxBuildsPerDefinition - - The maximum number of builds to retrieve for each definition. - This is only valid when definitions is also specified. - - Int32 - - Int32 - - - None - - - Properties - - A comma-delimited list of extended properties to retrieve. - - String[] - - String[] - - - None - - - Id - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - SwitchParameter - - SwitchParameter - - - False - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - Team.Build - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamBuild -ProjectName demo | Format-List * - - This command gets a list of all builds in the demo project. - The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the build objects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamBuild -ProjectName demo -top 5 -resultFilter failed - - This command gets a list of 5 failed builds in the demo project. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> 1203,1204 | Get-VSTeamBuild -ProjectName demo - - This command gets builds with IDs 1203 and 1204 by using the pipeline. - - - - -------------------------- EXAMPLE 4 -------------------------- - PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203,1204 - - This command gets builds with IDs 1203 and 1204 by using the ID parameter. - - - - -------------------------- EXAMPLE 5 -------------------------- - PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203 -Raw - - This command returns the raw object returned from the server. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamBuild - - - - Remove-VSTeamBuild - - - - - - - Get-VSTeamBuildArtifact - Get - VSTeamBuildArtifact - - Returns the artifacts of a build. - - - - Returns the artifacts of a build. - - - - Get-VSTeamBuildArtifact - - 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 - - - - - - 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 - - - - - - - System.Object - - - - - - - - - - - - - - - - - Get-VSTeamBuildDefinition - Get - VSTeamBuildDefinition - - Gets the build definitions for a team project. - - - - The Get-VSTeamBuildDefinition function gets the build definitions for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - With just a project name, this function gets all of the build definitions for that team project. - You can also specify a particular build definition by ID. - - - - Get-VSTeamBuildDefinition - - 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 - - - Filter - - Filters to definitions whose names equal this value. Append a * to filter to definitions whose names start with this value. For example: MS* - - String - - String - - - None - - - Type - - The type of the build definitions to retrieve. The acceptable values for this parameter are: - - build - - xaml - - All - - String - - String - - - All - - - - Get-VSTeamBuildDefinition - - 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 - - Specifies one or more build definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build definition, type Get-VSTeamBuildDefinition. - - Int32[] - - Int32[] - - - None - - - Revision - - Specifies the specific revision number of the definition to retrieve. - - Int32 - - Int32 - - - -1 - - - - Get-VSTeamBuildDefinition - - 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 - - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - SwitchParameter - - - False - - - - Get-VSTeamBuildDefinition - - 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 - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - 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 - - - Filter - - Filters to definitions whose names equal this value. Append a * to filter to definitions whose names start with this value. For example: MS* - - String - - String - - - None - - - Type - - The type of the build definitions to retrieve. The acceptable values for this parameter are: - - build - - xaml - - All - - String - - String - - - All - - - Id - - Specifies one or more build definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build definition, type Get-VSTeamBuildDefinition. - - Int32[] - - Int32[] - - - None - - - Revision - - Specifies the specific revision number of the definition to retrieve. - - Int32 - - Int32 - - - -1 - - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - SwitchParameter - - SwitchParameter - - - False - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - Team.BuildDefinition - - - - - - - - - You can pipe build definition IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo | Format-List * - - This command gets a list of all build definitions in the demo project. - The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the build definition objects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Json - - This command returns the raw object returned from the server formatted as a JSON string. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Raw - - This command returns the raw object returned from the server. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamBuildDefinition - - - - Remove-VSTeamBuildDefinition - - - - - - - Get-VSTeamBuildLog - Get - VSTeamBuildLog - - Displays the logs for the build. - - - - Displays the logs for the build. - - - - Get-VSTeamBuildLog - - 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 - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Index - - Each task stores its logs in an array. If you know the index of a specific task you can return just its logs. If you do not provide a value all the logs are displayed. - - Int32 - - Int32 - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Index - - Each task stores its logs in an array. If you know the index of a specific task you can return just its logs. If you do not provide a value all the logs are displayed. - - Int32 - - Int32 - - - None - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamBuild -Top 1 | Get-VSTeamBuildLog - - This command displays the logs of the first build. - The pipeline operator (|) passes the build id to the Get-VSTeamBuildLog cmdlet, which displays the logs. - - - - - - - - Get-VSTeamBuildTag - Get - VSTeamBuildTag - - Returns all the tags of a build. - - - - Returns all the tags of a build. - - - - Get-VSTeamBuildTag - - 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 - - - - - - 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 - - - - - - - System.Object - - - - - - - - - - - - - - - - - Get-VSTeamBuildTimeline - Get - VSTeamBuildTimeline - - Get the timelines for builds - - - - The Get-VSTeamBuildTimeline function gets the timelines for a build. - With just a project name and the build id, this function gets all the timelines of a build for that team project. - You can also specify a particular timeline by ID to get . - - - - Get-VSTeamBuildTimeline - - 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 - - - BuildId - - Build id where you get the time line from - - int[] - - int[] - - - None - - - Id - - Returns the timelines with the given timeline id. - - Guid - - Guid - - - None - - - ChangeId - - Returns the timelines with the given change id. - - Int32 - - Int32 - - - None - - - PlanId - - Returns the timelines with the given plan id. - - Guid - - Guid - - - None - - - Id - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - BuildId - - Build id where you get the time line from - - int[] - - int[] - - - None - - - Id - - Returns the timelines with the given timeline id. - - Guid - - Guid - - - None - - - ChangeId - - Returns the timelines with the given change id. - - Int32 - - Int32 - - - None - - - PlanId - - Returns the timelines with the given plan id. - - Guid - - Guid - - - None - - - Id - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - - - - - Team.Build - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 | Format-List * - - This command gets a list of all timelines of thr build with Id 1 in the demo project. - The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the timeline objects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 -Id 595dac0c-0f1a-4bfd-a35f-e5a838ac71d7 -ChangeId 2 -PlanId 356de525-47a9-4251-80c6-d3849a9d6382 - - This command gets the timelines with ID 1 and timeline id 595dac0c-0f1a-4bfd-a35f-e5a838ac71d7. It is filtered with the change ID and plan ID. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 -ID @(1,2) - - This command gets timelines with IDs 1 and 2 by using the ID parameter. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Get-VSTeamBuild - - - - - - - Get-VSTeamClassificationNode - Get - VSTeamClassificationNode - - Gets the classification node for a given node path. - - - - Gets the classification node for a given node path. - - - - Get-VSTeamClassificationNode - - 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 - - - StructureGroup - - Structure group of the classification node, area or iteration. - - string - - string - - - None - - - Depth - - Depth of children to fetch. - - int32 - - int32 - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - Ids - - Integer classification nodes ids. - - int32[] - - int32[] - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - StructureGroup - - Structure group of the classification node, area or iteration. - - string - - string - - - None - - - Depth - - Depth of children to fetch. - - int32 - - int32 - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - Ids - - Integer classification nodes ids. - - int32[] - - int32[] - - - None - - - - - - - System.Object - - - - - - - - - This function is the base function for Get-VSTeamArea and Get-VSTeamIteration. - - - - - - Get-VSTeamArea - - - - Get-VSTeamIteration - - - - - - - Get-VSTeamCloudSubscription - Get - VSTeamCloudSubscription - - Gets the Azure subscriptions associated with the Team Services account. - - - - The Get-VSTeamCloudSubscription function gets the Azure subscriptions associated with the Team Services account. - - - - Get-VSTeamCloudSubscription - - - - - - - None - - - - - - - - - - Team.AzureSubscription - - - - - - - - - This function currently is not supported in TFS. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamCloudSubscription - - This command gets a list of all Azure subscriptions associated with the Team Services account. - - - - - - Set-VSTeamAccount - - - - - - - Get-VSTeamDescriptor - Get - VSTeamDescriptor - - Resolve a storage key to a descriptor. - - - - Resolve a storage key to a descriptor. - - - - Get-VSTeamDescriptor - - StorageKey - - Storage key of the subject (user, group, scope, etc.) to resolve - - String - - String - - - None - - - - - - StorageKey - - Storage key of the subject (user, group, scope, etc.) to resolve - - String - - String - - - None - - - - - - - - - - - - - - - Get-VSTeamExtension - Get - VSTeamExtension - - Get the installed extensions in the specified Azure DevOps or Team Foundation Server project. - - - - Get the installed extensions in the specified Azure DevOps or Team Foundation Server project. - - - - Get-VSTeamExtension - - PublisherId - - The id of the publisher. - - String - - String - - - None - - - ExtensionId - - The id of the extension. - - String - - String - - - None - - - - Get-VSTeamExtension - - IncludeInstallationIssues - - If true (the default), include installed extensions with issues. - - - SwitchParameter - - - False - - - IncludeDisabledExtensions - - If true (the default), include disabled extensions in the results. - - - SwitchParameter - - - False - - - IncludeErrors - - If true, include installed extensions with errors. - - - SwitchParameter - - - False - - - - - - PublisherId - - The id of the publisher. - - String - - String - - - None - - - ExtensionId - - The id of the extension. - - String - - String - - - None - - - IncludeInstallationIssues - - If true (the default), include installed extensions with issues. - - SwitchParameter - - SwitchParameter - - - False - - - IncludeDisabledExtensions - - If true (the default), include disabled extensions in the results. - - SwitchParameter - - SwitchParameter - - - False - - - IncludeErrors - - If true, include installed extensions with errors. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - - Add-VSTeamExtension - - - - Get-VSTeamExtension - - - - Remove-VSTeamExtension - - - - Update-VSTeamExtension - - - - - - - Get-VSTeamFeed - Get - VSTeamFeed - - Returns a list of package feeds for the account. - - - - Get-VSTeamFeed gets all the feeds for the account - - - - Get-VSTeamFeed - - FeedId - - Specifies the ID of the feed. - - Guid - - Guid - - - None - - - - - - FeedId - - Specifies the ID of the feed. - - Guid - - Guid - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamFeed - - This command returns all the package feeds for the account. - - - - - - - - Get-VSTeamGitCommit - Get - VSTeamGitCommit - - Retrieve git commits for a project - - - - The Get-VSTeamGitCommit function gets the commits for a git repository. - - - - Get-VSTeamGitCommit - - 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 - - - RepositoryId - - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - - Guid - - Guid - - - None - - - FromDate - - If provided, only include history entries created after this date (string) - - DateTime - - DateTime - - - None - - - ToDate - - If provided, only include history entries created before this date (string) - - DateTime - - DateTime - - - None - - - ItemVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - ItemVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit) - - String - - String - - - None - - - ItemVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - CompareVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous) - - String - - String - - - None - - - FromCommitId - - If provided, a lower bound for filtering commits alphabetically - - String - - String - - - None - - - ToCommitId - - If provided, an upper bound for filtering commits alphabetically - - String - - String - - - None - - - Author - - Alias or display name of the author - - String - - String - - - None - - - ItemPath - - Path of item to search under - - String - - String - - - None - - - ExcludeDeletes - - Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. - - - SwitchParameter - - - False - - - Top - - Maximum number of entries to retrieve - - Int32 - - Int32 - - - None - - - Skip - - Number of entries to skip - - Int32 - - Int32 - - - None - - - User - - Alias or display name of the committer - - String - - String - - - None - - - - Get-VSTeamGitCommit - - 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 - - - RepositoryId - - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - - Guid - - Guid - - - None - - - FromDate - - If provided, only include history entries created after this date (string) - - DateTime - - DateTime - - - None - - - ToDate - - If provided, only include history entries created before this date (string) - - DateTime - - DateTime - - - None - - - ItemVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - ItemVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit) - - String - - String - - - None - - - ItemVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - CompareVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous) - - String - - String - - - None - - - FromCommitId - - If provided, a lower bound for filtering commits alphabetically - - String - - String - - - None - - - ToCommitId - - If provided, an upper bound for filtering commits alphabetically - - String - - String - - - None - - - Author - - Alias or display name of the author - - String - - String - - - None - - - Top - - Maximum number of entries to retrieve - - Int32 - - Int32 - - - None - - - Skip - - Number of entries to skip - - Int32 - - Int32 - - - None - - - User - - Alias or display name of the committer - - String - - String - - - None - - - - Get-VSTeamGitCommit - - 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 - - - RepositoryId - - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - - Guid - - Guid - - - None - - - FromDate - - If provided, only include history entries created after this date (string) - - DateTime - - DateTime - - - None - - - ToDate - - If provided, only include history entries created before this date (string) - - DateTime - - DateTime - - - None - - - ItemVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - ItemVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit) - - String - - String - - - None - - - ItemVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - CompareVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous) - - String - - String - - - None - - - FromCommitId - - If provided, a lower bound for filtering commits alphabetically - - String - - String - - - None - - - ToCommitId - - If provided, an upper bound for filtering commits alphabetically - - String - - String - - - None - - - Author - - Alias or display name of the author - - String - - String - - - None - - - Top - - Maximum number of entries to retrieve - - Int32 - - Int32 - - - None - - - Skip - - Number of entries to skip - - Int32 - - Int32 - - - None - - - User - - Alias or display name of the committer - - String - - String - - - None - - - - Get-VSTeamGitCommit - - 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 - - - RepositoryId - - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - - Guid - - Guid - - - None - - - FromDate - - If provided, only include history entries created after this date (string) - - DateTime - - DateTime - - - None - - - ToDate - - If provided, only include history entries created before this date (string) - - DateTime - - DateTime - - - None - - - ItemVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - ItemVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit) - - String - - String - - - None - - - ItemVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - CompareVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous) - - String - - String - - - None - - - FromCommitId - - If provided, a lower bound for filtering commits alphabetically - - String - - String - - - None - - - ToCommitId - - If provided, an upper bound for filtering commits alphabetically - - String - - String - - - None - - - Author - - Alias or display name of the author - - String - - String - - - None - - - ItemPath - - Path of item to search under - - String - - String - - - None - - - ExcludeDeletes - - Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. - - - SwitchParameter - - - False - - - Top - - Maximum number of entries to retrieve - - Int32 - - Int32 - - - None - - - Skip - - Number of entries to skip - - Int32 - - Int32 - - - None - - - HistoryMode - - What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. The acceptable values for this parameter are: - - firstParent - - fullHistory - - fullHistorySimplifyMerges - - simplifiedHistory - - String - - String - - - None - - - User - - Alias or display name of the committer - - String - - String - - - None - - - - Get-VSTeamGitCommit - - 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 - - - RepositoryId - - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - - Guid - - Guid - - - None - - - Ids - - If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - RepositoryId - - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - - Guid - - Guid - - - None - - - FromDate - - If provided, only include history entries created after this date (string) - - DateTime - - DateTime - - - None - - - ToDate - - If provided, only include history entries created before this date (string) - - DateTime - - DateTime - - - None - - - ItemVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - ItemVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit) - - String - - String - - - None - - - ItemVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - CompareVersionVersion - - Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - CompareVersionVersionOptions - - Version options - Specify additional modifiers to version (e.g Previous) - - String - - String - - - None - - - FromCommitId - - If provided, a lower bound for filtering commits alphabetically - - String - - String - - - None - - - ToCommitId - - If provided, an upper bound for filtering commits alphabetically - - String - - String - - - None - - - Author - - Alias or display name of the author - - String - - String - - - None - - - Ids - - If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. - - String - - String - - - None - - - ItemPath - - Path of item to search under - - String - - String - - - None - - - ExcludeDeletes - - Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. - - SwitchParameter - - SwitchParameter - - - False - - - Top - - Maximum number of entries to retrieve - - Int32 - - Int32 - - - None - - - Skip - - Number of entries to skip - - Int32 - - Int32 - - - None - - - HistoryMode - - What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. The acceptable values for this parameter are: - - firstParent - - fullHistory - - fullHistorySimplifyMerges - - simplifiedHistory - - String - - String - - - None - - - User - - Alias or display name of the committer - - String - - String - - - None - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets commits. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe a repository ID to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamGitCommit -ProjectName demo -RepositoryId 118C262F-0D4C-4B76-BD9B-7DD8CA12F196 - - This command gets a list of all commits in the demo project for a specific repository. - - - - - - - - Get-VSTeamGitRef - Get - VSTeamGitRef - - Queries the provided repository for its refs and returns them. - - - - Get-VSTeamGitRef gets all the refs for the provided repository. - - - - Get-VSTeamGitRef - - 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 - - - RepositoryId - - Specifies the ID of the repository. - - Guid - - Guid - - - None - - - Filter - - A filter to apply to the refs (starts with). - - string - - string - - - None - - - FilterContains - - A filter to apply to the refs (contains). (Azure DevOps Service and Azure DevOps Server 2019+ only) - - string - - string - - - None - - - Top - - Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuationToken is, top will default to 100. (Azure DevOps Service and Azure DevOps Server 2019+ only) - - int - - int - - - None - - - ContinuationToken - - The continuation token used for pagination. (Azure DevOps Service and Azure DevOps Server 2019+ only) - - string - - string - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - RepositoryId - - Specifies the ID of the repository. - - Guid - - Guid - - - None - - - Filter - - A filter to apply to the refs (starts with). - - string - - string - - - None - - - FilterContains - - A filter to apply to the refs (contains). (Azure DevOps Service and Azure DevOps Server 2019+ only) - - string - - string - - - None - - - Top - - Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuationToken is, top will default to 100. (Azure DevOps Service and Azure DevOps Server 2019+ only) - - int - - int - - - None - - - ContinuationToken - - The continuation token used for pagination. (Azure DevOps Service and Azure DevOps Server 2019+ only) - - string - - string - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamGitRef -ProjectName Demo - - This command returns all the Git refs for the Demo team project. - - - - - - - - Get-VSTeamGitRepository - Get - VSTeamGitRepository - - Get all the repositories in your Azure DevOps or Team Foundation Server account, or a specific project. - - - - Get-VSTeamGitRepository gets all the repositories in your Azure DevOps or Team Foundation Server account, or a specific project. - - - - Get-VSTeamGitRepository - - 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 - - Specifies one or more repositories by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a repository, type Get-VSTeamGitRepository. - - Guid[] - - Guid[] - - - None - - - - Get-VSTeamGitRepository - - 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 - - - Name - - Specifies one or more repositories by name. - To specify multiple names, use commas to separate the names. - To find the name of a repository, type Get-VSTeamGitRepository. - - String[] - - String[] - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies one or more repositories by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a repository, type Get-VSTeamGitRepository. - - Guid[] - - Guid[] - - - None - - - Name - - Specifies one or more repositories by name. - To specify multiple names, use commas to separate the names. - To find the name of a repository, type Get-VSTeamGitRepository. - - String[] - - String[] - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamGitRepository - - This command returns all the Git repositories for your TFS or Team Services account. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamGitRepository -ProjectName Demo - - This command returns all the Git repositories for the Demo team project. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> git clone (Get-VSTeamGitRepository | select -ExpandProperty remoteUrl) - - This command gets the remote URL and passes it to git clone command. - - - - - - - - Get-VSTeamGitStat - Get - VSTeamGitStat - - Retrieves statistics about branches within a repository. - - - - Retrieves statistics about branches within a repository. - - - - Get-VSTeamGitStat - - 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 - - - RepositoryId - - Specifies the ID of the repository. - - Guid - - Guid - - - None - - - BranchName - - Name of the branch. - - String - - String - - - None - - - VersionOptions - - Version options - Specify additional modifiers to version (e.g Previous). Valid options for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - Version - - Version string identifier (name of tag/branch, SHA1 of commit) - - String - - String - - - None - - - VersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. Valid options for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - RepositoryId - - Specifies the ID of the repository. - - Guid - - Guid - - - None - - - BranchName - - Name of the branch. - - String - - String - - - None - - - VersionOptions - - Version options - Specify additional modifiers to version (e.g Previous). Valid options for this parameter are: - - firstParent - - none - - previousChange - - String - - String - - - None - - - Version - - Version string identifier (name of tag/branch, SHA1 of commit) - - String - - String - - - None - - - VersionType - - Version type (branch, tag, or commit). Determines how Id is interpreted. Valid options for this parameter are: - - branch - - commit - - tag - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD - - This command returns all the Git stats for the entire repository - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop - - This command returns all the Git stats for a specific branch - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop -VersionType branch -Version 67cae2b029dff7eb3dc062b49403aaedca5bad8d - - This command returns all the Git stats for a specific commit - - - - - - - - Get-VSTeamGroup - Get - VSTeamGroup - - Returns a Group or List of Groups. - - - - Returns a Group or List of Groups. - - - - Get-VSTeamGroup - - 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 - - - SubjectTypes - - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vssgp (Azure DevOps Group) - - aadgp (Azure Active Directory Group) - - String[] - - String[] - - - None - - - ScopeDescriptor - - Specify a non-default scope (collection, project) to search for groups. - - String - - String - - - None - - - - Get-VSTeamGroup - - 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 - - - SubjectTypes - - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vssgp (Azure DevOps Group) - - aadgp (Azure Active Directory Group) - - String[] - - String[] - - - None - - - - Get-VSTeamGroup - - 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 - - - Descriptor - - The descriptor of the desired graph group. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - SubjectTypes - - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vssgp (Azure DevOps Group) - - aadgp (Azure Active Directory Group) - - String[] - - String[] - - - None - - - ScopeDescriptor - - Specify a non-default scope (collection, project) to search for groups. - - String - - String - - - None - - - Descriptor - - The descriptor of the desired graph group. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' - - Assigns Endpoint Administrators group to $group variable. - - - - - - - - Get-VSTeamInfo - Get - VSTeamInfo - - Displays your current account and default project. - - - - Displays your current account and default project. - - - - Get-VSTeamInfo - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamInfo - - This will display your current account and default project - - - - - - Set-VSTeamAccount - - - - - - - Get-VSTeamIteration - Get - VSTeamIteration - - Gets the iteration node for a given iteration path. - - - - Gets the iteration node for a given iteration path. - - - - Get-VSTeamIteration - - 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 - - - Depth - - Depth of children to fetch. - - int32 - - int32 - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - Ids - - Integer classification nodes ids. - - int32[] - - int32[] - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Depth - - Depth of children to fetch. - - int32 - - int32 - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - Ids - - Integer classification nodes ids. - - int32[] - - int32[] - - - None - - - - - - - System.Object - - - - - - - - - This is a wrapper function for Get-VSTeamClassificationNode - - - - - - Get-VSTeamClassificationNode - - - - Get-VSTeamIteration - - - - - - - Get-VSTeamJobRequest - Get - VSTeamJobRequest - - Returns all the job requests of an agent. - - - - Returns all the job requests of an agent. - - - - Get-VSTeamJobRequest - - PoolId - - Id of the pool. - - String - - String - - - None - - - AgentId - - Id of the agent to return. - - String - - String - - - None - - - CompletedRequestCount - - The number of requests to return. - - Int32 - - Int32 - - - None - - - - - - PoolId - - Id of the pool. - - String - - String - - - None - - - AgentId - - Id of the agent to return. - - String - - String - - - None - - - CompletedRequestCount - - The number of requests to return. - - Int32 - - Int32 - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamJobRequest 1 111 - - This will display all the job request of agent with id 111 under the pool with id 1. - - - - - - - - Get-VSTeamMember - Get - VSTeamMember - - Returns a team member. - - - - Returns a team member. - - - - Get-VSTeamMember - - 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 - - - TeamId - - The id of the team to search. - - String - - String - - - None - - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - - - TeamId - - The id of the team to search. - - String - - String - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - - - - - Team.Team - - - - - - - - - - - - - - - - - Get-VSTeamMembership - Get - VSTeamMembership - - Gets a memberships for a container or member. - - - - Gets a memberships for a container or member. - - - - Get-VSTeamMembership - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - - Get-VSTeamMembership - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - - - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - (Get-VSTeamMembership -MemberDescriptor $user.ID).value | % { Get-VSTeamGroup -Descriptor $_.containerDescriptor } - - Get all the groups for a user - - - - -------------------------- EXAMPLE 2 -------------------------- - (Get-VSTeamMembership -ContainerDescriptor $group.id).value | % {Get-VSTeamUser -Descriptor $_.memberDescriptor } - - Get all the members for a group - - - - - - Get-VsTeamUser - - - - Get-VsTeamGroup - - - - Add-VsTeamMembership - - - - Remove-VsTeamMembership - - - - Test-VsTeamMembership - - - - - - - Get-VSTeamOption - Get - VSTeamOption - - Returns all the versions of supported APIs of your TFS or AzD. - - - - Returns all the versions of supported APIs of your TFS or AzD. - There are two table formats defined for the Team.Option type, Default and Versions. - Default view contains Name, Area, Max Version and URI Template. - Version view contains Name, Area, Min Version, Max Version, Released Version and Resource Version. - - - - Get-VSTeamOption - - SubDomain - - Returns options for that sub domain APIs. Some examples include: - - vsaex = Member Entitlement Management - - feeds = Artifacts - - vsrm = Release Management - - vssps = Graph - - extmgmt = Extensions - - String - - String - - - None - - - Area - - Returns options for that area's APIs. - - String - - String - - - None - - - Resource - - Returns options for that resource's APIs. - - String - - String - - - None - - - - - - SubDomain - - Returns options for that sub domain APIs. Some examples include: - - vsaex = Member Entitlement Management - - feeds = Artifacts - - vsrm = Release Management - - vssps = Graph - - extmgmt = Extensions - - String - - String - - - None - - - Area - - Returns options for that area's APIs. - - String - - String - - - None - - - Resource - - Returns options for that resource's APIs. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamOption - - This will display all the versions of supported APIs for your account using the 'Default' table format. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamOption | Format-Table -View Versions - - This will display all the versions of supported APIs for your account using the 'Versions' custom table format. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamOption -SubDomain vsrm - - 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. - - - - - - Set-VSTeamAccount - - - - - - - Get-VSTeamPermissionInheritance - Get - VSTeamPermissionInheritance - - Returns true or false. - - - - Returns true or false. - - - - Get-VSTeamPermissionInheritance - - 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 - - - Name - - Specifies the name of the resource. - - String - - String - - - None - - - ResourceType - - Specifies the type of resource. The acceptable values for this parameter are: - - Repository - - BuildDefinition - - ReleaseDefinition - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Name - - Specifies the name of the resource. - - String - - String - - - None - - - ResourceType - - Specifies the type of resource. The acceptable values for this parameter are: - - Repository - - BuildDefinition - - ReleaseDefinition - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition - - This command returns true or false. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamBuildDefinition | Get-VSTeamPermissionInheritance -ResourceType BuildDefinition - - This command returns true or false for every build definition returned from Get-VSTeamBuildDefinition. - - - - - - Add-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Get-VSTeamPermissionInheritanceType - - - - - - - Get-VSTeamPolicy - Get - VSTeamPolicy - - Get the code policies in the specified Azure DevOps or Team Foundation Server project. - - - - Get the code policies in the specified Azure DevOps or Team Foundation Server project. - - - - Get-VSTeamPolicy - - 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 - - Specifies one code policy by id. - The id is an integer. Unique within each project. - - Int - - Int - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies one code policy by id. - The id is an integer. Unique within each project. - - Int - - Int - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamPolicy -ProjectName Demo - - This command returns all the policies for the Demo project in your TFS or Team Services account. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamPolicy -ProjectName Demo -Id 1 - - This command gets the policy with an id of 1 within the Demo project. - - - - - - Add-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Get-VSTeamPolicyType - - - - - - - Get-VSTeamPolicyType - Get - VSTeamPolicyType - - Get the policy types in the specified Azure DevOps or Team Foundation Server project. - - - - Get the policy types in the specified Azure DevOps or Team Foundation Server project. - - - - Get-VSTeamPolicyType - - 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 - - Specifies one policy type by id. - - Guid[] - - Guid[] - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies one policy type by id. - - Guid[] - - Guid[] - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamPolicyType -ProjectName Demo - - This command returns all the policy types for the Demo project. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamPolicyType -ProjectName Demo -Id 73da726a-8ff9-44d7-8caa-cbb581eac991 - - This command gets the policy type by the specified id within the Demo project. - - - - - - Add-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Get-VSTeamPolicy - - - - - - - Get-VSTeamPool - Get - VSTeamPool - - Returns the agent pools. - - - - Returns the agent pools. - - - - Get-VSTeamPool - - Id - - Id of the pool to return. - - int - - int - - - None - - - - - - Id - - Id of the pool to return. - - int - - int - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - - - - Get-VSTeamProcess - Get - VSTeamProcess - - Returns a list of process templates in the Team Services or Team Foundation Server account. - - - - 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. - - - - Get-VSTeamProcess - - Name - - Specifies the process template name for which this function operates. - You can tab complete from a list of available process templates. - - String - - String - - - None - - - Top - - Specifies the maximum number to return. If -Skip is specified and -Top is omitted the next 100 will be returned. If neither Skip nor -Top is specified, all process templates will be returned. - - Int32 - - Int32 - - - 100 - - - Skip - - Defines the number of Process Templates to skip. If -Top is specified and -Skip is omitted none will be skipped. If neither Skip nor -Top is specified, all process templates will be returned. - - Int32 - - Int32 - - - 0 - - - - Get-VSTeamProcess - - Name - - Specifies the process template name for which this function operates. - You can tab complete from a list of available process templates. - - String - - String - - - None - - - Id - - The id of the Process Template to return. - - String - - String - - - None - - - - - - Name - - Specifies the process template name for which this function operates. - You can tab complete from a list of available process templates. - - String - - String - - - None - - - Top - - Specifies the maximum number to return. If -Skip is specified and -Top is omitted the next 100 will be returned. If neither Skip nor -Top is specified, all process templates will be returned. - - Int32 - - Int32 - - - 100 - - - Skip - - Defines the number of Process Templates to skip. If -Top is specified and -Skip is omitted none will be skipped. If neither Skip nor -Top is specified, all process templates will be returned. - - Int32 - - Int32 - - - 0 - - - Id - - The id of the Process Template to return. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamProcess - - This will return all the Process Templates - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamProcess | Format-Wide - - This will return the Process Templates only showing their name - - - - -------------------------- EXAMPLE 3 -------------------------- - 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. - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProject - - - - - - - Get-VSTeamProfile - Get - VSTeamProfile - - Returns the saved profiles. - - - - Returns the saved profiles. - - - - Get-VSTeamProfile - - Name - - Optional name for the profile. - - String - - String - - - None - - - - - - Name - - Optional name for the profile. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamProfile - - Return the list of saved profiles - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamProfile -Name mydemos - - Will return details of the profile provided - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProfile - - - - - - - Get-VSTeamProject - Get - VSTeamProject - - Returns a list of projects in the Team Services or Team Foundation Server account. - - - - The list of projects returned can be controlled by using the stateFilter, top and skip parameters. - You can also get a single project by name or id. - You must call Set-VSTeamAccount before calling this function. - - - - Get-VSTeamProject - - 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 - - - StateFilter - - Returns team projects in a specific team project state. The acceptable values for this parameter are: - - WellFormed - - CreatePending - - Deleting - - New - - All - - String - - String - - - WellFormed - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - 100 - - - Skip - - Defines the number of team projects to skip. The default value is 0 - - Int32 - - Int32 - - - 0 - - - - Get-VSTeamProject - - 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 project to return. - - String - - String - - - None - - - IncludeCapabilities - - Will return additional information about the project. - - - 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 - - - StateFilter - - Returns team projects in a specific team project state. The acceptable values for this parameter are: - - WellFormed - - CreatePending - - Deleting - - New - - All - - String - - String - - - WellFormed - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - 100 - - - Skip - - Defines the number of team projects to skip. The default value is 0 - - Int32 - - Int32 - - - 0 - - - Id - - The id of the project to return. - - String - - String - - - None - - - IncludeCapabilities - - Will return additional information about the project. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamProject - - This will return all the WellFormed team projects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamProject -top 5 | Format-Wide - - This will return the top five WellFormed team projects only showing their name - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProject - - - - Remove-VSTeamProject - - - - - - - Get-VSTeamPullRequest - Get - VSTeamPullRequest - - Returns one or more open pull requests from your team, project, or Id. - - - - Returns one or more open pull requests from your team, project, or Id. - - - - Get-VSTeamPullRequest - - 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 - - Specifies the pull request by ID. - - String - - String - - - None - - - RepositoryId - - The repository ID of the pull request's target branch. - - Guid - - Guid - - - None - - - - Get-VSTeamPullRequest - - 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 - - Specifies the pull request by ID. - - String - - String - - - None - - - RepositoryId - - The repository ID of the pull request's target branch. - - Guid - - Guid - - - None - - - IncludeCommits - - If set, includes the commits that are part of the pull request. Requires the RepositoryId to be set. - - - SwitchParameter - - - False - - - - Get-VSTeamPullRequest - - 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 - - - RepositoryId - - The repository ID of the pull request's target branch. - - Guid - - Guid - - - None - - - SourceRepositoryId - - If set, search for pull requests whose source branch is in this repository. - - Guid - - Guid - - - None - - - SourceBranchRef - - If set, search for pull requests from this branch. - - String - - String - - - None - - - TargetBranchRef - - If set, search for pull requests into this branch. - - String - - String - - - None - - - Status - - If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: - - abandoned - - active - - all - - completed - - notSet - - String - - String - - - None - - - Top - - The number of pull requests to retrieve. - - Int32 - - Int32 - - - None - - - Skip - - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. - - Int32 - - Int32 - - - None - - - - Get-VSTeamPullRequest - - 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 - - - RepositoryId - - The repository ID of the pull request's target branch. - - Guid - - Guid - - - None - - - SourceRepositoryId - - If set, search for pull requests whose source branch is in this repository. - - Guid - - Guid - - - None - - - SourceBranchRef - - If set, search for pull requests from this branch. - - String - - String - - - None - - - TargetBranchRef - - If set, search for pull requests into this branch. - - String - - String - - - None - - - All - - - - - SwitchParameter - - - False - - - Top - - The number of pull requests to retrieve. - - Int32 - - Int32 - - - None - - - Skip - - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. - - Int32 - - Int32 - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies the pull request by ID. - - String - - String - - - None - - - RepositoryId - - The repository ID of the pull request's target branch. - - Guid - - Guid - - - None - - - SourceRepositoryId - - If set, search for pull requests whose source branch is in this repository. - - Guid - - Guid - - - None - - - SourceBranchRef - - If set, search for pull requests from this branch. - - String - - String - - - None - - - TargetBranchRef - - If set, search for pull requests into this branch. - - String - - String - - - None - - - Status - - If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: - - abandoned - - active - - all - - completed - - notSet - - String - - String - - - None - - - All - - - - SwitchParameter - - SwitchParameter - - - False - - - Top - - The number of pull requests to retrieve. - - Int32 - - Int32 - - - None - - - Skip - - The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. - - Int32 - - Int32 - - - None - - - IncludeCommits - - If set, includes the commits that are part of the pull request. Requires the RepositoryId to be set. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamPullRequest - - This command returns all the open pull requests for your TFS or Team Services account. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamPullRequest -ProjectName Demo - - This command returns all the open pull requests for the Demo team project. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamPullRequest -ProjectName Demo -All - - This command returns all pull requests for the Demo team project. - - - - -------------------------- EXAMPLE 4 -------------------------- - PS C:\> Get-VSTeamPullRequest -ProjectName Demo -TargetBranchRef "refs/heads/mybranch" - - This command returns all open pull requests for a specific branch - - - - -------------------------- EXAMPLE 5 -------------------------- - PS C:\> Get-VSTeamPullRequest -Id 123 - - This command gets the pull request with an Id of 123. - - - - -------------------------- EXAMPLE 6 -------------------------- - PS C:\> Get-VSTeamPullRequest -Id 123 -RepositoryId "93BBA613-2729-4158-9217-751E952AB4AF" -IncludeCommits - - This command gets the pull request with an Id of 123 and includes the commits that are part of the pull request. - - - - - - Show-VSTeamPullRequest - - - - Add-VSTeamPullRequest - - - - Update-VSTeamPullRequest - - - - - - - Get-VSTeamQueue - Get - VSTeamQueue - - Gets a agent queue. - - - - Gets a agent queue. - - - - Get-VSTeamQueue - - 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 - - - QueueName - - Name of the queue to return. - - String - - String - - - None - - - ActionFilter - - None, Manage or Use. - - String - - String - - - None - - - - Get-VSTeamQueue - - 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 - - Id of the queue to return. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - QueueName - - Name of the queue to return. - - String - - String - - - None - - - ActionFilter - - None, Manage or Use. - - String - - String - - - None - - - Id - - Id of the queue to return. - - String - - String - - - None - - - - - - - Team.Queue - - - - - - - - - - - - - - - - - Get-VSTeamRelease - Get - VSTeamRelease - - Gets the releases for a team project. - - - - The Get-VSTeamRelease function gets the releases for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - With just a project name, this function gets all of the releases for that team project. - You can also specify a particular release definition by ID. - - - - Get-VSTeamRelease - - 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 - - - Expand - - Specifies which property should be expanded in the list of Release (environments, artifacts, none). - - String - - String - - - None - - - StatusFilter - - Draft, Active or Abandoned. - - String - - String - - - None - - - DefinitionId - - Id of the release definition - - Int32 - - Int32 - - - 0 - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - 0 - - - CreatedBy - - - - String - - String - - - None - - - MinCreatedTime - - - - DateTime - - DateTime - - - None - - - MaxCreatedTime - - - - DateTime - - DateTime - - - None - - - QueryOrder - - - - String - - String - - - None - - - ContinuationToken - - - - String - - String - - - None - - - - Get-VSTeamRelease - - 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 - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - - Get-VSTeamRelease - - 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 - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - SwitchParameter - - - False - - - - Get-VSTeamRelease - - 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 - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - 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 - - - Expand - - Specifies which property should be expanded in the list of Release (environments, artifacts, none). - - String - - String - - - None - - - StatusFilter - - Draft, Active or Abandoned. - - String - - String - - - None - - - DefinitionId - - Id of the release definition - - Int32 - - Int32 - - - 0 - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - 0 - - - CreatedBy - - - - String - - String - - - None - - - MinCreatedTime - - - - DateTime - - DateTime - - - None - - - MaxCreatedTime - - - - DateTime - - DateTime - - - None - - - QueryOrder - - - - String - - String - - - None - - - ContinuationToken - - - - String - - String - - - None - - - Id - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - SwitchParameter - - SwitchParameter - - - False - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - Team.Release - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe release definition IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamRelease -ProjectName demo | Format-List * - - This command gets a list of all releases in the demo project. - The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Raw - - This command returns the raw object returned from the server. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Json - - This command returns the raw object returned from the server formated as JSON. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamRelease - - - - Remove-VSTeamRelease - - - - - - - Get-VSTeamReleaseDefinition - Get - VSTeamReleaseDefinition - - Gets the release definitions for a team project. - - - - The Get-VSTeamReleaseDefinition function gets the release definitions for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - With just a project name, this function gets all of the release definitions for that team project. - You can also specify a particular release definition by ID. - - - - Get-VSTeamReleaseDefinition - - 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 - - - Expand - - Specifies which property should be expanded in the list of Release Definition (environments, artifacts, none). - - String - - String - - - None - - - - Get-VSTeamReleaseDefinition - - 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 - - Specifies one or more release definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamReleaseDefinition. - - Int32[] - - Int32[] - - - None - - - - Get-VSTeamReleaseDefinition - - 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 - - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - SwitchParameter - - - False - - - - Get-VSTeamReleaseDefinition - - 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 - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - - 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 - - - Expand - - Specifies which property should be expanded in the list of Release Definition (environments, artifacts, none). - - String - - String - - - None - - - Id - - Specifies one or more release definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamReleaseDefinition. - - Int32[] - - Int32[] - - - None - - - JSON - - Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - - SwitchParameter - - SwitchParameter - - - False - - - Raw - - Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - - SwitchParameter - - SwitchParameter - - - False - - - - - - Int[] - - - - - - - - - - Team.ReleaseDefinition - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Format-List * - - This command gets a list of all release definitions in the demo project. - The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Json - - This command returns the raw object returned from the server formatted as a JSON string. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Raw - - This command returns the raw object returned from the server. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamReleaseDefinition - - - - Remove-VSTeamReleaseDefinition - - - - - - - Get-VSTeamResourceArea - Get - VSTeamResourceArea - - List all the areas supported by this instance of TFS/VSTS. - - - - List all the areas supported by this instance of TFS/VSTS. - - - - Get-VSTeamResourceArea - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamResourceArea - - This will display all the areas of supported APIs for your account. - - - - - - Set-VSTeamAccount - - - - Add-VSTeamOption - - - - - - - Get-VSTeamSecurityNamespace - Get - VSTeamSecurityNamespace - - List all security namespaces or just the specified namespace. - - - - List all security namespaces or just the specified namespace. - - - - Get-VSTeamSecurityNamespace - - Id - - Security namespace identifier. - - String - - String - - - None - - - - Get-VSTeamSecurityNamespace - - Name - - Security namespace name. - - String - - String - - - None - - - - Get-VSTeamSecurityNamespace - - LocalOnly - - If true, retrieve only local security namespaces. - - - SwitchParameter - - - False - - - - - - Id - - Security namespace identifier. - - String - - String - - - None - - - Name - - Security namespace name. - - String - - String - - - None - - - LocalOnly - - If true, retrieve only local security namespaces. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - VSTeamSecurityNamespace - - - - - - - - - - - - - - - - - Get-VSTeamServiceEndpoint - Get - VSTeamServiceEndpoint - - Gets a service endpoint. - - - - Gets a service endpoint. - - - - Get-VSTeamServiceEndpoint - - 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 - - Id of the service endpoint - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Id of the service endpoint - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - - - - Get-VSTeamServiceEndpointType - Get - VSTeamServiceEndpointType - - Get service endpoint types. - - - - Get service endpoint types. - - - - Get-VSTeamServiceEndpointType - - Type - - Name of service endpoint type to return. - - String - - String - - - None - - - Scheme - - Scheme of service endpoint - - String - - String - - - None - - - - - - Type - - Name of service endpoint type to return. - - String - - String - - - None - - - Scheme - - Scheme of service endpoint - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - - - - Get-VSTeamTaskGroup - Get - VSTeamTaskGroup - - Gets a task group - - - - Gets a task group - - - - Get-VSTeamTaskGroup - - 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 - - ID of the existing task group - - String - - String - - - None - - - - Get-VSTeamTaskGroup - - 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 - - - Name - - Name of the existing task group - - String - - String - - - None - - - - - - ProjectName - - - - - - - - - None - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - ID of the existing task group - - String - - String - - - None - - - Name - - Name of the existing task group - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" -} - -Get-VSTeamTaskGroup @methodParameters - - Get all the task groups for the some_project_name project. Here we are splatting the parameter, but it may also be directly specified. See a non-splatting example below. - - - - -------------------------- EXAMPLE 2 -------------------------- - Get-VSTeamTaskGroup -ProjectName "some_project_name" -Id "Task_group_id" - - Get a task group when the ID is already known. - - - - -------------------------- EXAMPLE 3 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "Task_group_name" -} - -Get-VSTeamTaskGroup @methodParameters - - Get a task group by name, when the ID is not known. Here we are splatting the parameters, but they may also be directly specified. Getting by ID is preferred, as it's more efficient; but getting by name is, of course, handy. - - - - - - Add-VSTeamTaskGroup - - - - Update-VSTeamTaskGroup - - - - Remove-VSTeamTaskGroup - - - - - - - Get-VSTeamTfvcBranch - Get - VSTeamTfvcBranch - - Gets a branch for a given path from TFVC source control. - - - - Get-VSTeamTfvcBranch gets a branch for a given path from TFVC source control. - - - - Get-VSTeamTfvcBranch - - Path - - Full path to the branch. - - String[] - - String[] - - - None - - - IncludeChildren - - Return child branches, if there are any. - - - SwitchParameter - - - False - - - IncludeParent - - Return the parent branch, if there is one. - - - SwitchParameter - - - False - - - IncludeDeleted - - Return branches marked as deleted. - - - SwitchParameter - - - False - - - - - - Path - - Full path to the branch. - - String[] - - String[] - - - None - - - IncludeChildren - - Return child branches, if there are any. - - SwitchParameter - - SwitchParameter - - - False - - - IncludeParent - - Return the parent branch, if there is one. - - SwitchParameter - - SwitchParameter - - - False - - - IncludeDeleted - - Return branches marked as deleted. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - You can pipe paths to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch - - This command returns the branch object for the path $/MyProject/MyBranch - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeChildren - - This command returns the branch object for the path $/MyProject/MyBranch and its child branches. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeParent - - This command returns the branch object for the path $/MyProject/MyBranch and its parent. - - - - -------------------------- EXAMPLE 4 -------------------------- - PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeDeleted - - This command returns the branch object for the path $/MyProject/MyBranch, even if it's marked as deleted. - - - - -------------------------- EXAMPLE 5 -------------------------- - PS C:\> '$/MyProject/MyBranch','$/AnotherProject/AnotherBranch' | Get-VSTeamTfvcBranch - - This command returns the branch objects for the paths $/MyProject/MyBranch and $/AnotherProject/AnotherBranch by using the pipeline. - - - - - - - - Get-VSTeamTfvcRootBranch - Get - VSTeamTfvcRootBranch - - Gets root branches for all projects with TFVC source control. - - - - Get-VSTeamTfvcRootBranch gets root branches for all projects with TFVC source control. - - - - Get-VSTeamTfvcRootBranch - - IncludeChildren - - Return the child branches for each root branch. - - - SwitchParameter - - - False - - - IncludeDeleted - - Return deleted branches. - - - SwitchParameter - - - False - - - - - - IncludeChildren - - Return the child branches for each root branch. - - SwitchParameter - - SwitchParameter - - - False - - - IncludeDeleted - - Return deleted branches. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamTfvcRootBranch - - This command returns root branches for all projects. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamTfvcRootBranch -IncludeChildren - - This command returns root branches for all projects and their respective child branches. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamTfvcRootBranch -IncludeDeleted - - This command returns root branches for all projects, also those marked as deleted. - - - - - - - - Get-VSTeamUser - Get - VSTeamUser - - Returns a list of users for the account. - - - - Returns a list of users for the account. - - - - Get-VSTeamUser - - SubjectTypes - - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vss (Azure DevOps User) - - aad (Azure Active Directory User) - - svc (Azure DevOps Service Identity) - - imp (Imported Identity) - - msa (Microsoft Account) - - String[] - - String[] - - - None - - - - Get-VSTeamUser - - Descriptor - - The descriptor of the desired graph user. - - String - - String - - - None - - - - - - SubjectTypes - - A comma separated list of user subject subtypes to reduce the retrieved results. Valid subject types: - - vss (Azure DevOps User) - - aad (Azure Active Directory User) - - svc (Azure DevOps Service Identity) - - imp (Imported Identity) - - msa (Microsoft Account) - - String[] - - String[] - - - None - - - Descriptor - - The descriptor of the desired graph user. - - String - - String - - - None - - - - - - - - - - - - - - - Get-VSTeamUserEntitlement - Get - VSTeamUserEntitlement - - Get User Entitlement for a user. - - - - Get User Entitlement for a user. - - - - Get-VSTeamUserEntitlement - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - Select - - Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are: - - Projects - - Extensions - - GroupRules - - String - - String - - - None - - - - Get-VSTeamUserEntitlement - - UserId - - The id of the user to retrieve. - - String[] - - String[] - - - None - - - - - - Skip - - The number of items to skip. - - Int32 - - Int32 - - - None - - - UserId - - The id of the user to retrieve. - - String[] - - String[] - - - None - - - Top - - Specifies the maximum number to return. - - Int32 - - Int32 - - - None - - - Select - - Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are: - - Projects - - Extensions - - GroupRules - - String - - String - - - None - - - - - - - - - - - - - - - Get-VSTeamVariableGroup - Get - VSTeamVariableGroup - - Gets a variable group - - - - Gets a variable group - - - - Get-VSTeamVariableGroup - - 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 - - - Name - - Name of the existing variable group - - String - - String - - - None - - - - - - ProjectName - - - - - - - - - None - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - ID of the existing variable group - - - - - - - None - - - Name - - Name of the existing variable group - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" -} - -Get-VSTeamVariableGroup @methodParameters - - - - - - -------------------------- EXAMPLE 2 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Id = "variable_group_id" -} - -Get-VSTeamVariableGroup @methodParameters - - - - - - -------------------------- EXAMPLE 3 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "variable_group_name" -} - -Get-VSTeamVariableGroup @methodParameters - - - - - - - - Add-VSTeamVariableGroup - - - - Update-VSTeamVariableGroup - - - - Remove-VSTeamVariableGroup - - - - - - - Get-VSTeamWiqlItem - Get - VSTeamWiqlItem - - Returns work items from the given WIQL query or a saved query by ID from your projects team. - - - - Returns work items from the given WIQL query or a saved query by ID from your projects team. - - - - Get-VSTeamWiqlItem - - Id - - The id query to return work items for. This is the ID of any saved query within a team in a project - - Int32 - - Int32 - - - None - - - Top - - The max number of results to return. - - String - - String - - - 100 - - - TimePrecision - - Whether or not to use time precision. - - - SwitchParameter - - - False - - - Expand - - The expand the work items with the selected attributes in the WIQL query. - - - SwitchParameter - - - False - - - - Get-VSTeamWiqlItem - - Query - - The WIQL query. For the syntax check the official documentation (https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops). - - String - - String - - - None - - - Top - - The max number of results to return. - - String - - String - - - 100 - - - TimePrecision - - Whether or not to use time precision. - - - SwitchParameter - - - False - - - Expand - - The expand the work items with the selected attributes in the WIQL query. - - - SwitchParameter - - - False - - - - - - Id - - The id query to return work items for. This is the ID of any saved query within a team in a project - - Int32 - - Int32 - - - None - - - Query - - The WIQL query. For the syntax check the official documentation (https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops). - - String - - String - - - None - - - Top - - The max number of results to return. - - String - - String - - - 100 - - - TimePrecision - - Whether or not to use time precision. - - SwitchParameter - - SwitchParameter - - - False - - - Expand - - The expand the work items with the selected attributes in the WIQL query. - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - ProjectName - - - - - - - If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWiql you will have to type in the names. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" -Expand - - This command gets work items via a WIQL query and expands the return work items with only the selected fields System.Id, System.Title and System.State. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" - - This command gets work items via a WIQL query and returns the WIQL query result with only work item IDs. - - - - - - - - Get-VSTeamWorkItem - Get - VSTeamWorkItem - - Returns one or more a work items from your project. - - - - Returns one or more a work items from your project. - - - - Get-VSTeamWorkItem - - Id - - The id of one or more work items. - - Int32[] - - Int32[] - - - None - - - ErrorPolicy - - The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: - - Fail - - Omit - - String - - String - - - omit - - - Fields - - Comma-separated list of requested fields. - - String[] - - String[] - - - None - - - Expand - - Comma-separated list of requested fields. The acceptable values for this parameter are: - - None - - Relations - - Fields - - Links - - All - - String - - String - - - None - - - AsOf - - - - DateTime - - DateTime - - - None - - - - - - Id - - The id of one or more work items. - - Int32[] - - Int32[] - - - None - - - ErrorPolicy - - The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: - - Fail - - Omit - - String - - String - - - omit - - - Fields - - Comma-separated list of requested fields. - - String[] - - String[] - - - None - - - Expand - - Comma-separated list of requested fields. The acceptable values for this parameter are: - - None - - Relations - - Fields - - Links - - All - - String - - String - - - None - - - AsOf - - - - DateTime - - DateTime - - - None - - - - - - System.String - - - ProjectName - WorkItemType - - - - - - - WorkItemType is a dynamic parameter and use the default project value to query their validate set. - If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamWorkItem -Id 47,48 - - This command gets work items with IDs 47 and 48 by using the IDs parameter. - - - - - - - - Get-VSTeamWorkItemType - Get - VSTeamWorkItemType - - Gets a list of all Work Item Types or a single work item type. - - - - Gets a list of all Work Item Types or a single work item type. - - - - Get-VSTeamWorkItemType - - 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 - - - WorkItemType - - The type of work item to retrieve. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - WorkItemType - - The type of work item to retrieve. - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - The JSON returned has empty named items i.e. "": "To Do" This causes issues with the ConvertFrom-Json CmdLet. Therefore, all "": are replaced with "_end": - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS R:\repos\vsteam> Get-WorkItemType -ProjectName test -WorkItemType 'Code Review Response' - - This command gets a single work item type. - - - - - - Set-VSTeamAccount - - - - - - - Invoke-VSTeamRequest - Invoke - VSTeamRequest - - Allows you to call any TFS/AzD REST API. All the Auth and Route Structure is taken care of for you. Just provide the parts of the API call you need. If you need to send a non-standard URL use the -Url parameter. If the -Url is used the Url is not changed but the header and UserAgent are added for you. - - - - Invoke-VSTeamRequest allows you to call a TFS/AzD REST API much easier than using Invoke-WebRequest directly. The shape of the URI and authentication is all handled for you. - - - - Invoke-VSTeamRequest - - 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 - - - ContentType - - Specifies the content type of the request. - If this parameter is omitted and the request method is POST, the content type will be set to application/json. - Otherwise, the content type is not specified in the call. - - String - - String - - - application/json - - - Method - - Specifies the method used for the request. The acceptable values for this parameter are: - - Get - - Post - - Patch - - Delete - - Options - - Put - - Default - - Trace - - Head - - Merge - - String - - String - - - Get - - - Body - - Specifies the body of the request. The body is the content of the request that follows the headers. - You can pipe a body value to Invoke-VSTeamRequest. - The Body parameter can be used to specify a list of query parameters or specify the content of the response. - When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. - - Object - - Object - - - None - - - InFile - - Path and file name to the file that contains the contents of the request. If the path is omitted, the default is the current location. - - String - - String - - - None - - - OutFile - - Specifies the output file for which this function saves the response body. Enter a path and file name. If you omit the path, the default is the current location. - - String - - String - - - None - - - Area - - The area to find the resource. You can tab complete this value. It can be filtered by passing -subDomain first. - - String - - String - - - None - - - Resource - - The name of the feature you want to manipulate. You can tab complete this value if you pass -Area before this parameter. - - String - - String - - - None - - - Id - - The unique value of the item you want to work with. - - String - - String - - - None - - - Version - - The version of the API you wish to target. - - String - - String - - - None - - - SubDomain - - The SubDomain before .dev.azure.com. For example, to target Release Management you must use the SubDomain vsrm. - - String - - String - - - None - - - JSON - - Converts the PowerShell object into JSON and displays in the console. - - - SwitchParameter - - - False - - - AdditionalHeaders - - Adds additional headers to the request - - Hashtable - - Hashtable - - - None - - - UseProjectId - - Converts the project name to project id before building the URI for the REST API call. - - - 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 - - - ContentType - - Specifies the content type of the request. - If this parameter is omitted and the request method is POST, the content type will be set to application/json. - Otherwise, the content type is not specified in the call. - - String - - String - - - application/json - - - Method - - Specifies the method used for the request. The acceptable values for this parameter are: - - Get - - Post - - Patch - - Delete - - Options - - Put - - Default - - Trace - - Head - - Merge - - String - - String - - - Get - - - Body - - Specifies the body of the request. The body is the content of the request that follows the headers. - You can pipe a body value to Invoke-VSTeamRequest. - The Body parameter can be used to specify a list of query parameters or specify the content of the response. - When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. - - Object - - Object - - - None - - - InFile - - Path and file name to the file that contains the contents of the request. If the path is omitted, the default is the current location. - - String - - String - - - None - - - OutFile - - Specifies the output file for which this function saves the response body. Enter a path and file name. If you omit the path, the default is the current location. - - String - - String - - - None - - - Area - - The area to find the resource. You can tab complete this value. It can be filtered by passing -subDomain first. - - String - - String - - - None - - - Resource - - The name of the feature you want to manipulate. You can tab complete this value if you pass -Area before this parameter. - - String - - String - - - None - - - Id - - The unique value of the item you want to work with. - - String - - String - - - None - - - Version - - The version of the API you wish to target. - - String - - String - - - None - - - SubDomain - - The SubDomain before .dev.azure.com. For example, to target Release Management you must use the SubDomain vsrm. - - String - - String - - - None - - - JSON - - Converts the PowerShell object into JSON and displays in the console. - - SwitchParameter - - SwitchParameter - - - False - - - AdditionalHeaders - - Adds additional headers to the request - - Hashtable - - Hashtable - - - None - - - UseProjectId - - Converts the project name to project id before building the URI for the REST API call. - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Invoke-VSTeamRequest -resource projectHistory -version '4.1-preview' -Verbose - - This command will return the project history. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> ivr -area release -resource releases -version '4.1-preview' -subDomain vsrm -Verbose - - This command will return the releases for a project. - - - - - - - - Remove-VSTeam - Remove - VSTeam - - Removes a team from a project. - - - - Removes a team from a project. - - - - Remove-VSTeam - - 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 - - - TeamId - - The id of the team to remove. - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - 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 - - - TeamId - - The id of the team to remove. - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - - - - Remove-VSTeamAccessControlEntry - Remove - VSTeamAccessControlEntry - - Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. - - - - Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. - - - - Remove-VSTeamAccessControlEntry - - SecurityNamespace - - VSTeamSecurityNamespace object. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - Valid IDs are: - AzD: - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) - - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) - - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) - - ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) - - Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) - - WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) - - DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) - - WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) - - GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) - - VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) - - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) - - WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) - - ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) - - ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) - - Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) - - Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) - - Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) - - Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) - - Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) - - AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) - - Library (b7e84409-6553-448a-bbb2-af228e07cbeb) - - Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) - - Project (52d39943-cb85-4d7f-8fa8-c6baac873819) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) - - CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) - - TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) - - ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) - - Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) - - MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) - - Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) - - Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) - - ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) - - WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) - - TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) - - BuildAdministration (302acaca-b667-436d-a946-87133492041c) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) - - Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) - - UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) - - WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) - - VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) - - Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) - - CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) - - WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) - - Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) - - BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) - - Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) - - Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) - - DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) - - VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) - - VSSPS: - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) - - Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) - - SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) - - CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) - - GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) - - RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) - - String - - String - - - None - - - Token - - The security Token - Valid token formats are: - - Git Repository (repov2/$projectID/$repositoryID) - - Build Definition ($projectID/$buildDefinitionID) - - Release Definition ($projectID/$releaseDefinitionID, $projectID/Path/to/Release/$releaseDefinitionID) - - String - - String - - - None - - - Descriptor - - An array of descriptors of users/groups to be removed - - System.Array - - System.Array - - - None - - - - - - SecurityNamespace - - VSTeamSecurityNamespace object. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - Valid IDs are: - AzD: - Analytics (58450c49-b02d-465a-ab12-59ae512d6531) - - AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) - - ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) - - ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) - - Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) - - WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) - - DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) - - WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) - - GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) - - VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) - - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) - - WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) - - ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) - - ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) - - Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) - - Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) - - Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) - - Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) - - Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) - - AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) - - Library (b7e84409-6553-448a-bbb2-af228e07cbeb) - - Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) - - Project (52d39943-cb85-4d7f-8fa8-c6baac873819) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) - - CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) - - TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) - - ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) - - Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) - - MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) - - Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) - - Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) - - ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) - - WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) - - TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) - - BuildAdministration (302acaca-b667-436d-a946-87133492041c) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) - - Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) - - UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) - - WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) - - VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) - - Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) - - CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) - - WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) - - Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) - - BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) - - Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) - - Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) - - DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) - - VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) - - VSSPS: - EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) - - EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) - - Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) - - Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) - - Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) - - SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) - - Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) - - CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) - - StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) - - GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) - - Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) - - SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) - - RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) - - Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) - - WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) - - DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) - - Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) - - IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) - - ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) - - String - - String - - - None - - - Token - - The security Token - Valid token formats are: - - Git Repository (repov2/$projectID/$repositoryID) - - Build Definition ($projectID/$buildDefinitionID) - - Release Definition ($projectID/$releaseDefinitionID, $projectID/Path/to/Release/$releaseDefinitionID) - - String - - String - - - None - - - Descriptor - - An array of descriptors of users/groups to be removed - - System.Array - - System.Array - - - None - - - - - - - This function outputs a non-terminating error if the ACE removal from the ACL returns $False. This can be due to the wrong descriptor being provided, or the descriptor already not being on the ACL. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") - - This will remove the specified descriptor from the specified repository, using the security namespace id, while confirming for the remove action. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -confirm:$false - - This will remove the specified descriptor from the specified repository, using the security namespace id, with no confirmation for the remove action. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("descriptor1","descriptor2") - - This will remove multiple descriptors from the specified repository, using the security namespace id, while confirming for the remove action. - - - - -------------------------- EXAMPLE 4 -------------------------- - PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") - - This will remove the specified descriptor from the specified repository, using a security namespace object, while confirming for the remove action. - - - - -------------------------- EXAMPLE 5 -------------------------- - PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -confirm:$false - - This will remove the specified descriptor from the specified repository, using a security namespace object, with no confirmation for the remove action. - - - - -------------------------- EXAMPLE 6 -------------------------- - PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("descriptor1","descriptor2") - - This will remove multiple descriptors from the specified repository, using a security namespace object, while confirming for the remove action. - - - - - - - - Remove-VSTeamAccessControlList - Remove - VSTeamAccessControlList - - Remove access control lists under the specified security namespace. - - - - Remove access control lists under the specified security namespace. - - - - Remove-VSTeamAccessControlList - - SecurityNamespace - - Security namespace identifier. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - - String - - String - - - None - - - Tokens - - One or more comma-separated security tokens - - String - - String - - - None - - - Recurse - - If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens. - - - SwitchParameter - - - False - - - - - - SecurityNamespace - - Security namespace identifier. - - VSTeamSecurityNamespace - - VSTeamSecurityNamespace - - - None - - - SecurityNamespaceId - - Security namespace identifier. - - String - - String - - - None - - - Tokens - - One or more comma-separated security tokens - - String - - String - - - None - - - Recurse - - If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - System.Object - - - - - - - - - - - - - - - - - Remove-VSTeamAccount - Remove - VSTeamAccount - - Clears your default project, account name and personal access token. - - - - Clears the environment variables that hold your default project, account, bearer token and personal access token. You have to run Set-VSTeamAccount again before calling any other functions. - To remove from the Machine level you must be running PowerShell as administrator. - - - - Remove-VSTeamAccount - - Level - - On Windows allows you to clear your account information at the Process, User or Machine levels. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Level - - On Windows allows you to clear your account information at the Process, User or Machine levels. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamAccount - - This will clear your account name and personal access token. - - - - - - Set-VSTeamAccount - - - - - - - Remove-VSTeamAgent - Remove - VSTeamAgent - - Removes an agent from a pool. - - - - Removes an agent from a pool. - - - - Remove-VSTeamAgent - - PoolId - - Id of the pool. - - int - - int - - - None - - - Id - - Id of the agent to remove. - - int[] - - int[] - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - PoolId - - Id of the pool. - - int - - int - - - None - - - Id - - Id of the agent to remove. - - int[] - - int[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - - - - - - - - - Remove-VSTeamArea - Remove - VSTeamArea - - Removes an existing area from the project - - - - Removes an existing area from the project - - - - Remove-VSTeamArea - - 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 - - - Path - - Path of the area node. - - string - - string - - - None - - - ReClassifyId - - Id of an area where work items should be reassigned to if they are currently assigned to the area being deleted. - - int - - int - - - None - - - Force - - Forces the function without confirmation - - - 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 - - - Path - - Path of the area node. - - string - - string - - - None - - - ReClassifyId - - Id of an area where work items should be reassigned to if they are currently assigned to the area being deleted. - - int - - int - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - System.Object - - - - - - - - - This function is a wrapper of the base function Remove-VSTeamClassificationNode.md. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamArea -ProjectName Demo -Path "\MyIteration\Path" - - This command removes an existing area with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root area, since no reclassification id has been given. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Remove-VSTeamArea -ProjectName "Demo" -Path "\MyIteration\Path" -ReClassifyId 19 - - This command removes an existing area with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the area with the id 19. - - - - - - Remove-VSTeamClassificationNode - - - - Remove-VSTeamIteration - - - - - - - Remove-VSTeamBuild - Remove - VSTeamBuild - - Deletes the build. - - - - Deletes the build. - - - - Remove-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 - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - - 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 - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamBuild | Remove-VSTeamBuild -Force - - This command will delete all builds that are not marked retain indefinitely. - - - - - - - - Remove-VSTeamBuildDefinition - Remove - VSTeamBuildDefinition - - Removes the build definitions for a team project. - - - - The Remove-VSTeamBuildDefinition function removes the build definitions for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - - - - Remove-VSTeamBuildDefinition - - 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 - - Specifies one or more build definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build definition, type Get-VSTeamBuildDefinition. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - - 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 - - Specifies one or more build definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build definition, type Get-VSTeamBuildDefinition. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - None - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build definition IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo | Remove-VSTeamBuildDefinition - - This command gets a list of all build definitions in the demo project. - The pipeline operator (|) passes the data to the Remove-VSTeamBuildDefinition function, which removes each build definition object. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamBuildDefinition - - - - Get-VSTeamBuildDefinition - - - - - - - Remove-VSTeamBuildTag - Remove - VSTeamBuildTag - - Removes the tag from a build. - - - - Removes the tag from a build. - - - - Remove-VSTeamBuildTag - - 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 - - - Tags - - One or more tags. To specify multiple, use commas to separate. - - String[] - - String[] - - - None - - - Id - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - 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 - - Specifies one or more builds by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a build, type Get-VSTeamBuild. - - Int32[] - - Int32[] - - - None - - - Tags - - One or more tags. To specify multiple, use commas to separate. - - String[] - - String[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - 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 - - - - - - - - - - - - - - - Remove-VSTeamClassificationNode - Remove - VSTeamClassificationNode - - Removes either an existing iteration or area from the project - - - - Removes either an existing iteration or area from the project - - - - Remove-VSTeamClassificationNode - - 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 - - - StructureGroup - - Structure group of the classification node. - - - iterations - areas - - string - - string - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - ReClassifyId - - Id of a classification node where work items should be reassigned to if they are currently assigned to the node being deleted. - - int - - int - - - None - - - Force - - Forces the function without confirmation - - - 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 - - - StructureGroup - - Structure group of the classification node. - - string - - string - - - None - - - Path - - Path of the classification node. - - string - - string - - - None - - - ReClassifyId - - Id of a classification node where work items should be reassigned to if they are currently assigned to the node being deleted. - - int - - int - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - System.Object - - - - - - - - - This function is the base function for Remove-VSTeamArea and Remove-VSTeamIteration. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamClassificationNode -ProjectName Demo -StructureGroup "iterations" -Path "\MyIteration\Path" - - This command removes an existing iteration with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root iteration, since no reclassification id has been given. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Remove-VSTeamClassificationNode -ProjectName "Demo" -StructureGroup "areas" -Path "\MyIteration\Path" -ReClassifyId 19 - - This command removes an existing area with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the area with the id 19. - - - - - - Remove-VSTeamArea - - - - Remove-VSTeamIteration - - - - - - - Remove-VSTeamExtension - Remove - VSTeamExtension - - Uninstall the specified extension from the account / project collection. - - - - Uninstall the specified extension from the account / project collection. - - - - Remove-VSTeamExtension - - PublisherId - - The id of the publisher. - - String - - String - - - None - - - ExtensionId - - The id of the extension. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - PublisherId - - The id of the publisher. - - String - - String - - - None - - - ExtensionId - - The id of the extension. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - - Add-VSTeamExtension - - - - Get-VSTeamExtension - - - - Remove-VSTeamExtension - - - - Update-VSTeamExtension - - - - - - - Remove-VSTeamFeed - Remove - VSTeamFeed - - Removes a package feed from the account. - - - - Removes a package feed from the account. - - - - Remove-VSTeamFeed - - FeedId - - Specifies the ID of the feed. - - Guid - - Guid - - - None - - - - - - FeedId - - Specifies the ID of the feed. - - Guid - - Guid - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' - - This command remove the package feed from the account. - - - - - - - - Remove-VSTeamGitRepository - Remove - VSTeamGitRepository - - Removes the Git repository from your Azure DevOps or Team Foundation Server account. - - - - Remove-VSTeamGitRepository removes the Git repository from your Azure DevOps or Team Foundation Server account. - - - - Remove-VSTeamGitRepository - - Id - - Specifies one or more repositories by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a repository, type Get-Repository. - - Guid[] - - Guid[] - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Id - - Specifies one or more repositories by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a repository, type Get-Repository. - - Guid[] - - Guid[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamGitRepository -Id 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 - - This command removes all the Git repositories for your TFS or Team Services account. - - - - - - - - Remove-VSTeamIteration - Remove - VSTeamIteration - - Removes an existing iteration from the project - - - - Removes an existing iteration from the project - - - - Remove-VSTeamIteration - - 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 - - - Path - - Path of the iteration node. - - string - - string - - - None - - - ReClassifyId - - Id of an iteration where work items should be reassigned to if they are currently assigned to the iteration being deleted. - - int - - int - - - None - - - Force - - Forces the function without confirmation - - - 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 - - - Path - - Path of the iteration node. - - string - - string - - - None - - - ReClassifyId - - Id of an iteration where work items should be reassigned to if they are currently assigned to the iteration being deleted. - - int - - int - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - System.Object - - - - - - - - - This function is a wrapper of the base function Remove-VSTeamClassificationNode.md. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamIteration -ProjectName Demo -Path "\MyIteration\Path" - - This command removes an existing iteration with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root iteration, since no reclassification id has been given. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Remove-VSTeamIteration -ProjectName "Demo" -Path "\MyIteration\Path" -ReClassifyId 19 - - This command removes an existing iteration with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the iteration with the id 19. - - - - - - Remove-VSTeamArea - - - - Remove-VSTeamClassificationNode - - - - - - - Remove-VSTeamMembership - Remove - VSTeamMembership - - Removes a membership to a container. - - - - Removes a membership to a container. - - - - Remove-VSTeamMembership - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - - - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> $user = Get-VSTeamUser | ? DisplayName -eq 'Test User' -PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' -PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -ContainerDescriptor $group.Descriptor - - Removes Test User from the Endpoint Administrators group. - - - - - - Get-VsTeamUser - - - - Get-VsTeamGroup - - - - Add-VsTeamMembership - - - - Get-VsTeamMembership - - - - Test-VsTeamMembership - - - - - - - Remove-VSTeamPolicy - Remove - VSTeamPolicy - - Removes the specified policy from the specified project. - - - - Remove-VSTeamPolicy removes the policy from the specified project. - - - - Remove-VSTeamPolicy - - 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 - - Specifies one or more policies by ID. - To find the ID of a policy see Get-VSTeamPolicy (Get-VSTeamPolicy.md) - - Int[] - - Int[] - - - None - - - Force - - Forces the function without confirmation - - - 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 - - Specifies one or more policies by ID. - To find the ID of a policy see Get-VSTeamPolicy (Get-VSTeamPolicy.md) - - Int[] - - Int[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamPolicy -ProjectName Demo -Id 1 - - This command removes the policy with ID of 1 from the Demo project. - - - - - - Add-VSTeamPolicy - - - - Get-VSTeamPolicy - - - - Get-VSTeamPolicyType - - - - - - - Remove-VSTeamProfile - Remove - VSTeamProfile - - Removes the profile. - - - - Removes the profile. - - - - Remove-VSTeamProfile - - Name - - Name of profile to remove. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Name - - Name of profile to remove. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamProfile | Remove-VSTeamProfile -Force - - This will remove all the profiles on your system. - - - - - - Add-VSTeamProfile - - - - - - - Remove-VSTeamProject - Remove - VSTeamProject - - Deletes the Team Project from your Team Services account. - - - - This will permanently delete your Team Project from your Team Services account. - This function takes a DynamicParam for ProjectName that can be read from the Pipeline by Property Name - - - - Remove-VSTeamProject - - 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 - - - Force - - Forces the function without confirmation - - - 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 - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamProject 'MyProject' - - You will be prompted for confirmation and the project will be deleted. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Remove-VSTeamProject 'MyProject' -Force - - You will NOT be prompted for confirmation and the project will be deleted. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamProject | Remove-VSTeamProject -Force - - This will remove all projects - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProject - - - - - - - Remove-VSTeamRelease - Remove - VSTeamRelease - - Removes the releases for a team project. - - - - The Remove-VSTeamRelease function removes the releases for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - - - - Remove-VSTeamRelease - - 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 - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - - 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 - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - None - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe release definition IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamRelease -ProjectName demo | Remove-VSTeamRelease - - This command gets a list of all releases in the demo project. - The pipeline operator (|) passes the data to the Remove-VSTeamRelease function, which removes each release definition object. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamRelease - - - - Get-VSTeamRelease - - - - - - - Remove-VSTeamReleaseDefinition - Remove - VSTeamReleaseDefinition - - Removes the release definitions for a team project. - - - - The Remove-VSTeamReleaseDefinition function removes the release definitions for a team project. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - - - - Remove-VSTeamReleaseDefinition - - 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 - - Specifies one or more release definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamReleaseDefinition. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - - 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 - - Specifies one or more release definitions by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release definition, type Get-VSTeamReleaseDefinition. - - Int32[] - - Int32[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - None - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe release definition IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Remove-VSTeamReleaseDefinition - - This command gets a list of all release definitions in the demo project. - The pipeline operator (|) passes the data to the Remove-VSTeamReleaseDefinition function, which removes each release definition object. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamReleaseDefinition - - - - Get-VSTeamReleaseDefinition - - - - - - - Remove-VSTeamServiceEndpoint - Remove - VSTeamServiceEndpoint - - Removes a service endpoint. - - - - Removes a service endpoint. - - - - Remove-VSTeamServiceEndpoint - - 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 - - Id of the service endpoint - - String[] - - String[] - - - None - - - Force - - Forces the function without confirmation - - - 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 - - Id of the service endpoint - - String[] - - String[] - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - - - - Remove-VSTeamTaskGroup - Remove - VSTeamTaskGroup - - Removes a task group - - - - Removes a task group - - - - Remove-VSTeamTaskGroup - - 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 - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - SwitchParameter - - - False - - - Force - - Does not prompt - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - SwitchParameter - - - False - - - Id - - ID of the existing task group - - String - - String - - - None - - - - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Does not prompt - - SwitchParameter - - SwitchParameter - - - False - - - ProjectName - - - - - - - - - None - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - False - - - Id - - ID of the existing task group - - String - - String - - - None - - - - - - System.String[] - - - System.String - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $projectName = "some_project_name" -$taskGroup = Get-VSTeamTaskGroup -Name "taskName" -ProjectName $projectName - -$methodParameters = @{ - Id = $taskGroup.id - ProjectName = $projectName - Force = $true -} - -Remove-VSTeamTaskGroup @methodParameters - - - - - - - - Add-VSTeamTaskGroup - - - - Get-VSTeamTaskGroup - - - - Update-VSTeamTaskGroup - - - - - - - Remove-VSTeamUserEntitlement - Remove - VSTeamUserEntitlement - - Delete a user from the account. - The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. - - - - Delete a user from the account. - The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. - - - - Remove-VSTeamUserEntitlement - - UserId - - The id of the user to remove. - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - Remove-VSTeamUserEntitlement - - Email - - The email of the user to remove. - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - UserId - - The id of the user to remove. - - String - - String - - - None - - - Email - - The email of the user to remove. - - String - - String - - - None - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - - - - Remove-VSTeamVariableGroup - Remove - VSTeamVariableGroup - - Removes a variable group - - - - Removes a variable group - - - - Remove-VSTeamVariableGroup - - 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 - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - 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 - - - Id - - ID of the existing variable group - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - 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 - - - Id - - ID of the existing variable group - - String - - String - - - None - - - - - - System.String[] - - - System.String - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "Vsts" - Variables = @{ - key1 = @{ - value = "value1" - isSecret = $true - } - } -} - -$newVariableGroup = Add-VSTeamVariableGroup @methodParameters - -$methodParameters = @{ - Id = $newVariableGroup.id - ProjectName = "some_project_name" - Force = $true -} - -Remove-VSTeamVariableGroup @methodParameters - - - - - - - - Add-VSTeamVariableGroup - - - - Get-VSTeamVariableGroup - - - - Update-VSTeamVariableGroup - - - - - - - Remove-VSTeamWorkItem - Remove - VSTeamWorkItem - - Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - - - - Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - - - - Remove-VSTeamWorkItem - - Id - - The id of one or more work items. - - Int32[] - - Int32[] - - - None - - - Destroy - - Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - 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 - - - - - - Id - - The id of one or more work items. - - Int32[] - - Int32[] - - - None - - - Destroy - - Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - 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 - - - - - - - If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Remove-VSTeamWorkItem -Id 47,48 -Force - - This command deletes work items with IDs 47 and 48 by using the IDs parameter. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Remove-VSTeamWorkItem -Id 47 - - This command deletes the work item with ID 47 by using the ID parameter. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Remove-VSTeamWorkItem -Id 47 -Destroy -Force - - This command deletes work item with IDs 47 permanently by using the Destroy parameter. - - - - - - - - Set-VSTeamAccount - Set - VSTeamAccount - - Stores your account name and personal access token for use with the other functions in this module. - - - - On Windows you have to option to store the information at the process, user or machine (you must be running PowerShell as administrator to store at the machine level) level. - On Linux and Mac you can only store at the process level. - Calling Set-VSTeamAccount will clear any default project. - - - - Set-VSTeamAccount - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - SecurePersonalAccessToken - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Set-VSTeamAccount command. - - SecureString - - SecureString - - - None - - - Level - - On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. - To store at the Machine level you must be running PowerShell as an Administrator. - - String - - String - - - None - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - - SwitchParameter - - - False - - - Drive - - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - Set-VSTeamAccount - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - PersonalAccessToken - - The personal access token from AzD/TFS to use to access this account. - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - Level - - On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. - To store at the Machine level you must be running PowerShell as an Administrator. - - String - - String - - - None - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - - SwitchParameter - - - False - - - Drive - - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - Set-VSTeamAccount - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - Level - - On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. - To store at the Machine level you must be running PowerShell as an Administrator. - - String - - String - - - None - - - UseWindowsAuthentication - - Allows the use of the current user's Windows credentials to authenticate against a local Team Foundation Server or Azure DevOps Server. This cannot be used to connect to Azure DevOps Services. - - - SwitchParameter - - - False - - - Drive - - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - Set-VSTeamAccount - - Profile - - The profile name stored using Add-VSTeamProfile function. You can tab complete through existing profile names. - - String - - String - - - None - - - Drive - - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Account - - The Azure DevOps (AzD) account name to use. DO NOT enter the entire URL. - Just the portion after dev.azure.com. For example in the following url mydemos is the account name. <https://dev.azure.com/mydemos> or The full Team Foundation Server (TFS) url including the collection. <http://localhost:8080/tfs/DefaultCollection> - - String - - String - - - None - - - SecurePersonalAccessToken - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Set-VSTeamAccount command. - - SecureString - - SecureString - - - None - - - Level - - On Windows allows you to store your account information at the Process, User or Machine levels. When saved at the User or Machine level your account information will be in any future PowerShell processes. - To store at the Machine level you must be running PowerShell as an Administrator. - - String - - String - - - None - - - PersonalAccessToken - - The personal access token from AzD/TFS to use to access this account. - - String - - String - - - None - - - UseWindowsAuthentication - - Allows the use of the current user's Windows credentials to authenticate against a local Team Foundation Server or Azure DevOps Server. This cannot be used to connect to Azure DevOps Services. - - SwitchParameter - - SwitchParameter - - - False - - - UseBearerToken - - Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - - SwitchParameter - - SwitchParameter - - - False - - - Profile - - The profile name stored using Add-VSTeamProfile function. You can tab complete through existing profile names. - - String - - String - - - None - - - Version - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2018 - - AzD2019 - - VSTS - - AzD - - If you are on AzD it will default to Azd otherwise it will default to TFS2017 - - String - - String - - - TFS2017 for TFS and AzD for AzD - - - Drive - - The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamAccount - - You will be prompted for the account name and personal access token. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrthisisnotreal4uhlh5vgbmgap3mziwnga - - Allows you to provide all the information on the command line. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Set-VSTeamAccount -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication - - On Windows, allows you use to use Windows authentication against a local TFS server. - - - - -------------------------- EXAMPLE 4 -------------------------- - PS C:\> Set-VSTeamAccount -Profile demonstrations - - Will add the account from the profile provided. - - - - -------------------------- EXAMPLE 5 -------------------------- - PS C:\> Set-VSTeamAccount -Profile demonstrations -Drive demo | Invoke-Expression -PS C:\> Set-Location demo: -PS demo:\> Get-ChildItem - - Will add the account from the profile provided and mount a drive named demo that you can navigate like a file system. If you do not pipe to Invoke-Expression you can simply copy and paste the output and execute it. - - - - -------------------------- EXAMPLE 6 -------------------------- - PS C:\> Set-VSTeamAccount -Profile demonstrations -Level Machine - - Will add the account from the profile provided and store the information at the Machine level. Now any new PowerShell sessions will auto load this account. - Note: You must run PowerShell as an Administrator to store at the Machine level. - - - - -------------------------- EXAMPLE 7 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken - - Will add the account and use the OAuth Token provided by AzD when you check the Allow scripts to access OAuth token checkbox on the phase. Using this method removes the need to create a Personal Access Token. Note -Token is just an alias for -PersonalAccessToken. The token is scoped to only allow access to the account running the build or release. To access other accounts you will have to use a personal access token. - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProfile - - - - Clear-VSTeamDefaultProject - - - - Set-VSTeamDefaultProject - - - - - - - Set-VSTeamAlias - Set - VSTeamAlias - - In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - - - - In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - - - - Set-VSTeamAlias - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - - - - Set-VSTeamAPIVersion - Set - VSTeamAPIVersion - - Sets the API versions to support either TFS2017, TFS2018, AzD2019 or AzD. - - - - Set-VSTeamAPIVersion sets the versions of APIs used. - - - - Set-VSTeamAPIVersion - - Target - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2017U1 - - TFS2017U2 - - TFS2017U3 - - TFS2018 - - TFS2018U1 - - TFS2018U2 - - TFS2018U3 - - AzD2019 - - AzD2019U1 - - VSTS - - AzD - - String - - String - - - TFS2017 - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - Set-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 - - - Version - - Specifies the version to use. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Target - - Specifies the version to use. The acceptable values for this parameter are: - - TFS2017 - - TFS2017U1 - - TFS2017U2 - - TFS2017U3 - - TFS2018 - - TFS2018U1 - - TFS2018U2 - - TFS2018U3 - - AzD2019 - - AzD2019U1 - - VSTS - - AzD - - String - - String - - - TFS2017 - - - 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 - - - Version - - Specifies the version to use. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamAPIVersion AzD - - This command sets the API versions to support AzD. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamAPIVersion -Service Release -Version '5.0' - - This command sets the version of the Release calls to 5.0. - - - - - - - - Set-VSTeamApproval - Set - VSTeamApproval - - Sets the status of approval to Approved, Rejected, Pending, or ReAssigned. - - - - Set-VSTeamApproval sets the status of approval to Approved, Rejected, Pending, or ReAssigned. - - - - Set-VSTeamApproval - - 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 - - Specifies the approval IDs of the approvals to set. - - Int32[] - - Int32[] - - - None - - - Status - - Specifies the status to set for the approval. The acceptable values for this parameter are: - - Approved - - Rejected - - Pending - - ReAssigned - - String - - String - - - Approved - - - Approver - - Specifies the user to whom the approval has been re-assigned to Alias of the user chuckreinhart@outlook.com, for example. - - String - - String - - - None - - - Comment - - Specifies the comment to be stored with this approval. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - 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 - - Specifies the approval IDs of the approvals to set. - - Int32[] - - Int32[] - - - None - - - Status - - Specifies the status to set for the approval. The acceptable values for this parameter are: - - Approved - - Rejected - - Pending - - ReAssigned - - String - - String - - - Approved - - - Approver - - Specifies the user to whom the approval has been re-assigned to Alias of the user chuckreinhart@outlook.com, for example. - - String - - String - - - None - - - Comment - - Specifies the comment to be stored with this approval. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamApproval | Set-VSTeamApproval - - This command sets all pending approvals to approved. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamApproval -Id 1 -Status Rejected - - This command rejects approval with Id of 1. - - - - - - - - Set-VSTeamDefaultAPITimeout - Set - VSTeamDefaultAPITimeout - - Sets the default timeout to be used with other calls in the module. - - - - By setting a default timeout you can adjust the value for your needs - - - - Set-VSTeamDefaultAPITimeout - - TimeoutSec - - Specifies the timeout for all function calls. - - Int - - Int - - - None - - - Level - - On Windows allows you to store your default timeout at the Process, User or Machine levels. - When saved at the User or Machine level your default timeout will be in any future PowerShell processes. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - TimeoutSec - - Specifies the timeout for all function calls. - - Int - - Int - - - None - - - Level - - On Windows allows you to store your default timeout at the Process, User or Machine levels. - When saved at the User or Machine level your default timeout will be in any future PowerShell processes. - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamDefaultAPITimeout 30 - - This command sets 30 seconds as the default timeout. - - - - - - - - Set-VSTeamDefaultProject - Set - VSTeamDefaultProject - - Sets the default project to be used with other calls in the module. - - - - The majority of the functions in this module require a project name. - By setting a default project you can omit that parameter from your function calls and this default will be used instead. - - - - Set-VSTeamDefaultProject - - Project - - 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 - - - Level - - On Windows allows you to store your default project at the Process, User or Machine levels. - When saved at the User or Machine level your default project will be in any future PowerShell processes. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - Project - - 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 - - - Level - - On Windows allows you to store your default project at the Process, User or Machine levels. - When saved at the User or Machine level your default project will be in any future PowerShell processes. - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - Setting a default project also enables tab completion of dynamic parameters when you call Add-VSTeamBuild. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo - - This command sets Demo as the default project. - You can now call other functions that require a project name without passing the project. - - - - - - - - Set-VSTeamEnvironmentStatus - Set - VSTeamEnvironmentStatus - - Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - - - - Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - - - - Set-VSTeamEnvironmentStatus - - 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 - - - EnvironmentId - - Specifies one or more environments by ID you wish to deploy. - The Environment Ids are unique for each environment and in each release. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of an environment type Get-VSTeamRelease -expand environments. - - Int32[] - - Int32[] - - - None - - - ReleaseId - - Specifies the release by ID. - - Int32 - - Int32 - - - None - - - Status - - The status to set for the environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - - String - - String - - - None - - - Comment - - The comment to set for the status change. - - String - - String - - - None - - - ScheduledDeploymentTime - - The date and time to schedule when setting the status to scheduled. - - DateTime - - DateTime - - - None - - - Force - - Forces the function without confirmation - - - 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 - - - EnvironmentId - - Specifies one or more environments by ID you wish to deploy. - The Environment Ids are unique for each environment and in each release. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of an environment type Get-VSTeamRelease -expand environments. - - Int32[] - - Int32[] - - - None - - - ReleaseId - - Specifies the release by ID. - - Int32 - - Int32 - - - None - - - Status - - The status to set for the environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - - String - - String - - - None - - - Comment - - The comment to set for the status change. - - String - - String - - - None - - - ScheduledDeploymentTime - - The date and time to schedule when setting the status to scheduled. - - DateTime - - DateTime - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamEnvironmentStatus -ReleaseId 54 -Id 5 -status inProgress - - This command will set the status of environment with id 5 of release 54 to inProgress. You can use this call to redeploy an environment. - - - - - - - - Set-VSTeamPermissionInheritance - Set - VSTeamPermissionInheritance - - Sets the permission inheritance to true or false. - - - - Sets the permission inheritance to true or false. - - - - Set-VSTeamPermissionInheritance - - 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 - - - Name - - Specifies the name of the resource. - - String - - String - - - None - - - ResourceType - - Specifies the type of resource. The acceptable values for this parameter are: - - Repository - - BuildDefinition - - ReleaseDefinition - - String - - String - - - None - - - NewState - - The new state to set - - Boolean - - Boolean - - - None - - - Force - - Forces the function without confirmation - - - 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 - - - Name - - Specifies the name of the resource. - - String - - String - - - None - - - ResourceType - - Specifies the type of resource. The acceptable values for this parameter are: - - Repository - - BuildDefinition - - ReleaseDefinition - - String - - String - - - None - - - NewState - - The new state to set - - Boolean - - Boolean - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition -NewState $true -Force - - This command sets the permission inheritance to true. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Get-VSTeamBuildDefinition | Set-VSTeamPermissionInheritance -ResourceType BuildDefinition -NewState $true -Force - - ThisThis command sets the permission inheritance to true for every build definition returned from Get-VSTeamBuildDefinition. - - - - - - Add-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Set-VSTeamPermissionInheritanceType - - - - - - - Set-VSTeamReleaseStatus - Set - VSTeamReleaseStatus - - Sets the status of a release to Active or Abandoned. - - - - Sets the status of a release to Active or Abandoned. - - - - Set-VSTeamReleaseStatus - - 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 - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - Status - - The status to set for the release Active or Abandoned. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - 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 - - Specifies one or more releases by ID. - To specify multiple IDs, use commas to separate the IDs. - To find the ID of a release type Get-VSTeamRelease. - - Int32[] - - Int32[] - - - None - - - Status - - The status to set for the release Active or Abandoned. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamReleaseStatus -Id 5 -status Abandoned - - This command will set the status of release with id 5 to Abandoned. - - - - - - - - Show-VSTeam - Show - VSTeam - - Opens TFS or AzD site in the default browser. - - - - Opens TFS or AzD site in the default browser. - - - - Show-VSTeam - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeam - - This will open a browser to the TFS or AzD site - - - - - - Set-VSTeamAccount - - - - - - - Show-VSTeamApproval - Show - VSTeamApproval - - Opens the release associated with the waiting approval in the default browser. - - - - Opens the release associated with the waiting approval in the default browser. - - - - Show-VSTeamApproval - - 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 - - - ReleaseDefinitionId - - Only approvals for the release id provided will be returned. - - Int32 - - Int32 - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - ReleaseDefinitionId - - Only approvals for the release id provided will be returned. - - Int32 - - Int32 - - - None - - - - - - - Team.BuildDefinition - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - You can pipe build definition IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamApproval -ProjectName Demo | Show-VSTeamApproval - - This command opens a web browser showing the release requiring approval. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamBuildDefinition - - - - Remove-VSTeamBuildDefinition - - - - - - - Show-VSTeamBuild - Show - VSTeamBuild - - Opens the build summary in the default browser. - - - - Opens the build summary in the default browser. - - - - Show-VSTeamBuild - - Id - - Specifies build by ID. - - Int32 - - Int32 - - - None - - - - - - Id - - Specifies build by ID. - - Int32 - - Int32 - - - None - - - - - - - Team.Build - - - - - - - - - You can pipe the build ID to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamBuild -ProjectName Demo -Id 3 - - This command will open a web browser with the summary of build 3. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamBuild - - - - Remove-VSTeamBuild - - - - - - - Show-VSTeamBuildDefinition - Show - VSTeamBuildDefinition - - Opens the build definition in the default browser. - - - - Opens the build definition in the default browser. - The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - With just a project name, this function shows all of the build definitions for that team project. - You can also specify a particular build definition by ID. - - - - Show-VSTeamBuildDefinition - - 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 - - - Type - - The type of the build definitions to retrieve. The acceptable values for this parameter are: - - Mine - - All - - Queued - - XAML - - If not specified, all types will be returned. - - String - - String - - - All - - - Path - - The folder of the build definitions to retrieve. - - String - - String - - - \ - - - - Show-VSTeamBuildDefinition - - 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 - - Specifies build definition by ID. - - Int32 - - Int32 - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Type - - The type of the build definitions to retrieve. The acceptable values for this parameter are: - - Mine - - All - - Queued - - XAML - - If not specified, all types will be returned. - - String - - String - - - All - - - Path - - The folder of the build definitions to retrieve. - - String - - String - - - \ - - - Id - - Specifies build definition by ID. - - Int32 - - Int32 - - - None - - - - - - - Team.BuildDefinition - - - - - - - - - You can pipe build definition IDs to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamBuildDefinition -ProjectName Demo - - This command will open a web browser with All Definitions for this project showing. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamBuildDefinition - - - - Remove-VSTeamBuildDefinition - - - - - - - Show-VSTeamFeed - Show - VSTeamFeed - - Opens the feed in the default browser. - - - - Opens the feed in the default browser. - - - - Show-VSTeamFeed - - - - - Id - - Specifies feed by ID or Name. - - Int32 - - Int32 - - - None - - - - - - - Team.Feed - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamFeed -Name Demo - - This command will open a web browser with this feed showing. - - - - - - Set-VSTeamAccount - - - - Add-VSTeamFeed - - - - - - - Show-VSTeamGitRepository - Show - VSTeamGitRepository - - Opens the Git repository in the default browser. - - - - Opens the Git repository in the default browser. - - - - Show-VSTeamGitRepository - - 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 - - - RemoteUrl - - The RemoteUrl of the Git repository to open. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - RemoteUrl - - The RemoteUrl of the Git repository to open. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamGitRepository -ProjectName Demo - - This command opens the Git repository in a browser. - - - - - - - - Show-VSTeamProject - Show - VSTeamProject - - Opens the project in the default browser. - - - - Opens the project in default browser. - You must call Set-VSTeamAccount before calling this function. - - - - Show-VSTeamProject - - 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 project to return. - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - The id of the project to return. - - String - - String - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamProject TestProject - - This will open a browser to the TestProject site - - - - - - Set-VSTeamAccount - - - - Add-VSTeamProject - - - - Remove-VSTeamProject - - - - - - - Show-VSTeamPullRequest - Show - VSTeamPullRequest - - Opens the pull request in the default browser. - - - - Opens the pull request in the default browser. - - - - Show-VSTeamPullRequest - - PullRequestId - - Specifies pull request by ID. - - Int32 - - Int32 - - - None - - - - - - PullRequestId - - Specifies pull request by ID. - - Int32 - - Int32 - - - None - - - - - - - Team.Release - - - - - - - - - You can pipe the pull request ID to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamPullRequest 3 - - This command will open a web browser with the pull request id of 3. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Show-VSTeamPullRequest -Id 3 - - This command will open a web browser with the pull request id of 3. - - - - - - Get-VSTeamPullRequest - - - - - - - Show-VSTeamRelease - Show - VSTeamRelease - - Opens the release summary in the default browser. - - - - Opens the release summary in the default browser. - - - - Show-VSTeamRelease - - Id - - Specifies release by ID. - - Int32 - - Int32 - - - None - - - - - - Id - - Specifies release by ID. - - Int32 - - Int32 - - - None - - - - - - - Team.Release - - - - - - - - - You can pipe the release ID to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamRelease -ProjectName Demo -Id 3 - - This command will open a web browser with the summary of release 3. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamRelease - - - - Remove-VSTeamRelease - - - - - - - Show-VSTeamReleaseDefinition - Show - VSTeamReleaseDefinition - - Opens the release definitions for a team project in the default browser. - - - - Opens the release definitions for a team project in the default browser. - - - - Show-VSTeamReleaseDefinition - - 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 - - Specifies release definition by ID. - - Int32 - - Int32 - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies release definition by ID. - - Int32 - - Int32 - - - None - - - - - - - Team.ReleaseDefinition - - - - - - - - - You can pipe the release definition ID to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamReleaseDefinition -ProjectName Demo - - This command will open a web browser with All Release Definitions for this project showing. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamReleaseDefinition - - - - Remove-VSTeamReleaseDefinition - - - - - - - Show-VSTeamWorkItem - Show - VSTeamWorkItem - - Opens the work item in the default browser. - - - - Opens the work item in the default browser. - - - - Show-VSTeamWorkItem - - Id - - Specifies work item by ID. - - Int32 - - Int32 - - - None - - - - - - Id - - Specifies work item by ID. - - Int32 - - Int32 - - - None - - - - - - - Team.WorkItem - - - - - - - - - You can pipe the WorkItem ID to this function. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Show-VSTeamWorkItem -ProjectName Demo -Id 3 - - This command will open a web browser with the summary of work item 3. - - - - - - Set-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - Add-VSTeamWorkItem - - - - Get-VSTeamWorkItem - - - - - - - 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 - Test - VSTeamMembership - - Tests the membership in a container. - - - - Tests the membership in a container. - - - - Test-VSTeamMembership - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - - - - MemberDescriptor - - A member descriptor retrieved by Get-VsTeamUser - - String - - String - - - None - - - ContainerDescriptor - - A container descriptor retrieved by Get-VsTeamGroup - - String - - String - - - None - - - - - - - System.Boolean - - - - - - - - - - - - - - - Get-VsTeamUser - - - - Get-VsTeamGroup - - - - Add-VsTeamMembership - - - - Get-VsTeamMembership - - - - Remove-VsTeamMembership - - - - - - - Test-VSTeamYamlPipeline - Test - VSTeamYamlPipeline - - Tests the commited YAML pipeline files to check for inconsitencies. Now, you can try out a YAML pipeline without committing it to a repo or running it. Given an existing pipeline and an optional new YAML payload, this function will give you back the full YAML pipeline. - - - - Tests the commited YAML pipeline files to check for inconsitencies. Now, you can try out a YAML pipeline without committing it to a repo or running it. Given an existing pipeline and an optional new YAML payload, this function will give you back the full YAML pipeline. - - - - Test-VSTeamYamlPipeline - - 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 - - - PipelineId - - Id of the YAML pipeline to be checked - - Int32 - - Int32 - - - None - - - FilePath - - Path to the file that should be checked - - String - - String - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - PipelineId - - Id of the YAML pipeline to be checked - - Int32 - - Int32 - - - None - - - FilePath - - Path to the file that should be checked - - String - - String - - - None - - - - - - System.String - - - FilePath - - - - - System.Int32 - - - PipelineId - - - - - - - Team.YamlPipelineResult - - - - - - - - - If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamBuild you will have to type in the names. - Currently the API that is used by this cmdlet is only supporting YAML pipelines without template references. This will be supported soon. see the issue in GitHub: https://github.com/microsoft/azure-pipelines-yaml/issues/34#issuecomment-591092498 (https://github.com/microsoft/azure-pipelines-yaml/issues/34#issuecomment-591092498) - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -FilePath './azure-pipelines.yml' - -Name Id url state ----- -- --- ----- - -1 https://dev.azure.com/devsdb/3428bdd7-9fed-4c30-a6c9-fcb52f084ab9/_apis/pipelines/24/runs/-1 unknown - - This example checks the YAML pipeline with ID 24 and the file './azure-pipelines.yml' for consistency on Azure DevOps to see if the changes still work. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> $yamlOverride = [string](Get-Content -raw $FilePath) -PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -YamlOverride $yamlOverride - - This example checks the YAML pipeline with ID 24 and the content of a yaml file in the variable $yamlOverride for consistency on Azure DevOps to see if the changes still work. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> $yamlOverride = [string](Get-Content -raw $FilePath) -PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 - - This example checks the YAML pipeline with ID 24 for consistency on Azure DevOps to see if the existing YAML of the pipeline works. - - - - - - Get-VSTeamBuildDefinition - - - - - - - Update-VSTeam - Update - VSTeam - - Updates the team name, description or both. - - - - Updates the team name, description or both. - - - - Update-VSTeam - - 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 - - - Description - - The new description of the team - - String - - String - - - None - - - Name - - The name of the team to update - - String - - String - - - None - - - NewTeamName - - The new name of the team - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - 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 - - - Description - - The new description of the team - - String - - String - - - None - - - Name - - The name of the team to update - - String - - String - - - None - - - NewTeamName - - The new name of the team - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - Description - Name - NewTeamName - - - - - - - Team.Team - - - - - - - - - - - - - - - - - Update-VSTeamAgent - Update - VSTeamAgent - - Instructs the agent to download and install the lastest version of the agent on self-hosted agents. - - - - Instructs the agent to download and install the lastest version of the agent on self-hosted agents. - - - - Update-VSTeamAgent - - PoolId - - Id of the pool. - - int - - int - - - None - - - Id - - Id of the agent to Update. - - int[] - - int[] - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - - - PoolId - - Id of the pool. - - int - - int - - - None - - - Id - - Id of the agent to Update. - - int[] - - int[] - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - - - - - - - - - Update-VSTeamBuild - Update - VSTeamBuild - - Allows you to set the keep forever flag and build number. - - - - Allows you to set the keep forever flag and build number. - - - - Update-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 - - - BuildNumber - - The value you want to set as the build number. - - String - - String - - - None - - - Id - - The id of the build. - - Int32 - - Int32 - - - None - - - KeepForever - - $True or $False to set the keep forever property of the build. - - Boolean - - Boolean - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - 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 - - - BuildNumber - - The value you want to set as the build number. - - String - - String - - - None - - - Id - - The id of the build. - - Int32 - - Int32 - - - None - - - KeepForever - - $True or $False to set the keep forever property of the build. - - Boolean - - Boolean - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - Team.Build - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Get-VSTeamBuild | Update-VSTeamBuild -KeepForever $false - - Sets the keep forever property of every build to false. - - - - - - - - Update-VSTeamBuildDefinition - Update - VSTeamBuildDefinition - - Updates a build definition for a team project. - - - - Reads a JSON file off disk or string and uses that file to update an existing build definition in the provided project. - You must call Set-VSTeamAccount before calling this function. - - - - Update-VSTeamBuildDefinition - - 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 - - - InFile - - Path and file name to the JSON file that contains the definition to be updated. If the path is omitted, the default is the current location. - - String - - String - - - None - - - Id - - Specifies the build definition to update by ID. - To find the ID of a build definition, type Get-VSTeamBuildDefinition. - - Int32 - - Int32 - - - None - - - - Update-VSTeamBuildDefinition - - 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 - - - BuildDefinition - - JSON string of build definition. - - String - - String - - - None - - - Id - - Specifies the build definition to update by ID. - To find the ID of a build definition, type Get-VSTeamBuildDefinition. - - Int32 - - Int32 - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies the build definition to update by ID. - To find the ID of a build definition, type Get-VSTeamBuildDefinition. - - Int32 - - Int32 - - - None - - - InFile - - Path and file name to the JSON file that contains the definition to be updated. If the path is omitted, the default is the current location. - - String - - String - - - None - - - BuildDefinition - - JSON string of build definition. - - String - - String - - - None - - - - - - - None - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Update-VSTeamBuildDefinition -ProjectName Demo -Id 123 -InFile build.json - - This command reads build.json and updates existing build definition with id 123 from it on the demo team project. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> $b = Get-VSTeamBuildDefinition -ProjectName Demo -Id 23 -Raw -PS C:\> $b.variables.subscriptionId.value = 'Some New Value' -PS C:\> $body = $b | ConvertTo-Json -Depth 100 -PS C:\> Update-VSTeamBuildDefinition -ProjectName Demo -Id 23 -BuildDefinition $body - - - - - - - - - - Update-VSTeamExtension - Update - VSTeamExtension - - Update an installed extension. Typically this API is used to enable or disable an extension. - - - - Update an installed extension. Typically this API is used to enable or disable an extension. - - - - Update-VSTeamExtension - - PublisherId - - The id of the publisher. - - String - - String - - - None - - - ExtensionId - - The id of the extension. - - String - - String - - - None - - - ExtensionState - - The state of an installed extension. Example: "disabled". The acceptable values for this parameter are: - - none - - disabled - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - PublisherId - - The id of the publisher. - - String - - String - - - None - - - ExtensionId - - The id of the extension. - - String - - String - - - None - - - ExtensionState - - The state of an installed extension. Example: "disabled". The acceptable values for this parameter are: - - none - - disabled - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - - Add-VSTeamExtension - - - - Get-VSTeamExtension - - - - Remove-VSTeamExtension - - - - Update-VSTeamExtension - - - - - - - Update-VSTeamPolicy - Update - VSTeamPolicy - - Updates an existing policy in the specified project. - - - - Updates an existing policy in the specified project. - - - - Update-VSTeamPolicy - - 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 - - Specifies the policy to update. - - Int - - Int - - - None - - - type - - Specifies the id of the type of policy to be update. This must match the original policy, it cannot be changed via this call. - - Guid - - Guid - - - None - - - enabled - - Enables the policy - - - SwitchParameter - - - False - - - blocking - - Determines if the policy will block pushes to the branch if the policy is not adhered to. - - - SwitchParameter - - - False - - - settings - - The settings for the policy. - Each policy type has it's own settings that will need to be set. - - Hashtable - - Hashtable - - - None - - - - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - Id - - Specifies the policy to update. - - Int - - Int - - - None - - - type - - Specifies the id of the type of policy to be update. This must match the original policy, it cannot be changed via this call. - - Guid - - Guid - - - None - - - enabled - - Enables the policy - - SwitchParameter - - SwitchParameter - - - False - - - blocking - - Determines if the policy will block pushes to the branch if the policy is not adhered to. - - SwitchParameter - - SwitchParameter - - - False - - - settings - - The settings for the policy. - Each policy type has it's own settings that will need to be set. - - Hashtable - - Hashtable - - - None - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Update-VSTeamPolicy -ProjectName Demo -id 1 -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} - - This command updates an existing policy in the Demo project. - - - - - - Get-VSTeamPolicy - - - - Remove-VSTeamPolicy - - - - Get-VSTeamPolicyType - - - - - - - Update-VSTeamProfile - Update - VSTeamProfile - - Allows you to update the Personal Access Token for your profile. - - - - - - - - Update-VSTeamProfile - - Name - - Name of the profile to be updated - - String - - String - - - None - - - PAT - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Update-VSTeamProfile command. - - SecureString - - SecureString - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - Update-VSTeamProfile - - PersonalAccessToken - - The personal access token from AzD/TFS to use to access this account. - - String - - String - - - None - - - Name - - Name of the profile to be updated - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - PAT - - A secured string to capture your personal access token. - This will allow you to provide your personal access token without displaying it in plain text. - To use pat simply omit it from the Update-VSTeamProfile command. - - SecureString - - SecureString - - - None - - - PersonalAccessToken - - The personal access token from AzD/TFS to use to access this account. - - String - - String - - - None - - - Name - - Name of the profile to be updated - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Update-VSTeamProfile -Name ProfileName - - You will be prompted for the account name and personal access token. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Update-VSTeamProfile -Name mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga - - Allows you to provide all the information on the command line. - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Get-VSTeamProfile | Where-Object version -eq vsts | Select-Object -skip 1 | Update-VSTeamProfile -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Force - - This will update all but the first AzD profile - - - - - - Update-VSTeamAccount - - - - Set-VSTeamDefaultProject - - - - - - - Update-VSTeamProject - Update - VSTeamProject - - Updates the project name, description or both. - - - - Updates the project name, description or both. - - - - Update-VSTeamProject - - 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 - - - NewName - - The new name for the project. - - String - - String - - - None - - - NewDescription - - The new description for the project. - - String - - String - - - None - - - Id - - The id of the project to update. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - 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 - - - NewName - - The new name for the project. - - String - - String - - - None - - - NewDescription - - The new description for the project. - - String - - String - - - None - - - Id - - The id of the project to update. - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Update-VSTeamProject -Name Demo -NewName aspDemo - - This command changes the name of your project from Demo to aspDemo. - - - - - - - - Update-VSTeamPullRequest - Update - VSTeamPullRequest - - Update a pull request - - - - Update a pull request - - - - Update-VSTeamPullRequest - - RepositoryId - - The id of the repository - - Guid - - Guid - - - None - - - PullRequestId - - The id of the pull request - - Int32 - - Int32 - - - None - - - Draft - - Set the pull request as a draft - - - SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - Update-VSTeamPullRequest - - RepositoryId - - The id of the repository - - Guid - - Guid - - - None - - - PullRequestId - - The id of the pull request - - Int32 - - Int32 - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - Update-VSTeamPullRequest - - RepositoryId - - The id of the repository - - Guid - - Guid - - - None - - - PullRequestId - - The id of the pull request - - Int32 - - Int32 - - - None - - - Status - - The status to set the pull request to. Valid values for this are: - - abandoned - - active - - completed - - notSet - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - Update-VSTeamPullRequest - - RepositoryId - - The id of the repository - - Guid - - Guid - - - None - - - PullRequestId - - The id of the pull request - - Int32 - - Int32 - - - None - - - EnableAutoComplete - - Set the pull requests auto complete status - - - SwitchParameter - - - False - - - AutoCompleteIdentity - - The identity that enabled autocomplete. This is mandatory if -AutoComplete is set to $true - - VSTeamUser - - VSTeamUser - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - Update-VSTeamPullRequest - - RepositoryId - - The id of the repository - - Guid - - Guid - - - None - - - PullRequestId - - The id of the pull request - - Int32 - - Int32 - - - None - - - DisableAutoComplete - - Unset the pull requests auto complete status - - - SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - - - RepositoryId - - The id of the repository - - Guid - - Guid - - - None - - - PullRequestId - - The id of the pull request - - Int32 - - Int32 - - - None - - - Status - - The status to set the pull request to. Valid values for this are: - - abandoned - - active - - completed - - notSet - - String - - String - - - None - - - EnableAutoComplete - - Set the pull requests auto complete status - - SwitchParameter - - SwitchParameter - - - False - - - AutoCompleteIdentity - - The identity that enabled autocomplete. This is mandatory if -AutoComplete is set to $true - - VSTeamUser - - VSTeamUser - - - None - - - DisableAutoComplete - - Unset the pull requests auto complete status - - SwitchParameter - - SwitchParameter - - - False - - - Draft - - Set the pull request as a draft - - SwitchParameter - - SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - Team.PullRequest - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Draft - - Set the pull request to be a draft - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Status abandoned - - Abandon a pull request - - - - - - - - Update-VSTeamRelease - Update - VSTeamRelease - - Allows you to update release variables for future stages to read. - - - - Allows you to update release variables for future stages to read. - - - - Update-VSTeamRelease - - 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 release to update - - Int32 - - Int32 - - - None - - - Release - - The updated release to save in AzD - - PSCustomObject - - PSCustomObject - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - 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 release to update - - Int32 - - Int32 - - - None - - - Release - - The updated release to save in AzD - - PSCustomObject - - PSCustomObject - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - Team.Release - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamRelease -ProjectName project -Id 76 -Raw -PS C:\> $r.variables.temp.value='temp' -PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r - - Changes the variable temp on the release. This can be done in one stage and read in another stage. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamRelease -ProjectName project -Id 76 -Raw -PS C:\> $r.variables | Add-Member NoteProperty temp([PSCustomObject]@{value='test'}) -PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r - - Adds a variable temp to the release with a value of test. - - - - - - - - Update-VSTeamReleaseDefinition - Update - VSTeamReleaseDefinition - - Updates a build definition for a team project. - - - - Reads a JSON file off disk or from string and uses that file to update an existing release definition in the provided project. - You must call Set-VSTeamAccount before calling this function. - - - - Update-VSTeamReleaseDefinition - - 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 - - - InFile - - Path and file name to the JSON file that contains the definition to be updated. If the path is omitted, the default is the current location. - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - - SwitchParameter - - - False - - - - Update-VSTeamReleaseDefinition - - 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 - - - ReleaseDefinition - - JSON string of release definition. - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - - 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 - - - InFile - - Path and file name to the JSON file that contains the definition to be updated. If the path is omitted, the default is the current location. - - String - - String - - - None - - - ReleaseDefinition - - JSON string of release definition. - - String - - String - - - None - - - Confirm - - Prompts you for confirmation before running the function. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the function runs. The function is not run. - - SwitchParameter - - SwitchParameter - - - False - - - - - - - None - - - - - - - - - This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Update-VSTeamReleaseDefinition -ProjectName Demo -Id 123 -InFile release.json - - This command reads release.json and updates existing release definition with id 123 from it on the demo team project. - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> $b = Get-VSTeamReleaseDefinition -ProjectName Demo -Id 23 -Raw -PS C:\> $b.variables.subscriptionId.value = 'Some New Value' -PS C:\> $body = $b | ConvertTo-Json -Depth 100 -PS C:\> Update-VSTeamReleaseDefinition -ProjectName Demo -ReleaseDefinition $body - - This commands update the variables of the release definition. - - - - - - - - Update-VSTeamServiceEndpoint - Update - VSTeamServiceEndpoint - - Updates an existing service connection - - - - Updates an existing service connection - - - - Update-VSTeamServiceEndpoint - - 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 - - UUID of existing services endpoint from AzD - - String - - String - - - None - - - Object - - Hashtable of payload for REST call - - Hashtable - - Hashtable - - - None - - - Force - - Forces the function without confirmation - - - 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 - - UUID of existing services endpoint from AzD - - String - - String - - - None - - - Object - - Hashtable of payload for REST call - - Hashtable - - Hashtable - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - Team.ServiceEndpoint - - - - - - - - - - - - - - - Add-VSTeamServiceEndpoint - - - - Add-VSTeamServiceFabricEndpoint - - - - Add-VSTeamSonarQubeEndpoint - - - - Add-VSTeamKubernetesEndpoint - - - - Add-VSTeamAzureRMServiceEndpoint - - - - Get-VSTeamServiceEndpoint - - - - Get-VSTeamServiceEndpointType - - - - Remove-VSTeamServiceEndpoint - - - - - - - Update-VSTeamTaskGroup - Update - VSTeamTaskGroup - - Updates an existing task group - - - - Updates an existing task group - - - - Update-VSTeamTaskGroup - - 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 - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - SwitchParameter - - - False - - - Force - - Does not prompt - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - SwitchParameter - - - False - - - Id - - ID of the existing task group - - String - - String - - - None - - - InFile - - The path to the json file that represents the task group - - String - - String - - - None - - - - Update-VSTeamTaskGroup - - 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 - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - SwitchParameter - - - False - - - Force - - Does not prompt - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - SwitchParameter - - - False - - - Id - - ID of the existing task group - - String - - String - - - None - - - Body - - The json that represents the task group as a string - - String - - String - - - None - - - - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Does not prompt - - SwitchParameter - - SwitchParameter - - - False - - - ProjectName - - - - - - - - - None - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - False - - - Id - - ID of the existing task group - - String - - String - - - None - - - InFile - - The path to the json file that represents the task group - - String - - String - - - None - - - Body - - The json that represents the task group as a string - - String - - String - - - None - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $projectName = "projectName" - -$taskGroup = Get-VSTeamTaskGroup -Name "taskGroupName" -ProjectName $projectName - -# Make some change, e.g. -$taskGroup.description = "new description" - -$taskGroupJson = ConvertTo-Json -InputObject $taskGroup -Depth 10 - -Update-VSTeamTaskGroup -ProjectName $projectName -Id $taskGroup.id -Body $taskGroupJson - - - - - - - - Add-VSTeamTaskGroup - - - - Get-VSTeamTaskGroup - - - - Remove-VSTeamTaskGroup - - - - - - - Update-VSTeamUserEntitlement - Update - VSTeamUserEntitlement - - Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. - - - - Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. - - - - Update-VSTeamUserEntitlement - - Id - - The id of the user to be updated. - - String - - String - - - None - - - License - - Type of Account License you want to change to. The acceptable values for this parameter are: - - Advanced - - EarlyAdopter - - Express - - None - - Professional - - StakeHolder - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - Update-VSTeamUserEntitlement - - Email - - The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive. - - String - - String - - - None - - - License - - Type of Account License you want to change to. The acceptable values for this parameter are: - - Advanced - - EarlyAdopter - - Express - - None - - Professional - - StakeHolder - - String - - String - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Id - - The id of the user to be updated. - - String - - String - - - None - - - Email - - The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive. - - String - - String - - - None - - - License - - Type of Account License you want to change to. The acceptable values for this parameter are: - - Advanced - - EarlyAdopter - - Express - - None - - Professional - - StakeHolder - - String - - String - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - - - - - - - - Get-VSTeamUserEntitlement - - - - - - - Update-VSTeamVariableGroup - Update - VSTeamVariableGroup - - Updates an existing variable group - - - - Updates an existing variable group - - - - Update-VSTeamVariableGroup - - 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 - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - SwitchParameter - - - False - - - Force - - Does not prompt - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - SwitchParameter - - - False - - - Id - - ID of the existing variable group - - String - - String - - - None - - - Description - - The variable group description - - String - - String - - - None - - - Name - - The variable group name - - String - - String - - - None - - - ProviderData - - The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. - - Hashtable - - Hashtable - - - None - - - Type - - The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. - - - Vsts - AzureKeyVault - - String - - String - - - None - - - Variables - - The variable group variables. - - Hashtable - - Hashtable - - - None - - - - Update-VSTeamVariableGroup - - 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 - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - SwitchParameter - - - False - - - Force - - Does not prompt - - - SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - SwitchParameter - - - False - - - Id - - ID of the existing variable group - - String - - String - - - None - - - Body - - The json that represents the task group as a string - - String - - String - - - None - - - - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - SwitchParameter - - SwitchParameter - - - False - - - Force - - Does not prompt - - SwitchParameter - - SwitchParameter - - - False - - - ProjectName - - - - - - - - - None - - - ProjectName - - Specifies the team project for which this function operates. - You can tab complete from a list of available projects. - You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - - String - - String - - - None - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - SwitchParameter - - SwitchParameter - - - False - - - Id - - ID of the existing variable group - - String - - String - - - None - - - Description - - The variable group description - - String - - String - - - None - - - Name - - The variable group name - - String - - String - - - None - - - ProviderData - - The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. - - Hashtable - - Hashtable - - - None - - - Type - - The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. - - String - - String - - - None - - - Variables - - The variable group variables. - - Hashtable - - Hashtable - - - None - - - Body - - The json that represents the task group as a string - - String - - String - - - None - - - - - - System.String - - - System.Collections.Hashtable - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- EXAMPLE 1 -------------------------- - $methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "Vsts" - Variables = @{ - key1 = @{ - value = "value1" - isSecret = $true - } - } -} - -$newVariableGroup = Add-VSTeamVariableGroup @methodParameters - -$methodParameters = @{ - id = $newVariableGroup.id - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "AzureKeyVault" - Variables = @{ - name_of_existing_secret = @{ - enabled = $true - contentType = "" - value = "" - isSecret = $true - } - } - ProviderData = @{ - serviceEndpointId = "AzureRMServiceEndpointGuid" - vault = "name_of_existing_key_vault" - } -} - -Update-VSTeamVariableGroup @methodParameters - - - - - - -------------------------- EXAMPLE 2 -------------------------- - # Copy variable group varGroupName from project sourceProjectName to project targetProjectName. If varGroupName already exists, we'll update it; else, we'll add it. - -$Name = "varGroupName" -$FromProject = "sourceProjectName" -$ToProject = "targetProjectName" - -$FromVariableGroupObject = Get-VSTeamVariableGroup -Name $Name -ProjectName $FromProject -$body = ConvertTo-Json -InputObject $FromVariableGroupObject -Depth 100 -Compress -$toVariableGroupObject = Get-VSTeamVariableGroup -Name $Name -ProjectName $ToProject -if ($toVariableGroupObject) { - Update-VSTeamVariableGroup -Body $body -ProjectName $ToProject -Id $toVariableGroupObject.id -} -else { - Add-VSTeamVariableGroup -Body $body -ProjectName $ToProject -} - - - - - - - - Add-VSTeamVariableGroup - - - - Get-VSTeamVariableGroup - - - - Remove-VSTeamVariableGroup - - - - - - - Update-VSTeamWorkItem - Update - VSTeamWorkItem - - Update a work item in your project. - - - - Update-VSTeamWorkItem will update a new work item in your project. - - - - Update-VSTeamWorkItem - - Id - - The id of the work item. - - Int32 - - Int32 - - - None - - - Title - - The title of the work item - - String - - String - - - None - - - Description - - The Description of the work item - - String - - String - - - None - - - IterationPath - - The IterationPath of the work item - - String - - String - - - None - - - AssignedTo - - The email address of the user this work item will be assigned to. - - String - - String - - - None - - - AdditionalFields - - Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'. - - Hashtable - - Hashtable - - - None - - - Force - - Forces the function without confirmation - - - SwitchParameter - - - False - - - - - - Id - - The id of the work item. - - Int32 - - Int32 - - - None - - - Title - - The title of the work item - - String - - String - - - None - - - Description - - The Description of the work item - - String - - String - - - None - - - IterationPath - - The IterationPath of the work item - - String - - String - - - None - - - AssignedTo - - The email address of the user this work item will be assigned to. - - String - - String - - - None - - - AdditionalFields - - Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'. - - Hashtable - - Hashtable - - - None - - - Force - - Forces the function without confirmation - - SwitchParameter - - SwitchParameter - - - False - - - - - - System.String - - - ProjectName - WorkItemType - - - - - - - WorkItemType is a dynamic parameter and use the default project value to query their validate set. - If you do not set the default project by called Set-VSTeamDefaultProject before calling Update-VSTeamWorkItem you will have to type in the names. - Any of the basic work item parameters defined in this method, will cause an exception if also added to the parameter AdditionalFields, since it is redundant. Either only use the parameter OR define them in the AdditionalFields parameter. - - - - - -------------------------- EXAMPLE 1 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Update-VSTeamWorkItem -WorkItemId 1 -Title "Updated Work Item" - -ID Title Status --- ----- ------ -6 Updated Work Item To Do - - - - - - -------------------------- EXAMPLE 2 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" - -ID Title Status --- ----- ------ -6 Updated Work Item To Do - - - - - - -------------------------- EXAMPLE 3 -------------------------- - PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> $additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"} -PS C:\> Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields - -ID Title Status --- ----- ------ -6 Updated Work Item To Do - - - - - - - - \ No newline at end of file diff --git a/Source/en-US/about_vsteam.help.txt b/Source/en-US/about_vsteam.help.txt index fcceb9ef5..994ed90b2 100644 --- a/Source/en-US/about_vsteam.help.txt +++ b/Source/en-US/about_vsteam.help.txt @@ -14,6 +14,10 @@ LONG DESCRIPTION -ProjectName parameter is dynamic and you can use tab completion to cycle through all the projects. + There ae many dynamic parameters either call Set-VSTeamDefaultProject or pass + in -ProjectName as the first parameter to the function. Either will enable + the rest of the dynamic parameters to query their values. + All the calls have a default 60 second timeout. Use Set-VSTeamDefaultAPITimeout to adjust the timeout. @@ -64,4 +68,6 @@ KEYWORDS SEE ALSO Set-VSTeamAccount - Get-VSTeamProject \ No newline at end of file + Get-VSTeamProject + about_vsteam_profiles + about_vsteam_provider \ No newline at end of file diff --git a/Source/en-US/about_vsteam_profiles.help.txt b/Source/en-US/about_vsteam_profiles.help.txt index 047cfc637..020430cef 100644 --- a/Source/en-US/about_vsteam_profiles.help.txt +++ b/Source/en-US/about_vsteam_profiles.help.txt @@ -36,4 +36,6 @@ KEYWORDS SEE ALSO Set-VSTeamAccount - Set-VSTeamAPIVersion \ No newline at end of file + Set-VSTeamAPIVersion + about_vsteam + about_vsteam_provider \ No newline at end of file diff --git a/Source/en-US/about_vsteam_provider.help.txt b/Source/en-US/about_vsteam_provider.help.txt index 731f38bf3..0d6bf4753 100644 --- a/Source/en-US/about_vsteam_provider.help.txt +++ b/Source/en-US/about_vsteam_provider.help.txt @@ -69,4 +69,6 @@ KEYWORDS SEE ALSO Set-VSTeamAccount - Set-VSTeamAPIVersion \ No newline at end of file + Set-VSTeamAPIVersion + about_vsteam + about_vsteam_profiles \ No newline at end of file diff --git a/Source/formats/Team.AccessControlEntry.ListView.ps1xml b/Source/formats/Team.AccessControlEntry.ListView.ps1xml deleted file mode 100644 index 2d045ec2e..000000000 --- a/Source/formats/Team.AccessControlEntry.ListView.ps1xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Team.AccessControlEntry.ListView - - Team.AccessControlEntry - - - - - - - Descriptor - - - Allow - - - Deny - - - ExtendedInfo - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.AccessControlEntry.TableView.ps1xml b/Source/formats/Team.AccessControlEntry.TableView.ps1xml deleted file mode 100644 index 2024786f7..000000000 --- a/Source/formats/Team.AccessControlEntry.TableView.ps1xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Team.AccessControlEntry.TableView - - Team.AccessControlEntry - - - - - - - - - - - - - - - - - - Descriptor - - - Allow - - - Deny - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.AccessControlList.ListView.ps1xml b/Source/formats/Team.AccessControlList.ListView.ps1xml deleted file mode 100644 index b0752be3e..000000000 --- a/Source/formats/Team.AccessControlList.ListView.ps1xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Team.AccessControlList.ListView - - Team.AccessControlList - - - - - - - Token - - - InheritPermissions - - - Aces - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.AccessControlList.TableView.ps1xml b/Source/formats/Team.AccessControlList.TableView.ps1xml deleted file mode 100644 index 7a4fdafce..000000000 --- a/Source/formats/Team.AccessControlList.TableView.ps1xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Team.AccessControlList.TableView - - Team.AccessControlList - - - - - - - - - - - - - - - - - - Token - - - InheritPermissions - - - Left - $_.Aces | % { $_.ToString() } - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.Agent.TableView.ps1xml b/Source/formats/Team.Agent.TableView.ps1xml deleted file mode 100644 index 069a54483..000000000 --- a/Source/formats/Team.Agent.TableView.ps1xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Team.Agent.TableView - - Team.Agent - - - - - - - - - - - - - - - - - - - - - - - - - - name - - - enabled - - - version - - - os - - - agentId - - - - - - - - diff --git a/Source/formats/Team.Approval.Approved.TableView.ps1xml b/Source/formats/Team.Approval.Approved.TableView.ps1xml deleted file mode 100644 index a61a874c5..000000000 --- a/Source/formats/Team.Approval.Approved.TableView.ps1xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Team.Approval.Approved.TableView - - Team.Approval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - releaseName - - - releaseEnvironmentName - - - isAutomated - - - shortApprovalType - - - approverName - - - releaseDefinitionName - - - comments - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.Approval.Pending.TableView.ps1xml b/Source/formats/Team.Approval.Pending.TableView.ps1xml deleted file mode 100644 index 048db0906..000000000 --- a/Source/formats/Team.Approval.Pending.TableView.ps1xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Team.Approval.Pending.TableView - - Team.Approval - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - status - - - releaseName - - - releaseEnvironmentName - - - shortApprovalType - - - approverName - - - releaseDefinitionName - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.Approval.Rejected.TableView.ps1xml b/Source/formats/Team.Approval.Rejected.TableView.ps1xml deleted file mode 100644 index 00f2e03dd..000000000 --- a/Source/formats/Team.Approval.Rejected.TableView.ps1xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Team.Approval.Rejected.TableView - - Team.Approval - - - - - - - - - - - - - - - - - - - - - - - - - - - releaseName - - - releaseEnvironmentName - - - shortApprovalType - - - approverName - - - releaseDefinitionName - - - comments - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.Build.Artifact.ListView.ps1xml b/Source/formats/Team.Build.Artifact.ListView.ps1xml deleted file mode 100644 index 3cccf99ae..000000000 --- a/Source/formats/Team.Build.Artifact.ListView.ps1xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Team.Build.Artifact.ListView - - Team.Build.Artifact - - - - - - - id - - - name - - - type - - - data - - - downloadUrl - - - - - - - - diff --git a/Source/formats/Team.Build.Artifact.Resource.ListView.ps1xml b/Source/formats/Team.Build.Artifact.Resource.ListView.ps1xml deleted file mode 100644 index 36bfc8cb1..000000000 --- a/Source/formats/Team.Build.Artifact.Resource.ListView.ps1xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Team.Build.Artifact.Resource.ListView - - Team.Build.Artifact.Resource - - - - - - - type - - - data - - - url - - - downloadUrl - - - properties - - - - - - - - diff --git a/Source/formats/Team.Build.Artifact.Resource.TableView.ps1xml b/Source/formats/Team.Build.Artifact.Resource.TableView.ps1xml deleted file mode 100644 index 2d13ce6c3..000000000 --- a/Source/formats/Team.Build.Artifact.Resource.TableView.ps1xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Team.Build.Artifact.Resource.TableView - - Team.Build.Artifact.Resource - - - - - - - - - - - - - - - - - - - - - - - - type - - - data - - - url - - - downloadUrl - - - properties - - - - - - - - diff --git a/Source/formats/Team.Build.Artifact.Resource.WideView.ps1xml b/Source/formats/Team.Build.Artifact.Resource.WideView.ps1xml deleted file mode 100644 index 62c7f93fb..000000000 --- a/Source/formats/Team.Build.Artifact.Resource.WideView.ps1xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Team.Build.Artifact.Resource.WideView - - Team.Build.Artifact.Resource - - - - - - properties - - - - - - - diff --git a/Source/formats/Team.Build.Artifact.TableView.ps1xml b/Source/formats/Team.Build.Artifact.TableView.ps1xml deleted file mode 100644 index bba19853e..000000000 --- a/Source/formats/Team.Build.Artifact.TableView.ps1xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Team.Build.Artifact.TableView - - Team.Build.Artifact - - - - - - - - - - - - - - - - - - name - - - type - - - downloadUrl - - - - - - - - diff --git a/Source/formats/Team.Build.Artifact.WideView.ps1xml b/Source/formats/Team.Build.Artifact.WideView.ps1xml deleted file mode 100644 index 82fd46a02..000000000 --- a/Source/formats/Team.Build.Artifact.WideView.ps1xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Team.Build.Artifact.WideView - - Team.Build.Artifact - - - - - - downloadUrl - - - - - - - diff --git a/Source/formats/Team.Build.ListView.ps1xml b/Source/formats/Team.Build.ListView.ps1xml deleted file mode 100644 index e4a1d325d..000000000 --- a/Source/formats/Team.Build.ListView.ps1xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Team.Build.ListView - - Team.Provider.Build - VSTeamBuild - - - - - - - ID - - - Name - - - Status - - - Result - - - StartTime - - - RequestedBy - - - BuildDefinition - - - ProjectName - - - - - - - - diff --git a/Source/formats/Team.Build.TableView.ps1xml b/Source/formats/Team.Build.TableView.ps1xml deleted file mode 100644 index a2c4465aa..000000000 --- a/Source/formats/Team.Build.TableView.ps1xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Team.PSDrive.Default.TableView - - Microsoft.PowerShell.SHiPS.SHiPSDirectory - Team.Account - Team.Provider.Pool - Team.Queues - Team.Pools - Team.Provider.Pools - Team.Builds - Team.BuildDefinitions - Team.Releases - Team.Repositories - Team.Teams - Team.Permissions - Team.Provider.Group - Team.Provider.User - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.Build.WideView.ps1xml b/Source/formats/Team.Build.WideView.ps1xml deleted file mode 100644 index 7bace7ba2..000000000 --- a/Source/formats/Team.Build.WideView.ps1xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Team.Build.WideView - - Team.Build - - - - - - buildnumber - - - - - - - diff --git a/Source/formats/Team.BuildDefinition.ListView.ps1xml b/Source/formats/Team.BuildDefinition.ListView.ps1xml deleted file mode 100644 index 5c96a54a2..000000000 --- a/Source/formats/Team.BuildDefinition.ListView.ps1xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Team.BuildDefinition.ListView - - Team.BuildDefinition - - - - - - - ID - - - Name - - - AuthoredBy - - - - - - - - diff --git a/Source/formats/Team.BuildDefinition.TableView.ps1xml b/Source/formats/Team.BuildDefinition.TableView.ps1xml deleted file mode 100644 index 6417b80da..000000000 --- a/Source/formats/Team.BuildDefinition.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.BuildDefinition.TableView - - Team.BuildDefinition - - - - - - - - - - - - - - - - - Name - - - ID - - - - - - - - diff --git a/Source/formats/Team.BuildDefinitionPhasedProcess.TableView.ps1xml b/Source/formats/Team.BuildDefinitionPhasedProcess.TableView.ps1xml deleted file mode 100644 index af4d0e236..000000000 --- a/Source/formats/Team.BuildDefinitionPhasedProcess.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.BuildDefinitionPhasedProcess.TableView - - Team.BuildDefinitionPhasedProcess - - - - - - - - - - - - - - - - - Name - - - Phases - - - - - - - - diff --git a/Source/formats/Team.BuildDefinitionProcess.ListView.ps1xml b/Source/formats/Team.BuildDefinitionProcess.ListView.ps1xml deleted file mode 100644 index 3db821419..000000000 --- a/Source/formats/Team.BuildDefinitionProcess.ListView.ps1xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Team.BuildDefinitionProcess.ListView - - Team.BuildDefinitionProcess - - - - - - - Name - - - Phases - - - - - - - - diff --git a/Source/formats/Team.BuildDefinitionProcessPhase.ListView.ps1xml b/Source/formats/Team.BuildDefinitionProcessPhase.ListView.ps1xml deleted file mode 100644 index d4dbf4174..000000000 --- a/Source/formats/Team.BuildDefinitionProcessPhase.ListView.ps1xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Team.BuildDefinitionProcessPhase.ListView - - Team.BuildDefinitionProcessPhase - - - - - - - Name - - - Steps - - - - - - - - diff --git a/Source/formats/Team.BuildDefinitionProcessPhase.TableView.ps1xml b/Source/formats/Team.BuildDefinitionProcessPhase.TableView.ps1xml deleted file mode 100644 index f4029672a..000000000 --- a/Source/formats/Team.BuildDefinitionProcessPhase.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.BuildDefinitionProcessPhase.TableView - - Team.BuildDefinitionProcessPhase - - - - - - - - - - - - - - - - - Name - - - StepCount - - - - - - - - diff --git a/Source/formats/Team.BuildDefinitionProcessPhaseStep.ListView.ps1xml b/Source/formats/Team.BuildDefinitionProcessPhaseStep.ListView.ps1xml deleted file mode 100644 index b009dd0b3..000000000 --- a/Source/formats/Team.BuildDefinitionProcessPhaseStep.ListView.ps1xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Team.BuildDefinitionProcessPhaseStep.ListView - - Team.BuildDefinitionProcessPhaseStep - - - - - - - ID - - - Name - - - Enabled - - - - - - - - diff --git a/Source/formats/Team.BuildDefinitionProcessPhaseStep.TableView.ps1xml b/Source/formats/Team.BuildDefinitionProcessPhaseStep.TableView.ps1xml deleted file mode 100644 index d3e50c9a5..000000000 --- a/Source/formats/Team.BuildDefinitionProcessPhaseStep.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.BuildDefinitionProcessPhaseStep.TableView - - Team.BuildDefinitionProcessPhaseStep - - - - - - - - - - - - - - - - - - - - ID - - - Name - - - Enabled - - - - - - - - diff --git a/Source/formats/Team.BuildDefinitionYamlProcess.TableView.ps1xml b/Source/formats/Team.BuildDefinitionYamlProcess.TableView.ps1xml deleted file mode 100644 index c295a7e5e..000000000 --- a/Source/formats/Team.BuildDefinitionYamlProcess.TableView.ps1xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Team.BuildDefinitionYamlProcess.TableView - - Team.BuildDefinitionYamlProcess - - - - - - - - - - - - - - yamlFilename - - - - - - - - diff --git a/Source/formats/Team.BuildTimeline.TableView.ps1xml b/Source/formats/Team.BuildTimeline.TableView.ps1xml deleted file mode 100644 index abb0adc18..000000000 --- a/Source/formats/Team.BuildTimeline.TableView.ps1xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Team.BuildTimeline.TableView - - Team.BuildTimeline - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - changeId - - - [datetime]::Parse($_.lastChangedOn) - - - lastChangedBy - - - numberOfRecords - - - - - - - - diff --git a/Source/formats/Team.BuildTimline.ListView.ps1xml b/Source/formats/Team.BuildTimline.ListView.ps1xml deleted file mode 100644 index cffe36099..000000000 --- a/Source/formats/Team.BuildTimline.ListView.ps1xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Team.BuildTimeline.ListView - - Team.BuildTimeline - - - - - - - changeId - - - id - - - numberOfRecords - - - records - - - - - - - - diff --git a/Source/formats/Team.ClassificationNode.ListView.ps1xml b/Source/formats/Team.ClassificationNode.ListView.ps1xml deleted file mode 100644 index 989024ab7..000000000 --- a/Source/formats/Team.ClassificationNode.ListView.ps1xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Team.ClassificationNode.ListView - - Team.ClassificationNode - - - - - - - ID - - - Identifier - - - Name - - - Path - - - StructureType - - - ProjectName - - - Url - - - HasChildren - - - Children - - - - - - - - diff --git a/Source/formats/Team.ClassificationNode.TableView.ps1xml b/Source/formats/Team.ClassificationNode.TableView.ps1xml deleted file mode 100644 index ab757b630..000000000 --- a/Source/formats/Team.ClassificationNode.TableView.ps1xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Team.ClassificationNode.TableView - - Team.ClassificationNode - - - - - - - - - - - - - - - - - - - - - - - - - - - ID - - - Identifier - - - Name - - - Path - - - StructureType - - - HasChildren - - - - - - - - diff --git a/Source/formats/Team.Descriptor.ListView.ps1xml b/Source/formats/Team.Descriptor.ListView.ps1xml deleted file mode 100644 index d4a90a5fa..000000000 --- a/Source/formats/Team.Descriptor.ListView.ps1xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Team.Descriptor.ListView - - Team.Descriptor - - - - - - - Descriptor - - - Links - - - - - - - - diff --git a/Source/formats/Team.Descriptor.TableView.ps1xml b/Source/formats/Team.Descriptor.TableView.ps1xml deleted file mode 100644 index 8fc84cb9a..000000000 --- a/Source/formats/Team.Descriptor.TableView.ps1xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Team.Descriptor.TableView - - Team.Descriptor - - - - - - - - - - - - - - - Descriptor - - - Links - - - - - - - - diff --git a/Source/formats/Team.Environment.Status.TableView.ps1xml b/Source/formats/Team.Environment.Status.TableView.ps1xml deleted file mode 100644 index 3e289d399..000000000 --- a/Source/formats/Team.Environment.Status.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Environment.Status.TableView - - VSTeamEnvironment - VSTeamAttempt - VSTeamTask - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - status - - - - - - - - diff --git a/Source/formats/Team.Extension.TableView.ps1xml b/Source/formats/Team.Extension.TableView.ps1xml deleted file mode 100644 index 55a7a3b19..000000000 --- a/Source/formats/Team.Extension.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Extension.TableView - - Team.Extension - - - - - - - - - - - - - - - - - - - - Name - - - ID - - - publisherId - - - - - - - - diff --git a/Source/formats/Team.Feed.TableView.ps1xml b/Source/formats/Team.Feed.TableView.ps1xml deleted file mode 100644 index 704716872..000000000 --- a/Source/formats/Team.Feed.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Feed.TableView - - Team.Feed - - - - - - - - - - - - - - - - - - - - Name - - - Description - - - ID - - - - - - - - diff --git a/Source/formats/Team.GitCommitRef.TableView.ps1xml b/Source/formats/Team.GitCommitRef.TableView.ps1xml deleted file mode 100644 index 3952361db..000000000 --- a/Source/formats/Team.GitCommitRef.TableView.ps1xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Team.GitCommitRef.TableView - - Team.GitCommitRef - Team.GitUserDate - - - - - - - - - - - - - - - - - - - - - - - CommitId - - - $_.Committer.Date - - - $_.Committer.Name - - - Comment - - - - - - - - diff --git a/Source/formats/Team.GitRef.TableView.ps1xml b/Source/formats/Team.GitRef.TableView.ps1xml deleted file mode 100644 index 07da5c025..000000000 --- a/Source/formats/Team.GitRef.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.GitRef.TableView - - Team.GitRef - - - - - - - - - - - - - - - - - RefName - - - Creator - - - - - - - - diff --git a/Source/formats/Team.GitUserDate.TableView.ps1xml b/Source/formats/Team.GitUserDate.TableView.ps1xml deleted file mode 100644 index 92ee7962b..000000000 --- a/Source/formats/Team.GitUserDate.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.GitUserDate.TableView - - Team.GitUserDate - - - - - - - - - - - - - - - - - Name - - - EMail - - - - - - - - diff --git a/Source/formats/Team.Group.ListView.ps1xml b/Source/formats/Team.Group.ListView.ps1xml deleted file mode 100644 index 3006e820a..000000000 --- a/Source/formats/Team.Group.ListView.ps1xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Team.Group.ListView - - Team.Group - - - - - - - ID - - - PrincipalName - - - DisplayName - - - ProjectName - - - Origin - - - OriginID - - - URL - - - Descriptor - - - Links - - - - - - - - diff --git a/Source/formats/Team.Group.TableView.ps1xml b/Source/formats/Team.Group.TableView.ps1xml deleted file mode 100644 index 66ec9220c..000000000 --- a/Source/formats/Team.Group.TableView.ps1xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Team.Group.TableView - - Team.Group - - - - - - - - - - - - - - - - - - - - - PrincipalName - - - DisplayName - - - ProjectName - - - Origin - - - - - - - - diff --git a/Source/formats/Team.JobRequest.TableView.ps1xml b/Source/formats/Team.JobRequest.TableView.ps1xml deleted file mode 100644 index eab97dce3..000000000 --- a/Source/formats/Team.JobRequest.TableView.ps1xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - Team.JobRequest.TableView - - Team.JobRequest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ID - - - Type - - - Pipeline - - - Name - - - QueueTime - - - AssignTime - - - StartTime - - - FinishTime - - - Demands - - - Duration - - - - - - - - diff --git a/Source/formats/Team.Option.TableView.ps1xml b/Source/formats/Team.Option.TableView.ps1xml deleted file mode 100644 index 490030be3..000000000 --- a/Source/formats/Team.Option.TableView.ps1xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Team.Option.TableView - - Team.Option - - - - - - - - - - - - - - - - - - - - - area - - - resourceName - - - releasedVersion - - - routeTemplate - - - - - - - - diff --git a/Source/formats/Team.Option.Versions.TableView.ps1xml b/Source/formats/Team.Option.Versions.TableView.ps1xml deleted file mode 100644 index 80c8ad08e..000000000 --- a/Source/formats/Team.Option.Versions.TableView.ps1xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Versions - - Team.Option - - - - - - - - - - - - - - - - - - - - - - - - - - - area - - - resourceName - - - releasedVersion - - - minVersion - - - maxVersion - - - resourceVersion - - - - - - - - diff --git a/Source/formats/Team.PSDrive.Default.ListView.ps1xml b/Source/formats/Team.PSDrive.Default.ListView.ps1xml deleted file mode 100644 index e4a5eeecc..000000000 --- a/Source/formats/Team.PSDrive.Default.ListView.ps1xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Team.PSDrive.Default.ListView - - Microsoft.PowerShell.SHiPS.SHiPSDirectory - Team.Account - Team.Pool - Team.Queues - Team.Pools - Team.Builds - Team.BuildDefinitions - Team.Releases - Team.Repositories - Team.Teams - - - - - - - Name - - - projectName - - - - - - - - diff --git a/Source/formats/Team.PSDrive.Default.TableView.ps1xml b/Source/formats/Team.PSDrive.Default.TableView.ps1xml deleted file mode 100644 index 79e3ee4f6..000000000 --- a/Source/formats/Team.PSDrive.Default.TableView.ps1xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Team.PSDrive.Default.TableView - - Microsoft.PowerShell.SHiPS.SHiPSDirectory - Team.Account - Team.Pool - Team.Queues - Team.Pools - Team.Provider.Pools - Team.Builds - Team.BuildDefinitions - Team.Releases - Team.Repositories - Team.Teams - Team.Permissions - Team.Groups - Team.Users - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.PSDrive.Leaf.Default.TableView.ps1xml b/Source/formats/Team.PSDrive.Leaf.Default.TableView.ps1xml deleted file mode 100644 index a4a1a9202..000000000 --- a/Source/formats/Team.PSDrive.Leaf.Default.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.PSDrive.Leaf.Default.TableView - - Microsoft.PowerShell.SHiPS.SHiPSLeaf - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - - - - - - diff --git a/Source/formats/Team.PolicyType.TableView.ps1xml b/Source/formats/Team.PolicyType.TableView.ps1xml deleted file mode 100644 index 282eac587..000000000 --- a/Source/formats/Team.PolicyType.TableView.ps1xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Team.PolicyType.TableView - - Team.PolicyType - - - - - - - - - - - - - - - - - - displayName - - - description - - - id - - - - - - - - diff --git a/Source/formats/Team.Pool.TableView.ps1xml b/Source/formats/Team.Pool.TableView.ps1xml deleted file mode 100644 index 70caf0448..000000000 --- a/Source/formats/Team.Pool.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Pool.TableView - - Team.Pool - - - - - - - - - - - - - - - - - - - - Name - - - Count - - - ID - - - - - - - - diff --git a/Source/formats/Team.Process.ListView.ps1xml b/Source/formats/Team.Process.ListView.ps1xml deleted file mode 100644 index 021d723e5..000000000 --- a/Source/formats/Team.Process.ListView.ps1xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - Team.Process.ListView - - Team.Process - Team.Provider.Process - VSTeamProcess - - - - - - - Name - - - ID - - - Description - - - IsEnabled - - - IsDefault - - - - - - - - diff --git a/Source/formats/Team.Process.TableView.ps1xml b/Source/formats/Team.Process.TableView.ps1xml deleted file mode 100644 index 164b018f8..000000000 --- a/Source/formats/Team.Process.TableView.ps1xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Team.Process.TableView - - Team.Process - - - - - - - - - - - - - - - - - - - - - - - Name - - - IsEnabled - - - IsDefault - - - Description - - - - - - - - diff --git a/Source/formats/Team.Profile.TableView.ps1xml b/Source/formats/Team.Profile.TableView.ps1xml deleted file mode 100644 index 45c2b4709..000000000 --- a/Source/formats/Team.Profile.TableView.ps1xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Team.Profile.TableView - - Team.Profile - - - - - - - - - - - - - - - - - - - - - Name - - - URL - - - Version - - - Type - - - - - - - - diff --git a/Source/formats/Team.Project.ListView.ps1xml b/Source/formats/Team.Project.ListView.ps1xml deleted file mode 100644 index 87b5b5cb9..000000000 --- a/Source/formats/Team.Project.ListView.ps1xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Team.Project.ListView - - Team.Project - Team.Provider.Project - VSTeamProject - - - - - - - Name - - - ID - - - Description - - - - - - - - diff --git a/Source/formats/Team.Project.TableView.ps1xml b/Source/formats/Team.Project.TableView.ps1xml deleted file mode 100644 index 608ab32a6..000000000 --- a/Source/formats/Team.Project.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.Project.TableView - - Team.Project - - - - - - - - - - - - - - - - - Name - - - Description - - - - - - - - diff --git a/Source/formats/Team.Provider.Agent.TableView.ps1xml b/Source/formats/Team.Provider.Agent.TableView.ps1xml deleted file mode 100644 index 99eae72b1..000000000 --- a/Source/formats/Team.Provider.Agent.TableView.ps1xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Team.Provider.Agent.TableView - - Team.Provider.Agent - - - - - - - - - - - - - - - - - - - - - - - - - - DisplayMode - - - name - - - enabled - - - version - - - os - - - - - - - - diff --git a/Source/formats/Team.Provider.BuildDefinition.TableView.ps1xml b/Source/formats/Team.Provider.BuildDefinition.TableView.ps1xml deleted file mode 100644 index f0c3057d3..000000000 --- a/Source/formats/Team.Provider.BuildDefinition.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.BuildDefinition.TableView - - Team.Provider.BuildDefinition - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - ID - - - - - - - - diff --git a/Source/formats/Team.Provider.BuildDefinitionProcessPhase.TableView.ps1xml b/Source/formats/Team.Provider.BuildDefinitionProcessPhase.TableView.ps1xml deleted file mode 100644 index 3c2e527ad..000000000 --- a/Source/formats/Team.Provider.BuildDefinitionProcessPhase.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.BuildDefinitionProcessPhase.TableView - - Team.Provider.BuildDefinitionProcessPhase - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - StepCount - - - - - - - - diff --git a/Source/formats/Team.Provider.BuildDefinitionProcessPhaseStep.TableView.ps1xml b/Source/formats/Team.Provider.BuildDefinitionProcessPhaseStep.TableView.ps1xml deleted file mode 100644 index 5d0e478c3..000000000 --- a/Source/formats/Team.Provider.BuildDefinitionProcessPhaseStep.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.BuildDefinitionProcessPhaseStep.TableView - - Team.Provider.BuildDefinitionProcessPhaseStep - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - Enabled - - - - - - - - diff --git a/Source/formats/Team.Provider.BuildDefinitionYamlProcess.TableView.ps1xml b/Source/formats/Team.Provider.BuildDefinitionYamlProcess.TableView.ps1xml deleted file mode 100644 index 06b586fbe..000000000 --- a/Source/formats/Team.Provider.BuildDefinitionYamlProcess.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.Provider.BuildDefinitionYamlProcess.TableView - - Team.Provider.BuildDefinitionYamlProcess - - - - - - - - - - - - - - - - - DisplayMode - - - yamlFilename - - - - - - - - diff --git a/Source/formats/Team.Provider.Extension.TableView.ps1xml b/Source/formats/Team.Provider.Extension.TableView.ps1xml deleted file mode 100644 index 218cace8c..000000000 --- a/Source/formats/Team.Provider.Extension.TableView.ps1xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Team.Provider.Extension.TableView - - Team.Provider.Extension - - - - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - ID - - - publisherId - - - - - - - - diff --git a/Source/formats/Team.Provider.Feed.TableView.ps1xml b/Source/formats/Team.Provider.Feed.TableView.ps1xml deleted file mode 100644 index f857b1ae7..000000000 --- a/Source/formats/Team.Provider.Feed.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.Feed.TableView - - Team.Provider.Feed - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - Description - - - - - - - - diff --git a/Source/formats/Team.Provider.GitRef.TableView.ps1xml b/Source/formats/Team.Provider.GitRef.TableView.ps1xml deleted file mode 100644 index 722664fc4..000000000 --- a/Source/formats/Team.Provider.GitRef.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.GitRef.TableView - - Team.Provider.GitRef - - - - - - - - - - - - - - - - - - - - DisplayMode - - - RefName - - - Creator - - - - - - - - diff --git a/Source/formats/Team.Provider.JobRequest.TableView.ps1xml b/Source/formats/Team.Provider.JobRequest.TableView.ps1xml deleted file mode 100644 index 2cb2969fe..000000000 --- a/Source/formats/Team.Provider.JobRequest.TableView.ps1xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Team.Provider.JobRequest.TableView - - Team.Provider.JobRequest - - - - - - - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - Type - - - Pipeline - - - Duration - - - - - - - - diff --git a/Source/formats/Team.Provider.Pool.TableView.ps1xml b/Source/formats/Team.Provider.Pool.TableView.ps1xml deleted file mode 100644 index 64e1f3d36..000000000 --- a/Source/formats/Team.Provider.Pool.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.Pool.TableView - - Team.Provider.Pool - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - Count - - - - - - - - diff --git a/Source/formats/Team.Provider.Project.TableView.ps1xml b/Source/formats/Team.Provider.Project.TableView.ps1xml deleted file mode 100644 index 2fa5c5b93..000000000 --- a/Source/formats/Team.Provider.Project.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.Project.TableView - - Team.Provider.Project - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - Description - - - - - - - - diff --git a/Source/formats/Team.Provider.Queue.TableView.ps1xml b/Source/formats/Team.Provider.Queue.TableView.ps1xml deleted file mode 100644 index bac1b5e91..000000000 --- a/Source/formats/Team.Provider.Queue.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.Provider.Queue.TableView - - Team.Provider.Queue - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - - - - - - diff --git a/Source/formats/Team.Provider.Release.TableView.ps1xml b/Source/formats/Team.Provider.Release.TableView.ps1xml deleted file mode 100644 index 915d252a3..000000000 --- a/Source/formats/Team.Provider.Release.TableView.ps1xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Team.Provider.Release.TableView - - Team.Provider.Release - - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - status - - - definitionname - - - - - - - - diff --git a/Source/formats/Team.Provider.ReleaseDefinition.TableView.ps1xml b/Source/formats/Team.Provider.ReleaseDefinition.TableView.ps1xml deleted file mode 100644 index 8afb68f38..000000000 --- a/Source/formats/Team.Provider.ReleaseDefinition.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.ReleaseDefinition.TableView - - Team.Provider.ReleaseDefinition - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - ID - - - - - - - - diff --git a/Source/formats/Team.Provider.Repository.TableView.ps1xml b/Source/formats/Team.Provider.Repository.TableView.ps1xml deleted file mode 100644 index 61016d9f5..000000000 --- a/Source/formats/Team.Provider.Repository.TableView.ps1xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Team.Provider.Repository.TableView - - Team.Provider.Repository - VSTeamGitRepository - - - - - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - remoteUrl - - - defaultBranch - - - projectName - - - - - - - - diff --git a/Source/formats/Team.Provider.Team.TableView.ps1xml b/Source/formats/Team.Provider.Team.TableView.ps1xml deleted file mode 100644 index b5a307090..000000000 --- a/Source/formats/Team.Provider.Team.TableView.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Team.Provider.Team.TableView - - Team.Provider.Team - - - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - Description - - - - - - - - diff --git a/Source/formats/Team.Release.TableView.ps1xml b/Source/formats/Team.Release.TableView.ps1xml deleted file mode 100644 index fb6fe2820..000000000 --- a/Source/formats/Team.Release.TableView.ps1xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Team.Release.TableView - - VSTeamRelease - - - - - - - - - - - - - - - - - - DisplayMode - - - Name - - - status - - - - - - - - diff --git a/Source/formats/Team.ReleaseDefinition.TableView.ps1xml b/Source/formats/Team.ReleaseDefinition.TableView.ps1xml deleted file mode 100644 index 1f927c378..000000000 --- a/Source/formats/Team.ReleaseDefinition.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.ReleaseDefinition.TableView - - Team.ReleaseDefinition - - - - - - - - - - - - - - - - - Name - - - ID - - - - - - - - diff --git a/Source/formats/Team.Repository.ListView.ps1xml b/Source/formats/Team.Repository.ListView.ps1xml deleted file mode 100644 index eeb4811f9..000000000 --- a/Source/formats/Team.Repository.ListView.ps1xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Team.Repository.ListView - - Team.Repository - Team.Provider.Repository - VSTeamGitRepository - - - - - - - Name - - - remoteUrl - - - defaultBranch - - - projectName - - - - - - - - diff --git a/Source/formats/Team.Repository.TableView.ps1xml b/Source/formats/Team.Repository.TableView.ps1xml deleted file mode 100644 index 987fe77d4..000000000 --- a/Source/formats/Team.Repository.TableView.ps1xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Team.Repository.TableView - - Team.Repository - VSTeamGitRepository - - - - - - - - - - - - - - - - - - - - - Name - - - remoteUrl - - - defaultBranch - - - projectName - - - - - - - - diff --git a/Source/formats/Team.ResourceArea.TableView.ps1xml b/Source/formats/Team.ResourceArea.TableView.ps1xml deleted file mode 100644 index 56ff1209f..000000000 --- a/Source/formats/Team.ResourceArea.TableView.ps1xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Team.ResourceArea.TableView - - Team.ResourceArea - VSTeamResourceArea - - - - - - - - - - - - - - - Name - - - locationUrl - - - - - - - - diff --git a/Source/formats/Team.SecurityNamespace.ListView.ps1xml b/Source/formats/Team.SecurityNamespace.ListView.ps1xml deleted file mode 100644 index 87237c3c8..000000000 --- a/Source/formats/Team.SecurityNamespace.ListView.ps1xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Team.SecurityNamespace.ListView - - Team.SecurityNamespace - - - - - - - ID - - - Name - - - DisplayName - - - ElementLength - - - WritePermission - - - ReadPermission - - - DataspaceCategory - - - StructureValue - - - ExtensionType - - - IsRemotable - - - UseTokenTranslator - - - SystemBitMask - - - Actions - - - - - - - - diff --git a/Source/formats/Team.SecurityNamespace.TableView.ps1xml b/Source/formats/Team.SecurityNamespace.TableView.ps1xml deleted file mode 100644 index 6a224dfda..000000000 --- a/Source/formats/Team.SecurityNamespace.TableView.ps1xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Team.SecurityNamespace.TableView - - Team.SecurityNamespace - - - - - - - - - - - - - - - - - - ID - - - Name - - - IsRemotable - - - - - - - - diff --git a/Source/formats/Team.ServiceEndpoint.ListView.ps1xml b/Source/formats/Team.ServiceEndpoint.ListView.ps1xml deleted file mode 100644 index d59a33666..000000000 --- a/Source/formats/Team.ServiceEndpoint.ListView.ps1xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Team.ServiceEndpoint.ListView - - Team.ServiceEndpoint - - - - - - - name - - - type - - - createdByUser - - - id - - - - - - - - diff --git a/Source/formats/Team.ServiceEndpoint.TableView.ps1xml b/Source/formats/Team.ServiceEndpoint.TableView.ps1xml deleted file mode 100644 index cf9b18f05..000000000 --- a/Source/formats/Team.ServiceEndpoint.TableView.ps1xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Team.ServiceEndpoint.TableView - - Team.ServiceEndpoint - - - - - - - - - - - - - - - - - - - - - name - - - type - - - id - - - createdByUser - - - - - - - - diff --git a/Source/formats/Team.ServiceEndpointType.ListView.ps1xml b/Source/formats/Team.ServiceEndpointType.ListView.ps1xml deleted file mode 100644 index 0c48dd29e..000000000 --- a/Source/formats/Team.ServiceEndpointType.ListView.ps1xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Team.ServiceEndpointType.ListView - - Team.ServiceEndpointType - - - - - - - name - - - displayName - - - description - - - helpMarkDown - - - - - - - - diff --git a/Source/formats/Team.ServiceEndpointType.TableView.ps1xml b/Source/formats/Team.ServiceEndpointType.TableView.ps1xml deleted file mode 100644 index 34ac363fa..000000000 --- a/Source/formats/Team.ServiceEndpointType.TableView.ps1xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Team.ServiceEndpointType.TableView - - Team.ServiceEndpointType - - - - - - - - - - - - - - - displayName - - - description - - - - - - - - diff --git a/Source/formats/Team.Team.ListView.ps1xml b/Source/formats/Team.Team.ListView.ps1xml deleted file mode 100644 index a04f333b0..000000000 --- a/Source/formats/Team.Team.ListView.ps1xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Team.Team.ListView - - Team.Team - Team.Provider.Team - - - - - - - Name - - - Description - - - ID - - - ProjectName - - - - - - - - diff --git a/Source/formats/Team.Team.TableView.ps1xml b/Source/formats/Team.Team.TableView.ps1xml deleted file mode 100644 index 759183e2d..000000000 --- a/Source/formats/Team.Team.TableView.ps1xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Team.Team.TableView - - Team.Team - - - - - - - - - - - - - - - - - Name - - - Description - - - - - - - - diff --git a/Source/formats/Team.User2.ListView.ps1xml b/Source/formats/Team.User2.ListView.ps1xml deleted file mode 100644 index a9901cfd8..000000000 --- a/Source/formats/Team.User2.ListView.ps1xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Team.User2.ListView - - Team.User2 - - - - - - - ID - - - PrincipalName - - - MailAddress - - - DisplayName - - - Origin - - - OriginID - - - URL - - - Descriptor - - - Links - - - - - - - - diff --git a/Source/formats/Team.User2.TableView.ps1xml b/Source/formats/Team.User2.TableView.ps1xml deleted file mode 100644 index cca34ed09..000000000 --- a/Source/formats/Team.User2.TableView.ps1xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Team.User2.TableView - - Team.User2 - - - - - - - - - - - - - - - - - - PrincipalName - - - DisplayName - - - Origin - - - - - - - - diff --git a/Source/formats/Team.UserEntitlement.ListView.ps1xml b/Source/formats/Team.UserEntitlement.ListView.ps1xml deleted file mode 100644 index 957966113..000000000 --- a/Source/formats/Team.UserEntitlement.ListView.ps1xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Team.UserEntitlement.ListView - - Team.UserEntitlement - - - - - - - id - - - userName - - - email - - - accessLevelName - - - projects - - - - - - - - diff --git a/Source/formats/Team.UserEntitlement.TableView.ps1xml b/Source/formats/Team.UserEntitlement.TableView.ps1xml deleted file mode 100644 index 1b49f0d86..000000000 --- a/Source/formats/Team.UserEntitlement.TableView.ps1xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Team.UserEntitlement.TableView - - Team.UserEntitlement - - - - - - - - - - - - - - - - - - - - - userName - - - email - - - accessLevelName - - - lastAccessedDate - - - - - - - - diff --git a/Source/formats/Team.UserEntitlement.WideView.ps1xml b/Source/formats/Team.UserEntitlement.WideView.ps1xml deleted file mode 100644 index d205f140d..000000000 --- a/Source/formats/Team.UserEntitlement.WideView.ps1xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Team.UserEntitlement.WideView - - Team.UserEntitlement - - - - - - userName - - - - - - - diff --git a/Source/formats/Team.VariableGroup.ListView.ps1xml b/Source/formats/Team.VariableGroup.ListView.ps1xml deleted file mode 100644 index a874e484a..000000000 --- a/Source/formats/Team.VariableGroup.ListView.ps1xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Team.VariableGroup.ListView - - Team.VariableGroup - - - - - - - id - - - name - - - createdByUser - - - modifiedByUser - - - - - - - - diff --git a/Source/formats/Team.VariableGroup.TableView.ps1xml b/Source/formats/Team.VariableGroup.TableView.ps1xml deleted file mode 100644 index 8d9989223..000000000 --- a/Source/formats/Team.VariableGroup.TableView.ps1xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Team.VariableGroup.TableView - - Team.VariableGroup - - - - - - - - - - - - - - - - - - - - - id - - - name - - - createdByUser - - - modifiedByUser - - - - - - - - diff --git a/Source/formats/Team.Wiql.ListView.ps1xml b/Source/formats/Team.Wiql.ListView.ps1xml deleted file mode 100644 index cdde42ec8..000000000 --- a/Source/formats/Team.Wiql.ListView.ps1xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Team.Wiql.ListView - - Team.Wiql - - - - - - - queryType - - - WorkItemIDs - - - workItems - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.Wiql.TableView.ps1xml b/Source/formats/Team.Wiql.TableView.ps1xml deleted file mode 100644 index c8c54361a..000000000 --- a/Source/formats/Team.Wiql.TableView.ps1xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Team.Wiql.TableView - - Team.Wiql - - - - - - - - - - - - - - - - - - queryType - - - WorkItemIDs - - - workItems - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.WorkItem.ListView.ps1xml b/Source/formats/Team.WorkItem.ListView.ps1xml deleted file mode 100644 index ca9db652d..000000000 --- a/Source/formats/Team.WorkItem.ListView.ps1xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Team.WorkItem.ListView - - Team.WorkItem - - - - - - - id - - - title - - - state - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.WorkItem.TableView.ps1xml b/Source/formats/Team.WorkItem.TableView.ps1xml deleted file mode 100644 index 2c1f2b120..000000000 --- a/Source/formats/Team.WorkItem.TableView.ps1xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Team.WorkItem.TableView - - Team.WorkItem - - - - - - - - - - - - - - - - - - id - - - title - - - state - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.WorkItemDeleted.ListView.ps1xml b/Source/formats/Team.WorkItemDeleted.ListView.ps1xml deleted file mode 100644 index a21e0c9d3..000000000 --- a/Source/formats/Team.WorkItemDeleted.ListView.ps1xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Team.WorkItemDeleted.ListView - - Team.WorkItemDeleted - - - - - - - id - - - name - - - deletedBy - - - deletedDate - - - code - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.WorkItemDeleted.TableView.ps1xml b/Source/formats/Team.WorkItemDeleted.TableView.ps1xml deleted file mode 100644 index 16b92770a..000000000 --- a/Source/formats/Team.WorkItemDeleted.TableView.ps1xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Team.WorkItemDeleted.TableView - - Team.WorkItemDeleted - - - - - - - - - - - - - - - - - - - - - - - - id - - - name - - - deletedBy - - - deletedDate - - - code - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.WorkItemType.ListView.ps1xml b/Source/formats/Team.WorkItemType.ListView.ps1xml deleted file mode 100644 index 31e3100e6..000000000 --- a/Source/formats/Team.WorkItemType.ListView.ps1xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Team.WorkItemType.ListView - - Team.WorkItemType - - - - - - - name - - - description - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.WorkItemType.TableView.ps1xml b/Source/formats/Team.WorkItemType.TableView.ps1xml deleted file mode 100644 index 9ce94d5da..000000000 --- a/Source/formats/Team.WorkItemType.TableView.ps1xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Team.WorkItemType.TableView - - Team.WorkItemType - - - - - - - - - - - - - - - name - - - description - - - - - - - - \ No newline at end of file diff --git a/Source/formats/Team.YamlPipelineResult.TableView.ps1xml b/Source/formats/Team.YamlPipelineResult.TableView.ps1xml deleted file mode 100644 index 708694730..000000000 --- a/Source/formats/Team.YamlPipelineResult.TableView.ps1xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Team.YamlPipelineResult.TableView - - Team.YamlPipelineResult - - - - - - - - - - - - - - - - - - - - - name - - - id - - - url - - - state - - - - - - - - \ No newline at end of file diff --git a/Source/formats/_formats.json b/Source/formats/_formats.json index ee5f3bc28..1d57bbe7f 100644 --- a/Source/formats/_formats.json +++ b/Source/formats/_formats.json @@ -2,105 +2,110 @@ "outputFile": "vsteam.format.ps1xml", "fileType": "formats", "files": [ - "Team.Provider.JobRequest.TableView.ps1xml", - "Team.Approval.Pending.TableView.ps1xml", - "Team.Approval.Approved.TableView.ps1xml", - "Team.Approval.Rejected.TableView.ps1xml", - "Team.AccessControlEntry.TableView.ps1xml", - "Team.AccessControlEntry.ListView.ps1xml", - "Team.AccessControlList.TableView.ps1xml", - "Team.AccessControlList.ListView.ps1xml", - "Team.Build.TableView.ps1xml", - "Team.Build.WideView.ps1xml", - "Team.Build.ListView.ps1xml", - "Team.Build.Artifact.TableView.ps1xml", - "Team.Build.Artifact.WideView.ps1xml", - "Team.Build.Artifact.ListView.ps1xml", - "Team.Build.Artifact.Resource.TableView.ps1xml", - "Team.Build.Artifact.Resource.WideView.ps1xml", - "Team.Build.Artifact.Resource.ListView.ps1xml", - "Team.ClassificationNode.TableView.ps1xml", - "Team.ClassificationNode.ListView.ps1xml", - "Team.Descriptor.TableView.ps1xml", - "Team.Descriptor.ListView.ps1xml", - "Team.Group.TableView.ps1xml", - "Team.Group.ListView.ps1xml", - "Team.PolicyType.TableView.ps1xml", - "Team.Profile.TableView.ps1xml", - "Team.SecurityNamespace.TableView.ps1xml", - "Team.SecurityNamespace.ListView.ps1xml", - "Team.ServiceEndpointType.TableView.ps1xml", - "Team.ServiceEndpointType.ListView.ps1xml", - "Team.ServiceEndpoint.TableView.ps1xml", - "Team.ServiceEndpoint.ListView.ps1xml", - "Team.Option.TableView.ps1xml", - "Team.Option.Versions.TableView.ps1xml", - "Team.User2.TableView.ps1xml", - "Team.User2.ListView.ps1xml", - "Team.UserEntitlement.TableView.ps1xml", - "Team.UserEntitlement.WideView.ps1xml", - "Team.UserEntitlement.ListView.ps1xml", - "Team.VariableGroup.TableView.ps1xml", - "Team.VariableGroup.ListView.ps1xml", - "Team.Provider.Feed.TableView.ps1xml", - "Team.Feed.TableView.ps1xml", - "Team.Provider.GitRef.TableView.ps1xml", - "Team.GitRef.TableView.ps1xml", - "Team.Agent.TableView.ps1xml", - "Team.Provider.Agent.TableView.ps1xml", - "Team.Provider.Team.TableView.ps1xml", - "Team.Team.TableView.ps1xml", - "Team.Team.ListView.ps1xml", - "Team.Provider.Release.TableView.ps1xml", - "Team.ReleaseDefinition.TableView.ps1xml", - "Team.Provider.ReleaseDefinition.TableView.ps1xml", - "Team.Environment.Status.TableView.ps1xml", - "Team.Build.TableView.ps1xml", - "Team.Build.ListView.ps1xml", - "Team.BuildDefinition.TableView.ps1xml", - "Team.Provider.BuildDefinition.TableView.ps1xml", - "Team.BuildDefinition.ListView.ps1xml", - "Team.BuildDefinitionYamlProcess.TableView.ps1xml", - "Team.Provider.BuildDefinitionYamlProcess.TableView.ps1xml", - "Team.BuildDefinitionPhasedProcess.TableView.ps1xml", - "Team.BuildDefinitionProcess.ListView.ps1xml", - "Team.BuildDefinitionProcessPhase.TableView.ps1xml", - "Team.Provider.BuildDefinitionProcessPhase.TableView.ps1xml", - "Team.BuildDefinitionProcessPhase.ListView.ps1xml", - "Team.BuildDefinitionProcessPhaseStep.TableView.ps1xml", - "Team.Provider.BuildDefinitionProcessPhaseStep.TableView.ps1xml", - "Team.BuildDefinitionProcessPhaseStep.ListView.ps1xml", - "Team.Release.TableView.ps1xml", - "Team.Repository.TableView.ps1xml", - "Team.Provider.Repository.TableView.ps1xml", - "Team.Repository.ListView.ps1xml", - "Team.Provider.Project.TableView.ps1xml", - "Team.Project.TableView.ps1xml", - "Team.Project.ListView.ps1xml", - "Team.Process.TableView.ps1xml", - "Team.Process.ListView.ps1xml", - "Team.Pool.TableView.ps1xml", - "Team.Provider.Queue.TableView.ps1xml", - "Team.Provider.Pool.TableView.ps1xml", - "Team.Extension.TableView.ps1xml", - "Team.Provider.Extension.TableView.ps1xml", - "Team.PSDrive.Default.TableView.ps1xml", - "Team.PSDrive.Default.ListView.ps1xml", - "Team.PSDrive.Leaf.Default.TableView.ps1xml", - "Team.WorkItemType.TableView.ps1xml", - "Team.WorkItemType.ListView.ps1xml", - "Team.Wiql.TableView.ps1xml", - "Team.Wiql.ListView.ps1xml", - "Team.WorkItem.TableView.ps1xml", - "Team.WorkItem.ListView.ps1xml", - "Team.WorkItemDeleted.TableView.ps1xml", - "Team.WorkItemDeleted.ListView.ps1xml", - "Team.JobRequest.TableView.ps1xml", - "Team.GitCommitRef.TableView.ps1xml", - "Team.GitUserDate.TableView.ps1xml", - "Team.BuildTimeline.TableView.ps1xml", - "Team.BuildTimeline.ListView.ps1xml", - "Team.YamlPipelineResult.TableView.ps1xml", - "Team.ResourceArea.TableView.ps1xml" + "vsteam_lib.TaskGroup.TableView.ps1xml", + "vsteam_lib.GitStat.TableView.ps1xml", + "vsteam_lib.AzureSubscription.TableView.ps1xml", + "vsteam_lib.Environment.Status.TableView.ps1xml", + "vsteam_lib.Query.TableView.ps1xml", + "vsteam_lib.Provider.JobRequest.TableView.ps1xml", + "vsteam_lib.Approval.Pending.TableView.ps1xml", + "vsteam_lib.Approval.Approved.TableView.ps1xml", + "vsteam_lib.Approval.Rejected.TableView.ps1xml", + "vsteam_lib.AccessControlEntry.TableView.ps1xml", + "vsteam_lib.AccessControlEntry.ListView.ps1xml", + "vsteam_lib.AccessControlList.TableView.ps1xml", + "vsteam_lib.AccessControlList.ListView.ps1xml", + "vsteam_lib.Build.TableView.ps1xml", + "vsteam_lib.Build.Artifact.TableView.ps1xml", + "vsteam_lib.Build.Artifact.WideView.ps1xml", + "vsteam_lib.Build.Artifact.ListView.ps1xml", + "vsteam_lib.Build.Artifact.Resource.TableView.ps1xml", + "vsteam_lib.Build.Artifact.Resource.WideView.ps1xml", + "vsteam_lib.Build.Artifact.Resource.ListView.ps1xml", + "vsteam_lib.ClassificationNode.TableView.ps1xml", + "vsteam_lib.ClassificationNode.ListView.ps1xml", + "vsteam_lib.Descriptor.TableView.ps1xml", + "vsteam_lib.Descriptor.ListView.ps1xml", + "vsteam_lib.Group.TableView.ps1xml", + "vsteam_lib.Group.ListView.ps1xml", + "vsteam_lib.PolicyType.TableView.ps1xml", + "vsteam_lib.Profile.TableView.ps1xml", + "vsteam_lib.SecurityNamespace.TableView.ps1xml", + "vsteam_lib.SecurityNamespace.ListView.ps1xml", + "vsteam_lib.ServiceEndpointType.TableView.ps1xml", + "vsteam_lib.ServiceEndpointType.ListView.ps1xml", + "vsteam_lib.ServiceEndpoint.TableView.ps1xml", + "vsteam_lib.ServiceEndpoint.ListView.ps1xml", + "vsteam_lib.Option.TableView.ps1xml", + "vsteam_lib.Option.Versions.TableView.ps1xml", + "vsteam_lib.User.TableView.ps1xml", + "vsteam_lib.User.ListView.ps1xml", + "vsteam_lib.UserEntitlement.TableView.ps1xml", + "vsteam_lib.UserEntitlement.WideView.ps1xml", + "vsteam_lib.UserEntitlement.ListView.ps1xml", + "vsteam_lib.VariableGroup.TableView.ps1xml", + "vsteam_lib.VariableGroup.ListView.ps1xml", + "vsteam_lib.Provider.Feed.TableView.ps1xml", + "vsteam_lib.Feed.TableView.ps1xml", + "vsteam_lib.Provider.GitRef.TableView.ps1xml", + "vsteam_lib.GitRef.TableView.ps1xml", + "vsteam_lib.Agent.TableView.ps1xml", + "vsteam_lib.Provider.Agent.TableView.ps1xml", + "vsteam_lib.Provider.Team.TableView.ps1xml", + "vsteam_lib.Team.TableView.ps1xml", + "vsteam_lib.Team.ListView.ps1xml", + "vsteam_lib.Provider.Release.TableView.ps1xml", + "vsteam_lib.ReleaseDefinition.TableView.ps1xml", + "vsteam_lib.Provider.ReleaseDefinition.TableView.ps1xml", + "vsteam_lib.Environment.Status.TableView.ps1xml", + "vsteam_lib.BuildDefinition.TableView.ps1xml", + "vsteam_lib.Provider.BuildDefinition.TableView.ps1xml", + "vsteam_lib.Provider.Environment.Status.TableView.ps1xml", + "vsteam_lib.BuildDefinition.ListView.ps1xml", + "vsteam_lib.BuildDefinitionYamlProcess.TableView.ps1xml", + "vsteam_lib.Provider.BuildDefinitionYamlProcess.TableView.ps1xml", + "vsteam_lib.BuildDefinitionPhasedProcess.TableView.ps1xml", + "vsteam_lib.BuildDefinitionProcess.ListView.ps1xml", + "vsteam_lib.BuildDefinitionProcessPhase.TableView.ps1xml", + "vsteam_lib.Provider.BuildDefinitionProcessPhase.TableView.ps1xml", + "vsteam_lib.BuildDefinitionProcessPhase.ListView.ps1xml", + "vsteam_lib.BuildDefinitionProcessPhaseStep.TableView.ps1xml", + "vsteam_lib.Provider.BuildDefinitionProcessPhaseStep.TableView.ps1xml", + "vsteam_lib.BuildDefinitionProcessPhaseStep.ListView.ps1xml", + "vsteam_lib.Release.TableView.ps1xml", + "vsteam_lib.Repository.TableView.ps1xml", + "vsteam_lib.Provider.Repository.TableView.ps1xml", + "vsteam_lib.Repository.ListView.ps1xml", + "vsteam_lib.Provider.Project.TableView.ps1xml", + "vsteam_lib.Project.TableView.ps1xml", + "vsteam_lib.Project.ListView.ps1xml", + "vsteam_lib.Process.TableView.ps1xml", + "vsteam_lib.Process.ListView.ps1xml", + "vsteam_lib.AgentPool.TableView.ps1xml", + "vsteam_lib.Provider.AgentPool.TableView.ps1xml", + "vsteam_lib.Extension.TableView.ps1xml", + "vsteam_lib.Provider.Extension.TableView.ps1xml", + "vsteam_lib.PSDrive.Default.TableView.ps1xml", + "vsteam_lib.Provider.Build.TableView.ps1xml", + "vsteam_lib.Queue.TableView.ps1xml", + "vsteam_lib.PSDrive.Default.ListView.ps1xml", + "vsteam_lib.WorkItemType.TableView.ps1xml", + "vsteam_lib.WorkItemType.ListView.ps1xml", + "vsteam_lib.Wiql.TableView.ps1xml", + "vsteam_lib.Wiql.ListView.ps1xml", + "vsteam_lib.WorkItem.TableView.ps1xml", + "vsteam_lib.WorkItem.ListView.ps1xml", + "vsteam_lib.WorkItemDeleted.TableView.ps1xml", + "vsteam_lib.WorkItemDeleted.ListView.ps1xml", + "vsteam_lib.JobRequest.TableView.ps1xml", + "vsteam_lib.GitCommitRef.TableView.ps1xml", + "vsteam_lib.GitUserDate.TableView.ps1xml", + "vsteam_lib.BuildTimeline.TableView.ps1xml", + "vsteam_lib.YamlPipelineResult.TableView.ps1xml", + "vsteam_lib.Build.WideView.ps1xml", + "vsteam_lib.Build.ListView.ps1xml", + "vsteam_lib.ResourceArea.TableView.ps1xml", + "vsteam_lib.PullRequest.TableView.ps1xml", + "vsteam_lib.Policy.TableView.ps1xml" ] } \ No newline at end of file diff --git a/Source/formats/readme.md b/Source/formats/readme.md index 9eda40a25..8cbc539b7 100644 --- a/Source/formats/readme.md +++ b/Source/formats/readme.md @@ -2,4 +2,4 @@ Make sure the table views are listed before the list views. If not when Get-ChildItem is called the list format will be used instead of the table. You can control the order the files are merged using the _formats.json file. -There are also needs to be a different format for the types returned from the provider which are PowerShell classes vs the types added to the objects returned by the other functions. +There are also needs to be a different format for the types returned from the provider which are classes vs the types added to the objects returned by the other functions. diff --git a/Source/formats/vsteam_lib.AccessControlEntry.ListView.ps1xml b/Source/formats/vsteam_lib.AccessControlEntry.ListView.ps1xml new file mode 100644 index 000000000..48a100b59 --- /dev/null +++ b/Source/formats/vsteam_lib.AccessControlEntry.ListView.ps1xml @@ -0,0 +1,31 @@ + + + + + vsteam_lib.AccessControlEntry.ListView + + vsteam_lib.AccessControlEntry + + + + + + + Descriptor + + + Allow + + + Deny + + + ExtendedInfo + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.AccessControlEntry.TableView.ps1xml b/Source/formats/vsteam_lib.AccessControlEntry.TableView.ps1xml new file mode 100644 index 000000000..1f55defc9 --- /dev/null +++ b/Source/formats/vsteam_lib.AccessControlEntry.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.AccessControlEntry.TableView + + vsteam_lib.AccessControlEntry + + + + + + + + + + + + + + + + + + Descriptor + + + Allow + + + Deny + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.AccessControlList.ListView.ps1xml b/Source/formats/vsteam_lib.AccessControlList.ListView.ps1xml new file mode 100644 index 000000000..390fe0fe1 --- /dev/null +++ b/Source/formats/vsteam_lib.AccessControlList.ListView.ps1xml @@ -0,0 +1,28 @@ + + + + + vsteam_lib.AccessControlList.ListView + + vsteam_lib.AccessControlList + + + + + + + Token + + + InheritPermissions + + + Aces + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.AccessControlList.TableView.ps1xml b/Source/formats/vsteam_lib.AccessControlList.TableView.ps1xml new file mode 100644 index 000000000..69b06c419 --- /dev/null +++ b/Source/formats/vsteam_lib.AccessControlList.TableView.ps1xml @@ -0,0 +1,40 @@ + + + + + vsteam_lib.AccessControlList.TableView + + vsteam_lib.AccessControlList + + + + + + + + + + + + + + + + + + Token + + + InheritPermissions + + + Left + $_.Aces.Values | % { $_.ToString() } + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.Agent.TableView.ps1xml b/Source/formats/vsteam_lib.Agent.TableView.ps1xml new file mode 100644 index 000000000..5e7206fca --- /dev/null +++ b/Source/formats/vsteam_lib.Agent.TableView.ps1xml @@ -0,0 +1,53 @@ + + + + + vsteam_lib.Agent.TableView + + vsteam_lib.Agent + + + + + + + + + + + + + + + + + + + + + + + + + + name + + + enabled + + + version + + + os + + + agentId + + + + + + + + diff --git a/Source/formats/vsteam_lib.AgentPool.TableView.ps1xml b/Source/formats/vsteam_lib.AgentPool.TableView.ps1xml new file mode 100644 index 000000000..792d2892b --- /dev/null +++ b/Source/formats/vsteam_lib.AgentPool.TableView.ps1xml @@ -0,0 +1,42 @@ + + + + + + vsteam_lib.AgentPool.TableView + + vsteam_lib.AgentPool + + + + + + + + + + + + + + + + + + + + Name + + + Count + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Approval.Approved.TableView.ps1xml b/Source/formats/vsteam_lib.Approval.Approved.TableView.ps1xml new file mode 100644 index 000000000..041eab248 --- /dev/null +++ b/Source/formats/vsteam_lib.Approval.Approved.TableView.ps1xml @@ -0,0 +1,63 @@ + + + + + vsteam_lib.Approval.Approved.TableView + + vsteam_lib.Approval + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + releaseName + + + releaseEnvironmentName + + + isAutomated + + + shortApprovalType + + + approverName + + + releaseDefinitionName + + + comments + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.Approval.Pending.TableView.ps1xml b/Source/formats/vsteam_lib.Approval.Pending.TableView.ps1xml new file mode 100644 index 000000000..b5a90279c --- /dev/null +++ b/Source/formats/vsteam_lib.Approval.Pending.TableView.ps1xml @@ -0,0 +1,63 @@ + + + + + vsteam_lib.Approval.Pending.TableView + + vsteam_lib.Approval + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + releaseName + + + status + + + releaseEnvironmentName + + + shortApprovalType + + + approverName + + + releaseDefinitionName + + + Id + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.Approval.Rejected.TableView.ps1xml b/Source/formats/vsteam_lib.Approval.Rejected.TableView.ps1xml new file mode 100644 index 000000000..4548945c6 --- /dev/null +++ b/Source/formats/vsteam_lib.Approval.Rejected.TableView.ps1xml @@ -0,0 +1,57 @@ + + + + + vsteam_lib.Approval.Rejected.TableView + + vsteam_lib.Approval + + + + + + + + + + + + + + + + + + + + + + + + + + + releaseName + + + releaseEnvironmentName + + + shortApprovalType + + + approverName + + + releaseDefinitionName + + + comments + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.AzureSubscription.TableView.ps1xml b/Source/formats/vsteam_lib.AzureSubscription.TableView.ps1xml new file mode 100644 index 000000000..de3e786f9 --- /dev/null +++ b/Source/formats/vsteam_lib.AzureSubscription.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.AzureSubscription.TableView + + vsteam_lib.AzureSubscription + + + + + + + + + + + + + + + + + + displayName + + + subscriptionTenantId + + + subscriptionId + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.Build.Artifact.ListView.ps1xml b/Source/formats/vsteam_lib.Build.Artifact.ListView.ps1xml new file mode 100644 index 000000000..685a78a00 --- /dev/null +++ b/Source/formats/vsteam_lib.Build.Artifact.ListView.ps1xml @@ -0,0 +1,34 @@ + + + + + vsteam_lib.Build.Artifact.ListView + + vsteam_lib.Build.Artifact + + + + + + + name + + + type + + + data + + + downloadUrl + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Build.Artifact.Resource.ListView.ps1xml b/Source/formats/vsteam_lib.Build.Artifact.Resource.ListView.ps1xml new file mode 100644 index 000000000..cb6230f55 --- /dev/null +++ b/Source/formats/vsteam_lib.Build.Artifact.Resource.ListView.ps1xml @@ -0,0 +1,34 @@ + + + + + vsteam_lib.Build.Artifact.Resource.ListView + + vsteam_lib.Build.Artifact.Resource + + + + + + + type + + + data + + + url + + + downloadUrl + + + properties + + + + + + + + diff --git a/Source/formats/vsteam_lib.Build.Artifact.Resource.TableView.ps1xml b/Source/formats/vsteam_lib.Build.Artifact.Resource.TableView.ps1xml new file mode 100644 index 000000000..1925a13a3 --- /dev/null +++ b/Source/formats/vsteam_lib.Build.Artifact.Resource.TableView.ps1xml @@ -0,0 +1,51 @@ + + + + + vsteam_lib.Build.Artifact.Resource.TableView + + vsteam_lib.Build.Artifact.Resource + + + + + + + + + + + + + + + + + + + + + + + + type + + + data + + + url + + + downloadUrl + + + properties + + + + + + + + diff --git a/Source/formats/vsteam_lib.Build.Artifact.Resource.WideView.ps1xml b/Source/formats/vsteam_lib.Build.Artifact.Resource.WideView.ps1xml new file mode 100644 index 000000000..732bd484a --- /dev/null +++ b/Source/formats/vsteam_lib.Build.Artifact.Resource.WideView.ps1xml @@ -0,0 +1,20 @@ + + + + + vsteam_lib.Build.Artifact.Resource.WideView + + vsteam_lib.Build.Artifact.Resource + + + + + + properties + + + + + + + diff --git a/Source/formats/vsteam_lib.Build.Artifact.TableView.ps1xml b/Source/formats/vsteam_lib.Build.Artifact.TableView.ps1xml new file mode 100644 index 000000000..165840b8a --- /dev/null +++ b/Source/formats/vsteam_lib.Build.Artifact.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.Build.Artifact.TableView + + vsteam_lib.Build.Artifact + + + + + + + + + + + + + + + + + + name + + + type + + + downloadUrl + + + + + + + + diff --git a/Source/formats/vsteam_lib.Build.Artifact.WideView.ps1xml b/Source/formats/vsteam_lib.Build.Artifact.WideView.ps1xml new file mode 100644 index 000000000..54ef397f0 --- /dev/null +++ b/Source/formats/vsteam_lib.Build.Artifact.WideView.ps1xml @@ -0,0 +1,20 @@ + + + + + vsteam_lib.Build.Artifact.WideView + + vsteam_lib.Build.Artifact + + + + + + downloadUrl + + + + + + + diff --git a/Source/formats/vsteam_lib.Build.ListView.ps1xml b/Source/formats/vsteam_lib.Build.ListView.ps1xml new file mode 100644 index 000000000..98e13b67a --- /dev/null +++ b/Source/formats/vsteam_lib.Build.ListView.ps1xml @@ -0,0 +1,44 @@ + + + + + vsteam_lib.Build.ListView + + vsteam_lib.Provider.Build + vsteam_lib.Build + + + + + + + Name + + + Status + + + Result + + + StartTime + + + RequestedBy + + + BuildDefinition + + + ProjectName + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Build.TableView.ps1xml b/Source/formats/vsteam_lib.Build.TableView.ps1xml new file mode 100644 index 000000000..6458f9260 --- /dev/null +++ b/Source/formats/vsteam_lib.Build.TableView.ps1xml @@ -0,0 +1,47 @@ + + + + + vsteam_lib.Build.TableView + + vsteam_lib.Build + + + + + + + + + + + + + + + + + + + + + + + BuildDefinition + + + BuildNumber + + + Result + + + Id + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.Build.WideView.ps1xml b/Source/formats/vsteam_lib.Build.WideView.ps1xml new file mode 100644 index 000000000..f03e9d9ba --- /dev/null +++ b/Source/formats/vsteam_lib.Build.WideView.ps1xml @@ -0,0 +1,20 @@ + + + + + vsteam_lib.Build.WideView + + vsteam_lib.Build + + + + + + buildnumber + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinition.ListView.ps1xml b/Source/formats/vsteam_lib.BuildDefinition.ListView.ps1xml new file mode 100644 index 000000000..78895fdc8 --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinition.ListView.ps1xml @@ -0,0 +1,28 @@ + + + + + vsteam_lib.BuildDefinition.ListView + + vsteam_lib.BuildDefinition + + + + + + + Name + + + AuthoredBy + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinition.TableView.ps1xml b/Source/formats/vsteam_lib.BuildDefinition.TableView.ps1xml new file mode 100644 index 000000000..1b613e120 --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinition.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.BuildDefinition.TableView + + vsteam_lib.BuildDefinition + + + + + + + + + + + + + + + + + Name + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinitionPhasedProcess.TableView.ps1xml b/Source/formats/vsteam_lib.BuildDefinitionPhasedProcess.TableView.ps1xml new file mode 100644 index 000000000..d79ba6878 --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinitionPhasedProcess.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.BuildDefinitionPhasedProcess.TableView + + vsteam_lib.BuildDefinitionPhasedProcess + + + + + + + + + + + + + + + + + Name + + + Phases + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinitionProcess.ListView.ps1xml b/Source/formats/vsteam_lib.BuildDefinitionProcess.ListView.ps1xml new file mode 100644 index 000000000..995c7e3af --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinitionProcess.ListView.ps1xml @@ -0,0 +1,25 @@ + + + + + vsteam_lib.BuildDefinitionProcess.ListView + + vsteam_lib.BuildDefinitionProcess + + + + + + + Name + + + Phases + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinitionProcessPhase.ListView.ps1xml b/Source/formats/vsteam_lib.BuildDefinitionProcessPhase.ListView.ps1xml new file mode 100644 index 000000000..8b7b35ad5 --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinitionProcessPhase.ListView.ps1xml @@ -0,0 +1,25 @@ + + + + + vsteam_lib.BuildDefinitionProcessPhase.ListView + + vsteam_lib.BuildDefinitionProcessPhase + + + + + + + Name + + + Steps + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinitionProcessPhase.TableView.ps1xml b/Source/formats/vsteam_lib.BuildDefinitionProcessPhase.TableView.ps1xml new file mode 100644 index 000000000..8d5fda363 --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinitionProcessPhase.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.BuildDefinitionProcessPhase.TableView + + vsteam_lib.BuildDefinitionProcessPhase + + + + + + + + + + + + + + + + + Name + + + StepCount + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinitionProcessPhaseStep.ListView.ps1xml b/Source/formats/vsteam_lib.BuildDefinitionProcessPhaseStep.ListView.ps1xml new file mode 100644 index 000000000..ab5e47f7a --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinitionProcessPhaseStep.ListView.ps1xml @@ -0,0 +1,28 @@ + + + + + vsteam_lib.BuildDefinitionProcessPhaseStep.ListView + + vsteam_lib.BuildDefinitionProcessPhaseStep + + + + + + + Name + + + Enabled + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinitionProcessPhaseStep.TableView.ps1xml b/Source/formats/vsteam_lib.BuildDefinitionProcessPhaseStep.TableView.ps1xml new file mode 100644 index 000000000..6e81d3db6 --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinitionProcessPhaseStep.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.BuildDefinitionProcessPhaseStep.TableView + + vsteam_lib.BuildDefinitionProcessPhaseStep + + + + + + + + + + + + + + + + + + + + Name + + + Enabled + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildDefinitionYamlProcess.TableView.ps1xml b/Source/formats/vsteam_lib.BuildDefinitionYamlProcess.TableView.ps1xml new file mode 100644 index 000000000..12b3f750b --- /dev/null +++ b/Source/formats/vsteam_lib.BuildDefinitionYamlProcess.TableView.ps1xml @@ -0,0 +1,29 @@ + + + + + vsteam_lib.BuildDefinitionYamlProcess.TableView + + vsteam_lib.BuildDefinitionYamlProcess + + + + + + + + + + + + + + yamlFilename + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildTimeline.TableView.ps1xml b/Source/formats/vsteam_lib.BuildTimeline.TableView.ps1xml new file mode 100644 index 000000000..976842bb4 --- /dev/null +++ b/Source/formats/vsteam_lib.BuildTimeline.TableView.ps1xml @@ -0,0 +1,53 @@ + + + + + vsteam_lib.BuildTimeline.TableView + + vsteam_lib.BuildTimeline + + + + + + + + + + + + + + + + + + + + + + + + + + [datetime]::Parse($_.lastChangedOn) + + + lastChangedBy + + + numberOfRecords + + + changeId + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.BuildTimline.ListView.ps1xml b/Source/formats/vsteam_lib.BuildTimline.ListView.ps1xml new file mode 100644 index 000000000..9e402c663 --- /dev/null +++ b/Source/formats/vsteam_lib.BuildTimline.ListView.ps1xml @@ -0,0 +1,31 @@ + + + + + vsteam_lib.BuildTimeline.ListView + + vsteam_lib.BuildTimeline + + + + + + + changeId + + + numberOfRecords + + + records + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.ClassificationNode.ListView.ps1xml b/Source/formats/vsteam_lib.ClassificationNode.ListView.ps1xml new file mode 100644 index 000000000..8d170e618 --- /dev/null +++ b/Source/formats/vsteam_lib.ClassificationNode.ListView.ps1xml @@ -0,0 +1,46 @@ + + + + + vsteam_lib.ClassificationNode.ListView + + vsteam_lib.ClassificationNode + + + + + + + Identifier + + + Name + + + Path + + + StructureType + + + ProjectName + + + Url + + + HasChildren + + + Children + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.ClassificationNode.TableView.ps1xml b/Source/formats/vsteam_lib.ClassificationNode.TableView.ps1xml new file mode 100644 index 000000000..ecb274854 --- /dev/null +++ b/Source/formats/vsteam_lib.ClassificationNode.TableView.ps1xml @@ -0,0 +1,51 @@ + + + + + vsteam_lib.ClassificationNode.TableView + + vsteam_lib.ClassificationNode + + + + + + + + + + + + + + + + + + + + + + + + Name + + + Path + + + StructureType + + + HasChildren + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Descriptor.ListView.ps1xml b/Source/formats/vsteam_lib.Descriptor.ListView.ps1xml new file mode 100644 index 000000000..663ec3b8e --- /dev/null +++ b/Source/formats/vsteam_lib.Descriptor.ListView.ps1xml @@ -0,0 +1,25 @@ + + + + + vsteam_lib.Descriptor.ListView + + vsteam_lib.Descriptor + + + + + + + Name + + + Links + + + + + + + + diff --git a/Source/formats/vsteam_lib.Descriptor.TableView.ps1xml b/Source/formats/vsteam_lib.Descriptor.TableView.ps1xml new file mode 100644 index 000000000..8c789e9cb --- /dev/null +++ b/Source/formats/vsteam_lib.Descriptor.TableView.ps1xml @@ -0,0 +1,33 @@ + + + + + vsteam_lib.Descriptor.TableView + + vsteam_lib.Descriptor + + + + + + + + + + + + + + + Name + + + Links + + + + + + + + diff --git a/Source/formats/vsteam_lib.Environment.Status.TableView.ps1xml b/Source/formats/vsteam_lib.Environment.Status.TableView.ps1xml new file mode 100644 index 000000000..d49e2b3bd --- /dev/null +++ b/Source/formats/vsteam_lib.Environment.Status.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Environment.Status.TableView + + vsteam_lib.Environment + vsteam_lib.Attempt + vsteam_lib.Task + + + + + + + + + + + + + + + + + + Name + + + status + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Extension.TableView.ps1xml b/Source/formats/vsteam_lib.Extension.TableView.ps1xml new file mode 100644 index 000000000..68fc8a77e --- /dev/null +++ b/Source/formats/vsteam_lib.Extension.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Extension.TableView + + vsteam_lib.Extension + + + + + + + + + + + + + + + + + + + + Name + + + Id + + + publisherId + + + + + + + + diff --git a/Source/formats/vsteam_lib.Feed.TableView.ps1xml b/Source/formats/vsteam_lib.Feed.TableView.ps1xml new file mode 100644 index 000000000..a3986a2fb --- /dev/null +++ b/Source/formats/vsteam_lib.Feed.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Feed.TableView + + vsteam_lib.Feed + + + + + + + + + + + + + + + + + + + + Name + + + Description + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.GitCommitRef.TableView.ps1xml b/Source/formats/vsteam_lib.GitCommitRef.TableView.ps1xml new file mode 100644 index 000000000..9fb36d437 --- /dev/null +++ b/Source/formats/vsteam_lib.GitCommitRef.TableView.ps1xml @@ -0,0 +1,48 @@ + + + + + vsteam_lib.GitCommitRef.TableView + + vsteam_lib.GitCommitRef + vsteam_lib.GitUserDate + + + + + + + + + + + + + + + + + + + + + + + $_.Committer.Date + + + $_.Committer.Name + + + Comment + + + CommitId + + + + + + + + diff --git a/Source/formats/vsteam_lib.GitRef.TableView.ps1xml b/Source/formats/vsteam_lib.GitRef.TableView.ps1xml new file mode 100644 index 000000000..873d8ffff --- /dev/null +++ b/Source/formats/vsteam_lib.GitRef.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.GitRef.TableView + + vsteam_lib.GitRef + + + + + + + + + + + + + + + + + RefName + + + Creator + + + + + + + + diff --git a/Source/formats/vsteam_lib.GitStat.TableView.ps1xml b/Source/formats/vsteam_lib.GitStat.TableView.ps1xml new file mode 100644 index 000000000..b5f1416e2 --- /dev/null +++ b/Source/formats/vsteam_lib.GitStat.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.GitStat.TableView + + vsteam_lib.GitStat + + + + + + + + + + + + + + + + + + Name + + + aheadCount + + + behindCount + + + + + + + + diff --git a/Source/formats/vsteam_lib.GitUserDate.TableView.ps1xml b/Source/formats/vsteam_lib.GitUserDate.TableView.ps1xml new file mode 100644 index 000000000..1e734f9dd --- /dev/null +++ b/Source/formats/vsteam_lib.GitUserDate.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.GitUserDate.TableView + + vsteam_lib.GitUserDate + + + + + + + + + + + + + + + + + Name + + + Email + + + + + + + + diff --git a/Source/formats/vsteam_lib.Group.ListView.ps1xml b/Source/formats/vsteam_lib.Group.ListView.ps1xml new file mode 100644 index 000000000..875877ef5 --- /dev/null +++ b/Source/formats/vsteam_lib.Group.ListView.ps1xml @@ -0,0 +1,46 @@ + + + + + vsteam_lib.Group.ListView + + vsteam_lib.Group + + + + + + + PrincipalName + + + DisplayName + + + ProjectName + + + Origin + + + OriginID + + + URL + + + Descriptor + + + Links + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Group.TableView.ps1xml b/Source/formats/vsteam_lib.Group.TableView.ps1xml new file mode 100644 index 000000000..a0e22f52c --- /dev/null +++ b/Source/formats/vsteam_lib.Group.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.Group.TableView + + vsteam_lib.Group + + + + + + + + + + + + + + + + + + + + + PrincipalName + + + DisplayName + + + ProjectName + + + Origin + + + + + + + + diff --git a/Source/formats/vsteam_lib.JobRequest.TableView.ps1xml b/Source/formats/vsteam_lib.JobRequest.TableView.ps1xml new file mode 100644 index 000000000..05ce8698a --- /dev/null +++ b/Source/formats/vsteam_lib.JobRequest.TableView.ps1xml @@ -0,0 +1,59 @@ + + + + + vsteam_lib.JobRequest.TableView + + vsteam_lib.JobRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name + + + result + + + Pipeline + + + QueueTime + + + Duration + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Option.TableView.ps1xml b/Source/formats/vsteam_lib.Option.TableView.ps1xml new file mode 100644 index 000000000..ffd2e3495 --- /dev/null +++ b/Source/formats/vsteam_lib.Option.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.Option.TableView + + vsteam_lib.Option + + + + + + + + + + + + + + + + + + + + + area + + + resourceName + + + releasedVersion + + + routeTemplate + + + + + + + + diff --git a/Source/formats/vsteam_lib.Option.Versions.TableView.ps1xml b/Source/formats/vsteam_lib.Option.Versions.TableView.ps1xml new file mode 100644 index 000000000..c0fba8ce7 --- /dev/null +++ b/Source/formats/vsteam_lib.Option.Versions.TableView.ps1xml @@ -0,0 +1,57 @@ + + + + + Versions + + vsteam_lib.Option + + + + + + + + + + + + + + + + + + + + + + + + + + + area + + + resourceName + + + releasedVersion + + + minVersion + + + maxVersion + + + resourceVersion + + + + + + + + diff --git a/Source/formats/vsteam_lib.PSDrive.Default.ListView.ps1xml b/Source/formats/vsteam_lib.PSDrive.Default.ListView.ps1xml new file mode 100644 index 000000000..489eb353b --- /dev/null +++ b/Source/formats/vsteam_lib.PSDrive.Default.ListView.ps1xml @@ -0,0 +1,30 @@ + + + + + vsteam_lib.PSDrive.Default.ListView + + vsteam_lib.AgentPool + vsteam_lib.Queue + vsteam_lib.Builds + vsteam_lib.Releases + vsteam_lib.Repositories + vsteam_lib.Teams + + + + + + + Name + + + projectName + + + + + + + + diff --git a/Source/formats/vsteam_lib.PSDrive.Default.TableView.ps1xml b/Source/formats/vsteam_lib.PSDrive.Default.TableView.ps1xml new file mode 100644 index 000000000..1a8633d31 --- /dev/null +++ b/Source/formats/vsteam_lib.PSDrive.Default.TableView.ps1xml @@ -0,0 +1,52 @@ + + + + + vsteam_lib.PSDrive.Default.TableView + + Microsoft.PowerShell.SHiPS.SHiPSLeaf + Microsoft.PowerShell.SHiPS.SHiPSDirectory + vsteam_lib.Provider.Directory + vsteam_lib.Queues + vsteam_lib.Provider.Queue + vsteam_lib.Provider.Pool + vsteam_lib.Provider.Pools + vsteam_lib.Builds + vsteam_lib.Provider.BuildDefinitions + vsteam_lib.Releases + vsteam_lib.ReleaseDefinitions + vsteam_lib.Repositories + vsteam_lib.Teams + vsteam_lib.Permissions + vsteam_lib.Groups + vsteam_lib.Users + vsteam_lib.Provider.Group + vsteam_lib.Provider.User + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.Policy.TableView.ps1xml b/Source/formats/vsteam_lib.Policy.TableView.ps1xml new file mode 100644 index 000000000..11a6ee04a --- /dev/null +++ b/Source/formats/vsteam_lib.Policy.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.Policy.TableView + + vsteam_lib.Policy + + + + + + + + + + + + + + + + + + + + + policyType + + + createdByUser + + + isEnabled + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.PolicyType.TableView.ps1xml b/Source/formats/vsteam_lib.PolicyType.TableView.ps1xml new file mode 100644 index 000000000..f0551469e --- /dev/null +++ b/Source/formats/vsteam_lib.PolicyType.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.PolicyType.TableView + + vsteam_lib.PolicyType + + + + + + + + + + + + + + + + + + displayName + + + description + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Process.ListView.ps1xml b/Source/formats/vsteam_lib.Process.ListView.ps1xml new file mode 100644 index 000000000..8f0e0ac6f --- /dev/null +++ b/Source/formats/vsteam_lib.Process.ListView.ps1xml @@ -0,0 +1,36 @@ + + + + + vsteam_lib.Process.ListView + + vsteam_lib.Process + vsteam_lib.Provider.Process + vsteam_lib.Process + + + + + + + Name + + + Description + + + IsEnabled + + + IsDefault + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Process.TableView.ps1xml b/Source/formats/vsteam_lib.Process.TableView.ps1xml new file mode 100644 index 000000000..b29f830f3 --- /dev/null +++ b/Source/formats/vsteam_lib.Process.TableView.ps1xml @@ -0,0 +1,48 @@ + + + + + vsteam_lib.Process.TableView + + vsteam_lib.Process + vsteam_lib.Process + + + + + + + + + + + + + + + + + + + + + + + Name + + + IsEnabled + + + IsDefault + + + Description + + + + + + + + diff --git a/Source/formats/vsteam_lib.Profile.TableView.ps1xml b/Source/formats/vsteam_lib.Profile.TableView.ps1xml new file mode 100644 index 000000000..c000e1472 --- /dev/null +++ b/Source/formats/vsteam_lib.Profile.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.Profile.TableView + + vsteam_lib.Profile + + + + + + + + + + + + + + + + + + + + + Name + + + URL + + + Version + + + Type + + + + + + + + diff --git a/Source/formats/vsteam_lib.Project.ListView.ps1xml b/Source/formats/vsteam_lib.Project.ListView.ps1xml new file mode 100644 index 000000000..b2679e193 --- /dev/null +++ b/Source/formats/vsteam_lib.Project.ListView.ps1xml @@ -0,0 +1,28 @@ + + + + + vsteam_lib.Project.ListView + + vsteam_lib.Project + + + + + + + Name + + + Description + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Project.TableView.ps1xml b/Source/formats/vsteam_lib.Project.TableView.ps1xml new file mode 100644 index 000000000..f90983e22 --- /dev/null +++ b/Source/formats/vsteam_lib.Project.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.Project.TableView + + vsteam_lib.Project + + + + + + + + + + + + + + + + + Name + + + Description + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Agent.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Agent.TableView.ps1xml new file mode 100644 index 000000000..e511852af --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Agent.TableView.ps1xml @@ -0,0 +1,53 @@ + + + + + vsteam_lib.Provider.Agent.TableView + + vsteam_lib.Provider.Agent + + + + + + + + + + + + + + + + + + + + + + + + + + DisplayMode + + + name + + + enabled + + + version + + + os + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.AgentPool.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.AgentPool.TableView.ps1xml new file mode 100644 index 000000000..cf99ff735 --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.AgentPool.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.AgentPool.TableView + + vsteam_lib.Provider.AgentPool + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Count + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Build.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Build.TableView.ps1xml new file mode 100644 index 000000000..f464cd1f9 --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Build.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.Build.TableView + + vsteam_lib.Provider.Build + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Result + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.Provider.BuildDefinition.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.BuildDefinition.TableView.ps1xml new file mode 100644 index 000000000..4cd453501 --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.BuildDefinition.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.BuildDefinition.TableView + + vsteam_lib.Provider.BuildDefinition + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.BuildDefinitionProcessPhase.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.BuildDefinitionProcessPhase.TableView.ps1xml new file mode 100644 index 000000000..e1119fade --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.BuildDefinitionProcessPhase.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.BuildDefinitionProcessPhase.TableView + + vsteam_lib.Provider.BuildDefinitionProcessPhase + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + StepCount + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.BuildDefinitionProcessPhaseStep.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.BuildDefinitionProcessPhaseStep.TableView.ps1xml new file mode 100644 index 000000000..e54c16b0d --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.BuildDefinitionProcessPhaseStep.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.BuildDefinitionProcessPhaseStep.TableView + + vsteam_lib.Provider.BuildDefinitionProcessPhaseStep + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Enabled + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.BuildDefinitionYamlProcess.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.BuildDefinitionYamlProcess.TableView.ps1xml new file mode 100644 index 000000000..a029a1ae2 --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.BuildDefinitionYamlProcess.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.Provider.BuildDefinitionYamlProcess.TableView + + vsteam_lib.Provider.BuildDefinitionYamlProcess + + + + + + + + + + + + + + + + + DisplayMode + + + yamlFilename + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Environment.Status.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Environment.Status.TableView.ps1xml new file mode 100644 index 000000000..a8f890e60 --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Environment.Status.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.Environment.Status.TableView + + vsteam_lib.Provider.Environment + vsteam_lib.Provider.Attempt + vsteam_lib.Provider.Task + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + status + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Extension.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Extension.TableView.ps1xml new file mode 100644 index 000000000..c610f9b03 --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Extension.TableView.ps1xml @@ -0,0 +1,47 @@ + + + + + vsteam_lib.Provider.Extension.TableView + + vsteam_lib.Provider.Extension + + + + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Id + + + publisherId + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Feed.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Feed.TableView.ps1xml new file mode 100644 index 000000000..1b671167f --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Feed.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.Feed.TableView + + vsteam_lib.Provider.Feed + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Description + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.GitRef.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.GitRef.TableView.ps1xml new file mode 100644 index 000000000..f1bfee96c --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.GitRef.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.GitRef.TableView + + vsteam_lib.Provider.GitRef + + + + + + + + + + + + + + + + + + + + DisplayMode + + + RefName + + + Creator + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.JobRequest.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.JobRequest.TableView.ps1xml new file mode 100644 index 000000000..647ad3536 --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.JobRequest.TableView.ps1xml @@ -0,0 +1,53 @@ + + + + + vsteam_lib.Provider.JobRequest.TableView + + vsteam_lib.Provider.JobRequest + + + + + + + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Type + + + Pipeline + + + Duration + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Project.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Project.TableView.ps1xml new file mode 100644 index 000000000..c677f174e --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Project.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.Project.TableView + + vsteam_lib.Provider.Project + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Description + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Release.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Release.TableView.ps1xml new file mode 100644 index 000000000..6e0d30038 --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Release.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.Provider.Release.TableView + + vsteam_lib.Provider.Release + + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + status + + + definitionname + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.ReleaseDefinition.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.ReleaseDefinition.TableView.ps1xml new file mode 100644 index 000000000..a9df0fabd --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.ReleaseDefinition.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.ReleaseDefinition.TableView + + vsteam_lib.Provider.ReleaseDefinition + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Repository.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Repository.TableView.ps1xml new file mode 100644 index 000000000..45709b55b --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Repository.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.Provider.Repository.TableView + + vsteam_lib.Provider.GitRepository + + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + remoteUrl + + + defaultBranch + + + + + + + + diff --git a/Source/formats/vsteam_lib.Provider.Team.TableView.ps1xml b/Source/formats/vsteam_lib.Provider.Team.TableView.ps1xml new file mode 100644 index 000000000..cec1d63be --- /dev/null +++ b/Source/formats/vsteam_lib.Provider.Team.TableView.ps1xml @@ -0,0 +1,41 @@ + + + + + vsteam_lib.Provider.Team.TableView + + vsteam_lib.Provider.Team + + + + + + + + + + + + + + + + + + + + DisplayMode + + + Name + + + Description + + + + + + + + diff --git a/Source/formats/vsteam_lib.PullRequest.TableView.ps1xml b/Source/formats/vsteam_lib.PullRequest.TableView.ps1xml new file mode 100644 index 000000000..7c045f47f --- /dev/null +++ b/Source/formats/vsteam_lib.PullRequest.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.PullRequest.TableView + + vsteam_lib.PullRequest + + + + + + + + + + + + + + + + + + Title + + + createdByUser + + + pullRequestId + + + + + + + + diff --git a/Source/formats/vsteam_lib.Query.TableView.ps1xml b/Source/formats/vsteam_lib.Query.TableView.ps1xml new file mode 100644 index 000000000..310c3ad55 --- /dev/null +++ b/Source/formats/vsteam_lib.Query.TableView.ps1xml @@ -0,0 +1,33 @@ + + + + + vsteam_lib.Query.TableView + + vsteam_lib.Query + + + + + + + + + + + + + + + Name + + + hasChildren + + + + + + + + diff --git a/Source/formats/vsteam_lib.Queue.TableView.ps1xml b/Source/formats/vsteam_lib.Queue.TableView.ps1xml new file mode 100644 index 000000000..7d9a6c959 --- /dev/null +++ b/Source/formats/vsteam_lib.Queue.TableView.ps1xml @@ -0,0 +1,33 @@ + + + + + vsteam_lib.Queue.TableView + + vsteam_lib.Queue + + + + + + + + + + + + + + + Name + + + PoolName + + + + + + + + diff --git a/Source/formats/vsteam_lib.Release.TableView.ps1xml b/Source/formats/vsteam_lib.Release.TableView.ps1xml new file mode 100644 index 000000000..699612105 --- /dev/null +++ b/Source/formats/vsteam_lib.Release.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.Release.TableView + + vsteam_lib.Release + + + + + + + + + + + + + + + + + + + + + Name + + + status + + + DefinitionName + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.ReleaseDefinition.TableView.ps1xml b/Source/formats/vsteam_lib.ReleaseDefinition.TableView.ps1xml new file mode 100644 index 000000000..d4cf96d58 --- /dev/null +++ b/Source/formats/vsteam_lib.ReleaseDefinition.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.ReleaseDefinition.TableView + + vsteam_lib.ReleaseDefinition + + + + + + + + + + + + + + + + + Name + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Repository.ListView.ps1xml b/Source/formats/vsteam_lib.Repository.ListView.ps1xml new file mode 100644 index 000000000..15e6fa8e4 --- /dev/null +++ b/Source/formats/vsteam_lib.Repository.ListView.ps1xml @@ -0,0 +1,32 @@ + + + + + vsteam_lib.Repository.ListView + + vsteam_lib.Provider.GitRepository + vsteam_lib.GitRepository + + + + + + + Name + + + remoteUrl + + + defaultBranch + + + projectName + + + + + + + + diff --git a/Source/formats/vsteam_lib.Repository.TableView.ps1xml b/Source/formats/vsteam_lib.Repository.TableView.ps1xml new file mode 100644 index 000000000..2f90bed37 --- /dev/null +++ b/Source/formats/vsteam_lib.Repository.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.Repository.TableView + + vsteam_lib.GitRepository + + + + + + + + + + + + + + + + + + + + + Name + + + remoteUrl + + + defaultBranch + + + projectName + + + + + + + + diff --git a/Source/formats/vsteam_lib.ResourceArea.TableView.ps1xml b/Source/formats/vsteam_lib.ResourceArea.TableView.ps1xml new file mode 100644 index 000000000..5290460e8 --- /dev/null +++ b/Source/formats/vsteam_lib.ResourceArea.TableView.ps1xml @@ -0,0 +1,34 @@ + + + + + vsteam_lib.ResourceArea.TableView + + vsteam_lib.ResourceArea + VSTeamResourceArea + + + + + + + + + + + + + + + Name + + + locationUrl + + + + + + + + diff --git a/Source/formats/vsteam_lib.SecurityNamespace.ListView.ps1xml b/Source/formats/vsteam_lib.SecurityNamespace.ListView.ps1xml new file mode 100644 index 000000000..108cb5fd2 --- /dev/null +++ b/Source/formats/vsteam_lib.SecurityNamespace.ListView.ps1xml @@ -0,0 +1,58 @@ + + + + + vsteam_lib.SecurityNamespace.ListView + + vsteam_lib.SecurityNamespace + + + + + + + Name + + + DisplayName + + + ElementLength + + + WritePermission + + + ReadPermission + + + DataspaceCategory + + + StructureValue + + + ExtensionType + + + IsRemotable + + + UseTokenTranslator + + + SystemBitMask + + + Actions + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.SecurityNamespace.TableView.ps1xml b/Source/formats/vsteam_lib.SecurityNamespace.TableView.ps1xml new file mode 100644 index 000000000..f4879caca --- /dev/null +++ b/Source/formats/vsteam_lib.SecurityNamespace.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.SecurityNamespace.TableView + + vsteam_lib.SecurityNamespace + + + + + + + + + + + + + + + + + + Name + + + IsRemotable + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.ServiceEndpoint.ListView.ps1xml b/Source/formats/vsteam_lib.ServiceEndpoint.ListView.ps1xml new file mode 100644 index 000000000..1687404e9 --- /dev/null +++ b/Source/formats/vsteam_lib.ServiceEndpoint.ListView.ps1xml @@ -0,0 +1,31 @@ + + + + + vsteam_lib.ServiceEndpoint.ListView + + vsteam_lib.ServiceEndpoint + + + + + + + name + + + type + + + createdByUser + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.ServiceEndpoint.TableView.ps1xml b/Source/formats/vsteam_lib.ServiceEndpoint.TableView.ps1xml new file mode 100644 index 000000000..df0a45a87 --- /dev/null +++ b/Source/formats/vsteam_lib.ServiceEndpoint.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.ServiceEndpoint.TableView + + vsteam_lib.ServiceEndpoint + + + + + + + + + + + + + + + + + + + + + name + + + type + + + createdByUser + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.ServiceEndpointType.ListView.ps1xml b/Source/formats/vsteam_lib.ServiceEndpointType.ListView.ps1xml new file mode 100644 index 000000000..40968af04 --- /dev/null +++ b/Source/formats/vsteam_lib.ServiceEndpointType.ListView.ps1xml @@ -0,0 +1,31 @@ + + + + + vsteam_lib.ServiceEndpointType.ListView + + vsteam_lib.ServiceEndpointType + + + + + + + name + + + displayName + + + description + + + helpMarkDown + + + + + + + + diff --git a/Source/formats/vsteam_lib.ServiceEndpointType.TableView.ps1xml b/Source/formats/vsteam_lib.ServiceEndpointType.TableView.ps1xml new file mode 100644 index 000000000..1144454b8 --- /dev/null +++ b/Source/formats/vsteam_lib.ServiceEndpointType.TableView.ps1xml @@ -0,0 +1,33 @@ + + + + + vsteam_lib.ServiceEndpointType.TableView + + vsteam_lib.ServiceEndpointType + + + + + + + + + + + + + + + displayName + + + description + + + + + + + + diff --git a/Source/formats/vsteam_lib.TaskGroup.TableView.ps1xml b/Source/formats/vsteam_lib.TaskGroup.TableView.ps1xml new file mode 100644 index 000000000..c2b777f7a --- /dev/null +++ b/Source/formats/vsteam_lib.TaskGroup.TableView.ps1xml @@ -0,0 +1,33 @@ + + + + + vsteam_lib.TaskGroup.TableView + + vsteam_lib.TaskGroup + + + + + + + + + + + + + + + Name + + + description + + + + + + + + diff --git a/Source/formats/vsteam_lib.Team.ListView.ps1xml b/Source/formats/vsteam_lib.Team.ListView.ps1xml new file mode 100644 index 000000000..b63f7523b --- /dev/null +++ b/Source/formats/vsteam_lib.Team.ListView.ps1xml @@ -0,0 +1,32 @@ + + + + + vsteam_lib.Team.ListView + + vsteam_lib.Team + vsteam_lib.Provider.Team + + + + + + + Name + + + Description + + + ProjectName + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Team.TableView.ps1xml b/Source/formats/vsteam_lib.Team.TableView.ps1xml new file mode 100644 index 000000000..47645545a --- /dev/null +++ b/Source/formats/vsteam_lib.Team.TableView.ps1xml @@ -0,0 +1,35 @@ + + + + + vsteam_lib.Team.TableView + + vsteam_lib.Team + + + + + + + + + + + + + + + + + Name + + + Description + + + + + + + + diff --git a/Source/formats/vsteam_lib.User.ListView.ps1xml b/Source/formats/vsteam_lib.User.ListView.ps1xml new file mode 100644 index 000000000..ff3e61fa6 --- /dev/null +++ b/Source/formats/vsteam_lib.User.ListView.ps1xml @@ -0,0 +1,46 @@ + + + + + vsteam_lib.User.ListView + + vsteam_lib.User + + + + + + + PrincipalName + + + MailAddress + + + DisplayName + + + Origin + + + OriginID + + + URL + + + Descriptor + + + Links + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.User.TableView.ps1xml b/Source/formats/vsteam_lib.User.TableView.ps1xml new file mode 100644 index 000000000..d74321dcc --- /dev/null +++ b/Source/formats/vsteam_lib.User.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.User.TableView + + vsteam_lib.User + + + + + + + + + + + + + + + + + + DisplayName + + + Origin + + + PrincipalName + + + + + + + + diff --git a/Source/formats/vsteam_lib.UserEntitlement.ListView.ps1xml b/Source/formats/vsteam_lib.UserEntitlement.ListView.ps1xml new file mode 100644 index 000000000..85bcba863 --- /dev/null +++ b/Source/formats/vsteam_lib.UserEntitlement.ListView.ps1xml @@ -0,0 +1,34 @@ + + + + + vsteam_lib.UserEntitlement.ListView + + vsteam_lib.UserEntitlement + + + + + + + userName + + + email + + + accessLevelName + + + projects + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.UserEntitlement.TableView.ps1xml b/Source/formats/vsteam_lib.UserEntitlement.TableView.ps1xml new file mode 100644 index 000000000..807e16467 --- /dev/null +++ b/Source/formats/vsteam_lib.UserEntitlement.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.UserEntitlement.TableView + + vsteam_lib.UserEntitlement + + + + + + + + + + + + + + + + + + + + + userName + + + email + + + accessLevelName + + + lastAccessedDate + + + + + + + + diff --git a/Source/formats/vsteam_lib.UserEntitlement.WideView.ps1xml b/Source/formats/vsteam_lib.UserEntitlement.WideView.ps1xml new file mode 100644 index 000000000..57433f917 --- /dev/null +++ b/Source/formats/vsteam_lib.UserEntitlement.WideView.ps1xml @@ -0,0 +1,20 @@ + + + + + vsteam_lib.UserEntitlement.WideView + + vsteam_lib.UserEntitlement + + + + + + userName + + + + + + + diff --git a/Source/formats/vsteam_lib.VariableGroup.ListView.ps1xml b/Source/formats/vsteam_lib.VariableGroup.ListView.ps1xml new file mode 100644 index 000000000..e2253a34b --- /dev/null +++ b/Source/formats/vsteam_lib.VariableGroup.ListView.ps1xml @@ -0,0 +1,31 @@ + + + + + vsteam_lib.VariableGroup.ListView + + vsteam_lib.VariableGroup + + + + + + + name + + + createdByUser + + + modifiedByUser + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.VariableGroup.TableView.ps1xml b/Source/formats/vsteam_lib.VariableGroup.TableView.ps1xml new file mode 100644 index 000000000..63c8ac167 --- /dev/null +++ b/Source/formats/vsteam_lib.VariableGroup.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.VariableGroup.TableView + + vsteam_lib.VariableGroup + + + + + + + + + + + + + + + + + + + + + name + + + createdByUser + + + modifiedByUser + + + Id + + + + + + + + diff --git a/Source/formats/vsteam_lib.Wiql.ListView.ps1xml b/Source/formats/vsteam_lib.Wiql.ListView.ps1xml new file mode 100644 index 000000000..d158ed052 --- /dev/null +++ b/Source/formats/vsteam_lib.Wiql.ListView.ps1xml @@ -0,0 +1,28 @@ + + + + + vsteam_lib.Wiql.ListView + + vsteam_lib.Wiql + + + + + + + queryType + + + workItems + + + WorkItemIDs + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.Wiql.TableView.ps1xml b/Source/formats/vsteam_lib.Wiql.TableView.ps1xml new file mode 100644 index 000000000..b5409fda9 --- /dev/null +++ b/Source/formats/vsteam_lib.Wiql.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.Wiql.TableView + + vsteam_lib.Wiql + + + + + + + + + + + + + + + + + + queryType + + + workItems + + + WorkItemIDs + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.WorkItem.ListView.ps1xml b/Source/formats/vsteam_lib.WorkItem.ListView.ps1xml new file mode 100644 index 000000000..c3a4ca004 --- /dev/null +++ b/Source/formats/vsteam_lib.WorkItem.ListView.ps1xml @@ -0,0 +1,28 @@ + + + + + vsteam_lib.WorkItem.ListView + + vsteam_lib.WorkItem + + + + + + + title + + + state + + + Id + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.WorkItem.TableView.ps1xml b/Source/formats/vsteam_lib.WorkItem.TableView.ps1xml new file mode 100644 index 000000000..c82f1b427 --- /dev/null +++ b/Source/formats/vsteam_lib.WorkItem.TableView.ps1xml @@ -0,0 +1,39 @@ + + + + + vsteam_lib.WorkItem.TableView + + vsteam_lib.WorkItem + + + + + + + + + + + + + + + + + + title + + + state + + + Id + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.WorkItemDeleted.ListView.ps1xml b/Source/formats/vsteam_lib.WorkItemDeleted.ListView.ps1xml new file mode 100644 index 000000000..d07585948 --- /dev/null +++ b/Source/formats/vsteam_lib.WorkItemDeleted.ListView.ps1xml @@ -0,0 +1,34 @@ + + + + + vsteam_lib.WorkItemDeleted.ListView + + vsteam_lib.WorkItemDeleted + + + + + + + name + + + deletedBy + + + deletedDate + + + code + + + Id + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.WorkItemDeleted.TableView.ps1xml b/Source/formats/vsteam_lib.WorkItemDeleted.TableView.ps1xml new file mode 100644 index 000000000..c57ff55a1 --- /dev/null +++ b/Source/formats/vsteam_lib.WorkItemDeleted.TableView.ps1xml @@ -0,0 +1,51 @@ + + + + + vsteam_lib.WorkItemDeleted.TableView + + vsteam_lib.WorkItemDeleted + + + + + + + + + + + + + + + + + + + + + + + + name + + + deletedBy + + + deletedDate + + + code + + + Id + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.WorkItemType.ListView.ps1xml b/Source/formats/vsteam_lib.WorkItemType.ListView.ps1xml new file mode 100644 index 000000000..2302143f0 --- /dev/null +++ b/Source/formats/vsteam_lib.WorkItemType.ListView.ps1xml @@ -0,0 +1,25 @@ + + + + + vsteam_lib.WorkItemType.ListView + + vsteam_lib.WorkItemType + + + + + + + name + + + description + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.WorkItemType.TableView.ps1xml b/Source/formats/vsteam_lib.WorkItemType.TableView.ps1xml new file mode 100644 index 000000000..a959cebe7 --- /dev/null +++ b/Source/formats/vsteam_lib.WorkItemType.TableView.ps1xml @@ -0,0 +1,33 @@ + + + + + vsteam_lib.WorkItemType.TableView + + vsteam_lib.WorkItemType + + + + + + + + + + + + + + + name + + + description + + + + + + + + \ No newline at end of file diff --git a/Source/formats/vsteam_lib.YamlPipelineResult.TableView.ps1xml b/Source/formats/vsteam_lib.YamlPipelineResult.TableView.ps1xml new file mode 100644 index 000000000..663b057bc --- /dev/null +++ b/Source/formats/vsteam_lib.YamlPipelineResult.TableView.ps1xml @@ -0,0 +1,45 @@ + + + + + vsteam_lib.YamlPipelineResult.TableView + + vsteam_lib.YamlPipelineResult + + + + + + + + + + + + + + + + + + + + + name + + + url + + + state + + + Id + + + + + + + + \ No newline at end of file diff --git a/Source/types/Team.AccessControlEntry.ps1xml b/Source/types/Team.AccessControlEntry.ps1xml deleted file mode 100644 index 7361c876a..000000000 --- a/Source/types/Team.AccessControlEntry.ps1xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Team.AccessControlEntry - - - PSStandardMembers - - - DefaultDisplayPropertySet - - Descriptor - Allow - Deny - ExtendedInfo - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.AccessControlList.ps1xml b/Source/types/Team.AccessControlList.ps1xml deleted file mode 100644 index bbd8cf9f4..000000000 --- a/Source/types/Team.AccessControlList.ps1xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Team.AccessControlList - - - PSStandardMembers - - - DefaultDisplayPropertySet - - Token - InheritPermissions - Aces - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.AccessLevel.ps1xml b/Source/types/Team.AccessLevel.ps1xml deleted file mode 100644 index bedcca87c..000000000 --- a/Source/types/Team.AccessLevel.ps1xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - Team.AccessLevel - - - PSStandardMembers - - - DefaultDisplayPropertySet - - accountLicenseType - assignmentSource - licenseDisplayName - licensingSource - msdnLicenseType - status - statusMessage - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Approval.ps1xml b/Source/types/Team.Approval.ps1xml deleted file mode 100644 index 239276320..000000000 --- a/Source/types/Team.Approval.ps1xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - Team.Approval - - - approverName - $this.approver.displayName - - - releaseName - $this.release.name - - - releaseDefinitionId - $this.releaseDefinition.id - - - releaseDefinitionName - $this.releaseDefinition.name - - - releaseEnvironmentName - $this.releaseEnvironment.name - - - shortApprovalType - $this.approvalType.Replace('Deploy', '').Replace('p', 'P') - - - PSStandardMembers - - - DefaultDisplayPropertySet - - id - approverName - status - comments - releaseDefinitionName - releaseEnvironmentName - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.AzureSubscription.ps1xml b/Source/types/Team.AzureSubscription.ps1xml deleted file mode 100644 index eb007f8b1..000000000 --- a/Source/types/Team.AzureSubscription.ps1xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Team.AzureSubscription - - - PSStandardMembers - - - DefaultDisplayPropertySet - - displayName - subscriptionId - subscriptionTenantId - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Build.Artifact.ps1xml b/Source/types/Team.Build.Artifact.ps1xml deleted file mode 100644 index 4e336b9a1..000000000 --- a/Source/types/Team.Build.Artifact.ps1xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - Team.Build.Artifact - - - type - $this.resource.type - - - data - $this.resource.data - - - url - $this.resource.url - - - downloadUrl - $this.resource.downloadUrl - - - PSStandardMembers - - - DefaultDisplayPropertySet - - id - name - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Build.ps1xml b/Source/types/Team.Build.ps1xml deleted file mode 100644 index 5a0446465..000000000 --- a/Source/types/Team.Build.ps1xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - Team.Build - - - name - buildNumber - - - queueName - $this.queue.name - - - queueID - $this.queue.id - - - definitionName - $this.definition.name - - - projectName - $this.project.name - - - repositoryType - $this.repository.type - - - requestedForUser - $this.requestedFor.displayName - - - requestedByUser - $this.requestedBy.displayName - - - lastChangedByUser - $this.lastChangedBy.displayName - - - - \ No newline at end of file diff --git a/Source/types/Team.BuildTimeline.ps1xml b/Source/types/Team.BuildTimeline.ps1xml deleted file mode 100644 index 4318b6dc6..000000000 --- a/Source/types/Team.BuildTimeline.ps1xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - Team.BuildTimeline - - - id - $this.id - - - changeId - $this.changeId - - - lastChangedOn - [datetime]::Parse($this.lastChangedOn) - - - lastChangedBy - $this.lastChangedBy - - - numberOfRecords - $this.records.Count - - - - \ No newline at end of file diff --git a/Source/types/Team.BuildTimelineRecord.ps1xml b/Source/types/Team.BuildTimelineRecord.ps1xml deleted file mode 100644 index 7ca538999..000000000 --- a/Source/types/Team.BuildTimelineRecord.ps1xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - Team.BuildTimelineRecord - - - LastModified - [datetime]::Parse($this.lastModified) - - - PSStandardMembers - - - DefaultDisplayPropertySet - - Name - Id - Type - State - Result - ParentId - ErrorCount - WarningCount - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.ClassificationNode.ps1xml b/Source/types/Team.ClassificationNode.ps1xml deleted file mode 100644 index df9820693..000000000 --- a/Source/types/Team.ClassificationNode.ps1xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - Team.ClassificationNode - - - PSStandardMembers - - - DefaultDisplayPropertySet - - ID - Identifier - Name - Path - StructureType - ProjectName - Url - HasChildren - Children - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Descriptor.ps1xml b/Source/types/Team.Descriptor.ps1xml deleted file mode 100644 index d967d443c..000000000 --- a/Source/types/Team.Descriptor.ps1xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - Team.Descriptor - - - PSStandardMembers - - - DefaultDisplayPropertySet - - Descriptor - Links - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Environment.ps1xml b/Source/types/Team.Environment.ps1xml deleted file mode 100644 index 0b1b4041e..000000000 --- a/Source/types/Team.Environment.ps1xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Team.Environment - - - PSStandardMembers - - - DefaultDisplayPropertySet - - id - name - status - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.GitRepository.ps1xml b/Source/types/Team.GitRepository.ps1xml deleted file mode 100644 index e60f1b407..000000000 --- a/Source/types/Team.GitRepository.ps1xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - Team.GitRepository - - - projectName - $this.project.name - - - PSStandardMembers - - - DefaultDisplayPropertySet - - name - remoteUrl - defaultBranch - projectName - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Group.ps1xml b/Source/types/Team.Group.ps1xml deleted file mode 100644 index 24bcde4b7..000000000 --- a/Source/types/Team.Group.ps1xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - Team.Group - - - PSStandardMembers - - - DefaultDisplayPropertySet - - SubjectKind - Description - PrincipalName - Domain - MailAddress - Origin - OriginID - DisplayName - URL - Descriptor - Links - ID - Name - ProjectName - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Option.ps1xml b/Source/types/Team.Option.ps1xml deleted file mode 100644 index 2716135e3..000000000 --- a/Source/types/Team.Option.ps1xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Team.Option - - - PSStandardMembers - - - DefaultDisplayPropertySet - - resourceName - minVersion - maxVersion - routeTemplate - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Policy.ps1xml b/Source/types/Team.Policy.ps1xml deleted file mode 100644 index fda648936..000000000 --- a/Source/types/Team.Policy.ps1xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - Team.Policy - - - policyType - $this.type.displayName - - - PSStandardMembers - - - DefaultDisplayPropertySet - - policyType - settings - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.PullRequest.ps1xml b/Source/types/Team.PullRequest.ps1xml deleted file mode 100644 index 883d7fcb2..000000000 --- a/Source/types/Team.PullRequest.ps1xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - Team.PullRequest - - - repositoryName - $this.repository.name - - - createdByUser - $this.createdBy.displayName - - - reviewedByUser - $this.reviewers.displayName - - - reviewStatus - - $votes = $this.reviewers.vote - if (!$this.reviewers -or $votes -contains 0) { "Pending" } elseif ($votes -contains -10) { "Rejected" } else { "Approved" } - - - - browseUrl - - $organization = [VSTeamVersions]::Account - $project = $this.repository.project.name - $repositoryId = $this.repository.name - $pullRequestId = $this.pullRequestId - "$organization/$project/_git/$repositoryId/pullrequest/$pullRequestId" - - - - PSStandardMembers - - - DefaultDisplayPropertySet - - pullRequestId - repositoryName - reviewStatus - createdByUser - creationDate - title - description - sourceRefname - mergeStatus - reviewedByUser - status - url - artifactId - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.Release.ps1xml b/Source/types/Team.Release.ps1xml deleted file mode 100644 index 71614afc6..000000000 --- a/Source/types/Team.Release.ps1xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - Team.Release - - - - releaseId - $this.id - - - definitionName - $this.releaseDefinition.name - - - definitionId - $this.releaseDefinition.id - - - projectId - $this.projectReference.id - - - requestedForUser - $this.requestedFor.displayName - - - modifiedByUser - $this.modifiedBy.displayName - - - createdByUser - $this.createdBy.displayName - - - PSStandardMembers - - - DefaultDisplayPropertySet - - id - name - status - definitionName - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.SecurityNamespace.ps1xml b/Source/types/Team.SecurityNamespace.ps1xml deleted file mode 100644 index d3ff95a6e..000000000 --- a/Source/types/Team.SecurityNamespace.ps1xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - Team.SecurityNamespace - - - PSStandardMembers - - - DefaultDisplayPropertySet - - ID - Name - DisplayName - ElementLength - WritePermission - ReadPermission - DataspaceCategory - StructureValue - ExtensionType - IsRemotable - UseTokenTranslator - SystemBitMask - Actions - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.ServiceEndpoint.ps1xml b/Source/types/Team.ServiceEndpoint.ps1xml deleted file mode 100644 index 0253e57c9..000000000 --- a/Source/types/Team.ServiceEndpoint.ps1xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Team.ServiceEndpoint - - - createdByUser - $this.createdBy.displayName - - - - \ No newline at end of file diff --git a/Source/types/Team.Team.ps1xml b/Source/types/Team.Team.ps1xml deleted file mode 100644 index ac00b6a9b..000000000 --- a/Source/types/Team.Team.ps1xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Team.Team - - - PSStandardMembers - - - DefaultDisplayPropertySet - - projectname - name - id - description - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.TeamMember.ps1xml b/Source/types/Team.TeamMember.ps1xml deleted file mode 100644 index 49cc80818..000000000 --- a/Source/types/Team.TeamMember.ps1xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Team.TeamMember - - - PSStandardMembers - - - DefaultDisplayPropertySet - - team - displayName - id - uniqueName - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.TfvcBranch.ps1xml b/Source/types/Team.TfvcBranch.ps1xml deleted file mode 100644 index 74931e11a..000000000 --- a/Source/types/Team.TfvcBranch.ps1xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - Team.TfvcBranch - - - PSStandardMembers - - - DefaultDisplayPropertySet - - path - description - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.User2.ps1xml b/Source/types/Team.User2.ps1xml deleted file mode 100644 index 69ad50887..000000000 --- a/Source/types/Team.User2.ps1xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - Team.User2 - - - PSStandardMembers - - - DefaultDisplayPropertySet - - SubjectKind - CUID - PrincipalName - Domain - MailAddress - Origin - OriginID - DisplayName - URL - Descriptor - Links - ID - Name - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.UserEntitlement.ps1xml b/Source/types/Team.UserEntitlement.ps1xml deleted file mode 100644 index f4e823c75..000000000 --- a/Source/types/Team.UserEntitlement.ps1xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - Team.UserEntitlement - - - accessLevelName - $this.accessLevel.licenseDisplayName - - - userName - $this.user.displayName - - - email - $this.user.mailAddress - - - projects - [string]::Join(", ", $this.projectEntitlements.projectRef.name) - - - PSStandardMembers - - - DefaultDisplayPropertySet - - accessLevel - extensions - groupAssignments - id - lastAccessedDate - projectEntitlements - user - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.VariableGroup.ps1xml b/Source/types/Team.VariableGroup.ps1xml deleted file mode 100644 index 4ffbaeb5b..000000000 --- a/Source/types/Team.VariableGroup.ps1xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Team.VariableGroup - - - createdByUser - $this.createdBy.displayName - - - modifiedByUser - $this.modifiedBy.displayName - - - - \ No newline at end of file diff --git a/Source/types/Team.Wiql.ps1xml b/Source/types/Team.Wiql.ps1xml deleted file mode 100644 index fab3e0d4d..000000000 --- a/Source/types/Team.Wiql.ps1xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - Team.Wiql - - - QueryType - $this.PSObject.Properties['queryType'].Value - - - QueryResultType - $this.PSObject.Properties['queryResultType'].Value - - - AsOf - $this.PSObject.Properties['asOf'].Value - - - Columns - $this.PSObject.Properties['columns'].Value - - - SortColumns - $this.PSObject.Properties['sortColumns'].Value - - - WorkItemIDs - [int[]]$this.PSObject.Properties['workItems'].Value.id - - - WorkItems - $this.PSObject.Properties['workItems'].Value - - - PSStandardMembers - - - DefaultDisplayPropertySet - - queryType - WorkItemIDs - workItems - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.WorkItem.ps1xml b/Source/types/Team.WorkItem.ps1xml deleted file mode 100644 index 6f2cd8eaf..000000000 --- a/Source/types/Team.WorkItem.ps1xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - Team.WorkItem - - - Title - $this.fields.PSObject.Properties['System.Title'].Value - - - Description - $this.fields.PSObject.Properties['System.Description'].Value - - - State - $this.fields.PSObject.Properties['System.State'].Value - - - AreaPath - $this.fields.PSObject.Properties['System.AreaPath'].Value - - - IterationPath - $this.fields.PSObject.Properties['System.IterationPath'].Value - - - AssignedTo - $this.fields.PSObject.Properties['System.AssignedTo'].Value - - - TeamProject - $this.fields.PSObject.Properties['System.TeamProject'].Value - - - WorkItemType - $this.fields.PSObject.Properties['System.WorkItemType'].Value - - - Reason - $this.fields.PSObject.Properties['System.Reason'].Value - - - PSStandardMembers - - - DefaultDisplayPropertySet - - id - title - state - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.WorkItemDeleted.ps1xml b/Source/types/Team.WorkItemDeleted.ps1xml deleted file mode 100644 index 17254712a..000000000 --- a/Source/types/Team.WorkItemDeleted.ps1xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - Team.WorkItemDeleted - - - Name - $this.fields.PSObject.Properties['name'].Value - - - Project - $this.fields.PSObject.Properties['project'].Value - - - Type - $this.fields.PSObject.Properties['type'].Value - - - Id - $this.fields.PSObject.Properties['id'].Value - - - Resource - $this.fields.PSObject.Properties['resource'].Value - - - DeletedBy - $this.fields.PSObject.Properties['deletedBy'].Value - - - DeletedDate - $this.fields.PSObject.Properties['deletedDate'].Value - - - Code - $this.fields.PSObject.Properties['code'].Value - - - Url - $this.fields.PSObject.Properties['url'].Value - - - PSStandardMembers - - - DefaultDisplayPropertySet - - id - name - deletedBy - deletedDate - code - - - - - - - \ No newline at end of file diff --git a/Source/types/Team.YamlPipelineResult.ps1xml b/Source/types/Team.YamlPipelineResult.ps1xml deleted file mode 100644 index 593d4aaca..000000000 --- a/Source/types/Team.YamlPipelineResult.ps1xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - Team.YamlPipelineResult - - - links - $this._links - - - pipeline - $this.pipeline - - - state - $this.state - - - url - $this.url - - - finalYaml - $this.finalYaml - - - id - $this.id - - - name - $this.name - - - PSStandardMembers - - - DefaultDisplayPropertySet - - name - id - url - state - finalYaml - - - - - - - \ No newline at end of file diff --git a/Source/types/vsteam_lib.AccessLevel.ps1xml b/Source/types/vsteam_lib.AccessLevel.ps1xml new file mode 100644 index 000000000..08d350e75 --- /dev/null +++ b/Source/types/vsteam_lib.AccessLevel.ps1xml @@ -0,0 +1,25 @@ + + + + vsteam_lib.AccessLevel + + + PSStandardMembers + + + DefaultDisplayPropertySet + + accountLicenseType + assignmentSource + licenseDisplayName + licensingSource + msdnLicenseType + status + statusMessage + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.Approval.ps1xml b/Source/types/vsteam_lib.Approval.ps1xml new file mode 100644 index 000000000..9160e81d9 --- /dev/null +++ b/Source/types/vsteam_lib.Approval.ps1xml @@ -0,0 +1,48 @@ + + + + vsteam_lib.Approval + + + approverName + $this.approver.displayName + + + releaseName + $this.release.name + + + releaseDefinitionId + $this.releaseDefinition.id + + + releaseDefinitionName + $this.releaseDefinition.name + + + releaseEnvironmentName + $this.releaseEnvironment.name + + + shortApprovalType + $this.approvalType.Replace('Deploy', '').Replace('p', 'P') + + + PSStandardMembers + + + DefaultDisplayPropertySet + + id + approverName + status + comments + releaseDefinitionName + releaseEnvironmentName + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.AzureSubscription.ps1xml b/Source/types/vsteam_lib.AzureSubscription.ps1xml new file mode 100644 index 000000000..a43c552fb --- /dev/null +++ b/Source/types/vsteam_lib.AzureSubscription.ps1xml @@ -0,0 +1,21 @@ + + + + vsteam_lib.AzureSubscription + + + PSStandardMembers + + + DefaultDisplayPropertySet + + displayName + subscriptionId + subscriptionTenantId + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.Build.Artifact.ps1xml b/Source/types/vsteam_lib.Build.Artifact.ps1xml new file mode 100644 index 000000000..4ce854c4f --- /dev/null +++ b/Source/types/vsteam_lib.Build.Artifact.ps1xml @@ -0,0 +1,36 @@ + + + + vsteam_lib.Build.Artifact + + + type + $this.resource.type + + + data + $this.resource.data + + + url + $this.resource.url + + + downloadUrl + $this.resource.downloadUrl + + + PSStandardMembers + + + DefaultDisplayPropertySet + + id + name + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.BuildTimeline.ps1xml b/Source/types/vsteam_lib.BuildTimeline.ps1xml new file mode 100644 index 000000000..a559cf89a --- /dev/null +++ b/Source/types/vsteam_lib.BuildTimeline.ps1xml @@ -0,0 +1,28 @@ + + + + vsteam_lib.BuildTimeline + + + id + $this.id + + + changeId + $this.changeId + + + lastChangedOn + [datetime]::Parse($this.lastChangedOn) + + + lastChangedBy + $this.lastChangedBy + + + numberOfRecords + $this.records.Count + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.BuildTimelineRecord.ps1xml b/Source/types/vsteam_lib.BuildTimelineRecord.ps1xml new file mode 100644 index 000000000..07d4f2984 --- /dev/null +++ b/Source/types/vsteam_lib.BuildTimelineRecord.ps1xml @@ -0,0 +1,30 @@ + + + + vsteam_lib.BuildTimelineRecord + + + LastModified + [datetime]::Parse($this.lastModified) + + + PSStandardMembers + + + DefaultDisplayPropertySet + + Name + Id + Type + State + Result + ParentId + ErrorCount + WarningCount + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.Environment.ps1xml b/Source/types/vsteam_lib.Environment.ps1xml new file mode 100644 index 000000000..1cb4e358e --- /dev/null +++ b/Source/types/vsteam_lib.Environment.ps1xml @@ -0,0 +1,21 @@ + + + + vsteam_lib.Environment + + + PSStandardMembers + + + DefaultDisplayPropertySet + + id + name + status + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.Option.ps1xml b/Source/types/vsteam_lib.Option.ps1xml new file mode 100644 index 000000000..ae6f8fc4d --- /dev/null +++ b/Source/types/vsteam_lib.Option.ps1xml @@ -0,0 +1,22 @@ + + + + vsteam_lib.Option + + + PSStandardMembers + + + DefaultDisplayPropertySet + + resourceName + minVersion + maxVersion + routeTemplate + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.Policy.ps1xml b/Source/types/vsteam_lib.Policy.ps1xml new file mode 100644 index 000000000..1d99d8f21 --- /dev/null +++ b/Source/types/vsteam_lib.Policy.ps1xml @@ -0,0 +1,30 @@ + + + + vsteam_lib.Policy + + + policyType + $this.type.displayName + + + createdByUser + $this.createdBy.displayName + + + PSStandardMembers + + + DefaultDisplayPropertySet + + policyType + createdByUser + isEnabled + id + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.PullRequest.ps1xml b/Source/types/vsteam_lib.PullRequest.ps1xml new file mode 100644 index 000000000..8ff71b3d1 --- /dev/null +++ b/Source/types/vsteam_lib.PullRequest.ps1xml @@ -0,0 +1,75 @@ + + + + + vsteam_lib.PullRequest + + + repositoryName + $this.repository.name + + + createdByUser + $this.createdBy.displayName + + + reviewedByUser + $this.reviewers.displayName + + + reviewStatus + + $votes = $this.reviewers.vote + if (!$this.reviewers -or $votes -contains 0) { "Pending" } elseif ($votes -contains -10) { "Rejected" } else { "Approved" } + + + + browseUrl + + $organization = [vsteam_lib.Versions]::Account + $project = $this.repository.project.name + $repositoryId = $this.repository.name + $pullRequestId = $this.pullRequestId + "$organization/$project/_git/$repositoryId/pullrequest/$pullRequestId" + + + + PSStandardMembers + + + DefaultDisplayPropertySet + + pullRequestId + repositoryName + reviewStatus + createdByUser + creationDate + title + description + sourceRefname + mergeStatus + reviewedByUser + status + url + artifactId + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.ServiceEndpoint.ps1xml b/Source/types/vsteam_lib.ServiceEndpoint.ps1xml new file mode 100644 index 000000000..ac30916e4 --- /dev/null +++ b/Source/types/vsteam_lib.ServiceEndpoint.ps1xml @@ -0,0 +1,12 @@ + + + + vsteam_lib.ServiceEndpoint + + + createdByUser + $this.createdBy.displayName + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.TeamMember.ps1xml b/Source/types/vsteam_lib.TeamMember.ps1xml new file mode 100644 index 000000000..44a7e57b8 --- /dev/null +++ b/Source/types/vsteam_lib.TeamMember.ps1xml @@ -0,0 +1,33 @@ + + + + vsteam_lib.TeamMember + + + Name + $this.identity.displayName + + + Unique Name + $this.identity.uniqueName + + + Id + $this.identity.id + + + PSStandardMembers + + + DefaultDisplayPropertySet + + Name + Unique Name + Id + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.TfvcBranch.ps1xml b/Source/types/vsteam_lib.TfvcBranch.ps1xml new file mode 100644 index 000000000..30cc16b93 --- /dev/null +++ b/Source/types/vsteam_lib.TfvcBranch.ps1xml @@ -0,0 +1,20 @@ + + + + vsteam_lib.TfvcBranch + + + PSStandardMembers + + + DefaultDisplayPropertySet + + path + description + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.VariableGroup.ps1xml b/Source/types/vsteam_lib.VariableGroup.ps1xml new file mode 100644 index 000000000..705fd9944 --- /dev/null +++ b/Source/types/vsteam_lib.VariableGroup.ps1xml @@ -0,0 +1,16 @@ + + + + vsteam_lib.VariableGroup + + + createdByUser + $this.createdBy.displayName + + + modifiedByUser + $this.modifiedBy.displayName + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.Wiql.ps1xml b/Source/types/vsteam_lib.Wiql.ps1xml new file mode 100644 index 000000000..da273e07c --- /dev/null +++ b/Source/types/vsteam_lib.Wiql.ps1xml @@ -0,0 +1,49 @@ + + + + vsteam_lib.Wiql + + + QueryType + $this.PSObject.Properties['queryType'].Value + + + QueryResultType + $this.PSObject.Properties['queryResultType'].Value + + + AsOf + $this.PSObject.Properties['asOf'].Value + + + Columns + $this.PSObject.Properties['columns'].Value + + + SortColumns + $this.PSObject.Properties['sortColumns'].Value + + + WorkItemIDs + [int[]]$this.PSObject.Properties['workItems'].Value.id + + + WorkItems + $this.PSObject.Properties['workItems'].Value + + + PSStandardMembers + + + DefaultDisplayPropertySet + + queryType + WorkItemIDs + workItems + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.WorkItem.ps1xml b/Source/types/vsteam_lib.WorkItem.ps1xml new file mode 100644 index 000000000..8d420b3af --- /dev/null +++ b/Source/types/vsteam_lib.WorkItem.ps1xml @@ -0,0 +1,57 @@ + + + + vsteam_lib.WorkItem + + + Title + $this.fields.PSObject.Properties['System.Title'].Value + + + Description + $this.fields.PSObject.Properties['System.Description'].Value + + + State + $this.fields.PSObject.Properties['System.State'].Value + + + AreaPath + $this.fields.PSObject.Properties['System.AreaPath'].Value + + + IterationPath + $this.fields.PSObject.Properties['System.IterationPath'].Value + + + AssignedTo + $this.fields.PSObject.Properties['System.AssignedTo'].Value + + + vsteam_lib.roject + $this.fields.PSObject.Properties['System.TeamProject'].Value + + + WorkItemType + $this.fields.PSObject.Properties['System.WorkItemType'].Value + + + Reason + $this.fields.PSObject.Properties['System.Reason'].Value + + + PSStandardMembers + + + DefaultDisplayPropertySet + + id + title + state + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.WorkItemDeleted.ps1xml b/Source/types/vsteam_lib.WorkItemDeleted.ps1xml new file mode 100644 index 000000000..77aeea2d7 --- /dev/null +++ b/Source/types/vsteam_lib.WorkItemDeleted.ps1xml @@ -0,0 +1,59 @@ + + + + vsteam_lib.WorkItemDeleted + + + Name + $this.fields.PSObject.Properties['name'].Value + + + Project + $this.fields.PSObject.Properties['project'].Value + + + Type + $this.fields.PSObject.Properties['type'].Value + + + Id + $this.fields.PSObject.Properties['id'].Value + + + Resource + $this.fields.PSObject.Properties['resource'].Value + + + DeletedBy + $this.fields.PSObject.Properties['deletedBy'].Value + + + DeletedDate + $this.fields.PSObject.Properties['deletedDate'].Value + + + Code + $this.fields.PSObject.Properties['code'].Value + + + Url + $this.fields.PSObject.Properties['url'].Value + + + PSStandardMembers + + + DefaultDisplayPropertySet + + id + name + deletedBy + deletedDate + code + + + + + + + \ No newline at end of file diff --git a/Source/types/vsteam_lib.YamlPipelineResult.ps1xml b/Source/types/vsteam_lib.YamlPipelineResult.ps1xml new file mode 100644 index 000000000..0e6283ba8 --- /dev/null +++ b/Source/types/vsteam_lib.YamlPipelineResult.ps1xml @@ -0,0 +1,51 @@ + + + + vsteam_lib.YamlPipelineResult + + + links + $this._links + + + pipeline + $this.pipeline + + + state + $this.state + + + url + $this.url + + + finalYaml + $this.finalYaml + + + id + $this.id + + + name + $this.name + + + PSStandardMembers + + + DefaultDisplayPropertySet + + name + id + url + state + finalYaml + + + + + + + \ No newline at end of file diff --git a/Split-File.ps1 b/Split-File.ps1 deleted file mode 100644 index d70da93b1..000000000 --- a/Split-File.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -function Split-File { - <# -.SYNOPSIS -Takes an formats or types file and splits it into separate files. - -.DESCRIPTION -The input file must be a ps1xml file of formats. A file will be created -from the Name node. - -.PARAMETER InputFile -The ps1xml file to process. - -.EXAMPLE -PS C:\> Split-File -InputFile .\Source\formats\builds.format.ps1xml - -#> - [CmdletBinding()] - param( - [Parameter(Mandatory = $True)] - [string] - $inputFile - ) - - [xml]$xml = Get-Content $inputFile - - foreach ($view in $xml.Configuration.ViewDefinitions.View) { - $finalXml = '' - $finalXml += $view.OuterXml - $finalXml += '' - - $output = Join-Path . "$($view.Name).ps1xml" - # This makes sure the file is there and empty. - # If the file already exisit it will be overwritten. - $null = New-Item -ItemType file -Path $output -Force - - Write-Verbose $output - $finalXml | Add-Content $output - } -} \ No newline at end of file diff --git a/integration/test/sampleFiles/010_builddef_1.json b/Tests/SampleFiles/010_builddef_1.json similarity index 100% rename from integration/test/sampleFiles/010_builddef_1.json rename to Tests/SampleFiles/010_builddef_1.json diff --git a/integration/test/sampleFiles/010_builddef_2.json b/Tests/SampleFiles/010_builddef_2.json similarity index 100% rename from integration/test/sampleFiles/010_builddef_2.json rename to Tests/SampleFiles/010_builddef_2.json diff --git a/integration/test/sampleFiles/010_releasedef_1.json b/Tests/SampleFiles/010_releasedef_1.json similarity index 100% rename from integration/test/sampleFiles/010_releasedef_1.json rename to Tests/SampleFiles/010_releasedef_1.json diff --git a/integration/test/sampleFiles/010_releasedef_2.json b/Tests/SampleFiles/010_releasedef_2.json similarity index 100% rename from integration/test/sampleFiles/010_releasedef_2.json rename to Tests/SampleFiles/010_releasedef_2.json diff --git a/Tests/SampleFiles/Get-BuildDefinition_2017.json b/Tests/SampleFiles/Get-BuildDefinition_2017.json new file mode 100644 index 000000000..3a3fdb284 --- /dev/null +++ b/Tests/SampleFiles/Get-BuildDefinition_2017.json @@ -0,0 +1,600 @@ +{ + "count": 2, + "value": [ + { + "build": [ + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "NuGet restore", + "timeoutInMinutes": 0, + "task": { + "id": "333b11bd-d341-40d9-afcf-b32d5ce6f23b", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Parameters.solution)", + "selectOrConfig": "select", + "feed": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "noCache": "false", + "packagesDirectory": "", + "verbosity": "Detailed" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build solution", + "timeoutInMinutes": 0, + "task": { + "id": "71a9a2d3-a98a-4caa-96ab-affca411ecda", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Parameters.solution)", + "vsVersion": "15.0", + "msbuildArgs": "/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation=\"$(build.artifactstagingdirectory)\\WebApp.zip\" /p:DeployIisAppPath=\"Default Web Site\"", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "msbuildArchitecture": "x86", + "logProjectEvents": "true", + "createLogFile": "false" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Test Assemblies", + "timeoutInMinutes": 0, + "task": { + "id": "ef087383-ee5e-42c7-9a53-ab56c98420f9", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\$(BuildConfiguration)\\*test*.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "", + "overrideTestrunParameters": "", + "runInParallel": "False", + "runTestsInIsolation": "False", + "pathtoCustomTestAdapters": "", + "codeCoverageEnabled": "False", + "otherConsoleOptions": "", + "testRunTitle": "", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "publishRunAttachments": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Publish symbols path", + "timeoutInMinutes": 0, + "task": { + "id": "0675668a-7bba-4ccb-901d-5ad6554ca653", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "SymbolsPath": "", + "SearchPattern": "**\\bin\\**\\*.pdb", + "SymbolsFolder": "", + "SkipIndexing": "false", + "TreatNotIndexedAsWarning": "false", + "SymbolsMaximumWaitTime": "", + "SymbolsProduct": "", + "SymbolsVersion": "", + "SymbolsArtifactName": "Symbols_$(BuildConfiguration)" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": true, + "displayName": "Publish Artifact", + "timeoutInMinutes": 0, + "task": { + "id": "2ff763a7-ce83-4e1f-bc89-0ae63477cebe", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(build.artifactstagingdirectory)", + "ArtifactName": "$(Parameters.ArtifactName)", + "ArtifactType": "Container", + "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)" + } + } + ], + "options": [ + { + "enabled": true, + "definition": { + "id": "5d58cc01-7c75-450c-be18-a388ddb129ec" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "7c555368-ca64-4199-add6-9ebaf0b0137d" + }, + "inputs": { + "multipliers": "[]", + "parallel": "false", + "continueOnError": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "a9db38f9-9fdc-478c-b0f9-464221e58316" + }, + "inputs": { + "workItemType": "136", + "assignToRequestor": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "57578776-4c22-4526-aeb0-86b6da17ee9c" + }, + "inputs": {} + } + ], + "variables": { + "system.debug": { + "value": "false", + "allowOverride": true + }, + "BuildConfiguration": { + "value": "release", + "allowOverride": true + }, + "BuildPlatform": { + "value": "any cpu", + "allowOverride": true + } + }, + "retentionRules": [ + { + "branches": [ + "+refs/heads/*" + ], + "artifacts": [], + "artifactTypesToDelete": [ + "FilePath", + "SymbolStore" + ], + "daysToKeep": 10, + "minimumToKeep": 1, + "deleteBuildRecord": true, + "deleteTestResults": true + } + ], + "_links": { + "self": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/957ff517-98a6-461a-8e07-c0a55dc48616/_apis/build/Definitions/17" + }, + "web": { + "href": "http://tfs2017:8080/tfs/_permalink/_build/index?collectionId=383b3ccd-9646-4a84-b6af-4a5683c8baf9&projectId=957ff517-98a6-461a-8e07-c0a55dc48616&definitionId=17" + }, + "editor": { + "href": "http://tfs2017:8080/tfs/_permalink/_build/definitionEditor?collectionId=383b3ccd-9646-4a84-b6af-4a5683c8baf9&projectId=957ff517-98a6-461a-8e07-c0a55dc48616&definitionId=17" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)", + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "repository": { + "properties": { + "cleanOptions": "0", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "4a6278ef-3294-4891-abc7-baae37f08e33", + "type": "TfsGit", + "name": "Test", + "url": "http://tfs2017:8080/tfs/DefaultCollection/_git/Test", + "defaultBranch": "refs/heads/master", + "clean": "false", + "checkoutSubmodules": false + }, + "processParameters": { + "inputs": [ + { + "options": {}, + "properties": {}, + "name": "solution", + "label": "Path to solution or packages.config", + "defaultValue": "**\\*.sln", + "required": true, + "type": "filePath", + "helpMarkDown": "The path to the Visual Studio solution file or NuGet packages.config", + "visibleRule": "", + "groupName": "" + }, + { + "options": {}, + "properties": {}, + "name": "ArtifactName", + "label": "Artifact Name", + "defaultValue": "drop", + "required": true, + "type": "string", + "helpMarkDown": "The name of the artifact to create.", + "visibleRule": "", + "groupName": "" + } + ] + }, + "quality": "definition", + "authoredBy": { + "id": "fc43189b-9a5a-4887-933c-efaabf280e6e", + "displayName": "Administrator", + "uniqueName": "TFS2017\\Administrator", + "url": "http://tfs2017:8080/tfs/DefaultCollection/_apis/Identities/fc43189b-9a5a-4887-933c-efaabf280e6e", + "imageUrl": "http://tfs2017:8080/tfs/DefaultCollection/_api/_common/identityImage?id=fc43189b-9a5a-4887-933c-efaabf280e6e" + }, + "queue": { + "id": 10, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "id": 17, + "name": "CI", + "url": "http://tfs2017:8080/tfs/DefaultCollection/957ff517-98a6-461a-8e07-c0a55dc48616/_apis/build/Definitions/17", + "uri": "vstfs:///Build/Definition/17", + "path": "\\", + "type": "build", + "revision": 1, + "createdDate": "2020-08-23T15:12:41.717Z", + "project": { + "id": "957ff517-98a6-461a-8e07-c0a55dc48616", + "name": "Test", + "url": "http://tfs2017:8080/tfs/DefaultCollection/_apis/projects/957ff517-98a6-461a-8e07-c0a55dc48616", + "state": "wellFormed", + "revision": 78, + "visibility": "private" + } + }, + { + "build": [ + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "NuGet restore", + "timeoutInMinutes": 0, + "task": { + "id": "333b11bd-d341-40d9-afcf-b32d5ce6f23b", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Parameters.solution)", + "selectOrConfig": "select", + "feed": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "noCache": "false", + "packagesDirectory": "", + "verbosity": "Detailed" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build solution", + "timeoutInMinutes": 0, + "task": { + "id": "71a9a2d3-a98a-4caa-96ab-affca411ecda", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Parameters.solution)", + "vsVersion": "15.0", + "msbuildArgs": "/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation=\"$(build.artifactstagingdirectory)\\WebApp.zip\" /p:DeployIisAppPath=\"Default Web Site\"", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "msbuildArchitecture": "x86", + "logProjectEvents": "true", + "createLogFile": "false" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Test Assemblies", + "timeoutInMinutes": 0, + "task": { + "id": "ef087383-ee5e-42c7-9a53-ab56c98420f9", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\$(BuildConfiguration)\\*test*.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "", + "overrideTestrunParameters": "", + "runInParallel": "False", + "runTestsInIsolation": "False", + "pathtoCustomTestAdapters": "", + "codeCoverageEnabled": "False", + "otherConsoleOptions": "", + "testRunTitle": "", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "publishRunAttachments": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Publish symbols path", + "timeoutInMinutes": 0, + "task": { + "id": "0675668a-7bba-4ccb-901d-5ad6554ca653", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "SymbolsPath": "", + "SearchPattern": "**\\bin\\**\\*.pdb", + "SymbolsFolder": "", + "SkipIndexing": "false", + "TreatNotIndexedAsWarning": "false", + "SymbolsMaximumWaitTime": "", + "SymbolsProduct": "", + "SymbolsVersion": "", + "SymbolsArtifactName": "Symbols_$(BuildConfiguration)" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": true, + "displayName": "Publish Artifact", + "timeoutInMinutes": 0, + "task": { + "id": "2ff763a7-ce83-4e1f-bc89-0ae63477cebe", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(build.artifactstagingdirectory)", + "ArtifactName": "$(Parameters.ArtifactName)", + "ArtifactType": "Container", + "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)" + } + } + ], + "options": [ + { + "enabled": true, + "definition": { + "id": "5d58cc01-7c75-450c-be18-a388ddb129ec" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "7c555368-ca64-4199-add6-9ebaf0b0137d" + }, + "inputs": { + "multipliers": "[]", + "parallel": "false", + "continueOnError": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "a9db38f9-9fdc-478c-b0f9-464221e58316" + }, + "inputs": { + "workItemType": "136", + "assignToRequestor": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "57578776-4c22-4526-aeb0-86b6da17ee9c" + }, + "inputs": {} + } + ], + "variables": { + "system.debug": { + "value": "false", + "allowOverride": true + }, + "BuildConfiguration": { + "value": "release", + "allowOverride": true + }, + "BuildPlatform": { + "value": "any cpu", + "allowOverride": true + } + }, + "demands": [ + "unitTest -equals true" + ], + "retentionRules": [ + { + "branches": [ + "+refs/heads/*" + ], + "artifacts": [], + "artifactTypesToDelete": [ + "FilePath", + "SymbolStore" + ], + "daysToKeep": 10, + "minimumToKeep": 1, + "deleteBuildRecord": true, + "deleteTestResults": true + } + ], + "_links": { + "self": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/957ff517-98a6-461a-8e07-c0a55dc48616/_apis/build/Definitions/18" + }, + "web": { + "href": "http://tfs2017:8080/tfs/_permalink/_build/index?collectionId=383b3ccd-9646-4a84-b6af-4a5683c8baf9&projectId=957ff517-98a6-461a-8e07-c0a55dc48616&definitionId=18" + }, + "editor": { + "href": "http://tfs2017:8080/tfs/_permalink/_build/definitionEditor?collectionId=383b3ccd-9646-4a84-b6af-4a5683c8baf9&projectId=957ff517-98a6-461a-8e07-c0a55dc48616&definitionId=18" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)", + "comment": "Added demand", + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "repository": { + "properties": { + "cleanOptions": "0", + "tfvcMapping": "{\"mappings\":[{\"serverPath\":\"$/Test\",\"mappingType\":\"map\",\"localPath\":\"\\\\\"},{\"serverPath\":\"$/Test/Drops\",\"mappingType\":\"cloak\",\"localPath\":\"\"}]}", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)" + }, + "id": "$/", + "type": "TfsVersionControl", + "name": "Test", + "url": "http://tfs2017:8080/tfs/DefaultCollection/", + "defaultBranch": "$/Test", + "rootFolder": "$/Test", + "clean": "false", + "checkoutSubmodules": false + }, + "processParameters": { + "inputs": [ + { + "options": {}, + "properties": {}, + "name": "solution", + "label": "Path to solution or packages.config", + "defaultValue": "**\\*.sln", + "required": true, + "type": "filePath", + "helpMarkDown": "The path to the Visual Studio solution file or NuGet packages.config", + "visibleRule": "", + "groupName": "" + }, + { + "options": {}, + "properties": {}, + "name": "ArtifactName", + "label": "Artifact Name", + "defaultValue": "drop", + "required": true, + "type": "string", + "helpMarkDown": "The name of the artifact to create.", + "visibleRule": "", + "groupName": "" + } + ] + }, + "quality": "definition", + "authoredBy": { + "id": "fc43189b-9a5a-4887-933c-efaabf280e6e", + "displayName": "Administrator", + "uniqueName": "TFS2017\\Administrator", + "url": "http://tfs2017:8080/tfs/DefaultCollection/_apis/Identities/fc43189b-9a5a-4887-933c-efaabf280e6e", + "imageUrl": "http://tfs2017:8080/tfs/DefaultCollection/_api/_common/identityImage?id=fc43189b-9a5a-4887-933c-efaabf280e6e" + }, + "queue": { + "id": 10, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "id": 18, + "name": "TFVC-CI", + "url": "http://tfs2017:8080/tfs/DefaultCollection/957ff517-98a6-461a-8e07-c0a55dc48616/_apis/build/Definitions/18", + "uri": "vstfs:///Build/Definition/18", + "path": "\\", + "type": "build", + "revision": 2, + "createdDate": "2020-08-23T22:30:31.693Z", + "project": { + "id": "957ff517-98a6-461a-8e07-c0a55dc48616", + "name": "Test", + "url": "http://tfs2017:8080/tfs/DefaultCollection/_apis/projects/957ff517-98a6-461a-8e07-c0a55dc48616", + "state": "wellFormed", + "revision": 78, + "visibility": "private" + } + } + ] +} diff --git a/Tests/SampleFiles/Get-BuildDefinition_2018.json b/Tests/SampleFiles/Get-BuildDefinition_2018.json new file mode 100644 index 000000000..aecd01e19 --- /dev/null +++ b/Tests/SampleFiles/Get-BuildDefinition_2018.json @@ -0,0 +1,380 @@ +{ + "count": 1, + "value": [ + { + "options": [ + { + "enabled": true, + "definition": { + "id": "5d58cc01-7c75-450c-be18-a388ddb129ec" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "a9db38f9-9fdc-478c-b0f9-464221e58316" + }, + "inputs": { + "workItemType": "211", + "assignToRequestor": "true", + "additionalFields": "{}" + } + } + ], + "variables": { + "BuildConfiguration": { + "value": "release", + "allowOverride": true + }, + "BuildPlatform": { + "value": "any cpu", + "allowOverride": true + }, + "system.debug": { + "value": "false", + "allowOverride": true + } + }, + "retentionRules": [ + { + "branches": [ + "+refs/heads/*" + ], + "artifacts": [], + "artifactTypesToDelete": [ + "FilePath", + "SymbolStore" + ], + "daysToKeep": 10, + "minimumToKeep": 1, + "deleteBuildRecord": true, + "deleteTestResults": true + } + ], + "properties": {}, + "tags": [], + "_links": { + "self": { + "href": "http://tfs:8080/tfs/DefaultCollection/8cb82586-f099-4a58-88a6-80477f69820e/_apis/build/Definitions/27?revision=1" + }, + "web": { + "href": "http://tfs:8080/tfs/_permalink/_build/index?collectionId=008e904f-c5c1-4ebd-9b1f-1880f82f7599&projectId=8cb82586-f099-4a58-88a6-80477f69820e&definitionId=27" + }, + "editor": { + "href": "http://tfs:8080/tfs/_permalink/_build/definitionEditor?collectionId=008e904f-c5c1-4ebd-9b1f-1880f82f7599&projectId=8cb82586-f099-4a58-88a6-80477f69820e&definitionId=27" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)", + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "process": { + "phases": [ + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use NuGet 4.4.1", + "timeoutInMinutes": 0, + "task": { + "id": "2c65196a-54fd-4a02-9be8-d9d1837b7c5d", + "versionSpec": "0.*", + "definitionType": "task" + }, + "inputs": { + "versionSpec": "4.4.1", + "checkLatest": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "NuGet restore", + "timeoutInMinutes": 0, + "task": { + "id": "333b11bd-d341-40d9-afcf-b32d5ce6f23b", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "restore", + "solution": "$(Parameters.solution)", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "allowPackageConflicts": "false", + "externalEndpoint": "", + "verbosityPush": "Detailed", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "versioningScheme": "off", + "includeReferencedProjects": "false", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "packTimezone": "utc", + "includeSymbols": "false", + "toolPackage": "false", + "buildProperties": "", + "verbosityPack": "Detailed", + "arguments": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build solution", + "timeoutInMinutes": 0, + "task": { + "id": "71a9a2d3-a98a-4caa-96ab-affca411ecda", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Parameters.solution)", + "vsVersion": "latest", + "msbuildArgs": "/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation=\"$(build.artifactstagingdirectory)\\WebApp.zip\" /p:DeployIisAppPath=\"Default Web Site\"", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "msbuildArchitecture": "x86", + "logProjectEvents": "true", + "createLogFile": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Test Assemblies", + "timeoutInMinutes": 0, + "task": { + "id": "ef087383-ee5e-42c7-9a53-ab56c98420f9", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\$(BuildConfiguration)\\*test*.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "", + "overrideTestrunParameters": "", + "pathtoCustomTestAdapters": "", + "runInParallel": "False", + "runTestsInIsolation": "False", + "codeCoverageEnabled": "False", + "otherConsoleOptions": "", + "distributionBatchType": "basedOnTestCases", + "batchingBasedOnAgentsOption": "autoBatchSize", + "customBatchSizeValue": "10", + "batchingBasedOnExecutionTimeOption": "autoBatchSize", + "customRunTimePerBatchValue": "60", + "dontDistribute": "False", + "testRunTitle": "", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "publishRunAttachments": "true", + "rerunFailedTests": "False", + "rerunType": "basedOnTestFailurePercentage", + "rerunFailedThreshold": "30", + "rerunFailedTestCasesMaxLimit": "5", + "rerunMaxAttempts": "3" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Publish symbols path", + "timeoutInMinutes": 0, + "task": { + "id": "0675668a-7bba-4ccb-901d-5ad6554ca653", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "SymbolsFolder": "$(Build.SourcesDirectory)", + "SearchPattern": "**\\bin\\**\\*.pdb", + "IndexSources": "true", + "PublishSymbols": "false", + "SymbolServerType": "TeamServices", + "SymbolsPath": "", + "DetailedLog": "true", + "TreatNotIndexedAsWarning": "false", + "SymbolsMaximumWaitTime": "", + "SymbolsProduct": "", + "SymbolsVersion": "", + "SymbolsArtifactName": "Symbols_$(BuildConfiguration)" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish Artifact", + "timeoutInMinutes": 0, + "task": { + "id": "2ff763a7-ce83-4e1f-bc89-0ae63477cebe", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(build.artifactstagingdirectory)", + "ArtifactName": "$(Parameters.ArtifactName)", + "ArtifactType": "Container", + "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)", + "Parallel": "false", + "ParallelCount": "8" + } + } + ], + "name": "Phase 1", + "refName": "Phase_1", + "condition": "succeeded()", + "target": { + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection", + "jobCancelTimeoutInMinutes": 1 + } + ], + "type": 1 + }, + "repository": { + "properties": { + "cleanOptions": "0", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "a02b620b-f4c0-49c9-8be2-f9ddf76ef9de", + "type": "TfsGit", + "name": "Test", + "url": "http://tfs:8080/tfs/DefaultCollection/_git/Test", + "defaultBranch": "refs/heads/master", + "clean": "false", + "checkoutSubmodules": false + }, + "processParameters": { + "inputs": [ + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "solution", + "label": "Path to solution or packages.config", + "defaultValue": "**\\*.sln", + "required": true, + "type": "filePath", + "helpMarkDown": "The path to the Visual Studio solution file or NuGet packages.config", + "visibleRule": "", + "groupName": "" + }, + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "ArtifactName", + "label": "Artifact Name", + "defaultValue": "drop", + "required": true, + "type": "string", + "helpMarkDown": "The name of the artifact to create.", + "visibleRule": "", + "groupName": "" + } + ] + }, + "quality": "definition", + "authoredBy": { + "displayName": "Administrator", + "url": "http://tfs:8080/tfs/DefaultCollection/_apis/Identities/ec76f7f3-fea1-4c81-bfcd-5065341fac4b", + "_links": { + "avatar": { + "href": "http://tfs:8080/tfs/DefaultCollection/_api/_common/identityImage?id=ec76f7f3-fea1-4c81-bfcd-5065341fac4b" + } + }, + "id": "ec76f7f3-fea1-4c81-bfcd-5065341fac4b", + "uniqueName": "TFS\\Administrator", + "imageUrl": "http://tfs:8080/tfs/DefaultCollection/_api/_common/identityImage?id=ec76f7f3-fea1-4c81-bfcd-5065341fac4b" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "http://tfs:8080/tfs/DefaultCollection/_apis/build/Queues/15" + } + }, + "id": 15, + "name": "Default", + "url": "http://tfs:8080/tfs/DefaultCollection/_apis/build/Queues/15", + "pool": { + "id": 1, + "name": "Default" + } + }, + "id": 27, + "name": "CI", + "url": "http://tfs:8080/tfs/DefaultCollection/8cb82586-f099-4a58-88a6-80477f69820e/_apis/build/Definitions/27?revision=1", + "uri": "vstfs:///Build/Definition/27", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 1, + "createdDate": "2020-08-23T15:16:22.373Z", + "project": { + "id": "8cb82586-f099-4a58-88a6-80477f69820e", + "name": "Test", + "url": "http://tfs:8080/tfs/DefaultCollection/_apis/projects/8cb82586-f099-4a58-88a6-80477f69820e", + "state": "wellFormed", + "revision": 204, + "visibility": "private" + } + } + ] +} diff --git a/Tests/SampleFiles/Get-BuildDefinition_2019.json b/Tests/SampleFiles/Get-BuildDefinition_2019.json new file mode 100644 index 000000000..caba36a14 --- /dev/null +++ b/Tests/SampleFiles/Get-BuildDefinition_2019.json @@ -0,0 +1,464 @@ +{ + "count": 2, + "value": [ + { + "triggers": [ + { + "branchFilters": [], + "pathFilters": [], + "settingsSourceType": 2, + "batchChanges": false, + "maxConcurrentBuildsPerBranch": 1, + "triggerType": "continuousIntegration" + } + ], + "_links": { + "self": { + "href": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_apis/build/Definitions/81?revision=1" + }, + "web": { + "href": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_build/definition?definitionId=81" + }, + "editor": { + "href": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_build/designer?id=81&_a=edit-build-definition" + }, + "badge": { + "href": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_apis/build/status/81" + } + }, + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "repository": { + "properties": { + "cloneUrl": "http://tfs2019:8080/DefaultCollection/Test/_git/Test", + "fullName": "Test", + "defaultBranch": "refs/heads/master", + "isFork": "False", + "safeRepository": "3ffe3712-46ce-49e5-8202-df131c2d52a1", + "reportBuildStatus": "true" + }, + "id": "3ffe3712-46ce-49e5-8202-df131c2d52a1", + "type": "TfsGit", + "name": "Test", + "url": "http://tfs2019:8080/DefaultCollection/Test/_git/Test", + "defaultBranch": "refs/heads/master", + "clean": null, + "checkoutSubmodules": false + }, + "quality": "definition", + "authoredBy": { + "displayName": "Administrator", + "url": "http://tfs2019:8080/DefaultCollection/_apis/Identities/85aa0256-232e-4417-8ec6-c761d36925b9", + "_links": { + "avatar": { + "href": "http://tfs2019:8080/DefaultCollection/_apis/GraphProfile/MemberAvatars/win.Uy0xLTUtMjEtMTc5MTA4NDQwNi0xOTM2NDIwMjI2LTI1MzcxNDQxMjUtNTAw" + } + }, + "id": "85aa0256-232e-4417-8ec6-c761d36925b9", + "uniqueName": "TFS2019\\Administrator", + "imageUrl": "http://tfs2019:8080/DefaultCollection/_apis/GraphProfile/MemberAvatars/win.Uy0xLTUtMjEtMTc5MTA4NDQwNi0xOTM2NDIwMjI2LTI1MzcxNDQxMjUtNTAw", + "descriptor": "win.Uy0xLTUtMjEtMTc5MTA4NDQwNi0xOTM2NDIwMjI2LTI1MzcxNDQxMjUtNTAw" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "http://tfs2019:8080/DefaultCollection/_apis/build/Queues/41" + } + }, + "id": 41, + "name": "Default", + "url": "http://tfs2019:8080/DefaultCollection/_apis/build/Queues/41", + "pool": { + "id": 1, + "name": "Default" + } + }, + "id": 81, + "name": "Test", + "url": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_apis/build/Definitions/81?revision=1", + "uri": "vstfs:///Build/Definition/81", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 1, + "createdDate": "2020-08-23T15:19:29.897Z", + "project": { + "id": "9e0e3db0-56b3-4b7a-b64e-63f575079e13", + "name": "Test", + "url": "http://tfs2019:8080/DefaultCollection/_apis/projects/9e0e3db0-56b3-4b7a-b64e-63f575079e13", + "state": "wellFormed", + "revision": 685, + "visibility": "private", + "lastUpdateTime": "2020-08-23T15:18:16.563Z" + } + }, + { + "build": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use NuGet 4.4.1", + "timeoutInMinutes": 0, + "task": { + "id": "2c65196a-54fd-4a02-9be8-d9d1837b7c5d", + "versionSpec": "0.*", + "definitionType": "task" + }, + "inputs": { + "versionSpec": "4.4.1", + "checkLatest": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "NuGet restore", + "timeoutInMinutes": 0, + "task": { + "id": "333b11bd-d341-40d9-afcf-b32d5ce6f23b", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "restore", + "solution": "$(Parameters.solution)", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "disableParallelProcessing": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "allowPackageConflicts": "false", + "externalEndpoint": "", + "verbosityPush": "Detailed", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "versioningScheme": "off", + "includeReferencedProjects": "false", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "packTimezone": "utc", + "includeSymbols": "false", + "toolPackage": "false", + "buildProperties": "", + "basePath": "", + "verbosityPack": "Detailed", + "arguments": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build solution", + "timeoutInMinutes": 0, + "task": { + "id": "71a9a2d3-a98a-4caa-96ab-affca411ecda", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Parameters.solution)", + "vsVersion": "latest", + "msbuildArgs": "/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation=\"$(build.artifactstagingdirectory)\\WebApp.zip\" /p:DeployIisAppPath=\"Default Web Site\"", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "msbuildArchitecture": "x86", + "logProjectEvents": "true", + "createLogFile": "false", + "logFileVerbosity": "normal" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Test Assemblies", + "timeoutInMinutes": 0, + "task": { + "id": "ef087383-ee5e-42c7-9a53-ab56c98420f9", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\$(BuildConfiguration)\\*test*.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "", + "overrideTestrunParameters": "", + "pathtoCustomTestAdapters": "", + "runInParallel": "False", + "runTestsInIsolation": "False", + "codeCoverageEnabled": "False", + "otherConsoleOptions": "", + "distributionBatchType": "basedOnTestCases", + "batchingBasedOnAgentsOption": "autoBatchSize", + "customBatchSizeValue": "10", + "batchingBasedOnExecutionTimeOption": "autoBatchSize", + "customRunTimePerBatchValue": "60", + "dontDistribute": "False", + "testRunTitle": "", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "publishRunAttachments": "true", + "diagnosticsEnabled": "false", + "collectDumpOn": "onAbortOnly", + "rerunFailedTests": "False", + "rerunType": "basedOnTestFailurePercentage", + "rerunFailedThreshold": "30", + "rerunFailedTestCasesMaxLimit": "5", + "rerunMaxAttempts": "3" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Publish symbols path", + "timeoutInMinutes": 0, + "task": { + "id": "0675668a-7bba-4ccb-901d-5ad6554ca653", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "SymbolsFolder": "$(Build.SourcesDirectory)", + "SearchPattern": "**\\bin\\**\\*.pdb", + "IndexSources": "true", + "PublishSymbols": "false", + "SymbolServerType": "TeamServices", + "SymbolsPath": "", + "CompressSymbols": "false", + "DetailedLog": "true", + "TreatNotIndexedAsWarning": "false", + "SymbolsMaximumWaitTime": "", + "SymbolsProduct": "", + "SymbolsVersion": "", + "SymbolsArtifactName": "Symbols_$(BuildConfiguration)" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": true, + "displayName": "Publish Artifact", + "timeoutInMinutes": 0, + "task": { + "id": "2ff763a7-ce83-4e1f-bc89-0ae63477cebe", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(build.artifactstagingdirectory)", + "ArtifactName": "$(Parameters.ArtifactName)", + "ArtifactType": "Container", + "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)", + "Parallel": "false", + "ParallelCount": "8" + } + } + ], + "options": [ + { + "enabled": true, + "definition": { + "id": "5d58cc01-7c75-450c-be18-a388ddb129ec" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "a9db38f9-9fdc-478c-b0f9-464221e58316" + }, + "inputs": { + "workItemType": "Task", + "assignToRequestor": "true", + "additionalFields": "{}" + } + } + ], + "variables": { + "BuildConfiguration": { + "value": "release", + "allowOverride": true + }, + "BuildPlatform": { + "value": "any cpu", + "allowOverride": true + }, + "system.debug": { + "value": "false", + "allowOverride": true + } + }, + "retentionRules": [ + { + "branches": [ + "+refs/heads/*" + ], + "artifacts": [], + "artifactTypesToDelete": [ + "FilePath", + "SymbolStore" + ], + "daysToKeep": 10, + "minimumToKeep": 1, + "deleteBuildRecord": true, + "deleteTestResults": true + } + ], + "_links": { + "self": { + "href": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_apis/build/Definitions/82?revision=1" + }, + "web": { + "href": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_build/definition?definitionId=82" + }, + "editor": { + "href": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_build/designer?id=82&_a=edit-build-definition" + }, + "badge": { + "href": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_apis/build/status/82" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)", + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "repository": { + "properties": { + "cleanOptions": "0", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "3ffe3712-46ce-49e5-8202-df131c2d52a1", + "type": "TfsGit", + "name": "Test", + "url": "http://tfs2019:8080/DefaultCollection/Test/_git/Test", + "defaultBranch": "refs/heads/master", + "clean": "false", + "checkoutSubmodules": false + }, + "processParameters": { + "inputs": [ + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "solution", + "label": "Path to solution or packages.config", + "defaultValue": "**\\*.sln", + "required": true, + "type": "filePath", + "helpMarkDown": "The path to the Visual Studio solution file or NuGet packages.config", + "visibleRule": "", + "groupName": "" + }, + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "ArtifactName", + "label": "Artifact Name", + "defaultValue": "drop", + "required": true, + "type": "string", + "helpMarkDown": "The name of the artifact to create.", + "visibleRule": "", + "groupName": "" + } + ] + }, + "quality": "definition", + "authoredBy": { + "displayName": "Administrator", + "url": "http://tfs2019:8080/DefaultCollection/_apis/Identities/85aa0256-232e-4417-8ec6-c761d36925b9", + "_links": { + "avatar": { + "href": "http://tfs2019:8080/DefaultCollection/_apis/GraphProfile/MemberAvatars/win.Uy0xLTUtMjEtMTc5MTA4NDQwNi0xOTM2NDIwMjI2LTI1MzcxNDQxMjUtNTAw" + } + }, + "id": "85aa0256-232e-4417-8ec6-c761d36925b9", + "uniqueName": "TFS2019\\Administrator", + "imageUrl": "http://tfs2019:8080/DefaultCollection/_apis/GraphProfile/MemberAvatars/win.Uy0xLTUtMjEtMTc5MTA4NDQwNi0xOTM2NDIwMjI2LTI1MzcxNDQxMjUtNTAw", + "descriptor": "win.Uy0xLTUtMjEtMTc5MTA4NDQwNi0xOTM2NDIwMjI2LTI1MzcxNDQxMjUtNTAw" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "http://tfs2019:8080/DefaultCollection/_apis/build/Queues/41" + } + }, + "id": 41, + "name": "Default", + "url": "http://tfs2019:8080/DefaultCollection/_apis/build/Queues/41", + "pool": { + "id": 1, + "name": "Default" + } + }, + "id": 82, + "name": "CI", + "url": "http://tfs2019:8080/DefaultCollection/9e0e3db0-56b3-4b7a-b64e-63f575079e13/_apis/build/Definitions/82?revision=1", + "uri": "vstfs:///Build/Definition/82", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 1, + "createdDate": "2020-08-23T15:21:57.13Z", + "project": { + "id": "9e0e3db0-56b3-4b7a-b64e-63f575079e13", + "name": "Test", + "url": "http://tfs2019:8080/DefaultCollection/_apis/projects/9e0e3db0-56b3-4b7a-b64e-63f575079e13", + "state": "wellFormed", + "revision": 685, + "visibility": "private", + "lastUpdateTime": "2020-08-23T15:18:16.563Z" + } + } + ] +} diff --git a/Tests/SampleFiles/Get-BuildDefinition_AzD.json b/Tests/SampleFiles/Get-BuildDefinition_AzD.json new file mode 100644 index 000000000..8b087d329 --- /dev/null +++ b/Tests/SampleFiles/Get-BuildDefinition_AzD.json @@ -0,0 +1,3239 @@ +{ + "count": 8, + "value": [ + { + "options": [ + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "workItemType": "Issue", + "assignToRequestor": "true", + "additionalFields": "{}" + } + } + ], + "triggers": [ + { + "branchFilters": [ + "+refs/heads/master" + ], + "pathFilters": [], + "batchChanges": false, + "maxConcurrentBuildsPerBranch": 1, + "pollingInterval": 0, + "triggerType": "continuousIntegration" + } + ], + "variables": { + "aquaPass": { + "value": null, + "isSecret": true + }, + "aquaRegPass": { + "value": null, + "isSecret": true + }, + "aquaRegUser": { + "value": "jessde@microsoft.com" + }, + "baseName": { + "value": "ptracker" + }, + "BuildConfiguration": { + "value": "release" + }, + "BuildPlatform": { + "value": "any cpu" + }, + "certPassword": { + "value": "redacted" + }, + "clientSecret": { + "value": null, + "isSecret": true + }, + "iosPassword": { + "value": null, + "isSecret": true + }, + "location": { + "value": "eastus2" + }, + "output": { + "value": "table" + }, + "resourceGroupName": { + "value": "PTracker-Common" + }, + "servicePrincipal": { + "value": "00000000-0000-0000-0000-000000000000" + }, + "skipComponentGovernanceDetection": { + "value": "true" + }, + "subscriptionId": { + "value": "00000000-0000-0000-0000-000000000000", + "allowOverride": true + }, + "system.debug": { + "value": "false", + "allowOverride": true + }, + "tenantId": { + "value": "00000000-0000-0000-0000-000000000000" + } + }, + "retentionRules": [ + { + "branches": [ + "+refs/heads/*" + ], + "artifacts": [], + "artifactTypesToDelete": [ + "FilePath", + "SymbolStore" + ], + "daysToKeep": 10, + "minimumToKeep": 1, + "deleteBuildRecord": true, + "deleteTestResults": true + } + ], + "properties": {}, + "tags": [], + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/definition?definitionId=23" + }, + "editor": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/designer?id=23&_a=edit-build-definition" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "process": { + "phases": [ + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use .NET Core sdk 2.2.203", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "packageType": "sdk", + "useGlobalJson": "false", + "workingDirectory": "", + "version": "2.2.203", + "includePreviewVersions": "false", + "installationPath": "$(Agent.ToolsDirectory)/dotnet", + "performMultiLevelLookup": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Restore, Build & Test", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "test", + "publishWebProjects": "true", + "projects": "src/PeopleTracker.BerService.Tests/PeopleTracker.BerService.Tests.csproj", + "custom": "", + "arguments": "--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude=\"[xunit*]*\" /p:CoverletOutput=src/PeopleTracker.BerService.Tests/TestResults/Coverage/", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "publish", + "publishWebProjects": "false", + "projects": "src/PeopleTracker.BerService/*.csproj", + "custom": "", + "arguments": "-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory)", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "false", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "src/PeopleTracker.BerService" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish Artifact: ber", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(Build.ArtifactStagingDirectory)", + "ArtifactName": "ber", + "ArtifactType": "Container", + "TargetPath": "", + "Parallel": "false", + "ParallelCount": "8", + "FileCopyOptions": "" + } + } + ], + "name": "BER on Windows", + "refName": "Job_4", + "condition": "succeeded()", + "target": { + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + }, + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use .NET Core sdk 2.2.203", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "packageType": "sdk", + "useGlobalJson": "false", + "workingDirectory": "", + "version": "2.2.203", + "includePreviewVersions": "false", + "installationPath": "$(Agent.ToolsDirectory)/dotnet", + "performMultiLevelLookup": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Restore, Build & Test", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "test", + "publishWebProjects": "true", + "projects": "src/PeopleTracker.Web.Tests/PeopleTracker.Web.Tests.csproj", + "custom": "", + "arguments": "--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude=\"[xunit*]*\" /p:CoverletOutput=$(Build.SourcesDirectory)/src/PeopleTracker.Web.Tests/TestResults/Coverage/", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish code coverage", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "codeCoverageTool": "Cobertura", + "summaryFileLocation": "$(Build.SourcesDirectory)/src/PeopleTracker.Web.Tests/TestResults/Coverage/coverage.cobertura.xml", + "pathToSources": "", + "reportDirectory": "", + "additionalCodeCoverageFiles": "", + "failIfCoverageEmpty": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "publish", + "publishWebProjects": "false", + "projects": "src/PeopleTracker.Web/*.csproj", + "custom": "", + "arguments": "-c $(BuildConfiguration) -o $(Build.StagingDirectory)", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "false", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Copy infrastructure files", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "SourceFolder": "src/PeopleTracker.IaC", + "Contents": "**/deploy*\n**/ber.ps1\n**/updatedns.ps1\n**/appCenter.ps1\n**/rbac.yaml\n**/peopletracker/**", + "TargetFolder": "$(Build.ArtifactStagingDirectory)/IaC", + "CleanTargetFolder": "false", + "OverWrite": "false", + "flattenFolders": "false", + "preserveTimestamp": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish Artifact: iac", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(Build.ArtifactStagingDirectory)/IaC", + "ArtifactName": "iac", + "ArtifactType": "Container", + "TargetPath": "", + "Parallel": "false", + "ParallelCount": "8", + "FileCopyOptions": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Create ACR, Build & Push image", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "targetType": "filePath", + "filePath": "src/PeopleTracker.IaC/common.ps1", + "arguments": "-tag $(Build.BuildId) -baseName $(baseName) -resourceGroupName $(resourceGroupName) -location $(location) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -output $(output) -subscriptionid $(subscriptionid) -tenantId $(tenantId) -aquaRegUser $(aquaRegUser) -aquaRegPass $(aquaRegPass) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "src/PeopleTracker.Web" + } + } + ], + "name": "Docker on Linux", + "refName": "Job_1", + "condition": "succeeded()", + "target": { + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/86" + } + }, + "id": 86, + "url": "https://dev.azure.com/Test/_apis/build/Queues/86", + "pool": null + }, + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + }, + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use NuGet 4.7.x", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "versionSpec": "4.7.x", + "checkLatest": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "NuGet restore", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "restore", + "solution": "PeopleTracker.WebService.sln", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "disableParallelProcessing": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "allowPackageConflicts": "false", + "externalEndpoint": "", + "verbosityPush": "Detailed", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "versioningScheme": "off", + "includeReferencedProjects": "false", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "packTimezone": "utc", + "includeSymbols": "false", + "toolPackage": "false", + "buildProperties": "", + "basePath": "", + "verbosityPack": "Detailed", + "arguments": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build solution", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "PeopleTracker.WebService.sln", + "vsVersion": "latest", + "msbuildArgs": "/p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "msbuildArchitecture": "x86", + "logProjectEvents": "true", + "createLogFile": "false", + "logFileVerbosity": "normal" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Run Unit Test", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\*Tests.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "TestCategory=Unit", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "", + "overrideTestrunParameters": "", + "pathtoCustomTestAdapters": "", + "runInParallel": "true", + "runTestsInIsolation": "False", + "codeCoverageEnabled": "false", + "otherConsoleOptions": "", + "distributionBatchType": "basedOnTestCases", + "batchingBasedOnAgentsOption": "autoBatchSize", + "customBatchSizeValue": "10", + "batchingBasedOnExecutionTimeOption": "autoBatchSize", + "customRunTimePerBatchValue": "60", + "dontDistribute": "False", + "testRunTitle": "Services", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "publishRunAttachments": "true", + "diagnosticsEnabled": "True", + "collectDumpOn": "onAbortOnly", + "rerunFailedTests": "False", + "rerunType": "basedOnTestFailurePercentage", + "rerunFailedThreshold": "30", + "rerunFailedTestCasesMaxLimit": "5", + "rerunMaxAttempts": "3" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Copy Files", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "SourceFolder": "src", + "Contents": "**\\PeopleTracker.NetService.zip\n**\\PeopleTracker.Database.dacpac\n**\\PeopleTracker.UITests\\bin\\$(BuildConfiguration)\\**", + "TargetFolder": "$(build.artifactstagingdirectory)", + "CleanTargetFolder": "true", + "OverWrite": "true", + "flattenFolders": "true", + "preserveTimestamp": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish Artifact: win", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(Build.ArtifactStagingDirectory)", + "ArtifactName": "win", + "ArtifactType": "Container", + "TargetPath": "", + "Parallel": "false", + "ParallelCount": "8", + "FileCopyOptions": "" + } + } + ], + "name": "Web on Windows", + "refName": "Job_2", + "condition": "succeeded()", + "target": { + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + }, + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use NuGet 4.7.x", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "versionSpec": "4.7.x", + "checkLatest": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "NuGet restore", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "restore", + "solution": "PeopleTracker.Mobile.sln", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "disableParallelProcessing": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "allowPackageConflicts": "false", + "externalEndpoint": "", + "verbosityPush": "Detailed", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "versioningScheme": "off", + "includeReferencedProjects": "false", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "packTimezone": "utc", + "includeSymbols": "false", + "toolPackage": "false", + "buildProperties": "", + "basePath": "", + "verbosityPack": "Detailed", + "arguments": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Install an Apple certificate", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "certSecureFile": "00000000-0000-0000-0000-000000000000", + "certPwd": "$(iosPassword)", + "keychain": "temp", + "keychainPassword": "", + "customKeychainPath": "", + "deleteCert": "false", + "deleteCustomKeychain": "false", + "signingIdentity": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Install an Apple provisioning profile", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "provisioningProfileLocation": "secureFiles", + "provProfileSecureFile": "00000000-0000-0000-0000-000000000000", + "provProfileSourceRepository": "", + "removeProfile": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Replace tokens for iOS", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "sourcePath": "src/PeopleTracker.Mobile.iOS", + "filePattern": "**/*.plist", + "warningsAsErrors": "false", + "tokenRegex": "__([a-zA-Z0-9\\.]+)__", + "secretTokens": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Replace tokens for Android", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "sourcePath": "src/PeopleTracker.Mobile.Droid", + "filePattern": "**/*.xml", + "warningsAsErrors": "false", + "tokenRegex": "__([a-zA-Z0-9\\.]+)__", + "secretTokens": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Version Assemblies using **/PeopleTracker.Mobile.csproj", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "sourcePath": "src/PeopleTracker.Mobile", + "filePattern": "**/PeopleTracker.Mobile.csproj", + "versionSource": "buildNumber", + "customNumberVariable": "myBuildNumber", + "versionFormat": "custom", + "customBuildRegex": "\\d+", + "replaceVersionFormat": "threeParts", + "customReplaceRegex": "", + "buildRegexIndex": "0", + "replacePrefix": "2.0.0.", + "replacePostfix": "", + "failIfNoMatchFound": "true" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Get Version for BER", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "$m = Select-String -Pattern '>([0-9\\.]+)<' -Path .\\PeopleTracker.Mobile.csproj\n$m.Matches.Groups[1].Value | Set-Content -Path $(Build.ArtifactStagingDirectory)\\version.txt", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "src/PeopleTracker.Mobile" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build Xamarin.iOS", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "solution": "PeopleTracker.Mobile.sln", + "configuration": "$(BuildConfiguration)", + "clean": "true", + "packageApp": "true", + "forSimulator": "false", + "runNugetRestore": "false", + "args": "", + "cwd": "", + "buildToolLocation": "", + "iosSigningIdentity": "", + "provProfileUuid": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build Xamarin.Android", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "project": "**/*Droid*.csproj", + "target": "", + "outputDir": "$(build.binariesdirectory/$(BuildConfiguration)", + "configuration": "$(BuildConfiguration)", + "createAppPackage": "true", + "clean": "false", + "msbuildLocationMethod": "version", + "msbuildVersion": "latest", + "msbuildLocation": "", + "msbuildArchitecture": "x86", + "msbuildArguments": "", + "jdkSelection": "JDKVersion", + "jdkVersion": "default", + "jdkUserInputPath": "", + "jdkArchitecture": "x64" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "WhiteSource Bolt", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "19.*", + "definitionType": "task" + }, + "inputs": { + "cwd": "", + "advance": "false", + "exclude": "", + "extraFolders": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Signing and align APK", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "3.*", + "definitionType": "task" + }, + "inputs": { + "files": "**/bin/*.apk", + "apksign": "true", + "keystoreFile": "00000000-0000-0000-0000-000000000000", + "keystorePass": "$(certPassword)", + "keystoreAlias": "peopletracker", + "keyPass": "$(certPassword)", + "apksignerArguments": "--verbose", + "apksignerLocation": "", + "zipalign": "true", + "zipalignLocation": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Copy Files", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "SourceFolder": "", + "Contents": "**/*.ipa\n**/*.apk\n**/*.app.dSYM\n**/PeopleTracker.Mobile.Tests/bin/**/*.dll\nsrc/ReleaseNotes.txt\n**/test-cloud.exe", + "TargetFolder": "$(Build.ArtifactStagingDirectory)", + "CleanTargetFolder": "false", + "OverWrite": "false", + "flattenFolders": "true", + "preserveTimestamp": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish Mobile Artifact", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(Build.ArtifactStagingDirectory)", + "ArtifactName": "mobile", + "ArtifactType": "Container", + "TargetPath": "", + "Parallel": "false", + "ParallelCount": "8", + "FileCopyOptions": "" + } + } + ], + "name": "Mobile on macOS", + "refName": "Job_3", + "condition": "succeeded()", + "target": { + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/95" + } + }, + "id": 95, + "url": "https://dev.azure.com/Test/_apis/build/Queues/95", + "pool": null + }, + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + } + ], + "type": 1 + }, + "repository": { + "properties": { + "cleanOptions": "3", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "defaultBranch": "refs/heads/master", + "clean": "true", + "checkoutSubmodules": false + }, + "processParameters": {}, + "quality": "definition", + "authoredBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/81" + } + }, + "id": 81, + "name": "Default", + "url": "https://dev.azure.com/Test/_apis/build/Queues/81", + "pool": { + "id": 1, + "name": "Default" + } + }, + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "createdDate": "2019-09-16T02:34:16.947Z", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + { + "options": [ + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "workItemType": "Issue", + "assignToRequestor": "true", + "additionalFields": "{}" + } + } + ], + "variables": { + "aquaPass": { + "value": null, + "isSecret": true + }, + "aquaRegPass": { + "value": null, + "isSecret": true + }, + "aquaRegUser": { + "value": "jessde@microsoft.com" + }, + "baseName": { + "value": "ptracker" + }, + "BuildConfiguration": { + "value": "release" + }, + "BuildPlatform": { + "value": "any cpu" + }, + "certPassword": { + "value": "redacted" + }, + "clientSecret": { + "value": null, + "isSecret": true + }, + "iosPassword": { + "value": null, + "isSecret": true + }, + "location": { + "value": "eastus2" + }, + "output": { + "value": "table" + }, + "resourceGroupName": { + "value": "PTracker-Common" + }, + "servicePrincipal": { + "value": "00000000-0000-0000-0000-000000000000" + }, + "skipComponentGovernanceDetection": { + "value": "true" + }, + "subscriptionId": { + "value": "00000000-0000-0000-0000-000000000000", + "allowOverride": true + }, + "system.debug": { + "value": "false", + "allowOverride": true + }, + "tenantId": { + "value": "00000000-0000-0000-0000-000000000000" + } + }, + "properties": {}, + "tags": [], + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=7" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/definition?definitionId=35" + }, + "editor": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/designer?id=35&_a=edit-build-definition" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" + } + }, + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "process": { + "phases": [ + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use .NET Core sdk 2.2.203", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "0.*", + "definitionType": "task" + }, + "inputs": { + "packageType": "sdk", + "version": "2.2.203" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Restore, Build & Test", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "test", + "publishWebProjects": "true", + "projects": "src/PeopleTracker.BerService.Tests/PeopleTracker.BerService.Tests.csproj", + "custom": "", + "arguments": "--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude=\"[xunit*]*\" /p:CoverletOutput=src/PeopleTracker.BerService.Tests/TestResults/Coverage/", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "publish", + "publishWebProjects": "false", + "projects": "src/PeopleTracker.BerService/*.csproj", + "custom": "", + "arguments": "-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory)", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "false", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "src/PeopleTracker.BerService" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish Artifact: ber", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(Build.ArtifactStagingDirectory)", + "ArtifactName": "ber", + "ArtifactType": "Container", + "TargetPath": "", + "Parallel": "false", + "ParallelCount": "8", + "FileCopyOptions": "" + } + } + ], + "name": "BER on Windows", + "refName": "Job_4", + "condition": "succeeded()", + "target": { + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + }, + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use .NET Core sdk 2.2.203", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "0.*", + "definitionType": "task" + }, + "inputs": { + "packageType": "sdk", + "version": "2.2.203" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Restore, Build & Test", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "test", + "publishWebProjects": "true", + "projects": "src/PeopleTracker.Web.Tests/PeopleTracker.Web.Tests.csproj", + "custom": "", + "arguments": "--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude=\"[xunit*]*\" /p:CoverletOutput=$(Build.SourcesDirectory)/src/PeopleTracker.Web.Tests/TestResults/Coverage/", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish code coverage", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "codeCoverageTool": "Cobertura", + "summaryFileLocation": "$(Build.SourcesDirectory)/src/PeopleTracker.Web.Tests/TestResults/Coverage/coverage.cobertura.xml", + "pathToSources": "", + "reportDirectory": "", + "additionalCodeCoverageFiles": "", + "failIfCoverageEmpty": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "publish", + "publishWebProjects": "false", + "projects": "src/PeopleTracker.Web/*.csproj", + "custom": "", + "arguments": "-c $(BuildConfiguration) -o $(Build.StagingDirectory)", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "false", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Copy infrastructure files", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "SourceFolder": "src/PeopleTracker.IaC", + "Contents": "**/deploy*\n**/ber.ps1\n**/updatedns.ps1\n**/appCenter.ps1\n**/rbac.yaml\n**/peopletracker/**", + "TargetFolder": "$(Build.ArtifactStagingDirectory)/IaC", + "CleanTargetFolder": "false", + "OverWrite": "false", + "flattenFolders": "false", + "preserveTimestamp": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish Artifact: iac", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(Build.ArtifactStagingDirectory)/IaC", + "ArtifactName": "iac", + "ArtifactType": "Container", + "TargetPath": "", + "Parallel": "false", + "ParallelCount": "8", + "FileCopyOptions": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Create ACR, Build & Push image", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "targetType": "filePath", + "filePath": "src/PeopleTracker.IaC/common.ps1", + "arguments": "-tag $(Build.BuildId) -baseName $(baseName) -resourceGroupName $(resourceGroupName) -location $(location) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -output $(output) -subscriptionid $(subscriptionid) -tenantId $(tenantId) -aquaRegUser $(aquaRegUser) -aquaRegPass $(aquaRegPass) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "src/PeopleTracker.Web" + } + } + ], + "name": "Docker on Linux", + "refName": "Job_1", + "condition": "succeeded()", + "target": { + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/86" + } + }, + "id": 86, + "url": "https://dev.azure.com/Test/_apis/build/Queues/86", + "pool": null + }, + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + }, + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use NuGet 4.7.x", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "versionSpec": "4.7.x", + "checkLatest": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "NuGet restore", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "restore", + "solution": "PeopleTracker.WebService.sln", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "disableParallelProcessing": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "allowPackageConflicts": "false", + "externalEndpoint": "", + "verbosityPush": "Detailed", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "versioningScheme": "off", + "includeReferencedProjects": "false", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "packTimezone": "utc", + "includeSymbols": "false", + "toolPackage": "false", + "buildProperties": "", + "basePath": "", + "verbosityPack": "Detailed", + "arguments": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build solution", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "PeopleTracker.WebService.sln", + "vsVersion": "latest", + "msbuildArgs": "/p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "msbuildArchitecture": "x86", + "logProjectEvents": "true", + "createLogFile": "false", + "logFileVerbosity": "normal" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "WhiteSource Bolt", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "19.*", + "definitionType": "task" + }, + "inputs": { + "cwd": "", + "advance": "false", + "exclude": "", + "extraFolders": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Run Unit Test", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\*Tests.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "TestCategory=Unit", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "", + "overrideTestrunParameters": "", + "pathtoCustomTestAdapters": "", + "runInParallel": "true", + "runTestsInIsolation": "False", + "codeCoverageEnabled": "false", + "otherConsoleOptions": "", + "distributionBatchType": "basedOnTestCases", + "batchingBasedOnAgentsOption": "autoBatchSize", + "customBatchSizeValue": "10", + "batchingBasedOnExecutionTimeOption": "autoBatchSize", + "customRunTimePerBatchValue": "60", + "dontDistribute": "False", + "testRunTitle": "Services", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "publishRunAttachments": "true", + "diagnosticsEnabled": "True", + "collectDumpOn": "onAbortOnly", + "rerunFailedTests": "False", + "rerunType": "basedOnTestFailurePercentage", + "rerunFailedThreshold": "30", + "rerunFailedTestCasesMaxLimit": "5", + "rerunMaxAttempts": "3" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Copy Files", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "SourceFolder": "src", + "Contents": "**\\PeopleTracker.NetService.zip\n**\\PeopleTracker.Database.dacpac\n**\\PeopleTracker.UITests\\bin\\$(BuildConfiguration)\\**", + "TargetFolder": "$(build.artifactstagingdirectory)", + "CleanTargetFolder": "true", + "OverWrite": "true", + "flattenFolders": "true", + "preserveTimestamp": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish Artifact: win", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(Build.ArtifactStagingDirectory)", + "ArtifactName": "win", + "ArtifactType": "Container", + "TargetPath": "", + "Parallel": "false", + "ParallelCount": "8", + "FileCopyOptions": "" + } + } + ], + "name": "Web on Windows", + "refName": "Job_2", + "condition": "succeeded()", + "target": { + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + } + ], + "type": 1 + }, + "repository": { + "properties": { + "cleanOptions": "3", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "defaultBranch": "refs/heads/master", + "clean": "true", + "checkoutSubmodules": false + }, + "processParameters": {}, + "quality": "definition", + "authoredBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/81" + } + }, + "id": 81, + "name": "Default", + "url": "https://dev.azure.com/Test/_apis/build/Queues/81", + "pool": { + "id": 1, + "name": "Default" + } + }, + "id": 35, + "name": "PTracker-CI-NoMobile", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=7", + "uri": "vstfs:///Build/Definition/35", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 7, + "createdDate": "2019-11-13T22:56:10.77Z", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + { + "options": [ + { + "enabled": true, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "workItemType": "Bug", + "assignToRequestor": "true", + "additionalFields": "{}" + } + } + ], + "variables": { + "BuildConfiguration": { + "value": "release", + "allowOverride": true + }, + "BuildPlatform": { + "value": "any cpu", + "allowOverride": true + }, + "system.debug": { + "value": "false", + "allowOverride": true + } + }, + "properties": {}, + "tags": [], + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/39?revision=1" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/definition?definitionId=39" + }, + "editor": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/designer?id=39&_a=edit-build-definition" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/39" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)", + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "process": { + "phases": [ + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Use NuGet 4.4.1", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "0.*", + "definitionType": "task" + }, + "inputs": { + "versionSpec": "4.4.1", + "checkLatest": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "NuGet restore", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "restore", + "solution": "$(Parameters.solution)", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "disableParallelProcessing": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "allowPackageConflicts": "false", + "externalEndpoint": "", + "verbosityPush": "Detailed", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "versioningScheme": "off", + "includeReferencedProjects": "false", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "packTimezone": "utc", + "includeSymbols": "false", + "toolPackage": "false", + "buildProperties": "", + "basePath": "", + "verbosityPack": "Detailed", + "arguments": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Build solution", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Parameters.solution)", + "vsVersion": "latest", + "msbuildArgs": "/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=\"$(build.artifactstagingdirectory)\\\\\"", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "msbuildArchitecture": "x86", + "logProjectEvents": "true", + "createLogFile": "false", + "logFileVerbosity": "normal" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "WhiteSource Bolt", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "19.*", + "definitionType": "task" + }, + "inputs": { + "cwd": "", + "advance": "false", + "exclude": "", + "extraFolders": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Test Assemblies", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\$(BuildConfiguration)\\*test*.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "testCategory=Unit", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "", + "overrideTestrunParameters": "", + "pathtoCustomTestAdapters": "", + "runInParallel": "False", + "runTestsInIsolation": "False", + "codeCoverageEnabled": "False", + "otherConsoleOptions": "", + "distributionBatchType": "basedOnTestCases", + "batchingBasedOnAgentsOption": "autoBatchSize", + "customBatchSizeValue": "10", + "batchingBasedOnExecutionTimeOption": "autoBatchSize", + "customRunTimePerBatchValue": "60", + "dontDistribute": "False", + "testRunTitle": "", + "platform": "$(BuildPlatform)", + "configuration": "$(BuildConfiguration)", + "publishRunAttachments": "true", + "diagnosticsEnabled": "false", + "collectDumpOn": "onAbortOnly", + "rerunFailedTests": "False", + "rerunType": "basedOnTestFailurePercentage", + "rerunFailedThreshold": "30", + "rerunFailedTestCasesMaxLimit": "5", + "rerunMaxAttempts": "3" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Publish symbols path", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "SymbolsFolder": "$(Build.SourcesDirectory)", + "SearchPattern": "**\\bin\\**\\*.pdb", + "IndexSources": "true", + "PublishSymbols": "false", + "SymbolServerType": "TeamServices", + "SymbolsPath": "", + "CompressSymbols": "false", + "DetailedLog": "true", + "TreatNotIndexedAsWarning": "false", + "SymbolsMaximumWaitTime": "", + "SymbolsProduct": "", + "SymbolsVersion": "", + "SymbolsArtifactName": "Symbols_$(BuildConfiguration)" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": true, + "displayName": "Publish Artifact", + "timeoutInMinutes": 0, + "condition": "succeededOrFailed()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(build.artifactstagingdirectory)", + "ArtifactName": "$(Parameters.ArtifactName)", + "ArtifactType": "Container", + "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)", + "Parallel": "false", + "ParallelCount": "8" + } + } + ], + "name": "Agent job 1", + "refName": "Job_1", + "condition": "succeeded()", + "target": { + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + } + ], + "type": 1 + }, + "repository": { + "properties": { + "cleanOptions": "0", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "Bakeoff", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/Bakeoff", + "defaultBranch": "refs/heads/master", + "clean": "false", + "checkoutSubmodules": false + }, + "processParameters": { + "inputs": [ + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "solution", + "label": "Path to solution or packages.config", + "defaultValue": "**\\*.sln", + "required": true, + "type": "filePath", + "helpMarkDown": "The path to the Visual Studio solution file or NuGet packages.config", + "visibleRule": "", + "groupName": "" + }, + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "ArtifactName", + "label": "Artifact Name", + "defaultValue": "drop", + "required": true, + "type": "string", + "helpMarkDown": "The name of the artifact to create.", + "visibleRule": "", + "groupName": "" + } + ] + }, + "quality": "definition", + "authoredBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/81" + } + }, + "id": 81, + "name": "Default", + "url": "https://dev.azure.com/Test/_apis/build/Queues/81", + "pool": { + "id": 1, + "name": "Default" + } + }, + "id": 39, + "name": "PeopleTracker-ASP.NET-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/39?revision=1", + "uri": "vstfs:///Build/Definition/39", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 1, + "createdDate": "2019-08-11T21:50:42.353Z", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + { + "options": [ + { + "enabled": true, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "workItemType": "Bug", + "assignToRequestor": "true", + "additionalFields": "{}" + } + } + ], + "variables": { + "administratorLoginPassword": { + "value": null, + "isSecret": true + }, + "BuildConfiguration": { + "value": "Release", + "allowOverride": true + }, + "BuildPlatform": { + "value": "any cpu", + "allowOverride": true + }, + "system.debug": { + "value": "false", + "allowOverride": true + } + }, + "properties": {}, + "tags": [], + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/40?revision=5" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/definition?definitionId=40" + }, + "editor": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/designer?id=40&_a=edit-build-definition" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/40" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)", + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "process": { + "phases": [ + { + "steps": [ + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Azure Deployment:Create Or Update Resource Group action on berblog", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "ConnectedServiceName": "00000000-0000-0000-0000-000000000000", + "action": "Create Or Update Resource Group", + "resourceGroupName": "berblog", + "location": "East US 2", + "templateLocation": "Linked artifact", + "csmFileLink": "", + "csmParametersFileLink": "", + "csmFile": "src/BerService.IaC/WebSiteSQLDatabase.json", + "csmParametersFile": "src/BerService.IaC/WebSiteSQLDatabase.parameters.json", + "overrideParameters": "-hostingPlanName berblog -skuName F1 -skuCapacity 1 -administratorLogin berblog -administratorLoginPassword $(administratorLoginPassword) -databaseName berblog -collation \"SQL_Latin1_General_CP1_CI_AS\" -edition \"Basic\" -maxSizeBytes \"1073741824\" -requestedServiceObjectiveName \"Basic\"", + "deploymentMode": "Incremental", + "enableDeploymentPrerequisites": "None", + "deploymentGroupEndpoint": "", + "project": "", + "deploymentGroupName": "", + "copyAzureVMTags": "true", + "runAgentServiceAsUser": "false", + "userName": "", + "password": "", + "outputVariable": "", + "deploymentName": "", + "deploymentOutputs": "", + "addSpnToEnvironment": "false" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Test", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "test", + "publishWebProjects": "true", + "projects": "$(Parameters.TestProjects)", + "custom": "", + "arguments": "--configuration $(BuildConfiguration)", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Publish", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "command": "publish", + "publishWebProjects": "True", + "projects": "$(Parameters.RestoreBuildProjects)", + "custom": "", + "arguments": "--configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "True", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Azure Web App Deploy: webSite3e3dz42ajqbea", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "azureSubscription": "00000000-0000-0000-0000-000000000000", + "appType": "webApp", + "appName": "webSite3e3dz42ajqbea", + "deployToSlotOrASE": "false", + "resourceGroupName": "", + "slotName": "production", + "package": "$(build.artifactstagingdirectory)/*.zip", + "runtimeStack": "", + "startUpCommand": "", + "customWebConfig": "", + "appSettings": "-Tokens__Key SECRET_THAT_SHOULD_BE_SET_IN_ENVIORNMENT_VAR -Tokens__Issuer http://ber.YOURDOMAIN.com -Tokens__Audience http://ber.YOURDOMAIN.com -Tokens__Web string -Tokens__Mobile string", + "configurationStrings": "", + "deploymentMethod": "auto" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": true, + "displayName": "Publish Artifact", + "timeoutInMinutes": 0, + "condition": "succeededOrFailed()", + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "PathtoPublish": "$(build.artifactstagingdirectory)", + "ArtifactName": "drop", + "ArtifactType": "Container", + "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)", + "Parallel": "false", + "ParallelCount": "8" + } + } + ], + "name": "Agent job 1", + "refName": "Job_1", + "condition": "succeeded()", + "target": { + "executionOptions": { + "type": 0 + }, + "allowScriptsAuthAccessOption": false, + "type": 1 + }, + "jobAuthorizationScope": "projectCollection" + } + ], + "target": { + "agentSpecification": { + "identifier": "ubuntu-16.04" + } + }, + "type": 1 + }, + "repository": { + "properties": { + "cleanOptions": "0", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "ber", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/ber", + "defaultBranch": "refs/heads/master", + "clean": "false", + "checkoutSubmodules": false + }, + "processParameters": { + "inputs": [ + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "RestoreBuildProjects", + "label": "Project(s) to restore and build", + "defaultValue": "src/BerService/BerService.csproj", + "type": "multiline", + "helpMarkDown": "Relative path of the .csproj file(s) from repo root. Wildcards can be used. For example, **/*.csproj for all .csproj files in all the subfolders.", + "visibleRule": "", + "groupName": "" + }, + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "TestProjects", + "label": "Project(s) to test", + "defaultValue": "src/BerService.Tests/BerService.Tests.csproj", + "type": "multiline", + "helpMarkDown": "Relative path of the .csproj file(s) from repo root. Wildcards can be used. For example, **/*.csproj for all .csproj files in all the subfolders.", + "visibleRule": "", + "groupName": "" + } + ] + }, + "quality": "definition", + "authoredBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/98" + } + }, + "id": 98, + "name": "Azure Pipelines", + "url": "https://dev.azure.com/Test/_apis/build/Queues/98", + "pool": { + "id": 14, + "name": "Azure Pipelines", + "isHosted": true + } + }, + "id": 40, + "name": "PeopleTracker-ASP.NET Core-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/40?revision=5", + "uri": "vstfs:///Build/Definition/40", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 5, + "createdDate": "2019-08-24T14:52:48.403Z", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + { + "options": [ + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": { + "workItemType": "Bug", + "assignToRequestor": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "inputs": {} + } + ], + "variables": { + "administratorLoginPassword": { + "value": null, + "isSecret": true + } + }, + "properties": {}, + "tags": [], + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/43?revision=4" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/definition?definitionId=43" + }, + "editor": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/designer?id=43&_a=edit-build-definition" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/43" + } + }, + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "process": { + "yamlFilename": "/azure-pipelines.yml", + "type": 2 + }, + "repository": { + "properties": { + "cloneUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/ber", + "fullName": "ber", + "defaultBranch": "refs/heads/master", + "isFork": "False", + "safeRepository": "00000000-0000-0000-0000-000000000000", + "reportBuildStatus": "true", + "cleanOptions": "0", + "fetchDepth": "0", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)" + }, + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "ber", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/ber", + "defaultBranch": "refs/heads/master", + "clean": null, + "checkoutSubmodules": false + }, + "quality": "definition", + "authoredBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/86" + } + }, + "id": 86, + "name": "Hosted Ubuntu 1604", + "url": "https://dev.azure.com/Test/_apis/build/Queues/86", + "pool": { + "id": 7, + "name": "Hosted Ubuntu 1604", + "isHosted": true + } + }, + "id": 43, + "name": "ber website", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/43?revision=4", + "uri": "vstfs:///Build/Definition/43", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 4, + "createdDate": "2019-08-31T20:51:20.63Z", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + { + "triggers": [ + { + "branchFilters": [], + "pathFilters": [], + "settingsSourceType": 2, + "batchChanges": false, + "maxConcurrentBuildsPerBranch": 1, + "triggerType": "continuousIntegration" + } + ], + "properties": {}, + "tags": [], + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/44?revision=2" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/definition?definitionId=44" + }, + "editor": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/designer?id=44&_a=edit-build-definition" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/44" + } + }, + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "process": { + "yamlFilename": "/azure-pipelines-function.yml", + "type": 2 + }, + "repository": { + "properties": { + "cloneUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/ber", + "fullName": "ber", + "defaultBranch": "refs/heads/master", + "isFork": "False", + "safeRepository": "00000000-0000-0000-0000-000000000000", + "reportBuildStatus": "true" + }, + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "ber", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/ber", + "defaultBranch": "refs/heads/master", + "clean": null, + "checkoutSubmodules": false + }, + "quality": "definition", + "authoredBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/86" + } + }, + "id": 86, + "name": "Hosted Ubuntu 1604", + "url": "https://dev.azure.com/Test/_apis/build/Queues/86", + "pool": { + "id": 7, + "name": "Hosted Ubuntu 1604", + "isHosted": true + } + }, + "id": 44, + "name": "ber function", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/44?revision=2", + "uri": "vstfs:///Build/Definition/44", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 2, + "createdDate": "2019-08-31T20:26:59.413Z", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + { + "triggers": [ + { + "branchFilters": [], + "pathFilters": [], + "settingsSourceType": 2, + "batchChanges": false, + "maxConcurrentBuildsPerBranch": 1, + "triggerType": "continuousIntegration" + } + ], + "variables": { + "EMAIL": { + "value": "dlbm3@hotmail.com" + }, + "PKG_PAT": { + "value": null, + "isSecret": true + }, + "REPO_URL": { + "value": "https://pkgs.dev.azure.com/Test/_packaging/ber/nuget/v2" + } + }, + "properties": {}, + "tags": [], + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/45?revision=5" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/definition?definitionId=45" + }, + "editor": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/designer?id=45&_a=edit-build-definition" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/45" + } + }, + "comment": "Update variables", + "jobAuthorizationScope": "projectCollection", + "jobTimeoutInMinutes": 60, + "jobCancelTimeoutInMinutes": 5, + "process": { + "yamlFilename": "/src/BerService.Pwsh/azure-pipelines.yml", + "type": 2 + }, + "repository": { + "properties": { + "cloneUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/ber", + "fullName": "ber", + "defaultBranch": "refs/heads/master", + "isFork": "False", + "safeRepository": "00000000-0000-0000-0000-000000000000", + "reportBuildStatus": "true" + }, + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "ber", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/ber", + "defaultBranch": "refs/heads/master", + "clean": null, + "checkoutSubmodules": false + }, + "quality": "definition", + "authoredBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/86" + } + }, + "id": 86, + "name": "Hosted Ubuntu 1604", + "url": "https://dev.azure.com/Test/_apis/build/Queues/86", + "pool": { + "id": 7, + "name": "Hosted Ubuntu 1604", + "isHosted": true + } + }, + "id": 45, + "name": "PowerShell", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/45?revision=5", + "uri": "vstfs:///Build/Definition/45", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 5, + "createdDate": "2019-09-15T22:45:32.647Z", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + { + "triggers": [ + { + "branchFilters": [], + "pathFilters": [], + "settingsSourceType": 2, + "batchChanges": false, + "maxConcurrentBuildsPerBranch": 1, + "triggerType": "continuousIntegration" + } + ], + "variables": { + "system.debug": { + "value": "false", + "allowOverride": true + } + }, + "properties": {}, + "tags": [ + "Testing", + "VSTeamSample" + ], + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/46?revision=1" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/definition?definitionId=46" + }, + "editor": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/designer?id=46&_a=edit-build-definition" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/46" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)", + "jobAuthorizationScope": "projectCollection", + "process": { + "yamlFilename": "/azure-pipelines.yml", + "type": 2 + }, + "repository": { + "properties": { + "reportBuildStatus": "true" + }, + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "Vars", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/Vars", + "defaultBranch": "refs/heads/master", + "clean": null, + "checkoutSubmodules": false + }, + "quality": "definition", + "authoredBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "drafts": [], + "queue": { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/build/Queues/86" + } + }, + "id": 86, + "name": "Hosted Ubuntu 1604", + "url": "https://dev.azure.com/Test/_apis/build/Queues/86", + "pool": { + "id": 7, + "name": "Hosted Ubuntu 1604", + "isHosted": true + } + }, + "id": 46, + "name": "Vars CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/46?revision=1", + "uri": "vstfs:///Build/Definition/46", + "path": "\\Vars", + "type": "build", + "queueStatus": "enabled", + "revision": 1, + "createdDate": "2019-09-25T20:55:54.983Z", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeam.json b/Tests/SampleFiles/Get-VSTeam.json new file mode 100644 index 000000000..949ad67b6 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeam.json @@ -0,0 +1,14 @@ +{ + "value": [ + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Test Team", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000/teams/00000000-0000-0000-0000-000000000000", + "description": "The default project team.", + "identityUrl": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "projectName": "Test", + "projectId": "00000000-0000-0000-0000-000000000000" + } + ], + "count": 1 +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamAccessControlList.json b/Tests/SampleFiles/Get-VSTeamAccessControlList.json new file mode 100644 index 000000000..b984915da --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamAccessControlList.json @@ -0,0 +1,35 @@ +{ + "count": 2, + "value": [ + { + "inheritPermissions": true, + "token": "$/00000000-0000-0000-0000-000000000001", + "acesDictionary": { + "Microsoft.TeamFoundation.Identity;S-00000000-0000-0000-0000-000000000000-00000000-0000-0000-0000-000000000000-0-3": { + "descriptor": "Microsoft.TeamFoundation.Identity;S-00000000-0000-0000-0000-000000000000-00000000-0000-0000-0000-000000000000-0-3", + "allow": 1, + "deny": 0, + "extendedInfo": { + "effectiveAllow": 1 + } + } + }, + "includeExtendedInfo": true + }, + { + "inheritPermissions": true, + "token": "$/00000000-0000-0000-0000-000000000002", + "acesDictionary": { + "Microsoft.TeamFoundation.Identity;S-00000000-0000-0000-0000-000000000000-00000000-0000-0000-0000-000000000000-0-3": { + "descriptor": "Microsoft.TeamFoundation.Identity;S-00000000-0000-0000-0000-000000000000-00000000-0000-0000-0000-000000000000-0-3", + "allow": 1, + "deny": 0, + "extendedInfo": { + "effectiveAllow": 1 + } + } + }, + "includeExtendedInfo": true + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamAgent-PoolId1.json b/Tests/SampleFiles/Get-VSTeamAgent-PoolId1.json new file mode 100644 index 000000000..040e79e62 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamAgent-PoolId1.json @@ -0,0 +1,537 @@ +{ + "count": 4, + "value": [ + { + "systemCapabilities": { + "Agent.Name": "WinBldBox-3_Service2", + "Agent.Version": "2.155.1", + "Agent.ComputerName": "WINBLDBOX-3", + "Agent.HomeDirectory": "F:\\agents\\WinBldBox-3_BlackShirt_Service2", + "Agent.OS": "Windows_NT", + "Agent.OSArchitecture": "X64", + "Agent.OSVersion": "6.3.9600", + "ALLUSERSPROFILE": "C:\\ProgramData", + "AndroidSDK": "C:\\Program Files (x86)\\Android\\android-sdk", + "AndroidSDK_19": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-19", + "AndroidSDK_21": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-21", + "AndroidSDK_22": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-22", + "AndroidSDK_23": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-23", + "APPDATA": "C:\\Users\\test\\AppData\\Roaming", + "AzureGuestAgent": "C:\\WindowsAzure\\GuestAgent_2.7.41491.982_2020-07-11_191057\\GuestAgent\\WindowsAzureGuestAgent.exe", + "AzurePS": "5.7.0", + "bower": "C:\\Users\\test\\AppData\\Roaming\\npm\\bower.cmd", + "Cmd": "C:\\Windows\\system32\\cmd.exe", + "CommonProgramFiles": "C:\\Program Files\\Common Files", + "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files", + "CommonProgramW6432": "C:\\Program Files\\Common Files", + "COMPUTERNAME": "WINBLDBOX-3", + "ComSpec": "C:\\Windows\\system32\\cmd.exe", + "docker": "C:\\Program Files\\Docker Toolbox\\docker.exe", + "DOCKER_TOOLBOX_INSTALL_PATH": "C:\\Program Files\\Docker Toolbox", + "DotNetFramework": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319", + "DotNetFramework_2.0": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727", + "DotNetFramework_2.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727", + "DotNetFramework_3.0": "C:\\Windows\\Microsoft.NET\\Framework\\v3.0", + "DotNetFramework_3.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.0", + "DotNetFramework_3.5": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5", + "DotNetFramework_3.5_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.5", + "DotNetFramework_4.7.0": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319", + "DotNetFramework_4.7.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319", + "ES_HEAP_SIZE": "2400m", + "FP_NO_HOST_CHECK": "NO", + "InteractiveSession": "False", + "java": "C:\\Program Files\\Java\\jre1.8.0_221", + "java_8": "C:\\Program Files (x86)\\Java\\jre1.8.0_221", + "java_8_x64": "C:\\Program Files\\Java\\jre1.8.0_221", + "JAVA_HOME": "C:\\java\\jdk", + "jdk": "C:\\java\\jdk", + "jdk_7": "C:\\Program Files (x86)\\Java\\jdk1.7.0_55", + "jdk_8_x64": "C:\\java\\jdk", + "LOCALAPPDATA": "C:\\Users\\test\\AppData\\Local", + "M2": "%M2_HOME%\\bin", + "M2_HOME": "C:\\java\\maven", + "maven": "C:\\java\\maven", + "MAVEN_HOME": "C:\\java\\maven", + "MSBuild": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\", + "MSBuild_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\", + "MSBuild_15.0_x64": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\amd64\\", + "MSBuild_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\", + "MSBuild_16.0_x64": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", + "MSBuild_2.0": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\", + "MSBuild_2.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\", + "MSBuild_3.5": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5\\", + "MSBuild_3.5_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.5\\", + "MSBuild_4.0": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\", + "MSBuild_4.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\", + "MSBuild_x64": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", + "node.js": "C:\\Program Files\\nodejs\\node.exe", + "npm": "C:\\Users\\test\\AppData\\Roaming\\npm\\npm.cmd", + "NUMBER_OF_PROCESSORS": "4", + "OneDrive": "C:\\Users\\test\\OneDrive", + "OneDriveConsumer": "C:\\Users\\test\\OneDrive", + "OS": "Windows_NT", + "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC", + "PowerShell": "5.1.14409.1018", + "PROCESSOR_ARCHITECTURE": "AMD64", + "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 85 Stepping 7, GenuineIntel", + "PROCESSOR_LEVEL": "6", + "PROCESSOR_REVISION": "5507", + "ProgramData": "C:\\ProgramData", + "ProgramFiles": "C:\\Program Files", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "ProgramW6432": "C:\\Program Files", + "PSModulePath": "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\;C:\\Program Files\\Microsoft Monitoring Agent\\Agent\\PowerShell\\;C:\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\PowerShell\\Modules\\", + "PUBLIC": "C:\\Users\\Public", + "SEARCH_ES_INDEX_PATH": "C:\\TfsData\\Search\\IndexStore", + "SqlPackage": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\Microsoft\\SQLDB\\DAC\\130\\SqlPackage.exe", + "SystemDrive": "C:", + "SystemRoot": "C:\\Windows", + "TEMP": "C:\\Users\\test\\AppData\\Local\\Temp", + "TMP": "C:\\Users\\test\\AppData\\Local\\Temp", + "USERDOMAIN": "WINBLDBOX-3", + "USERNAME": "test", + "USERPROFILE": "C:\\Users\\test", + "VisualStudio": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\", + "VisualStudio_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\", + "VisualStudio_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\", + "VisualStudio_IDE": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\", + "VisualStudio_IDE_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\", + "VisualStudio_IDE_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\", + "VS110COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\", + "VS120COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\", + "VS140COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\", + "VSTest": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "VSTest_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "VSTest_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "windir": "C:\\Windows", + "WIX": "C:\\Program Files (x86)\\WiX Toolset v3.11\\", + "Xamarin.Android": "6.1.1.1" + }, + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/_apis/distributedtask/pools/1/agents/111" + }, + "web": { + "href": "https://dev.azure.com/BlackShirt/_admin/_AgentPool#_a=agents&poolId=1&agentId=111" + } + }, + "maxParallelism": 1, + "createdOn": "2019-03-24T16:54:02.217Z", + "statusChangedOn": "2020-08-10T18:02:59.31Z", + "authorization": { + "clientId": "00000000-0000-0000-0000-000000000000", + "publicKey": { + "exponent": "AQAB", + "modulus": "redacted" + } + }, + "id": 111, + "name": "WinBldBox-3_Service2", + "version": "2.155.1", + "osDescription": "Microsoft Windows 6.3.9600 ", + "enabled": true, + "status": "offline", + "provisioningState": "Provisioned", + "accessPoint": "CodexAccessMapping" + }, + { + "systemCapabilities": { + "Agent.Name": "WinBldBox-3_Service3", + "Agent.Version": "2.155.1", + "Agent.ComputerName": "WINBLDBOX-3", + "Agent.HomeDirectory": "F:\\agents\\WinBldBox-3_BlackShirt_Service3", + "Agent.OS": "Windows_NT", + "Agent.OSArchitecture": "X64", + "Agent.OSVersion": "6.3.9600", + "ALLUSERSPROFILE": "C:\\ProgramData", + "AndroidSDK": "C:\\Program Files (x86)\\Android\\android-sdk", + "AndroidSDK_19": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-19", + "AndroidSDK_21": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-21", + "AndroidSDK_22": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-22", + "AndroidSDK_23": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-23", + "APPDATA": "C:\\Users\\test\\AppData\\Roaming", + "AzureGuestAgent": "C:\\WindowsAzure\\GuestAgent_2.7.41491.982_2020-07-11_191057\\GuestAgent\\WindowsAzureGuestAgent.exe", + "AzurePS": "5.7.0", + "bower": "C:\\Users\\test\\AppData\\Roaming\\npm\\bower.cmd", + "Cmd": "C:\\Windows\\system32\\cmd.exe", + "CommonProgramFiles": "C:\\Program Files\\Common Files", + "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files", + "CommonProgramW6432": "C:\\Program Files\\Common Files", + "COMPUTERNAME": "WINBLDBOX-3", + "ComSpec": "C:\\Windows\\system32\\cmd.exe", + "docker": "C:\\Program Files\\Docker Toolbox\\docker.exe", + "DOCKER_TOOLBOX_INSTALL_PATH": "C:\\Program Files\\Docker Toolbox", + "DotNetFramework": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319", + "DotNetFramework_2.0": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727", + "DotNetFramework_2.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727", + "DotNetFramework_3.0": "C:\\Windows\\Microsoft.NET\\Framework\\v3.0", + "DotNetFramework_3.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.0", + "DotNetFramework_3.5": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5", + "DotNetFramework_3.5_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.5", + "DotNetFramework_4.7.0": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319", + "DotNetFramework_4.7.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319", + "ES_HEAP_SIZE": "2400m", + "FP_NO_HOST_CHECK": "NO", + "InteractiveSession": "False", + "java": "C:\\Program Files\\Java\\jre1.8.0_221", + "java_8": "C:\\Program Files (x86)\\Java\\jre1.8.0_221", + "java_8_x64": "C:\\Program Files\\Java\\jre1.8.0_221", + "JAVA_HOME": "C:\\java\\jdk", + "jdk": "C:\\java\\jdk", + "jdk_7": "C:\\Program Files (x86)\\Java\\jdk1.7.0_55", + "jdk_8_x64": "C:\\java\\jdk", + "LOCALAPPDATA": "C:\\Users\\test\\AppData\\Local", + "M2": "%M2_HOME%\\bin", + "M2_HOME": "C:\\java\\maven", + "maven": "C:\\java\\maven", + "MAVEN_HOME": "C:\\java\\maven", + "MSBuild": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\", + "MSBuild_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\", + "MSBuild_15.0_x64": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\amd64\\", + "MSBuild_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\", + "MSBuild_16.0_x64": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", + "MSBuild_2.0": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\", + "MSBuild_2.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\", + "MSBuild_3.5": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5\\", + "MSBuild_3.5_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.5\\", + "MSBuild_4.0": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\", + "MSBuild_4.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\", + "MSBuild_x64": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", + "node.js": "C:\\Program Files\\nodejs\\node.exe", + "npm": "C:\\Users\\test\\AppData\\Roaming\\npm\\npm.cmd", + "NUMBER_OF_PROCESSORS": "4", + "OneDrive": "C:\\Users\\test\\OneDrive", + "OneDriveConsumer": "C:\\Users\\test\\OneDrive", + "OS": "Windows_NT", + "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC", + "PowerShell": "5.1.14409.1018", + "PROCESSOR_ARCHITECTURE": "AMD64", + "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 85 Stepping 7, GenuineIntel", + "PROCESSOR_LEVEL": "6", + "PROCESSOR_REVISION": "5507", + "ProgramData": "C:\\ProgramData", + "ProgramFiles": "C:\\Program Files", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "ProgramW6432": "C:\\Program Files", + "PSModulePath": "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\;C:\\Program Files\\Microsoft Monitoring Agent\\Agent\\PowerShell\\;C:\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\PowerShell\\Modules\\", + "PUBLIC": "C:\\Users\\Public", + "SEARCH_ES_INDEX_PATH": "C:\\TfsData\\Search\\IndexStore", + "SqlPackage": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\Microsoft\\SQLDB\\DAC\\130\\SqlPackage.exe", + "SystemDrive": "C:", + "SystemRoot": "C:\\Windows", + "TEMP": "C:\\Users\\test\\AppData\\Local\\Temp", + "TMP": "C:\\Users\\test\\AppData\\Local\\Temp", + "USERDOMAIN": "WINBLDBOX-3", + "USERNAME": "test", + "USERPROFILE": "C:\\Users\\test", + "VisualStudio": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\", + "VisualStudio_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\", + "VisualStudio_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\", + "VisualStudio_IDE": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\", + "VisualStudio_IDE_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\", + "VisualStudio_IDE_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\", + "VS110COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\", + "VS120COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\", + "VS140COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\", + "VSTest": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "VSTest_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "VSTest_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "windir": "C:\\Windows", + "WIX": "C:\\Program Files (x86)\\WiX Toolset v3.11\\", + "Xamarin.Android": "6.1.1.1" + }, + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/_apis/distributedtask/pools/1/agents/112" + }, + "web": { + "href": "https://dev.azure.com/BlackShirt/_admin/_AgentPool#_a=agents&poolId=1&agentId=112" + } + }, + "maxParallelism": 1, + "createdOn": "2019-03-24T16:55:24.647Z", + "statusChangedOn": "2020-08-10T18:03:01.207Z", + "authorization": { + "clientId": "00000000-0000-0000-0000-000000000000", + "publicKey": { + "exponent": "AQAB", + "modulus": "redacted" + } + }, + "id": 112, + "name": "WinBldBox-3_Service3", + "version": "2.155.1", + "osDescription": "Microsoft Windows 6.3.9600 ", + "enabled": true, + "status": "offline", + "provisioningState": "Provisioned", + "accessPoint": "CodexAccessMapping" + }, + { + "systemCapabilities": { + "Agent.Name": "WinBldBox-3_Service1", + "Agent.Version": "2.155.1", + "Agent.ComputerName": "WINBLDBOX-3", + "Agent.HomeDirectory": "F:\\agents\\WinBldBox-3_BlackShirt_Service1", + "Agent.OS": "Windows_NT", + "Agent.OSArchitecture": "X64", + "Agent.OSVersion": "6.3.9600", + "ALLUSERSPROFILE": "C:\\ProgramData", + "AndroidSDK": "C:\\Program Files (x86)\\Android\\android-sdk", + "AndroidSDK_19": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-19", + "AndroidSDK_21": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-21", + "AndroidSDK_22": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-22", + "AndroidSDK_23": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-23", + "APPDATA": "C:\\Users\\test\\AppData\\Roaming", + "AzureGuestAgent": "C:\\WindowsAzure\\GuestAgent_2.7.41491.982_2020-07-11_191057\\GuestAgent\\WindowsAzureGuestAgent.exe", + "AzurePS": "5.7.0", + "bower": "C:\\Users\\test\\AppData\\Roaming\\npm\\bower.cmd", + "Cmd": "C:\\Windows\\system32\\cmd.exe", + "CommonProgramFiles": "C:\\Program Files\\Common Files", + "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files", + "CommonProgramW6432": "C:\\Program Files\\Common Files", + "COMPUTERNAME": "WINBLDBOX-3", + "ComSpec": "C:\\Windows\\system32\\cmd.exe", + "docker": "C:\\Program Files\\Docker Toolbox\\docker.exe", + "DOCKER_TOOLBOX_INSTALL_PATH": "C:\\Program Files\\Docker Toolbox", + "DotNetFramework": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319", + "DotNetFramework_2.0": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727", + "DotNetFramework_2.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727", + "DotNetFramework_3.0": "C:\\Windows\\Microsoft.NET\\Framework\\v3.0", + "DotNetFramework_3.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.0", + "DotNetFramework_3.5": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5", + "DotNetFramework_3.5_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.5", + "DotNetFramework_4.7.0": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319", + "DotNetFramework_4.7.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319", + "ES_HEAP_SIZE": "2400m", + "FP_NO_HOST_CHECK": "NO", + "InteractiveSession": "False", + "java": "C:\\Program Files\\Java\\jre1.8.0_221", + "java_8": "C:\\Program Files (x86)\\Java\\jre1.8.0_221", + "java_8_x64": "C:\\Program Files\\Java\\jre1.8.0_221", + "JAVA_HOME": "C:\\java\\jdk", + "jdk": "C:\\java\\jdk", + "jdk_7": "C:\\Program Files (x86)\\Java\\jdk1.7.0_55", + "jdk_8_x64": "C:\\java\\jdk", + "LOCALAPPDATA": "C:\\Users\\test\\AppData\\Local", + "M2": "%M2_HOME%\\bin", + "M2_HOME": "C:\\java\\maven", + "maven": "C:\\java\\maven", + "MAVEN_HOME": "C:\\java\\maven", + "MSBuild": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\", + "MSBuild_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\", + "MSBuild_15.0_x64": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\amd64\\", + "MSBuild_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\", + "MSBuild_16.0_x64": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", + "MSBuild_2.0": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\", + "MSBuild_2.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\", + "MSBuild_3.5": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5\\", + "MSBuild_3.5_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.5\\", + "MSBuild_4.0": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\", + "MSBuild_4.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\", + "MSBuild_x64": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", + "node.js": "C:\\Program Files\\nodejs\\node.exe", + "npm": "C:\\Users\\test\\AppData\\Roaming\\npm\\npm.cmd", + "NUMBER_OF_PROCESSORS": "4", + "OneDrive": "C:\\Users\\test\\OneDrive", + "OneDriveConsumer": "C:\\Users\\test\\OneDrive", + "OS": "Windows_NT", + "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC", + "PowerShell": "5.1.14409.1018", + "PROCESSOR_ARCHITECTURE": "AMD64", + "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 85 Stepping 7, GenuineIntel", + "PROCESSOR_LEVEL": "6", + "PROCESSOR_REVISION": "5507", + "ProgramData": "C:\\ProgramData", + "ProgramFiles": "C:\\Program Files", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "ProgramW6432": "C:\\Program Files", + "PSModulePath": "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\;C:\\Program Files\\Microsoft Monitoring Agent\\Agent\\PowerShell\\;C:\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\PowerShell\\Modules\\", + "PUBLIC": "C:\\Users\\Public", + "SEARCH_ES_INDEX_PATH": "C:\\TfsData\\Search\\IndexStore", + "SqlPackage": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\Microsoft\\SQLDB\\DAC\\130\\SqlPackage.exe", + "SystemDrive": "C:", + "SystemRoot": "C:\\Windows", + "TEMP": "C:\\Users\\test\\AppData\\Local\\Temp", + "TMP": "C:\\Users\\test\\AppData\\Local\\Temp", + "USERDOMAIN": "WINBLDBOX-3", + "USERNAME": "test", + "USERPROFILE": "C:\\Users\\test", + "VisualStudio": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\", + "VisualStudio_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\", + "VisualStudio_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\", + "VisualStudio_IDE": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\", + "VisualStudio_IDE_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\", + "VisualStudio_IDE_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\", + "VS110COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\", + "VS120COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\", + "VS140COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\", + "VSTest": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "VSTest_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "VSTest_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "windir": "C:\\Windows", + "WIX": "C:\\Program Files (x86)\\WiX Toolset v3.11\\", + "Xamarin.Android": "6.1.1.1" + }, + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/_apis/distributedtask/pools/1/agents/113" + }, + "web": { + "href": "https://dev.azure.com/BlackShirt/_admin/_AgentPool#_a=agents&poolId=1&agentId=113" + } + }, + "maxParallelism": 1, + "createdOn": "2019-03-24T16:58:01.863Z", + "statusChangedOn": "2020-08-10T18:02:59.32Z", + "authorization": { + "clientId": "00000000-0000-0000-0000-000000000000", + "publicKey": { + "exponent": "AQAB", + "modulus": "redacted" + } + }, + "id": 113, + "name": "WinBldBox-3_Service1", + "version": "2.155.1", + "osDescription": "Microsoft Windows 6.3.9600 ", + "enabled": true, + "status": "offline", + "provisioningState": "Provisioned", + "accessPoint": "CodexAccessMapping" + }, + { + "systemCapabilities": { + "Agent.Name": "WinBldBox-3_Service4", + "Agent.Version": "2.155.1", + "Agent.ComputerName": "WINBLDBOX-3", + "Agent.HomeDirectory": "F:\\agents\\WinBldBox-3_BlackShirt_Service4", + "Agent.OS": "Windows_NT", + "Agent.OSArchitecture": "X64", + "Agent.OSVersion": "6.3.9600", + "ALLUSERSPROFILE": "C:\\ProgramData", + "AndroidSDK": "C:\\Program Files (x86)\\Android\\android-sdk", + "AndroidSDK_19": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-19", + "AndroidSDK_21": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-21", + "AndroidSDK_22": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-22", + "AndroidSDK_23": "C:\\Program Files (x86)\\Android\\android-sdk\\platforms\\android-23", + "APPDATA": "C:\\Users\\test\\AppData\\Roaming", + "AzureGuestAgent": "C:\\WindowsAzure\\GuestAgent_2.7.41491.982_2020-07-11_191057\\GuestAgent\\WindowsAzureGuestAgent.exe", + "AzurePS": "5.7.0", + "bower": "C:\\Users\\test\\AppData\\Roaming\\npm\\bower.cmd", + "Cmd": "C:\\Windows\\system32\\cmd.exe", + "CommonProgramFiles": "C:\\Program Files\\Common Files", + "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files", + "CommonProgramW6432": "C:\\Program Files\\Common Files", + "COMPUTERNAME": "WINBLDBOX-3", + "ComSpec": "C:\\Windows\\system32\\cmd.exe", + "docker": "C:\\Program Files\\Docker Toolbox\\docker.exe", + "DOCKER_TOOLBOX_INSTALL_PATH": "C:\\Program Files\\Docker Toolbox", + "DotNetFramework": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319", + "DotNetFramework_2.0": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727", + "DotNetFramework_2.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727", + "DotNetFramework_3.0": "C:\\Windows\\Microsoft.NET\\Framework\\v3.0", + "DotNetFramework_3.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.0", + "DotNetFramework_3.5": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5", + "DotNetFramework_3.5_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.5", + "DotNetFramework_4.7.0": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319", + "DotNetFramework_4.7.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319", + "ES_HEAP_SIZE": "2400m", + "FP_NO_HOST_CHECK": "NO", + "InteractiveSession": "False", + "java": "C:\\Program Files\\Java\\jre1.8.0_221", + "java_8": "C:\\Program Files (x86)\\Java\\jre1.8.0_221", + "java_8_x64": "C:\\Program Files\\Java\\jre1.8.0_221", + "JAVA_HOME": "C:\\java\\jdk", + "jdk": "C:\\java\\jdk", + "jdk_7": "C:\\Program Files (x86)\\Java\\jdk1.7.0_55", + "jdk_8_x64": "C:\\java\\jdk", + "LOCALAPPDATA": "C:\\Users\\test\\AppData\\Local", + "M2": "%M2_HOME%\\bin", + "M2_HOME": "C:\\java\\maven", + "maven": "C:\\java\\maven", + "MAVEN_HOME": "C:\\java\\maven", + "MSBuild": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\", + "MSBuild_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\", + "MSBuild_15.0_x64": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin\\amd64\\", + "MSBuild_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\", + "MSBuild_16.0_x64": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", + "MSBuild_2.0": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\", + "MSBuild_2.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\", + "MSBuild_3.5": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5\\", + "MSBuild_3.5_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v3.5\\", + "MSBuild_4.0": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\", + "MSBuild_4.0_x64": "C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\", + "MSBuild_x64": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\", + "node.js": "C:\\Program Files\\nodejs\\node.exe", + "npm": "C:\\Users\\test\\AppData\\Roaming\\npm\\npm.cmd", + "NUMBER_OF_PROCESSORS": "4", + "OneDrive": "C:\\Users\\test\\OneDrive", + "OneDriveConsumer": "C:\\Users\\test\\OneDrive", + "OS": "Windows_NT", + "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC", + "PowerShell": "5.1.14409.1018", + "PROCESSOR_ARCHITECTURE": "AMD64", + "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 85 Stepping 7, GenuineIntel", + "PROCESSOR_LEVEL": "6", + "PROCESSOR_REVISION": "5507", + "ProgramData": "C:\\ProgramData", + "ProgramFiles": "C:\\Program Files", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "ProgramW6432": "C:\\Program Files", + "PSModulePath": "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\;C:\\Program Files\\Microsoft Monitoring Agent\\Agent\\PowerShell\\;C:\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\PowerShell\\Modules\\", + "PUBLIC": "C:\\Users\\Public", + "SEARCH_ES_INDEX_PATH": "C:\\TfsData\\Search\\IndexStore", + "SqlPackage": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\Extensions\\Microsoft\\SQLDB\\DAC\\130\\SqlPackage.exe", + "SystemDrive": "C:", + "SystemRoot": "C:\\Windows", + "TEMP": "C:\\Users\\test\\AppData\\Local\\Temp", + "TMP": "C:\\Users\\test\\AppData\\Local\\Temp", + "USERDOMAIN": "WINBLDBOX-3", + "USERNAME": "test", + "USERPROFILE": "C:\\Users\\test", + "VisualStudio": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\", + "VisualStudio_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\", + "VisualStudio_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\", + "VisualStudio_IDE": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\", + "VisualStudio_IDE_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\", + "VisualStudio_IDE_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\", + "VS110COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\", + "VS120COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\", + "VS140COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\", + "VSTest": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "VSTest_15.0": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "VSTest_16.0": "F:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow", + "windir": "C:\\Windows", + "WIX": "C:\\Program Files (x86)\\WiX Toolset v3.11\\", + "Xamarin.Android": "6.1.1.1" + }, + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/_apis/distributedtask/pools/1/agents/130" + }, + "web": { + "href": "https://dev.azure.com/BlackShirt/_admin/_AgentPool#_a=agents&poolId=1&agentId=130" + } + }, + "maxParallelism": 1, + "createdOn": "2019-04-01T12:09:27.88Z", + "statusChangedOn": "2020-08-10T18:03:01.217Z", + "authorization": { + "clientId": "00000000-0000-0000-0000-000000000000", + "publicKey": { + "exponent": "AQAB", + "modulus": "redacted" + } + }, + "id": 130, + "name": "WinBldBox-3_Service4", + "version": "2.155.1", + "osDescription": "Microsoft Windows 6.3.9600 ", + "enabled": true, + "status": "offline", + "provisioningState": "Provisioned", + "accessPoint": "CodexAccessMapping" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamApproval.json b/Tests/SampleFiles/Get-VSTeamApproval.json new file mode 100644 index 000000000..e44ef23ce --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamApproval.json @@ -0,0 +1,101 @@ +{ + "count": 2, + "value": [ + { + "id": 5171, + "revision": 1, + "approver": { + "displayName": "Test User", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "approvalType": "preDeploy", + "createdOn": "2020-09-07T17:28:27.34Z", + "modifiedOn": "2020-09-07T17:28:27.34Z", + "status": "pending", + "comments": "", + "isAutomated": false, + "isNotificationOn": true, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 260, + "name": "Release-18", + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/260", + "_links": {} + }, + "releaseDefinition": { + "id": 7, + "name": "PTracker-CD - NoMobile", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/7", + "_links": {} + }, + "releaseEnvironment": { + "id": 3620, + "name": "Dev Common Infra", + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/260/environments/3620", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/5171" + }, + { + "id": 5170, + "revision": 1, + "approver": { + "displayName": "Test User", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "approvalType": "preDeploy", + "createdOn": "2020-09-07T17:28:27.303Z", + "modifiedOn": "2020-09-07T17:28:27.303Z", + "status": "pending", + "comments": "", + "isAutomated": false, + "isNotificationOn": true, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 260, + "name": "Release-18", + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/260", + "_links": {} + }, + "releaseDefinition": { + "id": 7, + "name": "PTracker-CD - NoMobile", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/7", + "_links": {} + }, + "releaseEnvironment": { + "id": 3621, + "name": "Dev Infra", + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/260/environments/3621", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/5170" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamBuild.json b/Tests/SampleFiles/Get-VSTeamBuild.json new file mode 100644 index 000000000..e30866edc --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamBuild.json @@ -0,0 +1,697 @@ +{ + "count": 5, + "value": [ + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=568" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [ + "Testing", + "Test123", + "Test245" + ], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 568, + "buildNumber": "568", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-11-14T00:49:33.4869922Z", + "startTime": "2019-11-14T00:49:37.916511Z", + "finishTime": "2019-11-14T00:56:02.1824107Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/568", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-11-14T00:56:14.133Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": true, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/567" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=567" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 567, + "buildNumber": "567", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-11-13T22:57:31.1366485Z", + "startTime": "2019-11-13T22:57:35.3378265Z", + "finishTime": "2019-11-13T23:01:48.4753281Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/567", + "definition": { + "drafts": [], + "id": 35, + "name": "PTracker-CI-NoMobile", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=7", + "uri": "vstfs:///Build/Definition/35", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 7, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/567", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-11-13T23:02:00.413Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": true, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/561" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=561" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 561, + "buildNumber": "561", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-24T09:47:50.3503432Z", + "startTime": "2019-09-24T09:47:55.8261537Z", + "finishTime": "2019-09-24T09:54:09.609426Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/561", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/561", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-09-24T09:54:22.31Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/560" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=560" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 560, + "buildNumber": "560", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-16T14:07:31.5444889Z", + "startTime": "2019-09-16T14:07:36.8564926Z", + "finishTime": "2019-09-16T14:13:54.1086977Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/560", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/560", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-09-16T14:14:07.007Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/559" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=559" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 559, + "buildNumber": "559", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-16T13:34:59.7905462Z", + "startTime": "2019-09-16T13:35:06.5445281Z", + "finishTime": "2019-09-16T13:41:24.5546558Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/559", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/559", + "sourceBranch": "refs/heads/master", + "sourceVersion": "b3ffb9a7c9c4a3d78da50c581aaaf3fc708d1b6c", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-09-16T13:41:36.677Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamBuildArtifact-Id568.json b/Tests/SampleFiles/Get-VSTeamBuildArtifact-Id568.json new file mode 100644 index 000000000..4e5f88ed6 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamBuildArtifact-Id568.json @@ -0,0 +1,87 @@ +{ + "count": 5, + "value": [ + { + "id": 1149, + "name": "win", + "source": "00000000-0000-0000-0000-000000000000", + "resource": { + "type": "Container", + "data": "#/3943501/win", + "properties": { + "localpath": "d:\\WinBldBox-3_Test_Service3\\2\\a", + "artifactsize": "23898082" + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=win&api-version=5.1", + "downloadUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=win&api-version=5.1&%24format=zip" + } + }, + { + "id": 1150, + "name": "ber", + "source": "00000000-0000-0000-0000-000000000000", + "resource": { + "type": "Container", + "data": "#/3943501/ber", + "properties": { + "localpath": "d:\\WinBldBox-3_Test_Service2\\2\\a", + "artifactsize": "4746071" + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=ber&api-version=5.1", + "downloadUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=ber&api-version=5.1&%24format=zip" + } + }, + { + "id": 1151, + "name": "Code Coverage Report_568", + "source": "00000000-0000-0000-0000-000000000000", + "resource": { + "_links": { + "web": { + "href": "https://dev.azure.com/Test/_apis/Containers/3943501/Code%20Coverage%20Report_568/index.html" + } + }, + "type": "Container", + "data": "#/3943501/Code Coverage Report_568", + "properties": { + "containerfolder": "Code Coverage Report_568", + "artifactname": "Code Coverage Report_568", + "artifacttype": "Container", + "Browsable": "True" + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=Code%20Coverage%20Report_568&api-version=5.1", + "downloadUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=Code%20Coverage%20Report_568&api-version=5.1&%24format=zip" + } + }, + { + "id": 1152, + "name": "iac", + "source": "00000000-0000-0000-0000-000000000000", + "resource": { + "type": "Container", + "data": "#/3943501/iac", + "properties": { + "localpath": "/home/vsts/work/1/a/IaC", + "artifactsize": "30214" + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=iac&api-version=5.1", + "downloadUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=iac&api-version=5.1&%24format=zip" + } + }, + { + "id": 1153, + "name": "mobile", + "source": "00000000-0000-0000-0000-000000000000", + "resource": { + "type": "Container", + "data": "#/3943501/mobile", + "properties": { + "localpath": "/Users/runner/runners/2.160.0/work/1/a", + "artifactsize": "79285593" + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=mobile&api-version=5.1", + "downloadUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/artifacts?artifactName=mobile&api-version=5.1&%24format=zip" + } + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamBuildLog-Id568.json b/Tests/SampleFiles/Get-VSTeamBuildLog-Id568.json new file mode 100644 index 000000000..8750b3f60 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamBuildLog-Id568.json @@ -0,0 +1,493 @@ +{ + "count": 61, + "value": [ + { + "lineCount": 36, + "createdOn": "2019-11-14T00:49:35.46Z", + "lastChangedOn": "2019-11-14T00:49:35.467Z", + "id": 2, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/2" + }, + { + "lineCount": 36, + "createdOn": "2019-11-14T00:49:35.463Z", + "lastChangedOn": "2019-11-14T00:49:35.467Z", + "id": 3, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/3" + }, + { + "lineCount": 36, + "createdOn": "2019-11-14T00:49:35.79Z", + "lastChangedOn": "2019-11-14T00:49:35.793Z", + "id": 4, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/4" + }, + { + "lineCount": 36, + "createdOn": "2019-11-14T00:49:35.833Z", + "lastChangedOn": "2019-11-14T00:49:35.837Z", + "id": 5, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/5" + }, + { + "lineCount": 9, + "createdOn": "2019-11-14T00:49:42.083Z", + "lastChangedOn": "2019-11-14T00:49:42.12Z", + "id": 6, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/6" + }, + { + "lineCount": 8, + "createdOn": "2019-11-14T00:49:42.247Z", + "lastChangedOn": "2019-11-14T00:49:42.28Z", + "id": 7, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/7" + }, + { + "lineCount": 227, + "createdOn": "2019-11-14T00:49:44.257Z", + "lastChangedOn": "2019-11-14T00:49:44.273Z", + "id": 8, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/8" + }, + { + "lineCount": 226, + "createdOn": "2019-11-14T00:49:45.443Z", + "lastChangedOn": "2019-11-14T00:49:45.457Z", + "id": 9, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/9" + }, + { + "lineCount": 17, + "createdOn": "2019-11-14T00:49:45.543Z", + "lastChangedOn": "2019-11-14T00:49:45.57Z", + "id": 10, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/10" + }, + { + "lineCount": 18, + "createdOn": "2019-11-14T00:49:52.983Z", + "lastChangedOn": "2019-11-14T00:49:53.063Z", + "id": 11, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/11" + }, + { + "lineCount": 320, + "createdOn": "2019-11-14T00:49:54.77Z", + "lastChangedOn": "2019-11-14T00:49:54.783Z", + "id": 12, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/12" + }, + { + "lineCount": 26, + "createdOn": "2019-11-14T00:49:55.503Z", + "lastChangedOn": "2019-11-14T00:49:55.52Z", + "id": 13, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/13" + }, + { + "lineCount": 610, + "createdOn": "2019-11-14T00:49:58.21Z", + "lastChangedOn": "2019-11-14T00:49:58.27Z", + "id": 14, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/14" + }, + { + "lineCount": 24, + "createdOn": "2019-11-14T00:50:07.57Z", + "lastChangedOn": "2019-11-14T00:50:08.72Z", + "id": 15, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/15" + }, + { + "lineCount": 26, + "createdOn": "2019-11-14T00:50:09.94Z", + "lastChangedOn": "2019-11-14T00:50:09.997Z", + "id": 16, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/16" + }, + { + "lineCount": 27, + "createdOn": "2019-11-14T00:50:09.967Z", + "lastChangedOn": "2019-11-14T00:50:10.033Z", + "id": 17, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/17" + }, + { + "lineCount": 79, + "createdOn": "2019-11-14T00:50:11.283Z", + "lastChangedOn": "2019-11-14T00:50:11.327Z", + "id": 18, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/18" + }, + { + "lineCount": 10, + "createdOn": "2019-11-14T00:50:12.51Z", + "lastChangedOn": "2019-11-14T00:50:12.55Z", + "id": 19, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/19" + }, + { + "lineCount": 593, + "createdOn": "2019-11-14T00:50:14.777Z", + "lastChangedOn": "2019-11-14T00:50:14.82Z", + "id": 20, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/20" + }, + { + "lineCount": 17, + "createdOn": "2019-11-14T00:50:15.977Z", + "lastChangedOn": "2019-11-14T00:50:16.02Z", + "id": 21, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/21" + }, + { + "lineCount": 609, + "createdOn": "2019-11-14T00:50:27.203Z", + "lastChangedOn": "2019-11-14T00:50:27.25Z", + "id": 22, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/22" + }, + { + "lineCount": 293, + "createdOn": "2019-11-14T00:50:33.583Z", + "lastChangedOn": "2019-11-14T00:50:33.627Z", + "id": 23, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/23" + }, + { + "lineCount": 10, + "createdOn": "2019-11-14T00:50:33.793Z", + "lastChangedOn": "2019-11-14T00:50:33.84Z", + "id": 24, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/24" + }, + { + "lineCount": 14, + "createdOn": "2019-11-14T00:50:34.117Z", + "lastChangedOn": "2019-11-14T00:50:34.16Z", + "id": 25, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/25" + }, + { + "lineCount": 13, + "createdOn": "2019-11-14T00:50:35.363Z", + "lastChangedOn": "2019-11-14T00:50:35.407Z", + "id": 26, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/26" + }, + { + "lineCount": 14, + "createdOn": "2019-11-14T00:50:35.68Z", + "lastChangedOn": "2019-11-14T00:50:35.72Z", + "id": 27, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/27" + }, + { + "lineCount": 13, + "createdOn": "2019-11-14T00:50:38.07Z", + "lastChangedOn": "2019-11-14T00:50:38.113Z", + "id": 28, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/28" + }, + { + "lineCount": 344, + "createdOn": "2019-11-14T00:50:40.547Z", + "lastChangedOn": "2019-11-14T00:50:40.563Z", + "id": 29, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/29" + }, + { + "lineCount": 25, + "createdOn": "2019-11-14T00:50:40.673Z", + "lastChangedOn": "2019-11-14T00:50:40.687Z", + "id": 30, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/30" + }, + { + "lineCount": 59, + "createdOn": "2019-11-14T00:50:43.2Z", + "lastChangedOn": "2019-11-14T00:50:43.223Z", + "id": 31, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/31" + }, + { + "lineCount": 16, + "createdOn": "2019-11-14T00:50:45.097Z", + "lastChangedOn": "2019-11-14T00:50:45.113Z", + "id": 32, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/32" + }, + { + "lineCount": 11, + "createdOn": "2019-11-14T00:50:45.237Z", + "lastChangedOn": "2019-11-14T00:50:45.253Z", + "id": 33, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/33" + }, + { + "lineCount": 6, + "createdOn": "2019-11-14T00:50:45.35Z", + "lastChangedOn": "2019-11-14T00:50:45.367Z", + "id": 34, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/34" + }, + { + "lineCount": 1575, + "createdOn": "2019-11-14T00:50:45.45Z", + "lastChangedOn": "2019-11-14T00:50:45.463Z", + "id": 35, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/35" + }, + { + "lineCount": 23, + "createdOn": "2019-11-14T00:50:47.38Z", + "lastChangedOn": "2019-11-14T00:50:47.397Z", + "id": 36, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/36" + }, + { + "lineCount": 16, + "createdOn": "2019-11-14T00:50:49.603Z", + "lastChangedOn": "2019-11-14T00:50:49.62Z", + "id": 37, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/37" + }, + { + "lineCount": 11, + "createdOn": "2019-11-14T00:50:49.737Z", + "lastChangedOn": "2019-11-14T00:50:49.76Z", + "id": 38, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/38" + }, + { + "lineCount": 8, + "createdOn": "2019-11-14T00:50:49.903Z", + "lastChangedOn": "2019-11-14T00:50:49.933Z", + "id": 39, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/39" + }, + { + "lineCount": 374, + "createdOn": "2019-11-14T00:50:50.053Z", + "lastChangedOn": "2019-11-14T00:50:50.07Z", + "id": 40, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/40" + }, + { + "lineCount": 46, + "createdOn": "2019-11-14T00:51:12.967Z", + "lastChangedOn": "2019-11-14T00:51:13.027Z", + "id": 41, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/41" + }, + { + "lineCount": 38, + "createdOn": "2019-11-14T00:51:17.22Z", + "lastChangedOn": "2019-11-14T00:51:17.28Z", + "id": 42, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/42" + }, + { + "lineCount": 19, + "createdOn": "2019-11-14T00:51:20.41Z", + "lastChangedOn": "2019-11-14T00:51:20.47Z", + "id": 43, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/43" + }, + { + "lineCount": 25, + "createdOn": "2019-11-14T00:51:20.65Z", + "lastChangedOn": "2019-11-14T00:51:20.73Z", + "id": 44, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/44" + }, + { + "lineCount": 16, + "createdOn": "2019-11-14T00:51:25.22Z", + "lastChangedOn": "2019-11-14T00:51:25.28Z", + "id": 45, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/45" + }, + { + "lineCount": 916, + "createdOn": "2019-11-14T00:54:43.993Z", + "lastChangedOn": "2019-11-14T00:54:44.037Z", + "id": 46, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/46" + }, + { + "lineCount": 335, + "createdOn": "2019-11-14T00:55:02.677Z", + "lastChangedOn": "2019-11-14T00:55:02.74Z", + "id": 47, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/47" + }, + { + "lineCount": 11, + "createdOn": "2019-11-14T00:55:04.073Z", + "lastChangedOn": "2019-11-14T00:55:04.13Z", + "id": 48, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/48" + }, + { + "lineCount": 6, + "createdOn": "2019-11-14T00:55:04.313Z", + "lastChangedOn": "2019-11-14T00:55:04.383Z", + "id": 49, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/49" + }, + { + "lineCount": 1142, + "createdOn": "2019-11-14T00:55:04.583Z", + "lastChangedOn": "2019-11-14T00:55:04.64Z", + "id": 50, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/50" + }, + { + "lineCount": 569, + "createdOn": "2019-11-14T00:55:23.253Z", + "lastChangedOn": "2019-11-14T00:55:23.297Z", + "id": 51, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/51" + }, + { + "lineCount": 21, + "createdOn": "2019-11-14T00:55:45.683Z", + "lastChangedOn": "2019-11-14T00:55:45.723Z", + "id": 52, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/52" + }, + { + "lineCount": 1070, + "createdOn": "2019-11-14T00:55:48.863Z", + "lastChangedOn": "2019-11-14T00:55:48.903Z", + "id": 53, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/53" + }, + { + "lineCount": 20, + "createdOn": "2019-11-14T00:55:51.34Z", + "lastChangedOn": "2019-11-14T00:55:51.383Z", + "id": 54, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/54" + }, + { + "lineCount": 27, + "createdOn": "2019-11-14T00:55:59.02Z", + "lastChangedOn": "2019-11-14T00:55:59.067Z", + "id": 55, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/55" + }, + { + "lineCount": 10, + "createdOn": "2019-11-14T00:55:59.19Z", + "lastChangedOn": "2019-11-14T00:55:59.24Z", + "id": 56, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/56" + }, + { + "lineCount": 10, + "createdOn": "2019-11-14T00:55:59.36Z", + "lastChangedOn": "2019-11-14T00:55:59.4Z", + "id": 57, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/57" + }, + { + "lineCount": 11, + "createdOn": "2019-11-14T00:55:59.607Z", + "lastChangedOn": "2019-11-14T00:55:59.65Z", + "id": 58, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/58" + }, + { + "lineCount": 11, + "createdOn": "2019-11-14T00:56:01.033Z", + "lastChangedOn": "2019-11-14T00:56:01.073Z", + "id": 59, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/59" + }, + { + "lineCount": 4, + "createdOn": "2019-11-14T00:56:01.18Z", + "lastChangedOn": "2019-11-14T00:56:01.22Z", + "id": 60, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/60" + }, + { + "lineCount": 3756, + "createdOn": "2019-11-14T00:56:01.34Z", + "lastChangedOn": "2019-11-14T00:56:01.38Z", + "id": 61, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/61" + }, + { + "lineCount": 2, + "createdOn": "2019-11-14T00:56:02.467Z", + "lastChangedOn": "2019-11-14T00:56:02.473Z", + "id": 62, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs/62" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamBuildTag-Id568.json b/Tests/SampleFiles/Get-VSTeamBuildTag-Id568.json new file mode 100644 index 000000000..725c844e1 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamBuildTag-Id568.json @@ -0,0 +1,8 @@ +{ + "count": 3, + "value": [ + "Testing", + "Test123", + "Test245" + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids20.json b/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids20.json new file mode 100644 index 000000000..e22057c84 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids20.json @@ -0,0 +1,22 @@ +{ + "count": 1, + "value": [ + { + "id": 20, + "identifier": "18e7998d-d0c5-4c01-b547-d7d4eb4c97c5", + "name": "Sprint 3", + "structureType": "iteration", + "hasChildren": false, + "path": "\\Demo Public\\Iteration\\Sprint 3", + "_links": { + "self": { + "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations/Sprint%203" + }, + "parent": { + "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations" + } + }, + "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations/Sprint%203" + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids24.json b/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids24.json new file mode 100644 index 000000000..ac46367ec --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids24.json @@ -0,0 +1,19 @@ +{ + "count": 1, + "value": [ + { + "id": 24, + "identifier": "b33b12d7-6abb-4b7a-b9d6-2092d0933c99", + "name": "Demo Public", + "structureType": "area", + "hasChildren": true, + "path": "\\Demo Public\\Area", + "_links": { + "self": { + "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas" + } + }, + "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas" + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids43.json b/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids43.json new file mode 100644 index 000000000..7420aa86d --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids43.json @@ -0,0 +1,22 @@ +{ + "count": 1, + "value": [ + { + "id": 43, + "identifier": "38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b", + "name": "Child 1 Level 1", + "structureType": "area", + "hasChildren": true, + "path": "\\Demo Public\\Area\\Child 1 Level 1", + "_links": { + "self": { + "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201" + }, + "parent": { + "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas" + } + }, + "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201" + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids85.json b/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids85.json new file mode 100644 index 000000000..865296ac2 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamClassificationNode-Depth0-Ids85.json @@ -0,0 +1,22 @@ +{ + "count": 1, + "value": [ + { + "id": 85, + "identifier": "90aa2c42-de51-450a-bfb6-6e264e364d9a", + "name": "Child 1 Level 2", + "structureType": "area", + "hasChildren": false, + "path": "\\Demo Public\\Area\\Child 1 Level 1\\Child 1 Level 2", + "_links": { + "self": { + "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201/Child%201%20Level%202" + }, + "parent": { + "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201" + } + }, + "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201/Child%201%20Level%202" + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamClassificationNode-depth3-ids16.json b/Tests/SampleFiles/Get-VSTeamClassificationNode-depth3-ids16.json new file mode 100644 index 000000000..6deff353d --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamClassificationNode-depth3-ids16.json @@ -0,0 +1,14 @@ +{ + "id": 16, + "identifier": "dfa90792-403a-4119-a52b-bd142c08291b", + "name": "Demo Public", + "structureType": "iteration", + "hasChildren": true, + "path": "\\Demo Public\\Iteration", + "_links": { + "self": { + "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations" + } + }, + "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations" +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamClassificationNode-depth3-ids82.json b/Tests/SampleFiles/Get-VSTeamClassificationNode-depth3-ids82.json new file mode 100644 index 000000000..623cb6140 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamClassificationNode-depth3-ids82.json @@ -0,0 +1,30 @@ +{ + "count": 1, + "value": [ + { + "id": 82, + "identifier": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "structureType": "iteration", + "hasChildren": true, + "children": [ + { + "id": 84, + "identifier": "00000000-0000-0000-0000-000000000000", + "name": "Sprint 1", + "structureType": "iteration", + "hasChildren": false, + "path": "\\PeopleTracker\\Iteration\\Sprint 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations/Sprint%201" + } + ], + "path": "\\PeopleTracker\\Iteration", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations" + } + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamClassificationNode-depth4-ids84.json b/Tests/SampleFiles/Get-VSTeamClassificationNode-depth4-ids84.json new file mode 100644 index 000000000..bd8ef9b4a --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamClassificationNode-depth4-ids84.json @@ -0,0 +1,22 @@ +{ + "count": 1, + "value": [ + { + "id": 84, + "identifier": "00000000-0000-0000-0000-000000000000", + "name": "Sprint 1", + "structureType": "iteration", + "hasChildren": false, + "path": "\\PeopleTracker\\Iteration\\Sprint 1", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations/Sprint%201" + }, + "parent": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations" + } + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations/Sprint%201" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamClassificationNode.json b/Tests/SampleFiles/Get-VSTeamClassificationNode.json new file mode 100644 index 000000000..e3d4da74c --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamClassificationNode.json @@ -0,0 +1,34 @@ +{ + "count": 2, + "value": [ + { + "id": 85, + "identifier": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "structureType": "area", + "hasChildren": false, + "path": "\\PeopleTracker\\Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Areas" + }, + { + "id": 82, + "identifier": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "structureType": "iteration", + "hasChildren": true, + "children": [ + { + "id": 84, + "identifier": "00000000-0000-0000-0000-000000000000", + "name": "Sprint 1", + "structureType": "iteration", + "hasChildren": false, + "path": "\\PeopleTracker\\Iteration\\Sprint 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations/Sprint%201" + } + ], + "path": "\\PeopleTracker\\Iteration", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamExtension.json b/Tests/SampleFiles/Get-VSTeamExtension.json new file mode 100644 index 000000000..5fdc8c571 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamExtension.json @@ -0,0 +1,326 @@ +{ + "count": 3, + "value": [ + { + "extensionId": "asg-cloudtest-attachments", + "extensionName": "Files and Folders View for Test Attachments", + "publisherId": "asg-cloudtest", + "publisherName": "CloudTest", + "version": "20200807.2", + "registrationId": "00000000-0000-0000-0000-000000000000", + "manifestVersion": 1.0, + "baseUri": "https://asg-cloudtest.gallerycdn.vsassets.io/extensions/asg-cloudtest/asg-cloudtest-attachments/20200807.2/1597083746942", + "fallbackBaseUri": "https://asg-cloudtest.gallery.vsassets.io/_apis/public/gallery/publisher/asg-cloudtest/extension/asg-cloudtest-attachments/20200807.2/assetbyname", + "scopes": [ + "vso.test", + "vso.test_write" + ], + "contributions": [ + { + "id": "asg-cloudtest.asg-cloudtest-attachments.asg-cloudtest.asg-cloudtest-attachments", + "type": "ms.vss-web.tab", + "targets": [ + "ms.vss-test-web.test-result-details-tab-items" + ], + "properties": { + "name": "Attachments*", + "uri": "dist/index.html", + "height": "100%", + "::Attributes": 0, + "::Version": "20200807.2" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "asg-cloudtest.asg-cloudtest-attachments" + } + } + ], + "restrictedTo": [ + "member" + ] + } + ], + "installState": { + "flags": "none", + "lastUpdated": "2020-08-10T20:31:07.787Z" + }, + "contributionTypes": [], + "lastPublished": "2020-08-10T18:22:26.937Z", + "files": [] + }, + { + "extensionId": "colinsalmcorner-buildtasks", + "extensionName": "Colin's ALM Corner Build & Release Tools", + "publisherId": "colinsalmcorner", + "publisherName": "Colin's ALM Corner", + "version": "1.4.114", + "registrationId": "00000000-0000-0000-0000-000000000000", + "manifestVersion": 1.0, + "baseUri": "https://colinsalmcorner.gallerycdn.vsassets.io/extensions/colinsalmcorner/colinsalmcorner-buildtasks/1.4.114/1567964986237", + "fallbackBaseUri": "https://colinsalmcorner.gallery.vsassets.io/_apis/public/gallery/publisher/colinsalmcorner/extension/colinsalmcorner-buildtasks/1.4.114/assetbyname", + "scopes": [], + "contributions": [ + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.replace-tokens-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/ReplaceTokens", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + }, + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.version-assemblies-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/VersionAssemblies", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + }, + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.dacpac-report-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/DacPacReport", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + }, + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.tokenizer-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/Tokenizer", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + }, + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.coverage-gate-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/CoverageGate", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + }, + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.tag-build-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/TagBuild", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + }, + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.azure-webdeploy-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/AzureWebDeploy", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + }, + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.docker-publish-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/DockerPublish", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + }, + { + "id": "colinsalmcorner.colinsalmcorner-buildtasks.route-traffic-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "Tasks/RouteTraffic", + "::Attributes": 16, + "::Version": "1.4.114" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "colinsalmcorner.colinsalmcorner-buildtasks" + } + } + ], + "restrictedTo": [ + "member" + ] + } + ], + "installState": { + "flags": "none", + "lastUpdated": "2019-09-09T00:05:10.06Z" + }, + "contributionTypes": [], + "lastPublished": "2019-09-08T17:49:46.227Z", + "files": [] + }, + { + "extensionId": "arm-outputs", + "extensionName": "ARM Outputs", + "publisherId": "keesschollaart", + "publisherName": "Kees Schollaart", + "version": "6.0.0", + "registrationId": "00000000-0000-0000-0000-000000000000", + "manifestVersion": 1.0, + "baseUri": "https://keesschollaart.gallerycdn.vsassets.io/extensions/keesschollaart/arm-outputs/6.0.0/1595768715839", + "fallbackBaseUri": "https://keesschollaart.gallery.vsassets.io/_apis/public/gallery/publisher/keesschollaart/extension/arm-outputs/6.0.0/assetbyname", + "scopes": [], + "contributions": [ + { + "id": "keesschollaart.arm-outputs.arm-outputs", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "arm-outputs", + "::Attributes": 16, + "::Version": "6.0.0" + }, + "constraints": [ + { + "name": "ExtensionLicensed", + "properties": { + "extensionId": "keesschollaart.arm-outputs" + } + } + ], + "restrictedTo": [ + "member" + ] + } + ], + "installState": { + "flags": "none", + "lastUpdated": "2020-07-26T23:28:05.687Z" + }, + "contributionTypes": [], + "lastPublished": "2020-07-26T13:05:15.833Z", + "files": [] + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamFeed.json b/Tests/SampleFiles/Get-VSTeamFeed.json new file mode 100644 index 000000000..7c49a5b37 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamFeed.json @@ -0,0 +1,68 @@ +{ + "count": 1, + "value": [ + { + "description": null, + "url": "https://feeds.dev.azure.com/Test/_apis/Packaging/Feeds/00000000-0000-0000-0000-000000000000", + "_links": { + "self": { + "href": "https://feeds.dev.azure.com/Test/_apis/Packaging/Feeds/00000000-0000-0000-0000-000000000000" + }, + "packages": { + "href": "https://feeds.dev.azure.com/Test/_apis/Packaging/Feeds/00000000-0000-0000-0000-000000000000/Packages" + }, + "permissions": { + "href": "https://feeds.dev.azure.com/Test/_apis/Packaging/Feeds/00000000-0000-0000-0000-000000000000/Permissions" + } + }, + "hideDeletedPackageVersions": true, + "defaultViewId": "00000000-0000-0000-0000-000000000000", + "id": "00000000-0000-0000-0000-000000000001", + "name": "ber", + "upstreamEnabled": true, + "viewId": null, + "viewName": null, + "fullyQualifiedName": "ber", + "fullyQualifiedId": "00000000-0000-0000-0000-000000000000", + "upstreamSources": [ + { + "id": "00000000-0000-0000-0000-000000000010", + "name": "npmjs", + "protocol": "npm", + "location": "https://registry.npmjs.org/", + "displayLocation": "https://registry.npmjs.org/", + "upstreamSourceType": "public", + "status": "ok" + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "NuGet Gallery", + "protocol": "nuget", + "location": "https://api.nuget.org/v3/index.json", + "displayLocation": "https://api.nuget.org/v3/index.json", + "upstreamSourceType": "public", + "status": "ok" + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PyPI", + "protocol": "pypi", + "location": "https://pypi.org/", + "displayLocation": "https://pypi.org/", + "upstreamSourceType": "public", + "status": "ok" + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Maven Central", + "protocol": "Maven", + "location": "https://repo.maven.apache.org/maven2/", + "displayLocation": "https://repo.maven.apache.org/maven2/", + "upstreamSourceType": "public", + "status": "ok" + } + ], + "capabilities": "defaultCapabilities" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamGitCommit.json b/Tests/SampleFiles/Get-VSTeamGitCommit.json new file mode 100644 index 000000000..6cdc37570 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamGitCommit.json @@ -0,0 +1,26 @@ +{ + "count": 1, + "value": [ + { + "commitId": "6843b66ef58214061b996508ae37a8bbd67a12c2", + "author": { + "name": "Donovan Brown", + "email": "Test@Test.com", + "date": "2019-08-08T20:58:58Z" + }, + "committer": { + "name": "Donovan Brown", + "email": "Test@Test.com", + "date": "2019-08-08T20:58:58Z" + }, + "comment": "Clean up.", + "changeCounts": { + "Add": 0, + "Edit": 3, + "Delete": 0 + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/6843b66ef58214061b996508ae37a8bbd67a12c2", + "remoteUrl": "https://dev.azure.com/Test/PeopleTracker/_git/Bakeoff/commit/6843b66ef58214061b996508ae37a8bbd67a12c2" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamGitRef.json b/Tests/SampleFiles/Get-VSTeamGitRef.json new file mode 100644 index 000000000..2411eebad --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamGitRef.json @@ -0,0 +1,23 @@ +{ + "value": [ + { + "name": "refs/heads/master", + "objectId": "6843c66ed58214061b996508ae37b8bbd67a12c2", + "creator": { + "displayName": "Test User", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "redacted" + }, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/refs?filter=heads%2Fmaster" + } + ], + "count": 1 +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamGitRepository-ProjectNamePeopleTracker-NamePeopleTracker.json b/Tests/SampleFiles/Get-VSTeamGitRepository-ProjectNamePeopleTracker-NamePeopleTracker.json new file mode 100644 index 000000000..014710a69 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamGitRepository-ProjectNamePeopleTracker-NamePeopleTracker.json @@ -0,0 +1,48 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "defaultBranch": "refs/heads/master", + "size": 24647257, + "remoteUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "sshUrl": "git@ssh.dev.azure.com:v3/Test/PeopleTracker/PeopleTracker", + "webUrl": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000" + }, + "project": { + "href": "vstfs:///Classification/TeamProject/00000000-0000-0000-0000-000000000000" + }, + "web": { + "href": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker" + }, + "ssh": { + "href": "git@ssh.dev.azure.com:v3/Test/PeopleTracker/PeopleTracker" + }, + "commits": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits" + }, + "refs": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/refs" + }, + "pullRequests": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests" + }, + "items": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/items" + }, + "pushes": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pushes" + } + } +} diff --git a/Tests/SampleFiles/Get-VSTeamGitRepository.json b/Tests/SampleFiles/Get-VSTeamGitRepository.json new file mode 100644 index 000000000..4054b8649 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamGitRepository.json @@ -0,0 +1,100 @@ +{ + "value": [ + { + "id": "00000000-0000-0000-0000-000000000001", + "name": "Bakeoff", + "url": "https://dev.azure.com/Test/0/_apis/git/repositories/0", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "defaultBranch": "refs/heads/master", + "size": 1939413, + "remoteUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/Bakeoff", + "sshUrl": "git@ssh.dev.azure.com:v3/Test/PeopleTracker/Bakeoff", + "webUrl": "https://dev.azure.com/Test/PeopleTracker/_git/Bakeoff" + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Vars", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "defaultBranch": "refs/heads/master", + "size": 2704, + "remoteUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/Vars", + "sshUrl": "git@ssh.dev.azure.com:v3/Test/PeopleTracker/Vars", + "webUrl": "https://dev.azure.com/Test/PeopleTracker/_git/Vars" + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Voting-App", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Voting-App", + "description": "Vote App", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 159, + "visibility": "private", + "lastUpdateTime": "2020-05-19T00:02:23.517Z" + }, + "size": 0, + "remoteUrl": "https://Test@dev.azure.com/Test/Voting-App/_git/Voting-App", + "sshUrl": "git@ssh.dev.azure.com:v3/Test/Voting-App/Voting-App", + "webUrl": "https://dev.azure.com/Test/Voting-App/_git/Voting-App" + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "defaultBranch": "refs/heads/master", + "size": 24647257, + "remoteUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "sshUrl": "git@ssh.dev.azure.com:v3/Test/PeopleTracker/PeopleTracker", + "webUrl": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker" + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "ber", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "defaultBranch": "refs/heads/master", + "size": 167584, + "remoteUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/ber", + "sshUrl": "git@ssh.dev.azure.com:v3/Test/PeopleTracker/ber", + "webUrl": "https://dev.azure.com/Test/PeopleTracker/_git/ber" + } + ], + "count": 5 +} diff --git a/Tests/SampleFiles/Get-VSTeamGroup.json b/Tests/SampleFiles/Get-VSTeamGroup.json new file mode 100644 index 000000000..747ddb450 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamGroup.json @@ -0,0 +1,57 @@ +{ + "count": 2, + "value": [ + { + "subjectKind": "group", + "description": "Members of this group should include accounts for people who should be able to administer the build resources.", + "domain": "vstfs:///Framework/IdentityDomain/00000000-0000-0000-0000-000000000000", + "principalName": "[Test]\\Project Collection Build Administrators", + "mailAddress": null, + "origin": "vsts", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Project Collection Build Administrators", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Groups/redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/redacted" + } + }, + "url": "https://vssps.dev.azure.com/Test/_apis/Graph/Groups/redacted", + "descriptor": "redacted" + }, + { + "subjectKind": "group", + "description": "Members of this group can create, modify and delete build definitions and manage queued and completed builds.", + "domain": "vstfs:///Classification/TeamProject/00000000-0000-0000-0000-000000000000", + "principalName": "[PeopleTracker]\\Build Administrators", + "mailAddress": null, + "origin": "vsts", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Build Administrators", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Groups/redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/redacted" + } + }, + "url": "https://vssps.dev.azure.com/Test/_apis/Graph/Groups/redacted", + "descriptor": "redacted" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamJobRequest-PoolId1-AgentID111.json b/Tests/SampleFiles/Get-VSTeamJobRequest-PoolId1-AgentID111.json new file mode 100644 index 000000000..8bf8a5049 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamJobRequest-PoolId1-AgentID111.json @@ -0,0 +1,201 @@ +{ + "count": 3, + "value": [ + { + "requestId": 3123, + "queueTime": "2019-11-14T00:56:12.53Z", + "assignTime": "2019-11-14T00:56:12.57Z", + "receiveTime": "2019-11-14T00:56:15.029774Z", + "finishTime": "2019-11-14T01:07:13.6836315Z", + "result": "failed", + "serviceOwner": "0000000d-0000-8888-8000-000000000000", + "hostId": "8a3198df-368a-45e1-a19f-342ba2db31a0", + "scopeId": "15af52f7-47f1-40a7-817a-7661062cea76", + "planType": "Release", + "planId": "de4123ec-74a1-4f08-96a3-a8850ed15150", + "jobId": "05c10af5-64d3-51b9-7a2c-1c8d37020562", + "demands": [ + "Agent.Version -gtVersion 2.115.0" + ], + "reservedAgent": { + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/_apis/distributedtask/pools/1/agents/111" + }, + "web": { + "href": "https://dev.azure.com/BlackShirt/_admin/_AgentPool#_a=agents&poolId=1&agentId=111" + } + }, + "id": 111, + "name": "WinBldBox-3_Service2", + "version": "2.155.1", + "osDescription": "Microsoft Windows 6.3.9600 ", + "enabled": true, + "status": "offline", + "provisioningState": "Provisioned", + "accessPoint": "CodexAccessMapping" + }, + "definition": { + "_links": { + "web": { + "href": "https://dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_apis/Release/definitions/2" + } + }, + "id": 2, + "name": "PTracker-CD" + }, + "owner": { + "_links": { + "web": { + "href": "https://dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_release?releaseId=259&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_apis/Release/releases/259" + } + }, + "id": 3602, + "name": "Release-194 / Dev Infra" + }, + "data": { + "ParallelismTag": "Private" + }, + "poolId": 1, + "agentDelays": [], + "orchestrationId": "de4123ec-74a1-4f08-96a3-a8850ed15150.stage_15af52f747f140a7817a7661062cea76_2_1.phase_1.__default", + "matchesAllAgentsInPool": true + }, + { + "requestId": 3119, + "queueTime": "2019-11-14T00:49:36.32Z", + "receiveTime": "2019-11-14T00:49:38.3279018Z", + "finishTime": "2019-11-14T00:50:50.4033333Z", + "serviceOwner": "00025394-6065-48ca-87d9-7f5672854ef7", + "hostId": "8a3198df-368a-45e1-a19f-342ba2db31a0", + "scopeId": "15af52f7-47f1-40a7-817a-7661062cea76", + "planType": "Build", + "planId": "7cd80108-3642-489b-a15e-b2f7759ff890", + "jobId": "0b109914-fd3b-548c-e58c-f9d47cb04f5f", + "demands": [ + "Agent.Version -gtVersion 2.144.0" + ], + "reservedAgent": { + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/_apis/distributedtask/pools/1/agents/111" + }, + "web": { + "href": "https://dev.azure.com/BlackShirt/_admin/_AgentPool#_a=agents&poolId=1&agentId=111" + } + }, + "id": 111, + "name": "WinBldBox-3_Service2", + "version": "2.155.1", + "osDescription": "Microsoft Windows 6.3.9600 ", + "enabled": true, + "status": "offline", + "provisioningState": "Provisioned", + "accessPoint": "CodexAccessMapping" + }, + "definition": { + "_links": { + "web": { + "href": "https://dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_build/definition?definitionId=23" + }, + "self": { + "href": "https://dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_apis/build/Definitions/23" + } + }, + "id": 23, + "name": "PTracker-CI" + }, + "owner": { + "_links": { + "web": { + "href": "https://dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_build/results?buildId=568" + }, + "self": { + "href": "https://dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_apis/build/Builds/568" + } + }, + "id": 568, + "name": "568" + }, + "data": { + "ParallelismTag": "Private", + "IsScheduledKey": "False" + }, + "poolId": 1, + "agentDelays": [], + "orchestrationId": "7cd80108-3642-489b-a15e-b2f7759ff890.job_4.__default", + "matchesAllAgentsInPool": true + }, + { + "requestId": 3117, + "queueTime": "2019-11-13T23:01:59.1733333Z", + "assignTime": "2019-11-13T23:01:59.2266667Z", + "receiveTime": "2019-11-13T23:02:01.4405864Z", + "finishTime": "2019-11-13T23:09:34.22949Z", + "serviceOwner": "0000000d-0000-8888-8000-000000000000", + "hostId": "8a3198df-368a-45e1-a19f-342ba2db31a0", + "scopeId": "15af52f7-47f1-40a7-817a-7661062cea76", + "planType": "Release", + "planId": "e65a0a3f-2e61-4d6a-9bbe-5234cb4a4040", + "jobId": "f7ccbfc1-6dad-551c-db4b-194c43b2b3cf", + "demands": [ + "Agent.Version -gtVersion 2.115.0" + ], + "reservedAgent": { + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/_apis/distributedtask/pools/1/agents/111" + }, + "web": { + "href": "https://dev.azure.com/BlackShirt/_admin/_AgentPool#_a=agents&poolId=1&agentId=111" + } + }, + "id": 111, + "name": "WinBldBox-3_Service2", + "version": "2.155.1", + "osDescription": "Microsoft Windows 6.3.9600 ", + "enabled": true, + "status": "offline", + "provisioningState": "Provisioned", + "accessPoint": "CodexAccessMapping" + }, + "definition": { + "_links": { + "web": { + "href": "https://dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_release?definitionId=7" + }, + "self": { + "href": "https://vsrm.dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_apis/Release/definitions/7" + } + }, + "id": 7, + "name": "PTracker-CD - NoMobile" + }, + "owner": { + "_links": { + "web": { + "href": "https://dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_release?releaseId=258&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/BlackShirt/15af52f7-47f1-40a7-817a-7661062cea76/_apis/Release/releases/258" + } + }, + "id": 3585, + "name": "Release-17 / Dev Common Infra" + }, + "data": { + "ParallelismTag": "Private" + }, + "poolId": 1, + "agentDelays": [], + "orchestrationId": "e65a0a3f-2e61-4d6a-9bbe-5234cb4a4040.stage_15af52f747f140a7817a7661062cea76_30_1.phase_1.__default", + "matchesAllAgentsInPool": true + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamOption-Area_git-Resource_annotatedTags.json b/Tests/SampleFiles/Get-VSTeamOption-Area_git-Resource_annotatedTags.json new file mode 100644 index 000000000..1d42c7bb7 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamOption-Area_git-Resource_annotatedTags.json @@ -0,0 +1,15 @@ +{ + "value": [ + { + "id": "5e8a8081-3851-4626-b677-9891cc04102e", + "area": "git", + "resourceName": "annotatedTags", + "routeTemplate": "{project}/_apis/{area}/repositories/{repositoryId}/{resource}/{objectId}", + "resourceVersion": 1, + "minVersion": "3.1", + "maxVersion": "6.1", + "releasedVersion": "0.0" + } + ], + "count": 1 +} diff --git a/unit/test/sampleFiles/Get-VSTeamOption.json b/Tests/SampleFiles/Get-VSTeamOption.json similarity index 100% rename from unit/test/sampleFiles/Get-VSTeamOption.json rename to Tests/SampleFiles/Get-VSTeamOption.json diff --git a/unit/test/sampleFiles/Get-VSTeamOption_vsrm.json b/Tests/SampleFiles/Get-VSTeamOption_vsrm.json similarity index 100% rename from unit/test/sampleFiles/Get-VSTeamOption_vsrm.json rename to Tests/SampleFiles/Get-VSTeamOption_vsrm.json diff --git a/Tests/SampleFiles/Get-VSTeamPolicy.json b/Tests/SampleFiles/Get-VSTeamPolicy.json new file mode 100644 index 000000000..59f6181f2 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamPolicy.json @@ -0,0 +1,48 @@ +{ + "count": 1, + "value": [ + { + "createdBy": { + "displayName": "Test User", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "createdDate": "2020-09-07T23:19:33.8376081Z", + "isEnabled": true, + "isBlocking": true, + "isDeleted": false, + "settings": { + "scope": [ + { + "repositoryId": null + } + ] + }, + "isEnterpriseManaged": false, + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/configurations/11" + }, + "policyType": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "revision": 1, + "id": 11, + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/configurations/11", + "type": { + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Reserved names restriction" + } + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamPolicyType.json b/Tests/SampleFiles/Get-VSTeamPolicyType.json new file mode 100644 index 000000000..503b10f86 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamPolicyType.json @@ -0,0 +1,170 @@ +{ + "count": 15, + "value": [ + { + "description": "This policy will reject pushes to a repository for files that contain credentials or secrets.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Secrets scanning restriction" + }, + { + "description": "This policy will reject pushes to a repository for paths which exceed the specified length.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Path Length restriction" + }, + { + "description": "This policy will reject pushes to a repository for names which aren't valid on all supported client OSes.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Reserved names restriction" + }, + { + "description": "This policy ensures that pull requests use a consistent merge strategy.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Require a merge strategy" + }, + { + "description": "Check if the pull request has any active comments", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Comment requirements" + }, + { + "description": "This policy will require a successfull status to be posted before updating protected refs.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Status" + }, + { + "description": "Git repository settings", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Git repository settings" + }, + { + "description": "This policy will require a successful build has been performed before updating protected refs.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Build" + }, + { + "description": "This policy will reject pushes to a repository for files which exceed the specified size.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "File size restriction" + }, + { + "description": "This policy will reject pushes to a repository which add file paths that match the specified patterns.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "File name restriction" + }, + { + "description": "This policy will block pushes from including commits where the author email does not match the specified patterns.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Commit author email validation" + }, + { + "description": "This policy will ensure that required reviewers are added for modified files matching specified patterns.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Required reviewers" + }, + { + "description": "This policy will ensure that a minimum number of reviewers have approved a pull request before completion.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Minimum number of reviewers" + }, + { + "description": "This policy encourages developers to link commits to work items.", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "Work item linking" + }, + { + "description": "GitRepositorySettingsPolicyName", + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/policy/types/00000000-0000-0000-0000-000000000000", + "displayName": "GitRepositorySettingsPolicyName" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamPool.json b/Tests/SampleFiles/Get-VSTeamPool.json new file mode 100644 index 000000000..49252b5cc --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamPool.json @@ -0,0 +1,509 @@ +{ + "count": 12, + "value": [ + { + "createdOn": "2018-08-21T18:09:14.907Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": null, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 1, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Default", + "isHosted": false, + "poolType": "automation", + "size": 4, + "isLegacy": false, + "options": "none" + }, + { + "createdOn": "2018-08-21T18:09:14.953Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": 1, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 2, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + }, + { + "createdOn": "2018-08-21T18:09:15.08Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": 1, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 4, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted VS2017", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + }, + { + "createdOn": "2018-08-21T18:09:15.157Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": 1, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 5, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Windows Container", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + }, + { + "createdOn": "2018-08-21T18:09:15.3Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": 1, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 6, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted macOS", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + }, + { + "createdOn": "2018-08-29T23:18:18.163Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": 1, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 7, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Ubuntu 1604", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + }, + { + "createdOn": "2018-09-22T17:34:20.457Z", + "autoProvision": false, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": null, + "createdBy": { + "displayName": "Sachin Raj", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/aad.NWZiYzQ4NzQtNTIwZC03MDQxLTg3ZjUtNzhiNjhmZDdlMDNi" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "sraj@microsoft.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/aad.NWZiYzQ4NzQtNTIwZC03MDQxLTg3ZjUtNzhiNjhmZDdlMDNi", + "descriptor": "aad.NWZiYzQ4NzQtNTIwZC03MDQxLTg3ZjUtNzhiNjhmZDdlMDNi" + }, + "owner": { + "displayName": "Sachin Raj", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/aad.NWZiYzQ4NzQtNTIwZC03MDQxLTg3ZjUtNzhiNjhmZDdlMDNi" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "sraj@microsoft.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/aad.NWZiYzQ4NzQtNTIwZC03MDQxLTg3ZjUtNzhiNjhmZDdlMDNi", + "descriptor": "aad.NWZiYzQ4NzQtNTIwZC03MDQxLTg3ZjUtNzhiNjhmZDdlMDNi" + }, + "id": 8, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "HostedVS2017", + "isHosted": false, + "poolType": "automation", + "size": 0, + "isLegacy": false, + "options": "none" + }, + { + "createdOn": "2019-02-20T05:13:15.64Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": 1, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 9, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Windows 2019 with VS2019", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + }, + { + "createdOn": "2019-03-23T20:59:36.817Z", + "autoProvision": false, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": null, + "createdBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 11, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Private Ubuntu 1604", + "isHosted": false, + "poolType": "automation", + "size": 1, + "isLegacy": false, + "options": "none" + }, + { + "createdOn": "2019-03-25T15:16:04.827Z", + "autoProvision": false, + "autoUpdate": true, + "autoSize": true, + "targetSize": null, + "agentCloudId": null, + "createdBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 12, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Private macOS", + "isHosted": false, + "poolType": "automation", + "size": 1, + "isLegacy": false, + "options": "none" + }, + { + "createdOn": "2019-03-29T23:31:59.223Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": 1, + "agentCloudId": 1, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 13, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted macOS High Sierra", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + }, + { + "createdOn": "2019-07-03T21:15:30.913Z", + "autoProvision": true, + "autoUpdate": true, + "autoSize": true, + "targetSize": 1, + "agentCloudId": 1, + "createdBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "owner": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "id": 14, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Azure Pipelines", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": false, + "options": "none" + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamProcess.json b/Tests/SampleFiles/Get-VSTeamProcess.json new file mode 100644 index 000000000..cbf761ec1 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamProcess.json @@ -0,0 +1,55 @@ +{ + "count": 5, + "value": [ + { + "typeId": "6b724908-ef14-45cf-84f8-768b5384da45", + "name": "Scrum", + "referenceName": null, + "description": "This template is for teams who follow the Scrum framework.", + "parentProcessTypeId": "00000000-0000-0000-0000-000000000000", + "isEnabled": true, + "isDefault": false, + "customizationType": "system" + }, + { + "typeId": "adcc42ab-9882-485e-a3ed-7678f01f66bc", + "name": "Agile", + "referenceName": null, + "description": "This template is flexible and will work great for most teams using Agile planning methods, including those practicing Scrum.", + "parentProcessTypeId": "00000000-0000-0000-0000-000000000000", + "isEnabled": true, + "isDefault": true, + "customizationType": "system" + }, + { + "typeId": "b8a3a935-7e91-48b8-a94c-606d37c3e9f2", + "name": "Basic", + "referenceName": null, + "description": "This template is flexible for any process and great for teams getting started with Azure DevOps.", + "parentProcessTypeId": "00000000-0000-0000-0000-000000000000", + "isEnabled": true, + "isDefault": false, + "customizationType": "system" + }, + { + "typeId": "27450541-8e31-4150-9947-dc59f998fc01", + "name": "CMMI", + "referenceName": null, + "description": "This template is for more formal projects requiring a framework for process improvement and an auditable record of decisions.", + "parentProcessTypeId": "00000000-0000-0000-0000-000000000000", + "isEnabled": true, + "isDefault": false, + "customizationType": "system" + }, + { + "typeId": "e2b1e994-a1cd-4112-a08b-3081e67202aa", + "name": "Scrum With Space", + "referenceName": "Inherited.e2b1e994a1cd4112a08b3081e67202aa", + "description": "Just a test process that has a space in it's name for testing VSTeam.", + "parentProcessTypeId": "6b724908-ef14-45cf-84f8-768b5384da45", + "isEnabled": true, + "isDefault": false, + "customizationType": "inherited" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamProfile.json b/Tests/SampleFiles/Get-VSTeamProfile.json new file mode 100644 index 000000000..430bdda32 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamProfile.json @@ -0,0 +1,23 @@ +[ + { + "Name": "http://localhost:8080/tfs/defaultcollection", + "URL": "http://localhost:8080/tfs/defaultcollection", + "Pat": "", + "Type": "OnPremise", + "Version": "TFS2017" + }, + { + "Name": "http://192.168.1.3:8080/tfs/defaultcollection", + "URL": "http://192.168.1.3:8080/tfs/defaultcollection", + "Pat": "OnE2cXpseHk0YXp3dHpz", + "Type": "Pat", + "Version": "TFS2017" + }, + { + "Name": "test", + "URL": "https://dev.azure.com/test", + "Pat": "OndrejR0ZHpwbDM3bXUycGt5c3hm", + "Type": "Pat", + "Version": "VSTS" + } +] \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamProject-NamePeopleTracker.json b/Tests/SampleFiles/Get-VSTeamProject-NamePeopleTracker.json new file mode 100644 index 000000000..cc6b5143d --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamProject-NamePeopleTracker.json @@ -0,0 +1,25 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "_links": { + "self": { + "href": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000" + }, + "collection": { + "href": "https://dev.azure.com/Test/_apis/projectCollections/00000000-0000-0000-0000-000000000000" + }, + "web": { + "href": "https://dev.azure.com/Test/PeopleTracker" + } + }, + "visibility": "private", + "defaultTeam": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker Team", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000/teams/00000000-0000-0000-0000-000000000000" + }, + "lastUpdateTime": "2019-09-25T20:47:14.247Z" +} diff --git a/Tests/SampleFiles/Get-VSTeamProject.json b/Tests/SampleFiles/Get-VSTeamProject.json new file mode 100644 index 000000000..3e875dbe1 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamProject.json @@ -0,0 +1,24 @@ +{ + "count": 2, + "value": [ + { + "id": "00000000-0000-0000-0000-000000000001", + "name": "Voting-App", + "description": "Vote App", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000001", + "state": "wellFormed", + "revision": 159, + "visibility": "private", + "lastUpdateTime": "2020-05-19T00:02:23.517Z" + }, + { + "id": "00000000-0000-0000-0000-000000000002", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000002", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamPullRequest-Id_17.json b/Tests/SampleFiles/Get-VSTeamPullRequest-Id_17.json new file mode 100644 index 000000000..1d5a5168c --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamPullRequest-Id_17.json @@ -0,0 +1,138 @@ +{ + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "size": 24647257, + "remoteUrl": "https://Test@dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "sshUrl": "git@ssh.dev.azure.com:v3/Test/PeopleTracker/PeopleTracker", + "webUrl": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker" + }, + "pullRequestId": 17, + "codeReviewId": 17, + "status": "active", + "createdBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "creationDate": "2020-09-07T23:40:35.9822431Z", + "title": "Updated README.md", + "description": "Updated README.md", + "sourceRefName": "refs/heads/patch", + "targetRefName": "refs/heads/master", + "mergeStatus": "succeeded", + "isDraft": false, + "mergeId": "00000000-0000-0000-0000-000000000000", + "lastMergeSourceCommit": { + "commitId": "c8262543095d0d443b5bcaff27201ef01314d4ff", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/c8262543095d0d443b5bcaff27201ef01314d4ff" + }, + "lastMergeTargetCommit": { + "commitId": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/4aed57b05fb1840a916ed7aca0d2b81784b916be" + }, + "lastMergeCommit": { + "commitId": "6421952a41c5d7273b73e8d867b52e9f36cd32fd", + "author": { + "name": "Donovan Brown", + "email": "Test@test.com", + "date": "2020-09-07T23:40:36Z" + }, + "committer": { + "name": "Donovan Brown", + "email": "Test@test.com", + "date": "2020-09-07T23:40:36Z" + }, + "comment": "Merge pull request 17 from patch into master", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/6421952a41c5d7273b73e8d867b52e9f36cd32fd" + }, + "reviewers": [ + { + "reviewerUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests/17/reviewers/00000000-0000-0000-0000-000000000000", + "vote": 0, + "hasDeclined": false, + "isRequired": true, + "isFlagged": false, + "displayName": "Damian Brady", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000" + }, + { + "reviewerUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests/17/reviewers/00000000-0000-0000-0000-000000000000", + "vote": 0, + "hasDeclined": false, + "isRequired": true, + "isFlagged": false, + "displayName": "Abel Wang", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000" + }, + { + "reviewerUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests/17/reviewers/00000000-0000-0000-0000-000000000000", + "vote": 0, + "hasDeclined": false, + "isFlagged": false, + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000" + }, + { + "reviewerUrl": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests/17/reviewers/00000000-0000-0000-0000-000000000000", + "vote": 0, + "hasDeclined": false, + "isFlagged": false, + "displayName": "Jessica Deen", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests/17", + "supportsIterations": true, + "artifactId": "vstfs:///Git/PullRequestId/00000000-0000-0000-0000-000000000000%00000000-0000-0000-0000-000000000000%2f17" +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamPullRequest.json b/Tests/SampleFiles/Get-VSTeamPullRequest.json new file mode 100644 index 000000000..dabb34a17 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamPullRequest.json @@ -0,0 +1,166 @@ +{ + "value": [ + { + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "state": "unchanged", + "visibility": "unchanged", + "lastUpdateTime": "0001-01-01T00:00:00" + } + }, + "pullRequestId": 17, + "codeReviewId": 17, + "status": "active", + "createdBy": { + "displayName": "Test User", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "creationDate": "2020-09-07T23:40:35.9822431Z", + "title": "Updated README.md", + "description": "Updated README.md", + "sourceRefName": "refs/heads/patch", + "targetRefName": "refs/heads/master", + "mergeStatus": "succeeded", + "isDraft": false, + "mergeId": "00000000-0000-0000-0000-000000000000", + "lastMergeSourceCommit": { + "commitId": "c8262543095d0d443b5bcaff27201ef01314d4ff", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/c8262543095d0d443b5bcaff27201ef01314d4ff" + }, + "lastMergeTargetCommit": { + "commitId": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/4aed57b05fb1840a916ed7aca0d2b81784b916be" + }, + "lastMergeCommit": { + "commitId": "6421952a41c5d7273b73e8d867b52e9f36cd32fd", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/6421952a41c5d7273b73e8d867b52e9f36cd32fd" + }, + "reviewers": [ + { + "vote": 0 + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests/17", + "supportsIterations": true + }, + { + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "state": "unchanged", + "visibility": "unchanged", + "lastUpdateTime": "0001-01-01T00:00:00" + } + }, + "pullRequestId": 15, + "codeReviewId": 15, + "status": "active", + "createdBy": { + "displayName": "Test User", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "creationDate": "2019-05-17T15:41:23.2051842Z", + "title": "Set up CI with Azure Pipelines", + "sourceRefName": "refs/heads/azure-pipelines1", + "targetRefName": "refs/heads/master", + "mergeStatus": "succeeded", + "isDraft": false, + "mergeId": "00000000-0000-0000-0000-000000000000", + "lastMergeSourceCommit": { + "commitId": "8001e2d24173b4dc7362144c15595b9d339faa08", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/8001e2d24173b4dc7362144c15595b9d339faa08" + }, + "lastMergeTargetCommit": { + "commitId": "7b368f65c8e4762d3a4841b1b6914fba7c78acab", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/7b368f65c8e4762d3a4841b1b6914fba7c78acab" + }, + "lastMergeCommit": { + "commitId": "1b7df84651e9b3e554e395b3e43ef1212b9560cf", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/1b7df84651e9b3e554e395b3e43ef1212b9560cf" + }, + "reviewers": [], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests/15", + "supportsIterations": true + }, + { + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000", + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "state": "unchanged", + "visibility": "unchanged", + "lastUpdateTime": "0001-01-01T00:00:00" + } + }, + "pullRequestId": 14, + "codeReviewId": 14, + "status": "active", + "createdBy": { + "displayName": "Test User", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "creationDate": "2019-05-17T14:44:07.8713427Z", + "title": "Set up CI with Azure Pipelines", + "sourceRefName": "refs/heads/azure-pipelines", + "targetRefName": "refs/heads/master", + "mergeStatus": "succeeded", + "isDraft": false, + "mergeId": "00000000-0000-0000-0000-000000000000", + "lastMergeSourceCommit": { + "commitId": "bc99ff1767f4fe6226fc55858d14a23d36a25ebc", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/bc99ff1767f4fe6226fc55858d14a23d36a25ebc" + }, + "lastMergeTargetCommit": { + "commitId": "7b368f65c8e4762d3a4841b1b6914fba7c78acab", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/7b368f65c8e4762d3a4841b1b6914fba7c78acab" + }, + "lastMergeCommit": { + "commitId": "963499bbd664b44d29e2a3f6377faa0a4cd474c7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/963499bbd664b44d29e2a3f6377faa0a4cd474c7" + }, + "reviewers": [], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/pullRequests/14", + "supportsIterations": true + } + ], + "count": 3 +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamQuery.json b/Tests/SampleFiles/Get-VSTeamQuery.json new file mode 100644 index 000000000..822ffb693 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamQuery.json @@ -0,0 +1,221 @@ +{ + "count": 2, + "value": [ + { + "id": "10000000-1000-1000-1000-100000000000", + "name": "Shared Queries", + "path": "Shared Queries", + "createdDate": "2019-04-19T23:29:53.37Z", + "lastModifiedBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastModifiedDate": "2019-04-19T23:29:53.37Z", + "isFolder": true, + "hasChildren": false, + "isPublic": true, + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + }, + "html": { + "href": "https://dev.azure.com/BlackShirt/web/qr.aspx?pguid=00000000-0000-0000-0000-000000000000&qid=00000000-0000-0000-0000-000000000000" + } + }, + "url": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + }, + { + "id": "20000000-2000-2000-2000-200000000000", + "name": "My Queries", + "path": "My Queries", + "createdBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "createdDate": "2019-04-19T23:29:53.55Z", + "lastModifiedBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastModifiedDate": "2019-04-19T23:29:53.55Z", + "isFolder": true, + "hasChildren": true, + "children": [ + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Followed work items", + "path": "My Queries/Followed work items", + "createdBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "createdDate": "2019-04-19T23:29:53.77Z", + "lastModifiedBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastModifiedDate": "2019-04-19T23:29:53.77Z", + "queryType": "flat", + "isPublic": false, + "lastExecutedBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastExecutedDate": "2020-05-24T01:10:28.893Z", + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + }, + "html": { + "href": "https://dev.azure.com/BlackShirt/web/qr.aspx?pguid=00000000-0000-0000-0000-000000000000&qid=00000000-0000-0000-0000-000000000000" + }, + "parent": { + "href": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + }, + "wiql": { + "href": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/wiql/00000000-0000-0000-0000-000000000000" + } + }, + "url": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Assigned to me", + "path": "My Queries/Assigned to me", + "createdBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "createdDate": "2019-04-19T23:29:53.58Z", + "lastModifiedBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastModifiedDate": "2019-04-19T23:29:53.58Z", + "queryType": "flat", + "isPublic": false, + "lastExecutedBy": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Donovan Brown ", + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "uniqueName": "fabrikamfiber3@hotmail.com", + "imageUrl": "https://dev.azure.com/BlackShirt/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastExecutedDate": "2020-05-24T01:10:38.863Z", + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + }, + "html": { + "href": "https://dev.azure.com/BlackShirt/web/qr.aspx?pguid=00000000-0000-0000-0000-000000000000&qid=00000000-0000-0000-0000-000000000000" + }, + "parent": { + "href": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + }, + "wiql": { + "href": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/wiql/00000000-0000-0000-0000-000000000000" + } + }, + "url": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + } + ], + "isPublic": false, + "_links": { + "self": { + "href": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + }, + "html": { + "href": "https://dev.azure.com/BlackShirt/web/qr.aspx?pguid=00000000-0000-0000-0000-000000000000&qid=00000000-0000-0000-0000-000000000000" + } + }, + "url": "https://dev.azure.com/BlackShirt/00000000-0000-0000-0000-000000000000/_apis/wit/queries/00000000-0000-0000-0000-000000000000" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamQueue.json b/Tests/SampleFiles/Get-VSTeamQueue.json new file mode 100644 index 000000000..e11ced5dc --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamQueue.json @@ -0,0 +1,170 @@ +{ + "count": 11, + "value": [ + { + "id": 81, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Default", + "pool": { + "id": 1, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "DefaultPool", + "isHosted": false, + "poolType": "automation", + "size": 4, + "isLegacy": false, + "options": "none" + } + }, + { + "id": 82, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Hosted", + "pool": { + "id": 2, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + } + }, + { + "id": 83, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Hosted VS2017", + "pool": { + "id": 4, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted VS2017", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + } + }, + { + "id": 84, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Windows Container", + "pool": { + "id": 5, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Windows Container", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + } + }, + { + "id": 85, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Hosted macOS", + "pool": { + "id": 6, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted macOS", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + } + }, + { + "id": 86, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Ubuntu 1604", + "pool": { + "id": 7, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Ubuntu 1604", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + } + }, + { + "id": 87, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Windows 2019 with VS2019", + "pool": { + "id": 9, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted Windows 2019 with VS2019", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + } + }, + { + "id": 88, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Private Ubuntu 1604", + "pool": { + "id": 11, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Private Ubuntu 1604", + "isHosted": false, + "poolType": "automation", + "size": 1, + "isLegacy": false, + "options": "none" + } + }, + { + "id": 89, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Private macOS", + "pool": { + "id": 12, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Private macOS", + "isHosted": false, + "poolType": "automation", + "size": 1, + "isLegacy": false, + "options": "none" + } + }, + { + "id": 95, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Hosted macOS High Sierra", + "pool": { + "id": 13, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Hosted macOS High Sierra", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": true, + "options": "none" + } + }, + { + "id": 98, + "projectId": "00000000-0000-0000-0000-000000000000", + "name": "Azure Pipelines", + "pool": { + "id": 14, + "scope": "00000000-0000-0000-0000-000000000000", + "name": "Azure Pipelines", + "isHosted": true, + "poolType": "automation", + "size": 15, + "isLegacy": false, + "options": "none" + } + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamRelease-id178-expandEnvironments.json b/Tests/SampleFiles/Get-VSTeamRelease-id178-expandEnvironments.json new file mode 100644 index 000000000..509a59c43 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamRelease-id178-expandEnvironments.json @@ -0,0 +1,11183 @@ +{ + "id": 178, + "name": "Release-132", + "status": "active", + "createdOn": "2019-07-13T15:49:31.86Z", + "modifiedOn": "2019-07-13T15:49:31.86Z", + "modifiedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "createdBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "createdFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "environments": [ + { + "id": 2149, + "releaseId": 178, + "name": "Dev Common Infra", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "dev" + }, + "resourceGroupName": { + "value": "PTracker-Dev" + }, + "TestWebAppUrl": { + "value": "http://peopletracker.us/" + }, + "dnsRecordName": { + "value": "@" + } + }, + "type": "Vsts", + "id": 1, + "name": "PTracker Dev", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3577, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T15:49:32.673Z", + "modifiedOn": "2019-07-13T15:49:32.68Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2149, + "name": "Dev Common Infra", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2149", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3577" + } + ], + "postDeployApprovals": [ + { + "id": 3579, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T15:51:19.327Z", + "modifiedOn": "2019-07-13T15:51:19.333Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2149, + "name": "Dev Common Infra", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2149", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3579" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3578, + "deploymentId": 1243, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1237, + "phaseId": "1237", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T15:49:39.24Z", + "dateEnded": "2019-07-13T15:51:16.927Z", + "startTime": "2019-07-13T15:49:39.24Z", + "finishTime": "2019-07-13T15:51:16.927Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2149/deployPhases/1237/tasks/7/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T15:49:39.437Z", + "dateEnded": "2019-07-13T15:49:40.55Z", + "startTime": "2019-07-13T15:49:39.437Z", + "finishTime": "2019-07-13T15:49:40.55Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2149/deployPhases/1237/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T15:49:40.563Z", + "dateEnded": "2019-07-13T15:49:43.823Z", + "startTime": "2019-07-13T15:49:40.563Z", + "finishTime": "2019-07-13T15:49:43.823Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2149/deployPhases/1237/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy Infra for BER", + "dateStarted": "2019-07-13T15:49:43.827Z", + "dateEnded": "2019-07-13T15:51:16.86Z", + "startTime": "2019-07-13T15:49:43.827Z", + "finishTime": "2019-07-13T15:51:16.86Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2149/deployPhases/1237/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T15:51:16.867Z", + "dateEnded": "2019-07-13T15:51:16.923Z", + "startTime": "2019-07-13T15:51:16.867Z", + "finishTime": "2019-07-13T15:51:16.923Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 4, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2149/deployPhases/1237/tasks/6/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T15:49:36.677Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T15:49:32.03Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T15:51:19.34Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 1, + "definitionEnvironmentId": 10, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "ReleaseStarted", + "conditionType": "event", + "value": "" + } + ], + "createdOn": "2019-07-13T15:49:32.03Z", + "modifiedOn": "2019-07-13T15:51:19.333Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Deploy Infra for BER", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "filePath", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/deployCommon.ps1", + "arguments": "-resourceGroupName $(commonResourceGroupName) -adminlogin $(dblogin) -password $(dbpassword) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -goDaddyKey $(GoDaddyKey) -goDaddySecret $(GoDaddySecret) -subscriptionid $(subscriptionid) -tenatId $(tenatId) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "true", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/iac" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "ReleaseStarted", + "timeToDeploy": 1.7761666666666667, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2150, + "releaseId": 178, + "name": "Dev Infra", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "dev" + }, + "resourceGroupName": { + "value": "PTracker-Dev" + }, + "TestWebAppUrl": { + "value": "http://peopletracker.us/" + }, + "dnsRecordName": { + "value": "@" + } + }, + "type": "Vsts", + "id": 1, + "name": "PTracker Dev", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3575, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T15:49:32.573Z", + "modifiedOn": "2019-07-13T15:49:32.58Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2150, + "name": "Dev Infra", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2150", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3575" + } + ], + "postDeployApprovals": [ + { + "id": 3582, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T15:51:40.483Z", + "modifiedOn": "2019-07-13T15:51:40.49Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2150, + "name": "Dev Infra", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2150", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3582" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3576, + "deploymentId": 1244, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1236, + "phaseId": "1236", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T15:49:38.793Z", + "dateEnded": "2019-07-13T15:51:38.48Z", + "startTime": "2019-07-13T15:49:38.793Z", + "finishTime": "2019-07-13T15:51:38.48Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2150/deployPhases/1236/tasks/7/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T15:49:38.993Z", + "dateEnded": "2019-07-13T15:49:39.97Z", + "startTime": "2019-07-13T15:49:38.993Z", + "finishTime": "2019-07-13T15:49:39.97Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2150/deployPhases/1236/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T15:49:39.98Z", + "dateEnded": "2019-07-13T15:49:42.233Z", + "startTime": "2019-07-13T15:49:39.98Z", + "finishTime": "2019-07-13T15:49:42.233Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2150/deployPhases/1236/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy Infra", + "dateStarted": "2019-07-13T15:49:42.233Z", + "dateEnded": "2019-07-13T15:51:38.39Z", + "startTime": "2019-07-13T15:49:42.233Z", + "finishTime": "2019-07-13T15:51:38.39Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2150/deployPhases/1236/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T15:51:38.397Z", + "dateEnded": "2019-07-13T15:51:38.473Z", + "startTime": "2019-07-13T15:51:38.397Z", + "finishTime": "2019-07-13T15:51:38.473Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 4, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2150/deployPhases/1236/tasks/6/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T15:49:36.387Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T15:49:32.05Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T15:51:40.5Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 2, + "definitionEnvironmentId": 2, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "ReleaseStarted", + "conditionType": "event", + "value": "" + } + ], + "createdOn": "2019-07-13T15:49:32.05Z", + "modifiedOn": "2019-07-13T15:51:40.49Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Deploy Infra", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "filePath", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/deploy.ps1", + "arguments": "-resourceGroupName $(resourceGroupName) -adminlogin $(dblogin) -password $(dbpassword) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -stage $(deploymentName) -subscriptionid $(subscriptionid) -tenatId $(tenatId) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "true", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/iac" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "ReleaseStarted", + "timeToDeploy": 2.1307833333333335, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2151, + "releaseId": 178, + "name": "Dev BER", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "dev" + }, + "resourceGroupName": { + "value": "PTracker-Dev" + }, + "TestWebAppUrl": { + "value": "http://peopletracker.us/" + }, + "dnsRecordName": { + "value": "@" + } + }, + "type": "Vsts", + "id": 1, + "name": "PTracker Dev", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3580, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T15:51:19.587Z", + "modifiedOn": "2019-07-13T15:51:19.593Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2151, + "name": "Dev BER", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3580" + } + ], + "postDeployApprovals": [ + { + "id": 3590, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T15:52:22.3Z", + "modifiedOn": "2019-07-13T15:52:22.303Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2151, + "name": "Dev BER", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3590" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3581, + "deploymentId": 1245, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1238, + "phaseId": "1238", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T15:51:25.743Z", + "dateEnded": "2019-07-13T15:52:20.273Z", + "startTime": "2019-07-13T15:51:25.743Z", + "finishTime": "2019-07-13T15:52:20.273Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151/deployPhases/1238/tasks/9/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T15:51:25.947Z", + "dateEnded": "2019-07-13T15:51:26.437Z", + "startTime": "2019-07-13T15:51:25.947Z", + "finishTime": "2019-07-13T15:51:26.437Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151/deployPhases/1238/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - ber", + "dateStarted": "2019-07-13T15:51:26.447Z", + "dateEnded": "2019-07-13T15:51:28.45Z", + "startTime": "2019-07-13T15:51:26.447Z", + "finishTime": "2019-07-13T15:51:28.45Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151/deployPhases/1238/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T15:51:28.45Z", + "dateEnded": "2019-07-13T15:51:31.427Z", + "startTime": "2019-07-13T15:51:28.45Z", + "finishTime": "2019-07-13T15:51:31.427Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151/deployPhases/1238/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T15:51:31.427Z", + "dateEnded": "2019-07-13T15:51:40.337Z", + "startTime": "2019-07-13T15:51:31.427Z", + "finishTime": "2019-07-13T15:51:40.337Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151/deployPhases/1238/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Azure App Service Deploy: BER", + "dateStarted": "2019-07-13T15:51:40.337Z", + "dateEnded": "2019-07-13T15:52:20.187Z", + "startTime": "2019-07-13T15:51:40.337Z", + "finishTime": "2019-07-13T15:52:20.187Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AzureRmWebAppDeployment", + "version": "4.3.36" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151/deployPhases/1238/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T15:52:20.193Z", + "dateEnded": "2019-07-13T15:52:20.267Z", + "startTime": "2019-07-13T15:52:20.193Z", + "finishTime": "2019-07-13T15:52:20.267Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 6, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2151/deployPhases/1238/tasks/8/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T15:51:23.58Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T15:51:19.377Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T15:52:22.313Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 3, + "definitionEnvironmentId": 11, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Dev Common Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T15:51:19.377Z", + "modifiedOn": "2019-07-13T15:52:22.303Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "ber/**", + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionid)\n\n$appServiceName = az webapp list --resource-group $(commonResourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=appServiceName]$appServiceName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "4.*", + "name": "Azure App Service Deploy: BER", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectionType": "AzureRM", + "ConnectedServiceName": "$(subscriptionConnection)", + "PublishProfilePath": "$(System.DefaultWorkingDirectory)/**/*.pubxml", + "PublishProfilePassword": "", + "WebAppKind": "webApp", + "WebAppName": "$(appServiceName)", + "DeployToSlotOrASEFlag": "false", + "ResourceGroupName": "", + "SlotName": "production", + "DockerNamespace": "", + "DockerRepository": "", + "DockerImageTag": "", + "VirtualApplication": "", + "Package": "$(System.DefaultWorkingDirectory)/**/*.zip", + "RuntimeStack": "", + "RuntimeStackFunction": "", + "StartupCommand": "", + "ScriptType": "", + "InlineScript": ":: You can provide your deployment commands here. One command per line.", + "ScriptPath": "", + "WebConfigParameters": "", + "AppSettings": "-Tokens:Audience http://ber.peopletracker.us -Tokens:Issuer http://ber.peopletracker.us -Tokens:Mobile PeopleTracker.Mobile -Tokens:Web PeopleTracker.Web -Tokens:Key $(JWTTokenKey)", + "ConfigurationSettings": "", + "UseWebDeploy": "false", + "DeploymentType": "webDeploy", + "TakeAppOfflineFlag": "true", + "SetParametersFile": "", + "RemoveAdditionalFilesFlag": "false", + "ExcludeFilesFromAppDataFlag": "true", + "AdditionalArguments": "-retryAttempts:6 -retryInterval:10000", + "RenameFilesFlag": "true", + "XmlTransformation": "false", + "XmlVariableSubstitution": "false", + "JSONFiles": "" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Dev Common Infra", + "timeToDeploy": 1.0439333333333334, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2152, + "releaseId": 178, + "name": "Dev Web Service", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "dev" + }, + "resourceGroupName": { + "value": "PTracker-Dev" + }, + "TestWebAppUrl": { + "value": "http://peopletracker.us/" + }, + "dnsRecordName": { + "value": "@" + } + }, + "type": "Vsts", + "id": 1, + "name": "PTracker Dev", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3583, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T15:51:40.67Z", + "modifiedOn": "2019-07-13T15:51:40.677Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2152, + "name": "Dev Web Service", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3583" + } + ], + "postDeployApprovals": [ + { + "id": 3592, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T15:54:11.577Z", + "modifiedOn": "2019-07-13T15:54:11.583Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2152, + "name": "Dev Web Service", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3592" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3584, + "deploymentId": 1246, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1239, + "phaseId": "1239", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T15:51:47.493Z", + "dateEnded": "2019-07-13T15:54:09.433Z", + "startTime": "2019-07-13T15:51:47.493Z", + "finishTime": "2019-07-13T15:54:09.433Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/11/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T15:51:47.693Z", + "dateEnded": "2019-07-13T15:51:48.617Z", + "startTime": "2019-07-13T15:51:47.693Z", + "finishTime": "2019-07-13T15:51:48.617Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - win", + "dateStarted": "2019-07-13T15:51:48.627Z", + "dateEnded": "2019-07-13T15:51:52.037Z", + "startTime": "2019-07-13T15:51:48.627Z", + "finishTime": "2019-07-13T15:51:52.037Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T15:51:52.037Z", + "dateEnded": "2019-07-13T15:51:53.927Z", + "startTime": "2019-07-13T15:51:52.037Z", + "finishTime": "2019-07-13T15:51:53.927Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - mobile", + "dateStarted": "2019-07-13T15:51:53.93Z", + "dateEnded": "2019-07-13T15:51:57.793Z", + "startTime": "2019-07-13T15:51:53.93Z", + "finishTime": "2019-07-13T15:51:57.793Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T15:51:57.793Z", + "dateEnded": "2019-07-13T15:52:05.6Z", + "startTime": "2019-07-13T15:51:57.793Z", + "finishTime": "2019-07-13T15:52:05.6Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy to Staging Slot", + "dateStarted": "2019-07-13T15:52:05.6Z", + "dateEnded": "2019-07-13T15:52:27.283Z", + "startTime": "2019-07-13T15:52:05.6Z", + "finishTime": "2019-07-13T15:52:27.283Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AzureRmWebAppDeployment", + "version": "4.3.36" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Swap Slots", + "dateStarted": "2019-07-13T15:52:27.283Z", + "dateEnded": "2019-07-13T15:54:09.417Z", + "startTime": "2019-07-13T15:52:27.283Z", + "finishTime": "2019-07-13T15:54:09.417Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AzureAppServiceManage", + "version": "0.2.55" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T15:54:09.423Z", + "dateEnded": "2019-07-13T15:54:09.427Z", + "startTime": "2019-07-13T15:54:09.423Z", + "finishTime": "2019-07-13T15:54:09.427Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 8, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2152/deployPhases/1239/tasks/10/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T15:51:45.5Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T15:51:40.53Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T15:54:11.593Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 4, + "definitionEnvironmentId": 4, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Dev Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T15:51:40.53Z", + "modifiedOn": "2019-07-13T15:54:11.583Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "win/**", + "iac/**", + "mobile/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionid)\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "4.*", + "name": "Deploy to Staging Slot", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectionType": "AzureRM", + "ConnectedServiceName": "$(subscriptionConnection)", + "PublishProfilePath": "$(System.DefaultWorkingDirectory)/**/*.pubxml", + "PublishProfilePassword": "", + "WebAppKind": "webApp", + "WebAppName": "$(webSiteName)", + "DeployToSlotOrASEFlag": "true", + "ResourceGroupName": "$(resourceGroupName)", + "SlotName": "stage", + "DockerNamespace": "", + "DockerRepository": "", + "DockerImageTag": "", + "VirtualApplication": "", + "Package": "$(System.DefaultWorkingDirectory)/artifact/win/PeopleTracker.NetService.zip", + "RuntimeStack": "", + "RuntimeStackFunction": "", + "StartupCommand": "", + "ScriptType": "", + "InlineScript": ":: You can provide your deployment commands here. One command per line.", + "ScriptPath": "", + "WebConfigParameters": "", + "AppSettings": "", + "ConfigurationSettings": "", + "UseWebDeploy": "true", + "DeploymentType": "webDeploy", + "TakeAppOfflineFlag": "false", + "SetParametersFile": "", + "RemoveAdditionalFilesFlag": "true", + "ExcludeFilesFromAppDataFlag": "true", + "AdditionalArguments": "-retryAttempts:6 -retryInterval:10000", + "RenameFilesFlag": "true", + "XmlTransformation": "false", + "XmlVariableSubstitution": "false", + "JSONFiles": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "Swap Slots", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectedServiceName": "$(subscriptionConnection)", + "Action": "Swap Slots", + "WebAppName": "$(webSiteName)", + "SpecifySlot": "false", + "ResourceGroupName": "$(resourceGroupName)", + "SourceSlot": "stage", + "SwapWithProduction": "true", + "TargetSlot": "", + "PreserveVnet": "false", + "Slot": "production", + "ExtensionsList": "", + "OutputVariable": "", + "AppInsightsResourceGroupName": "", + "ApplicationInsightsResourceName": "", + "ApplicationInsightsWebTestName": "" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Dev Infra", + "timeToDeploy": 2.5135, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2153, + "releaseId": 178, + "name": "Dev Database", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "dev" + }, + "resourceGroupName": { + "value": "PTracker-Dev" + }, + "TestWebAppUrl": { + "value": "http://peopletracker.us/" + }, + "dnsRecordName": { + "value": "@" + } + }, + "type": "Vsts", + "id": 1, + "name": "PTracker Dev", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3587, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T15:51:40.777Z", + "modifiedOn": "2019-07-13T15:51:40.783Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2153, + "name": "Dev Database", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2153", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3587" + } + ], + "postDeployApprovals": [ + { + "id": 3589, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T15:52:22.1Z", + "modifiedOn": "2019-07-13T15:52:22.103Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2153, + "name": "Dev Database", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2153", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3589" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3588, + "deploymentId": 1247, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1241, + "phaseId": "1241", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T15:51:47.663Z", + "dateEnded": "2019-07-13T15:52:19.95Z", + "startTime": "2019-07-13T15:51:47.663Z", + "finishTime": "2019-07-13T15:52:19.95Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service4", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2153/deployPhases/1241/tasks/8/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T15:51:47.867Z", + "dateEnded": "2019-07-13T15:51:48.653Z", + "startTime": "2019-07-13T15:51:47.867Z", + "finishTime": "2019-07-13T15:51:48.653Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service4", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2153/deployPhases/1241/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - win", + "dateStarted": "2019-07-13T15:51:48.667Z", + "dateEnded": "2019-07-13T15:51:52.097Z", + "startTime": "2019-07-13T15:51:48.667Z", + "finishTime": "2019-07-13T15:51:52.097Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service4", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2153/deployPhases/1241/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T15:51:52.097Z", + "dateEnded": "2019-07-13T15:51:59.777Z", + "startTime": "2019-07-13T15:51:52.097Z", + "finishTime": "2019-07-13T15:51:59.777Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service4", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2153/deployPhases/1241/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy DACPAC to Sql Azure", + "dateStarted": "2019-07-13T15:51:59.777Z", + "dateEnded": "2019-07-13T15:52:19.897Z", + "startTime": "2019-07-13T15:51:59.777Z", + "finishTime": "2019-07-13T15:52:19.897Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "SqlAzureDacpacDeployment", + "version": "1.153.0" + }, + "agentName": "WinBldBox-3_Service4", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2153/deployPhases/1241/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T15:52:19.903Z", + "dateEnded": "2019-07-13T15:52:19.943Z", + "startTime": "2019-07-13T15:52:19.903Z", + "finishTime": "2019-07-13T15:52:19.943Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 5, + "issues": [], + "agentName": "WinBldBox-3_Service4", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2153/deployPhases/1241/tasks/7/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T15:51:45.53Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T15:51:40.547Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T15:52:22.117Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 5, + "definitionEnvironmentId": 3, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Dev Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T15:51:40.547Z", + "modifiedOn": "2019-07-13T15:52:22.103Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "win/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionid)\n\n$servername= az sql server list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=servername]$servername\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "1.*", + "name": "Deploy DACPAC to Sql Azure", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectedServiceNameSelector": "ConnectedServiceNameARM", + "ConnectedServiceName": "", + "ConnectedServiceNameARM": "$(subscriptionConnection)", + "AuthenticationType": "server", + "ServerName": "$(servername).database.windows.net", + "DatabaseName": "ptracker", + "SqlUsername": "$(dblogin)", + "SqlPassword": "$(dbpassword)", + "aad.redacted": "", + "ConnectionString": "", + "TaskNameSelector": "DacpacTask", + "DeploymentAction": "Publish", + "DacpacFile": "$(System.DefaultWorkingDirectory)/artifact/win/PeopleTracker.Database.dacpac", + "BacpacFile": "", + "SqlFile": "", + "SqlInline": "", + "PublishProfile": "", + "AdditionalArguments": "/p:BlockOnPossibleDataLoss=False", + "SqlAdditionalArguments": "", + "InlineAdditionalArguments": "", + "IpDetectionMethod": "AutoDetect", + "StartIpAddress": "", + "EndIpAddress": "", + "DeleteFirewallRule": "true" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Dev Infra", + "timeToDeploy": 0.6873333333333334, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2154, + "releaseId": 178, + "name": "Dev K8s", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "dev" + }, + "resourceGroupName": { + "value": "PTracker-Dev" + }, + "TestWebAppUrl": { + "value": "http://peopletracker.us/" + }, + "dnsRecordName": { + "value": "@" + } + }, + "type": "Vsts", + "id": 1, + "name": "PTracker Dev", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3585, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T15:51:40.753Z", + "modifiedOn": "2019-07-13T15:51:40.76Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2154, + "name": "Dev K8s", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3585" + } + ], + "postDeployApprovals": [ + { + "id": 3591, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T15:52:53.19Z", + "modifiedOn": "2019-07-13T15:52:53.193Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2154, + "name": "Dev K8s", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3591" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3586, + "deploymentId": 1248, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1240, + "phaseId": "1240", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 15, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T15:51:48.657Z", + "dateEnded": "2019-07-13T15:52:50.763Z", + "startTime": "2019-07-13T15:51:48.657Z", + "finishTime": "2019-07-13T15:52:50.763Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/15/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T15:51:48.87Z", + "dateEnded": "2019-07-13T15:51:50.797Z", + "startTime": "2019-07-13T15:51:48.87Z", + "finishTime": "2019-07-13T15:51:50.797Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Pre-job: helm init", + "dateStarted": "2019-07-13T15:51:50.827Z", + "dateEnded": "2019-07-13T15:51:51.67Z", + "startTime": "2019-07-13T15:51:50.827Z", + "finishTime": "2019-07-13T15:51:51.67Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Pre-job: helm upgrade", + "dateStarted": "2019-07-13T15:51:51.67Z", + "dateEnded": "2019-07-13T15:51:52.13Z", + "startTime": "2019-07-13T15:51:51.67Z", + "finishTime": "2019-07-13T15:51:52.13Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T15:51:52.13Z", + "dateEnded": "2019-07-13T15:51:54.777Z", + "startTime": "2019-07-13T15:51:52.13Z", + "finishTime": "2019-07-13T15:51:54.777Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T15:51:54.777Z", + "dateEnded": "2019-07-13T15:52:09.44Z", + "startTime": "2019-07-13T15:51:54.777Z", + "finishTime": "2019-07-13T15:52:09.44Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Install Helm 2.10.0", + "dateStarted": "2019-07-13T15:52:09.44Z", + "dateEnded": "2019-07-13T15:52:13.05Z", + "startTime": "2019-07-13T15:52:09.44Z", + "finishTime": "2019-07-13T15:52:13.05Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmInstaller", + "version": "0.154.0" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "helm init", + "dateStarted": "2019-07-13T15:52:13.05Z", + "dateEnded": "2019-07-13T15:52:16.727Z", + "startTime": "2019-07-13T15:52:13.05Z", + "finishTime": "2019-07-13T15:52:16.727Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmDeploy", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "helm upgrade", + "dateStarted": "2019-07-13T15:52:16.727Z", + "dateEnded": "2019-07-13T15:52:31.993Z", + "startTime": "2019-07-13T15:52:16.727Z", + "finishTime": "2019-07-13T15:52:31.993Z", + "status": "succeeded", + "rank": 8, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmDeploy", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/10/logs" + }, + { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Update DNS", + "dateStarted": "2019-07-13T15:52:31.993Z", + "dateEnded": "2019-07-13T15:52:50.243Z", + "startTime": "2019-07-13T15:52:31.993Z", + "finishTime": "2019-07-13T15:52:50.243Z", + "status": "succeeded", + "rank": 9, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/11/logs" + }, + { + "id": 12, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Post-job: helm upgrade", + "dateStarted": "2019-07-13T15:52:50.243Z", + "dateEnded": "2019-07-13T15:52:50.477Z", + "startTime": "2019-07-13T15:52:50.243Z", + "finishTime": "2019-07-13T15:52:50.477Z", + "status": "succeeded", + "rank": 10, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/12/logs" + }, + { + "id": 13, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Post-job: helm init", + "dateStarted": "2019-07-13T15:52:50.477Z", + "dateEnded": "2019-07-13T15:52:50.723Z", + "startTime": "2019-07-13T15:52:50.477Z", + "finishTime": "2019-07-13T15:52:50.723Z", + "status": "succeeded", + "rank": 11, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/13/logs" + }, + { + "id": 14, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T15:52:50.727Z", + "dateEnded": "2019-07-13T15:52:50.76Z", + "startTime": "2019-07-13T15:52:50.727Z", + "finishTime": "2019-07-13T15:52:50.76Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 12, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2154/deployPhases/1240/tasks/14/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T15:51:45.6Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T15:51:40.563Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T15:52:53.203Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 6, + "definitionEnvironmentId": 5, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Dev Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T15:51:40.563Z", + "modifiedOn": "2019-07-13T15:52:53.193Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionid)\n\n$repository= az acr list --resource-group $(commonResourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=repository]$repository\"\n\n$cluster = az aks list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=cluster]$cluster\"\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "Install Helm 2.10.0", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "helmVersion": "2.10.0", + "checkLatestHelmVersion": "true", + "installKubeCtl": "true", + "kubectlVersion": "1.8.9", + "checkLatestKubeCtl": "true" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "helm init", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectionType": "Azure Resource Manager", + "azureSubscriptionEndpoint": "$(subscriptionConnection)", + "azureResourceGroup": "$(resourceGroupName)", + "kubernetesCluster": "$(cluster)", + "kubernetesServiceEndpoint": "", + "namespace": "", + "command": "init", + "chartType": "Name", + "chartName": "", + "chartPath": "", + "version": "", + "releaseName": "", + "overrideValues": "", + "valueFile": "", + "destination": "$(Build.ArtifactStagingDirectory)", + "canaryimage": "false", + "upgradetiller": "true", + "updatedependency": "false", + "save": "true", + "install": "true", + "recreate": "false", + "resetValues": "false", + "force": "false", + "waitForExecution": "true", + "arguments": "--service-account tiller", + "enableTls": "false", + "caCert": "", + "certificate": "", + "privatekey": "", + "tillernamespace": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "helm upgrade", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectionType": "Azure Resource Manager", + "azureSubscriptionEndpoint": "$(subscriptionConnection)", + "azureResourceGroup": "$(resourceGroupName)", + "kubernetesCluster": "$(cluster)", + "kubernetesServiceEndpoint": "", + "namespace": "", + "command": "upgrade", + "chartType": "FilePath", + "chartName": "", + "chartPath": "$(System.DefaultWorkingDirectory)/artifact/iac/$(chart)", + "version": "", + "releaseName": "$(deploymentName)", + "overrideValues": "image.tag=$(Build.BuildId),service.url=\"http://$(webSiteName).azurewebsites.net\",image.repository=\"$(repository).azurecr.io/peopletracker\"", + "valueFile": "", + "destination": "$(Build.ArtifactStagingDirectory)", + "canaryimage": "false", + "upgradetiller": "true", + "updatedependency": "false", + "save": "true", + "install": "true", + "recreate": "false", + "resetValues": "false", + "force": "false", + "waitForExecution": "true", + "arguments": "", + "enableTls": "false", + "caCert": "", + "certificate": "", + "privatekey": "", + "tillernamespace": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Update DNS", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "filePath", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/updatedns.ps1", + "arguments": "-resourceGroupName $(resourceGroupName) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -goDaddyKey $(GoDaddyKey) -goDaddySecret $(GoDaddySecret) -deploymentName $(deploymentName) -name '$(dnsRecordName)' -subscriptionid $(subscriptionid) -tenatId $(tenatId) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/iac" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Dev Infra", + "timeToDeploy": 1.2057833333333334, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": { + "isEnabled": false, + "timeout": 1440, + "samplingInterval": 15, + "stabilizationTime": 5, + "minimumSuccessDuration": 0 + }, + "gates": [] + } + }, + { + "id": 2155, + "releaseId": 178, + "name": "Dev Mobile", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "dev" + }, + "resourceGroupName": { + "value": "PTracker-Dev" + }, + "TestWebAppUrl": { + "value": "http://peopletracker.us/" + }, + "dnsRecordName": { + "value": "@" + } + }, + "type": "Vsts", + "id": 1, + "name": "PTracker Dev", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3593, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T15:54:11.77Z", + "modifiedOn": "2019-07-13T15:54:11.777Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2155, + "name": "Dev Mobile", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3593" + } + ], + "postDeployApprovals": [ + { + "id": 3595, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T15:54:57.263Z", + "modifiedOn": "2019-07-13T15:54:57.27Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2155, + "name": "Dev Mobile", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3595" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3594, + "deploymentId": 1249, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1242, + "phaseId": "1242", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T15:54:18.65Z", + "dateEnded": "2019-07-13T15:54:54.957Z", + "startTime": "2019-07-13T15:54:18.65Z", + "finishTime": "2019-07-13T15:54:54.957Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/11/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T15:54:18.827Z", + "dateEnded": "2019-07-13T15:54:19.573Z", + "startTime": "2019-07-13T15:54:18.827Z", + "finishTime": "2019-07-13T15:54:19.573Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T15:54:19.583Z", + "dateEnded": "2019-07-13T15:54:22.647Z", + "startTime": "2019-07-13T15:54:19.583Z", + "finishTime": "2019-07-13T15:54:22.647Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - mobile", + "dateStarted": "2019-07-13T15:54:22.647Z", + "dateEnded": "2019-07-13T15:54:26.633Z", + "startTime": "2019-07-13T15:54:22.647Z", + "finishTime": "2019-07-13T15:54:26.633Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T15:54:26.633Z", + "dateEnded": "2019-07-13T15:54:33.68Z", + "startTime": "2019-07-13T15:54:26.633Z", + "finishTime": "2019-07-13T15:54:33.68Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Update BER", + "dateStarted": "2019-07-13T15:54:33.68Z", + "dateEnded": "2019-07-13T15:54:42.423Z", + "startTime": "2019-07-13T15:54:33.68Z", + "finishTime": "2019-07-13T15:54:42.423Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy Android to Beta Testers", + "dateStarted": "2019-07-13T15:54:42.423Z", + "dateEnded": "2019-07-13T15:54:48.777Z", + "startTime": "2019-07-13T15:54:42.423Z", + "finishTime": "2019-07-13T15:54:48.777Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AppCenterDistribute", + "version": "3.154.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy iOS to Beta Testers", + "dateStarted": "2019-07-13T15:54:48.777Z", + "dateEnded": "2019-07-13T15:54:54.94Z", + "startTime": "2019-07-13T15:54:48.777Z", + "finishTime": "2019-07-13T15:54:54.94Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AppCenterDistribute", + "version": "3.154.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T15:54:54.947Z", + "dateEnded": "2019-07-13T15:54:54.953Z", + "startTime": "2019-07-13T15:54:54.947Z", + "finishTime": "2019-07-13T15:54:54.953Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 8, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2155/deployPhases/1242/tasks/10/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T15:54:15.547Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T15:54:11.623Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T15:54:57.28Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 7, + "definitionEnvironmentId": 8, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Dev Database", + "conditionType": "environmentState", + "value": "4" + }, + { + "result": true, + "name": "Dev Web Service", + "conditionType": "environmentState", + "value": "4" + }, + { + "result": true, + "name": "Dev BER", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T15:54:11.623Z", + "modifiedOn": "2019-07-13T15:54:57.27Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "mobile/**", + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionid)\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Update BER", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1", + "arguments": "-value 'http://$(webSiteName).azurewebsites.net'", + "script": "# Read the version from the file passed in by build\n$version = Get-Content .\\version.txt -Raw\n$version = $version.Trim()\n\n\n$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1 -berUrl $(berUrl) -appName $(appName) -dataType $(dataType) -version $version -value 'http://$(webSiteName).azurewebsites.net' -verbose\n\n\n$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1 -berUrl $(berUrl) -appName $(appName) -dataType Env -version $version -value 'Dev' -verbose", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/mobile" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "3.*", + "name": "Deploy Android to Beta Testers", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "serverEndpoint": "00000000-0000-0000-0000-000000000000", + "appSlug": "Trackyon/People-Tracker-Android", + "app": "$(System.DefaultWorkingDirectory)/artifact/mobile/PeopleTracker.Mobile.Droid.apk", + "symbolsType": "Apple", + "symbolsPath": "", + "pdbPath": "**/*.pdb", + "dsymPath": "", + "mappingTxtPath": "", + "packParentFolder": "false", + "releaseNotesSelection": "file", + "releaseNotesInput": "", + "releaseNotesFile": "$(System.DefaultWorkingDirectory)/artifact/mobile/ReleaseNotes.txt", + "isMandatory": "false", + "destinationType": "groups", + "destinationGroupIds": "", + "destinationStoreId": "", + "isSilent": "false" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "3.*", + "name": "Deploy iOS to Beta Testers", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "serverEndpoint": "00000000-0000-0000-0000-000000000000", + "appSlug": "Trackyon/People-Tracker", + "app": "$(System.DefaultWorkingDirectory)/artifact/mobile/PeopleTrackerMobileiOS.ipa", + "symbolsType": "Apple", + "symbolsPath": "", + "pdbPath": "**/*.pdb", + "dsymPath": "", + "mappingTxtPath": "", + "packParentFolder": "false", + "releaseNotesSelection": "file", + "releaseNotesInput": "", + "releaseNotesFile": "$(System.DefaultWorkingDirectory)/artifact/mobile/ReleaseNotes.txt", + "isMandatory": "false", + "destinationType": "groups", + "destinationGroupIds": "", + "destinationStoreId": "", + "isSilent": "false" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Dev Database,Dev Web Service,Dev BER", + "timeToDeploy": 0.7567166666666667, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2156, + "releaseId": 178, + "name": "Dev Testing", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "dev" + }, + "resourceGroupName": { + "value": "PTracker-Dev" + }, + "TestWebAppUrl": { + "value": "http://peopletracker.us/" + }, + "dnsRecordName": { + "value": "@" + } + }, + "type": "Vsts", + "id": 1, + "name": "PTracker Dev", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3596, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T15:54:57.513Z", + "modifiedOn": "2019-07-13T15:54:57.52Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2156, + "name": "Dev Testing", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3596" + } + ], + "postDeployApprovals": [ + { + "id": 3599, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:01:14.363Z", + "modifiedOn": "2019-07-13T16:01:14.38Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 4, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2156, + "name": "Dev Testing", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3599" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3598, + "deploymentId": 1250, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1243, + "phaseId": "1243", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:00:13.677Z", + "dateEnded": "2019-07-13T16:01:11.783Z", + "startTime": "2019-07-13T16:00:13.677Z", + "finishTime": "2019-07-13T16:01:11.783Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/deployPhases/1243/tasks/9/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:00:13.85Z", + "dateEnded": "2019-07-13T16:00:20.71Z", + "startTime": "2019-07-13T16:00:13.85Z", + "finishTime": "2019-07-13T16:00:20.71Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/deployPhases/1243/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - win", + "dateStarted": "2019-07-13T16:00:20.723Z", + "dateEnded": "2019-07-13T16:00:24.3Z", + "startTime": "2019-07-13T16:00:20.723Z", + "finishTime": "2019-07-13T16:00:24.3Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/deployPhases/1243/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - mobile", + "dateStarted": "2019-07-13T16:00:24.303Z", + "dateEnded": "2019-07-13T16:00:27.417Z", + "startTime": "2019-07-13T16:00:24.303Z", + "finishTime": "2019-07-13T16:00:27.417Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/deployPhases/1243/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Run Selenium Tests", + "dateStarted": "2019-07-13T16:00:27.417Z", + "dateEnded": "2019-07-13T16:00:54.527Z", + "startTime": "2019-07-13T16:00:27.417Z", + "finishTime": "2019-07-13T16:00:54.527Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "VSTest", + "version": "2.154.0" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/deployPhases/1243/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Run Mobile Tests", + "dateStarted": "2019-07-13T16:00:54.527Z", + "dateEnded": "2019-07-13T16:01:11.767Z", + "startTime": "2019-07-13T16:00:54.527Z", + "finishTime": "2019-07-13T16:01:11.767Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AppCenterTest", + "version": "1.152.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/deployPhases/1243/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:01:11.773Z", + "dateEnded": "2019-07-13T16:01:11.78Z", + "startTime": "2019-07-13T16:01:11.773Z", + "finishTime": "2019-07-13T16:01:11.78Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 6, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/deployPhases/1243/tasks/8/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:00:10.317Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T15:54:57.317Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:01:14.393Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "preDeploymentGates": { + "id": 3597, + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 0, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Release", + "dateStarted": "2019-07-13T15:59:58.737Z", + "dateEnded": "2019-07-13T16:00:01.053Z", + "startTime": "2019-07-13T15:59:58.737Z", + "finishTime": "2019-07-13T16:00:01.053Z", + "status": "succeeded", + "rank": 2, + "issues": [] + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Invoke REST API: GET", + "dateStarted": "2019-07-13T16:00:00.417Z", + "dateEnded": "2019-07-13T16:00:00.867Z", + "startTime": "2019-07-13T16:00:00.417Z", + "finishTime": "2019-07-13T16:00:00.867Z", + "status": "succeeded", + "rank": null, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "InvokeRESTAPI", + "version": "1.152.1" + }, + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/gates/3597/tasks/3/logs" + } + ] + }, + { + "job": { + "id": 0, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Release", + "dateStarted": "2019-07-13T15:54:58.07Z", + "dateEnded": "2019-07-13T15:55:00.107Z", + "startTime": "2019-07-13T15:54:58.07Z", + "finishTime": "2019-07-13T15:55:00.107Z", + "status": "succeeded", + "rank": 1, + "issues": [] + }, + "tasks": [ + { + "id": 2, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Invoke REST API: GET", + "dateStarted": "2019-07-13T15:54:59.533Z", + "dateEnded": "2019-07-13T15:54:59.927Z", + "startTime": "2019-07-13T15:54:59.533Z", + "finishTime": "2019-07-13T15:54:59.927Z", + "status": "succeeded", + "rank": null, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "InvokeRESTAPI", + "version": "1.152.1" + }, + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2156/gates/3597/tasks/2/logs" + } + ] + } + ], + "startedOn": "2019-07-13T15:54:57.537Z", + "lastModifiedOn": "2019-07-13T16:00:02.45Z", + "stabilizationCompletedOn": "2019-07-13T15:59:58.377Z", + "succeedingSince": "2019-07-13T16:00:01.54Z" + }, + "issues": [] + } + ], + "rank": 8, + "definitionEnvironmentId": 9, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Dev Mobile", + "conditionType": "environmentState", + "value": "4" + }, + { + "result": true, + "name": "Dev K8s", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T15:54:57.317Z", + "modifiedOn": "2019-07-13T16:01:14.38Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "win/**", + "mobile/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Run Selenium Tests", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\*UITests*.dll\n!**\\*TestAdapter.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "TestCategory=UI", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "$(System.DefaultWorkingDirectory)/artifact/win/bvt.runsettings", + "overrideTestrunParameters": "-webAppUrl $(TestWebAppUrl) -browser $(BrowserToUse)", + "pathtoCustomTestAdapters": "", + "runInParallel": "False", + "runTestsInIsolation": "False", + "codeCoverageEnabled": "False", + "otherConsoleOptions": "", + "distributionBatchType": "basedOnTestCases", + "batchingBasedOnAgentsOption": "autoBatchSize", + "customBatchSizeValue": "10", + "batchingBasedOnExecutionTimeOption": "autoBatchSize", + "customRunTimePerBatchValue": "60", + "dontDistribute": "False", + "testRunTitle": "Dev UI", + "platform": "Any CPU", + "configuration": "Release", + "publishRunAttachments": "false", + "diagnosticsEnabled": "True", + "collectDumpOn": "onAbortOnly", + "rerunFailedTests": "true", + "rerunType": "basedOnTestFailurePercentage", + "rerunFailedThreshold": "100", + "rerunFailedTestCasesMaxLimit": "5", + "rerunMaxAttempts": "3" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "1.*", + "name": "Run Mobile Tests", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "app": "$(System.DefaultWorkingDirectory)/artifact/mobile/PeopleTrackerMobileiOS.ipa", + "artifactsDir": "$(Build.ArtifactStagingDirectory)/AppCenterTest\t", + "enablePrepare": "true", + "framework": "uitest", + "appiumBuildDir": "", + "espressoBuildDir": "", + "espressoTestApkPath": "", + "calabashProjectDir": "", + "calabashConfigFile": "", + "calabashProfile": "", + "calabashSkipConfigCheck": "false", + "uitestBuildDir": "$(System.DefaultWorkingDirectory)/artifact/mobile", + "uitestStorePath": "", + "uitestStorePass": "", + "uitestKeyAlias": "", + "uitestKeyPass": "", + "uitestToolsDir": "$(System.DefaultWorkingDirectory)/artifact/mobile", + "signInfo": "", + "xcuitestBuildDir": "", + "xcuitestTestIpaPath": "", + "prepareOpts": "", + "enableRun": "true", + "credsType": "serviceEndpoint", + "serverEndpoint": "00000000-0000-0000-0000-000000000000", + "username": "", + "password": "", + "appSlug": "Trackyon/People-Tracker", + "devices": "Trackyon/peopletrackerios", + "series": "master", + "dsymDir": "", + "locale": "en_US", + "userDefinedLocale": "", + "loginOpts": "", + "runOpts": "", + "async": "true", + "cliLocationOverride": "", + "debug": "true" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Dev Mobile,Dev K8s", + "timeToDeploy": 1.189, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 90, + "gatesOptions": { + "isEnabled": true, + "timeout": 1440, + "samplingInterval": 5, + "stabilizationTime": 5, + "minimumSuccessDuration": 0 + }, + "gates": [ + { + "tasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "1.*", + "name": "Invoke REST API: GET", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectedServiceNameSelector": "connectedServiceName", + "connectedServiceName": "00000000-0000-0000-0000-000000000000", + "connectedServiceNameARM": "", + "method": "GET", + "headers": "{\n}", + "body": "", + "urlSuffix": "", + "waitForCompletion": "false", + "successCriteria": "" + } + } + ] + } + ] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2157, + "releaseId": 178, + "name": "QA Infra", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "qa" + }, + "resourceGroupName": { + "value": "PTracker-QA" + }, + "TestWebAppUrl": { + "value": "http://qa.peopletracker.us/" + }, + "dnsRecordName": { + "value": "qa" + } + }, + "type": "Vsts", + "id": 2, + "name": "PTracker QA", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3600, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:01:14.663Z", + "modifiedOn": "2019-07-13T16:01:14.667Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2157, + "name": "QA Infra", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2157", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3600" + } + ], + "postDeployApprovals": [ + { + "id": 3602, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:10:16.837Z", + "modifiedOn": "2019-07-13T16:10:16.84Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2157, + "name": "QA Infra", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2157", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3602" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3601, + "deploymentId": 1251, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1244, + "phaseId": "1244", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:01:19.03Z", + "dateEnded": "2019-07-13T16:10:14.717Z", + "startTime": "2019-07-13T16:01:19.03Z", + "finishTime": "2019-07-13T16:10:14.717Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2157/deployPhases/1244/tasks/7/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:01:19.223Z", + "dateEnded": "2019-07-13T16:01:19.63Z", + "startTime": "2019-07-13T16:01:19.223Z", + "finishTime": "2019-07-13T16:01:19.63Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2157/deployPhases/1244/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T16:01:19.64Z", + "dateEnded": "2019-07-13T16:01:22.663Z", + "startTime": "2019-07-13T16:01:19.64Z", + "finishTime": "2019-07-13T16:01:22.663Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2157/deployPhases/1244/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy Infra", + "dateStarted": "2019-07-13T16:01:22.663Z", + "dateEnded": "2019-07-13T16:10:14.683Z", + "startTime": "2019-07-13T16:01:22.663Z", + "finishTime": "2019-07-13T16:10:14.683Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2157/deployPhases/1244/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:10:14.687Z", + "dateEnded": "2019-07-13T16:10:14.713Z", + "startTime": "2019-07-13T16:10:14.687Z", + "finishTime": "2019-07-13T16:10:14.713Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 4, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2157/deployPhases/1244/tasks/6/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:01:16.987Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:01:14.483Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:10:16.85Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 9, + "definitionEnvironmentId": 13, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Dev Testing", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:01:14.483Z", + "modifiedOn": "2019-07-13T16:10:16.84Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Deploy Infra", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "filePath", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/deploy.ps1", + "arguments": "-resourceGroupName $(resourceGroupName) -adminlogin $(dblogin) -password $(dbpassword) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -stage $(deploymentName) -subscriptionId $(subscriptionId) -tenatId $(tenatId) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "true", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/iac" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Dev Testing", + "timeToDeploy": 9.034716666666666, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2158, + "releaseId": 178, + "name": "QA Web Service", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "qa" + }, + "resourceGroupName": { + "value": "PTracker-QA" + }, + "TestWebAppUrl": { + "value": "http://qa.peopletracker.us/" + }, + "dnsRecordName": { + "value": "qa" + } + }, + "type": "Vsts", + "id": 2, + "name": "PTracker QA", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3604, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:10:17.187Z", + "modifiedOn": "2019-07-13T16:10:17.19Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2158, + "name": "QA Web Service", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3604" + } + ], + "postDeployApprovals": [ + { + "id": 3611, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:12:44.607Z", + "modifiedOn": "2019-07-13T16:12:44.613Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2158, + "name": "QA Web Service", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3611" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3606, + "deploymentId": 1252, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1246, + "phaseId": "1246", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:10:26.717Z", + "dateEnded": "2019-07-13T16:12:41.93Z", + "startTime": "2019-07-13T16:10:26.717Z", + "finishTime": "2019-07-13T16:12:41.93Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/11/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:10:26.977Z", + "dateEnded": "2019-07-13T16:10:27.633Z", + "startTime": "2019-07-13T16:10:26.977Z", + "finishTime": "2019-07-13T16:10:27.633Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - win", + "dateStarted": "2019-07-13T16:10:27.643Z", + "dateEnded": "2019-07-13T16:10:30.797Z", + "startTime": "2019-07-13T16:10:27.643Z", + "finishTime": "2019-07-13T16:10:30.797Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T16:10:30.797Z", + "dateEnded": "2019-07-13T16:10:32.757Z", + "startTime": "2019-07-13T16:10:30.797Z", + "finishTime": "2019-07-13T16:10:32.757Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - mobile", + "dateStarted": "2019-07-13T16:10:32.757Z", + "dateEnded": "2019-07-13T16:10:36.05Z", + "startTime": "2019-07-13T16:10:32.757Z", + "finishTime": "2019-07-13T16:10:36.05Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T16:10:36.05Z", + "dateEnded": "2019-07-13T16:10:43.413Z", + "startTime": "2019-07-13T16:10:36.05Z", + "finishTime": "2019-07-13T16:10:43.413Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy to Staging Slot", + "dateStarted": "2019-07-13T16:10:43.413Z", + "dateEnded": "2019-07-13T16:11:03.653Z", + "startTime": "2019-07-13T16:10:43.413Z", + "finishTime": "2019-07-13T16:11:03.653Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AzureRmWebAppDeployment", + "version": "4.3.36" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Swap Slots", + "dateStarted": "2019-07-13T16:11:03.653Z", + "dateEnded": "2019-07-13T16:12:41.907Z", + "startTime": "2019-07-13T16:11:03.653Z", + "finishTime": "2019-07-13T16:12:41.907Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AzureAppServiceManage", + "version": "0.2.55" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:12:41.91Z", + "dateEnded": "2019-07-13T16:12:41.927Z", + "startTime": "2019-07-13T16:12:41.91Z", + "finishTime": "2019-07-13T16:12:41.927Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 8, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2158/deployPhases/1246/tasks/10/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:10:23.093Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:10:16.883Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:12:44.623Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 10, + "definitionEnvironmentId": 15, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "QA Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:10:16.883Z", + "modifiedOn": "2019-07-13T16:12:44.613Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "win/**", + "iac/**", + "mobile/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionId)\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "4.*", + "name": "Deploy to Staging Slot", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectionType": "AzureRM", + "ConnectedServiceName": "$(subscriptionConnection)", + "PublishProfilePath": "$(System.DefaultWorkingDirectory)/**/*.pubxml", + "PublishProfilePassword": "", + "WebAppKind": "webApp", + "WebAppName": "$(webSiteName)", + "DeployToSlotOrASEFlag": "true", + "ResourceGroupName": "$(resourceGroupName)", + "SlotName": "stage", + "DockerNamespace": "", + "DockerRepository": "", + "DockerImageTag": "", + "VirtualApplication": "", + "Package": "$(System.DefaultWorkingDirectory)/artifact/win/PeopleTracker.NetService.zip", + "RuntimeStack": "", + "RuntimeStackFunction": "", + "StartupCommand": "", + "ScriptType": "", + "InlineScript": ":: You can provide your deployment commands here. One command per line.", + "ScriptPath": "", + "WebConfigParameters": "", + "AppSettings": "", + "ConfigurationSettings": "", + "UseWebDeploy": "true", + "DeploymentType": "webDeploy", + "TakeAppOfflineFlag": "false", + "SetParametersFile": "", + "RemoveAdditionalFilesFlag": "true", + "ExcludeFilesFromAppDataFlag": "true", + "AdditionalArguments": "-retryAttempts:6 -retryInterval:10000", + "RenameFilesFlag": "true", + "XmlTransformation": "false", + "XmlVariableSubstitution": "false", + "JSONFiles": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "Swap Slots", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectedServiceName": "$(subscriptionConnection)", + "Action": "Swap Slots", + "WebAppName": "$(webSiteName)", + "SpecifySlot": "false", + "ResourceGroupName": "$(resourceGroupName)", + "SourceSlot": "stage", + "SwapWithProduction": "true", + "TargetSlot": "", + "PreserveVnet": "false", + "Slot": "production", + "ExtensionsList": "", + "OutputVariable": "", + "AppInsightsResourceGroupName": "", + "ApplicationInsightsResourceName": "", + "ApplicationInsightsWebTestName": "" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of QA Infra", + "timeToDeploy": 2.455566666666667, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2159, + "releaseId": 178, + "name": "QA Database", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "qa" + }, + "resourceGroupName": { + "value": "PTracker-QA" + }, + "TestWebAppUrl": { + "value": "http://qa.peopletracker.us/" + }, + "dnsRecordName": { + "value": "qa" + } + }, + "type": "Vsts", + "id": 2, + "name": "PTracker QA", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3603, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:10:17.18Z", + "modifiedOn": "2019-07-13T16:10:17.187Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2159, + "name": "QA Database", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2159", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3603" + } + ], + "postDeployApprovals": [ + { + "id": 3609, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:11:10.6Z", + "modifiedOn": "2019-07-13T16:11:10.607Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2159, + "name": "QA Database", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2159", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3609" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3605, + "deploymentId": 1253, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1245, + "phaseId": "1245", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:10:25.3Z", + "dateEnded": "2019-07-13T16:11:08.323Z", + "startTime": "2019-07-13T16:10:25.3Z", + "finishTime": "2019-07-13T16:11:08.323Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2159/deployPhases/1245/tasks/8/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:10:25.5Z", + "dateEnded": "2019-07-13T16:10:27.12Z", + "startTime": "2019-07-13T16:10:25.5Z", + "finishTime": "2019-07-13T16:10:27.12Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2159/deployPhases/1245/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - win", + "dateStarted": "2019-07-13T16:10:27.13Z", + "dateEnded": "2019-07-13T16:10:30.2Z", + "startTime": "2019-07-13T16:10:27.13Z", + "finishTime": "2019-07-13T16:10:30.2Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2159/deployPhases/1245/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T16:10:30.2Z", + "dateEnded": "2019-07-13T16:10:37.637Z", + "startTime": "2019-07-13T16:10:30.2Z", + "finishTime": "2019-07-13T16:10:37.637Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2159/deployPhases/1245/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy DACPAC to Sql Azure", + "dateStarted": "2019-07-13T16:10:37.637Z", + "dateEnded": "2019-07-13T16:11:08.28Z", + "startTime": "2019-07-13T16:10:37.637Z", + "finishTime": "2019-07-13T16:11:08.28Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "SqlAzureDacpacDeployment", + "version": "1.153.0" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2159/deployPhases/1245/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:11:08.287Z", + "dateEnded": "2019-07-13T16:11:08.32Z", + "startTime": "2019-07-13T16:11:08.287Z", + "finishTime": "2019-07-13T16:11:08.32Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 5, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2159/deployPhases/1245/tasks/7/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:10:22.92Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:10:16.903Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:11:10.617Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 11, + "definitionEnvironmentId": 16, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "QA Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:10:16.903Z", + "modifiedOn": "2019-07-13T16:11:10.607Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "win/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionId)\n\n$servername= az sql server list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=servername]$servername\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "1.*", + "name": "Deploy DACPAC to Sql Azure", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectedServiceNameSelector": "ConnectedServiceNameARM", + "ConnectedServiceName": "", + "ConnectedServiceNameARM": "$(subscriptionConnection)", + "AuthenticationType": "server", + "ServerName": "$(servername).database.windows.net", + "DatabaseName": "ptracker", + "SqlUsername": "$(dblogin)", + "SqlPassword": "$(dbpassword)", + "aad.redacted": "", + "ConnectionString": "", + "TaskNameSelector": "DacpacTask", + "DeploymentAction": "Publish", + "DacpacFile": "$(System.DefaultWorkingDirectory)/artifact/win/PeopleTracker.Database.dacpac", + "BacpacFile": "", + "SqlFile": "", + "SqlInline": "", + "PublishProfile": "", + "AdditionalArguments": "/p:BlockOnPossibleDataLoss=False", + "SqlAdditionalArguments": "", + "InlineAdditionalArguments": "", + "IpDetectionMethod": "AutoDetect", + "StartIpAddress": "", + "EndIpAddress": "", + "DeleteFirewallRule": "true" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of QA Infra", + "timeToDeploy": 0.8888333333333334, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2160, + "releaseId": 178, + "name": "QA K8s", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "qa" + }, + "resourceGroupName": { + "value": "PTracker-QA" + }, + "TestWebAppUrl": { + "value": "http://qa.peopletracker.us/" + }, + "dnsRecordName": { + "value": "qa" + } + }, + "type": "Vsts", + "id": 2, + "name": "PTracker QA", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3607, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:10:17.273Z", + "modifiedOn": "2019-07-13T16:10:17.28Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2160, + "name": "QA K8s", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3607" + } + ], + "postDeployApprovals": [ + { + "id": 3610, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:12:32.51Z", + "modifiedOn": "2019-07-13T16:12:32.517Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2160, + "name": "QA K8s", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3610" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3608, + "deploymentId": 1254, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1247, + "phaseId": "1247", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 15, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:10:25.11Z", + "dateEnded": "2019-07-13T16:12:29.707Z", + "startTime": "2019-07-13T16:10:25.11Z", + "finishTime": "2019-07-13T16:12:29.707Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/15/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:10:25.327Z", + "dateEnded": "2019-07-13T16:10:26.437Z", + "startTime": "2019-07-13T16:10:25.327Z", + "finishTime": "2019-07-13T16:10:26.437Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Pre-job: helm init", + "dateStarted": "2019-07-13T16:10:26.447Z", + "dateEnded": "2019-07-13T16:10:27.057Z", + "startTime": "2019-07-13T16:10:26.447Z", + "finishTime": "2019-07-13T16:10:27.057Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Pre-job: helm upgrade", + "dateStarted": "2019-07-13T16:10:27.057Z", + "dateEnded": "2019-07-13T16:10:27.52Z", + "startTime": "2019-07-13T16:10:27.057Z", + "finishTime": "2019-07-13T16:10:27.52Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T16:10:27.52Z", + "dateEnded": "2019-07-13T16:10:29.503Z", + "startTime": "2019-07-13T16:10:27.52Z", + "finishTime": "2019-07-13T16:10:29.503Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T16:10:29.503Z", + "dateEnded": "2019-07-13T16:10:42.243Z", + "startTime": "2019-07-13T16:10:29.503Z", + "finishTime": "2019-07-13T16:10:42.243Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Install Helm 2.10.0", + "dateStarted": "2019-07-13T16:10:42.243Z", + "dateEnded": "2019-07-13T16:10:43.133Z", + "startTime": "2019-07-13T16:10:42.243Z", + "finishTime": "2019-07-13T16:10:43.133Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmInstaller", + "version": "0.154.0" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "helm init", + "dateStarted": "2019-07-13T16:10:43.133Z", + "dateEnded": "2019-07-13T16:11:03.897Z", + "startTime": "2019-07-13T16:10:43.133Z", + "finishTime": "2019-07-13T16:11:03.897Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmDeploy", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "helm upgrade", + "dateStarted": "2019-07-13T16:11:03.897Z", + "dateEnded": "2019-07-13T16:12:08.877Z", + "startTime": "2019-07-13T16:11:03.897Z", + "finishTime": "2019-07-13T16:12:08.877Z", + "status": "succeeded", + "rank": 8, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmDeploy", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/10/logs" + }, + { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Update DNS", + "dateStarted": "2019-07-13T16:12:08.877Z", + "dateEnded": "2019-07-13T16:12:29.193Z", + "startTime": "2019-07-13T16:12:08.877Z", + "finishTime": "2019-07-13T16:12:29.193Z", + "status": "succeeded", + "rank": 9, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/11/logs" + }, + { + "id": 12, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Post-job: helm upgrade", + "dateStarted": "2019-07-13T16:12:29.193Z", + "dateEnded": "2019-07-13T16:12:29.43Z", + "startTime": "2019-07-13T16:12:29.193Z", + "finishTime": "2019-07-13T16:12:29.43Z", + "status": "succeeded", + "rank": 10, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/12/logs" + }, + { + "id": 13, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Post-job: helm init", + "dateStarted": "2019-07-13T16:12:29.43Z", + "dateEnded": "2019-07-13T16:12:29.667Z", + "startTime": "2019-07-13T16:12:29.43Z", + "finishTime": "2019-07-13T16:12:29.667Z", + "status": "succeeded", + "rank": 11, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/13/logs" + }, + { + "id": 14, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:12:29.673Z", + "dateEnded": "2019-07-13T16:12:29.703Z", + "startTime": "2019-07-13T16:12:29.673Z", + "finishTime": "2019-07-13T16:12:29.703Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 12, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2160/deployPhases/1247/tasks/14/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:10:22.983Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:10:16.92Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:12:32.53Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 12, + "definitionEnvironmentId": 17, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "QA Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:10:16.92Z", + "modifiedOn": "2019-07-13T16:12:32.517Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionId)\n\n$repository= az acr list --resource-group $(commonResourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=repository]$repository\"\n\n$cluster = az aks list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=cluster]$cluster\"\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "Install Helm 2.10.0", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "helmVersion": "2.10.0", + "checkLatestHelmVersion": "true", + "installKubeCtl": "true", + "kubectlVersion": "1.8.9", + "checkLatestKubeCtl": "true" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "helm init", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectionType": "Azure Resource Manager", + "azureSubscriptionEndpoint": "$(subscriptionConnection)", + "azureResourceGroup": "$(resourceGroupName)", + "kubernetesCluster": "$(cluster)", + "kubernetesServiceEndpoint": "", + "namespace": "", + "command": "init", + "chartType": "Name", + "chartName": "", + "chartPath": "", + "version": "", + "releaseName": "", + "overrideValues": "", + "valueFile": "", + "destination": "$(Build.ArtifactStagingDirectory)", + "canaryimage": "false", + "upgradetiller": "true", + "updatedependency": "false", + "save": "true", + "install": "true", + "recreate": "false", + "resetValues": "false", + "force": "false", + "waitForExecution": "true", + "arguments": "--service-account tiller", + "enableTls": "false", + "caCert": "", + "certificate": "", + "privatekey": "", + "tillernamespace": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "helm upgrade", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectionType": "Azure Resource Manager", + "azureSubscriptionEndpoint": "$(subscriptionConnection)", + "azureResourceGroup": "$(resourceGroupName)", + "kubernetesCluster": "$(cluster)", + "kubernetesServiceEndpoint": "", + "namespace": "", + "command": "upgrade", + "chartType": "FilePath", + "chartName": "", + "chartPath": "$(System.DefaultWorkingDirectory)/artifact/iac/$(chart)", + "version": "", + "releaseName": "$(deploymentName)", + "overrideValues": "image.tag=$(Build.BuildId),service.url=\"http://$(webSiteName).azurewebsites.net\",image.repository=\"$(repository).azurecr.io/peopletracker\"", + "valueFile": "", + "destination": "$(Build.ArtifactStagingDirectory)", + "canaryimage": "false", + "upgradetiller": "true", + "updatedependency": "false", + "save": "true", + "install": "true", + "recreate": "false", + "resetValues": "false", + "force": "false", + "waitForExecution": "true", + "arguments": "", + "enableTls": "false", + "caCert": "", + "certificate": "", + "privatekey": "", + "tillernamespace": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Update DNS", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "filePath", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/updatedns.ps1", + "arguments": "-resourceGroupName $(resourceGroupName) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -goDaddyKey $(GoDaddyKey) -goDaddySecret $(GoDaddySecret) -deploymentName $(deploymentName) -name '$(dnsRecordName)' -subscriptionId $(subscriptionId) -tenatId $(tenatId) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/iac" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of QA Infra", + "timeToDeploy": 2.2525, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2161, + "releaseId": 178, + "name": "QA Mobile", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "qa" + }, + "resourceGroupName": { + "value": "PTracker-QA" + }, + "TestWebAppUrl": { + "value": "http://qa.peopletracker.us/" + }, + "dnsRecordName": { + "value": "qa" + } + }, + "type": "Vsts", + "id": 2, + "name": "PTracker QA", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3612, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:12:44.837Z", + "modifiedOn": "2019-07-13T16:12:44.843Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2161, + "name": "QA Mobile", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3612" + } + ], + "postDeployApprovals": [ + { + "id": 3614, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:13:22.307Z", + "modifiedOn": "2019-07-13T16:13:22.313Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2161, + "name": "QA Mobile", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3614" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3613, + "deploymentId": 1255, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1248, + "phaseId": "1248", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:12:51.803Z", + "dateEnded": "2019-07-13T16:13:20.337Z", + "startTime": "2019-07-13T16:12:51.803Z", + "finishTime": "2019-07-13T16:13:20.337Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/11/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:12:51.99Z", + "dateEnded": "2019-07-13T16:12:52.427Z", + "startTime": "2019-07-13T16:12:51.99Z", + "finishTime": "2019-07-13T16:12:52.427Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T16:12:52.437Z", + "dateEnded": "2019-07-13T16:12:55.55Z", + "startTime": "2019-07-13T16:12:52.437Z", + "finishTime": "2019-07-13T16:12:55.55Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - mobile", + "dateStarted": "2019-07-13T16:12:55.55Z", + "dateEnded": "2019-07-13T16:12:58.69Z", + "startTime": "2019-07-13T16:12:55.55Z", + "finishTime": "2019-07-13T16:12:58.69Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T16:12:58.69Z", + "dateEnded": "2019-07-13T16:13:05.953Z", + "startTime": "2019-07-13T16:12:58.69Z", + "finishTime": "2019-07-13T16:13:05.953Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Update BER", + "dateStarted": "2019-07-13T16:13:05.953Z", + "dateEnded": "2019-07-13T16:13:07.793Z", + "startTime": "2019-07-13T16:13:05.953Z", + "finishTime": "2019-07-13T16:13:07.793Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy Android to Beta Testers", + "dateStarted": "2019-07-13T16:13:07.793Z", + "dateEnded": "2019-07-13T16:13:13.537Z", + "startTime": "2019-07-13T16:13:07.793Z", + "finishTime": "2019-07-13T16:13:13.537Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AppCenterDistribute", + "version": "3.154.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy iOS to Beta Testers", + "dateStarted": "2019-07-13T16:13:13.537Z", + "dateEnded": "2019-07-13T16:13:20.32Z", + "startTime": "2019-07-13T16:13:13.537Z", + "finishTime": "2019-07-13T16:13:20.32Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AppCenterDistribute", + "version": "3.154.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:13:20.327Z", + "dateEnded": "2019-07-13T16:13:20.333Z", + "startTime": "2019-07-13T16:13:20.327Z", + "finishTime": "2019-07-13T16:13:20.333Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 8, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2161/deployPhases/1248/tasks/10/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:12:48.8Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:12:44.653Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:13:22.327Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 13, + "definitionEnvironmentId": 18, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "QA Web Service", + "conditionType": "environmentState", + "value": "4" + }, + { + "result": true, + "name": "QA Database", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:12:44.653Z", + "modifiedOn": "2019-07-13T16:13:22.313Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "mobile/**", + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionId)\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Update BER", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1", + "arguments": "-value 'http://$(webSiteName).azurewebsites.net'", + "script": "# Read the version from the file passed in by build\n$version = Get-Content .\\version.txt -Raw\n$version = $version.Trim()\n\n\n$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1 -berUrl $(berUrl) -appName $(appName) -dataType $(dataType) -version $version -value 'http://$(webSiteName).azurewebsites.net' -verbose\n\n$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1 -berUrl $(berUrl) -appName $(appName) -dataType Env -version $version -value 'QA' -verbose", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/mobile" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "3.*", + "name": "Deploy Android to Beta Testers", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "serverEndpoint": "00000000-0000-0000-0000-000000000000", + "appSlug": "Trackyon/People-Tracker-Android", + "app": "$(System.DefaultWorkingDirectory)/artifact/mobile/PeopleTracker.Mobile.Droid.apk", + "symbolsType": "Apple", + "symbolsPath": "", + "pdbPath": "**/*.pdb", + "dsymPath": "", + "mappingTxtPath": "", + "packParentFolder": "false", + "releaseNotesSelection": "file", + "releaseNotesInput": "", + "releaseNotesFile": "$(System.DefaultWorkingDirectory)/artifact/mobile/ReleaseNotes.txt", + "isMandatory": "false", + "destinationType": "groups", + "destinationGroupIds": "", + "destinationStoreId": "", + "isSilent": "false" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "3.*", + "name": "Deploy iOS to Beta Testers", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "serverEndpoint": "00000000-0000-0000-0000-000000000000", + "appSlug": "Trackyon/People-Tracker", + "app": "$(System.DefaultWorkingDirectory)/artifact/mobile/PeopleTrackerMobileiOS.ipa", + "symbolsType": "Apple", + "symbolsPath": "", + "pdbPath": "**/*.pdb", + "dsymPath": "", + "mappingTxtPath": "", + "packParentFolder": "false", + "releaseNotesSelection": "file", + "releaseNotesInput": "", + "releaseNotesFile": "$(System.DefaultWorkingDirectory)/artifact/mobile/ReleaseNotes.txt", + "isMandatory": "false", + "destinationType": "groups", + "destinationGroupIds": "", + "destinationStoreId": "", + "isSilent": "false" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of QA Web Service,QA Database", + "timeToDeploy": 0.6235, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2162, + "releaseId": 178, + "name": "QA Testing", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "qa" + }, + "resourceGroupName": { + "value": "PTracker-QA" + }, + "TestWebAppUrl": { + "value": "http://qa.peopletracker.us/" + }, + "dnsRecordName": { + "value": "qa" + } + }, + "type": "Vsts", + "id": 2, + "name": "PTracker QA", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3615, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:13:22.52Z", + "modifiedOn": "2019-07-13T16:13:22.53Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2162, + "name": "QA Testing", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3615" + } + ], + "postDeployApprovals": [ + { + "id": 3618, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:19:23.55Z", + "modifiedOn": "2019-07-13T16:19:23.553Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 4, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2162, + "name": "QA Testing", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3618" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3617, + "deploymentId": 1256, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1249, + "phaseId": "1249", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:18:33.173Z", + "dateEnded": "2019-07-13T16:19:21.337Z", + "startTime": "2019-07-13T16:18:33.173Z", + "finishTime": "2019-07-13T16:19:21.337Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/deployPhases/1249/tasks/9/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:18:33.377Z", + "dateEnded": "2019-07-13T16:18:34.477Z", + "startTime": "2019-07-13T16:18:33.377Z", + "finishTime": "2019-07-13T16:18:34.477Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/deployPhases/1249/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - win", + "dateStarted": "2019-07-13T16:18:34.487Z", + "dateEnded": "2019-07-13T16:18:37.6Z", + "startTime": "2019-07-13T16:18:34.487Z", + "finishTime": "2019-07-13T16:18:37.6Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/deployPhases/1249/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - mobile", + "dateStarted": "2019-07-13T16:18:37.603Z", + "dateEnded": "2019-07-13T16:18:40.727Z", + "startTime": "2019-07-13T16:18:37.603Z", + "finishTime": "2019-07-13T16:18:40.727Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/deployPhases/1249/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Run Mobile Tests", + "dateStarted": "2019-07-13T16:18:40.727Z", + "dateEnded": "2019-07-13T16:19:01.51Z", + "startTime": "2019-07-13T16:18:40.727Z", + "finishTime": "2019-07-13T16:19:01.51Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AppCenterTest", + "version": "1.152.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/deployPhases/1249/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Run Selenium Tests", + "dateStarted": "2019-07-13T16:19:01.51Z", + "dateEnded": "2019-07-13T16:19:21.317Z", + "startTime": "2019-07-13T16:19:01.51Z", + "finishTime": "2019-07-13T16:19:21.317Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "VSTest", + "version": "2.154.0" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/deployPhases/1249/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:19:21.323Z", + "dateEnded": "2019-07-13T16:19:21.33Z", + "startTime": "2019-07-13T16:19:21.323Z", + "finishTime": "2019-07-13T16:19:21.33Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 6, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/deployPhases/1249/tasks/8/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:18:29.893Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:13:22.357Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:19:23.567Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "preDeploymentGates": { + "id": 3616, + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 0, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Release", + "dateStarted": "2019-07-13T16:18:23.157Z", + "dateEnded": "2019-07-13T16:18:25.473Z", + "startTime": "2019-07-13T16:18:23.157Z", + "finishTime": "2019-07-13T16:18:25.473Z", + "status": "succeeded", + "rank": 2, + "issues": [] + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Invoke REST API: GET", + "dateStarted": "2019-07-13T16:18:25.053Z", + "dateEnded": "2019-07-13T16:18:25.37Z", + "startTime": "2019-07-13T16:18:25.053Z", + "finishTime": "2019-07-13T16:18:25.37Z", + "status": "succeeded", + "rank": null, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "InvokeRESTAPI", + "version": "1.152.1" + }, + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/gates/3616/tasks/3/logs" + } + ] + }, + { + "job": { + "id": 0, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Release", + "dateStarted": "2019-07-13T16:13:22.943Z", + "dateEnded": "2019-07-13T16:13:24.627Z", + "startTime": "2019-07-13T16:13:22.943Z", + "finishTime": "2019-07-13T16:13:24.627Z", + "status": "succeeded", + "rank": 1, + "issues": [] + }, + "tasks": [ + { + "id": 2, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Invoke REST API: GET", + "dateStarted": "2019-07-13T16:13:24.227Z", + "dateEnded": "2019-07-13T16:13:24.527Z", + "startTime": "2019-07-13T16:13:24.227Z", + "finishTime": "2019-07-13T16:13:24.527Z", + "status": "succeeded", + "rank": null, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "InvokeRESTAPI", + "version": "1.152.1" + }, + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2162/gates/3616/tasks/2/logs" + } + ] + } + ], + "startedOn": "2019-07-13T16:13:22.543Z", + "lastModifiedOn": "2019-07-13T16:18:25.743Z", + "stabilizationCompletedOn": "2019-07-13T16:18:22.893Z", + "succeedingSince": "2019-07-13T16:18:25.583Z" + }, + "issues": [] + } + ], + "rank": 14, + "definitionEnvironmentId": 19, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "QA Mobile", + "conditionType": "environmentState", + "value": "4" + }, + { + "result": true, + "name": "QA K8s", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:13:22.357Z", + "modifiedOn": "2019-07-13T16:19:23.553Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "win/**", + "mobile/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "1.*", + "name": "Run Mobile Tests", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "app": "$(System.DefaultWorkingDirectory)/artifact/mobile/PeopleTracker.Mobile.Droid.apk", + "artifactsDir": "$(Build.ArtifactStagingDirectory)/AppCenterTest\t", + "enablePrepare": "true", + "framework": "uitest", + "appiumBuildDir": "", + "espressoBuildDir": "", + "espressoTestApkPath": "", + "calabashProjectDir": "", + "calabashConfigFile": "", + "calabashProfile": "", + "calabashSkipConfigCheck": "false", + "uitestBuildDir": "$(System.DefaultWorkingDirectory)/artifact/mobile", + "uitestStorePath": "", + "uitestStorePass": "", + "uitestKeyAlias": "", + "uitestKeyPass": "", + "uitestToolsDir": "$(System.DefaultWorkingDirectory)/artifact/mobile", + "signInfo": "", + "xcuitestBuildDir": "", + "xcuitestTestIpaPath": "", + "prepareOpts": "", + "enableRun": "true", + "credsType": "serviceEndpoint", + "serverEndpoint": "00000000-0000-0000-0000-000000000000", + "username": "", + "password": "", + "appSlug": "Trackyon/People-Tracker-Android", + "devices": "Trackyon/peopletrackerandroid", + "series": "master", + "dsymDir": "", + "locale": "en_US", + "userDefinedLocale": "", + "loginOpts": "", + "runOpts": "", + "async": "true", + "cliLocationOverride": "", + "debug": "true" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Run Selenium Tests", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "testSelector": "testAssemblies", + "testAssemblyVer2": "**\\*UITests*.dll\n!**\\*TestAdapter.dll\n!**\\obj\\**", + "testPlan": "", + "testSuite": "", + "testConfiguration": "", + "tcmTestRun": "$(test.RunId)", + "searchFolder": "$(System.DefaultWorkingDirectory)", + "testFiltercriteria": "TestCategory=UI", + "runOnlyImpactedTests": "False", + "runAllTestsAfterXBuilds": "50", + "uiTests": "false", + "vstestLocationMethod": "version", + "vsTestVersion": "latest", + "vstestLocation": "", + "runSettingsFile": "$(System.DefaultWorkingDirectory)/artifact/win/bvt.runsettings", + "overrideTestrunParameters": "-webAppUrl $(TestWebAppUrl) -browser $(BrowserToUse)", + "pathtoCustomTestAdapters": "", + "runInParallel": "False", + "runTestsInIsolation": "False", + "codeCoverageEnabled": "False", + "otherConsoleOptions": "", + "distributionBatchType": "basedOnTestCases", + "batchingBasedOnAgentsOption": "autoBatchSize", + "customBatchSizeValue": "10", + "batchingBasedOnExecutionTimeOption": "autoBatchSize", + "customRunTimePerBatchValue": "60", + "dontDistribute": "False", + "testRunTitle": "Dev UI", + "platform": "Any CPU", + "configuration": "Release", + "publishRunAttachments": "false", + "diagnosticsEnabled": "True", + "collectDumpOn": "onAbortOnly", + "rerunFailedTests": "true", + "rerunType": "basedOnTestFailurePercentage", + "rerunFailedThreshold": "100", + "rerunFailedTestCasesMaxLimit": "5", + "rerunMaxAttempts": "3" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of QA Mobile,QA K8s", + "timeToDeploy": 0.9611166666666667, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 91, + "gatesOptions": { + "isEnabled": true, + "timeout": 1440, + "samplingInterval": 5, + "stabilizationTime": 5, + "minimumSuccessDuration": 0 + }, + "gates": [ + { + "tasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "1.*", + "name": "Invoke REST API: GET", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectedServiceNameSelector": "connectedServiceName", + "connectedServiceName": "00000000-0000-0000-0000-000000000000", + "connectedServiceNameARM": "", + "method": "GET", + "headers": "{\n}", + "body": "", + "urlSuffix": "", + "waitForCompletion": "false", + "successCriteria": "" + } + } + ] + } + ] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2163, + "releaseId": 178, + "name": "Prod Infra", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "prod" + }, + "resourceGroupName": { + "value": "PTracker-Prod" + }, + "TestWebAppUrl": { + "value": "http://www.peopletracker.us/" + }, + "dnsRecordName": { + "value": "www" + } + }, + "type": "Vsts", + "id": 3, + "name": "PTracker Prod", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3619, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:19:23.773Z", + "modifiedOn": "2019-07-13T16:19:23.78Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2163, + "name": "Prod Infra", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2163", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3619" + } + ], + "postDeployApprovals": [ + { + "id": 3621, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:26:03.223Z", + "modifiedOn": "2019-07-13T16:26:03.23Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2163, + "name": "Prod Infra", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2163", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3621" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3620, + "deploymentId": 1257, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1250, + "phaseId": "1250", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:19:28.443Z", + "dateEnded": "2019-07-13T16:26:00.08Z", + "startTime": "2019-07-13T16:19:28.443Z", + "finishTime": "2019-07-13T16:26:00.08Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2163/deployPhases/1250/tasks/7/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:19:28.62Z", + "dateEnded": "2019-07-13T16:19:29.7Z", + "startTime": "2019-07-13T16:19:28.62Z", + "finishTime": "2019-07-13T16:19:29.7Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2163/deployPhases/1250/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T16:19:29.71Z", + "dateEnded": "2019-07-13T16:19:32.817Z", + "startTime": "2019-07-13T16:19:29.71Z", + "finishTime": "2019-07-13T16:19:32.817Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2163/deployPhases/1250/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy Infra", + "dateStarted": "2019-07-13T16:19:32.817Z", + "dateEnded": "2019-07-13T16:26:00.067Z", + "startTime": "2019-07-13T16:19:32.817Z", + "finishTime": "2019-07-13T16:26:00.067Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2163/deployPhases/1250/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:26:00.07Z", + "dateEnded": "2019-07-13T16:26:00.077Z", + "startTime": "2019-07-13T16:26:00.07Z", + "finishTime": "2019-07-13T16:26:00.077Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 4, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2163/deployPhases/1250/tasks/6/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:19:26.38Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:19:23.6Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:26:03.243Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 15, + "definitionEnvironmentId": 21, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "QA Testing", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:19:23.6Z", + "modifiedOn": "2019-07-13T16:26:03.23Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Deploy Infra", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "filePath", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/deploy.ps1", + "arguments": "-resourceGroupName $(resourceGroupName) -adminlogin $(dblogin) -password $(dbpassword) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -stage $(deploymentName) -subscriptionId $(subscriptionId) -tenatId $(tenatId) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "true", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/iac" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of QA Testing", + "timeToDeploy": 6.6559, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2164, + "releaseId": 178, + "name": "Prod Web Service", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "prod" + }, + "resourceGroupName": { + "value": "PTracker-Prod" + }, + "TestWebAppUrl": { + "value": "http://www.peopletracker.us/" + }, + "dnsRecordName": { + "value": "www" + } + }, + "type": "Vsts", + "id": 3, + "name": "PTracker Prod", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3626, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:26:03.747Z", + "modifiedOn": "2019-07-13T16:26:03.753Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2164, + "name": "Prod Web Service", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3626" + } + ], + "postDeployApprovals": [ + { + "id": 3629, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:28:35.663Z", + "modifiedOn": "2019-07-13T16:28:35.67Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2164, + "name": "Prod Web Service", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3629" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3627, + "deploymentId": 1258, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1253, + "phaseId": "1253", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:26:11.477Z", + "dateEnded": "2019-07-13T16:28:33.637Z", + "startTime": "2019-07-13T16:26:11.477Z", + "finishTime": "2019-07-13T16:28:33.637Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/11/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:26:11.717Z", + "dateEnded": "2019-07-13T16:26:16Z", + "startTime": "2019-07-13T16:26:11.717Z", + "finishTime": "2019-07-13T16:26:16Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - win", + "dateStarted": "2019-07-13T16:26:16.013Z", + "dateEnded": "2019-07-13T16:26:19.48Z", + "startTime": "2019-07-13T16:26:16.013Z", + "finishTime": "2019-07-13T16:26:19.48Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T16:26:19.48Z", + "dateEnded": "2019-07-13T16:26:21.397Z", + "startTime": "2019-07-13T16:26:19.48Z", + "finishTime": "2019-07-13T16:26:21.397Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - mobile", + "dateStarted": "2019-07-13T16:26:21.397Z", + "dateEnded": "2019-07-13T16:26:24.817Z", + "startTime": "2019-07-13T16:26:21.397Z", + "finishTime": "2019-07-13T16:26:24.817Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T16:26:24.817Z", + "dateEnded": "2019-07-13T16:26:32.513Z", + "startTime": "2019-07-13T16:26:24.817Z", + "finishTime": "2019-07-13T16:26:32.513Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy to Staging Slot", + "dateStarted": "2019-07-13T16:26:32.513Z", + "dateEnded": "2019-07-13T16:27:06.94Z", + "startTime": "2019-07-13T16:26:32.513Z", + "finishTime": "2019-07-13T16:27:06.94Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AzureRmWebAppDeployment", + "version": "4.3.36" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Swap Slots", + "dateStarted": "2019-07-13T16:27:06.94Z", + "dateEnded": "2019-07-13T16:28:33.56Z", + "startTime": "2019-07-13T16:27:06.94Z", + "finishTime": "2019-07-13T16:28:33.56Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AzureAppServiceManage", + "version": "0.2.55" + }, + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:28:33.567Z", + "dateEnded": "2019-07-13T16:28:33.633Z", + "startTime": "2019-07-13T16:28:33.567Z", + "finishTime": "2019-07-13T16:28:33.633Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 8, + "issues": [], + "agentName": "WinBldBox-3_Service1", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2164/deployPhases/1253/tasks/10/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:26:08.917Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:26:03.28Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:28:35.68Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 16, + "definitionEnvironmentId": 23, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Prod Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:26:03.28Z", + "modifiedOn": "2019-07-13T16:28:35.67Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "win/**", + "iac/**", + "mobile/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionId)\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "4.*", + "name": "Deploy to Staging Slot", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectionType": "AzureRM", + "ConnectedServiceName": "$(subscriptionConnection)", + "PublishProfilePath": "$(System.DefaultWorkingDirectory)/**/*.pubxml", + "PublishProfilePassword": "", + "WebAppKind": "webApp", + "WebAppName": "$(webSiteName)", + "DeployToSlotOrASEFlag": "true", + "ResourceGroupName": "$(resourceGroupName)", + "SlotName": "stage", + "DockerNamespace": "", + "DockerRepository": "", + "DockerImageTag": "", + "VirtualApplication": "", + "Package": "$(System.DefaultWorkingDirectory)/artifact/win/PeopleTracker.NetService.zip", + "RuntimeStack": "", + "RuntimeStackFunction": "", + "StartupCommand": "", + "ScriptType": "", + "InlineScript": ":: You can provide your deployment commands here. One command per line.", + "ScriptPath": "", + "WebConfigParameters": "", + "AppSettings": "", + "ConfigurationSettings": "", + "UseWebDeploy": "true", + "DeploymentType": "webDeploy", + "TakeAppOfflineFlag": "false", + "SetParametersFile": "", + "RemoveAdditionalFilesFlag": "true", + "ExcludeFilesFromAppDataFlag": "true", + "AdditionalArguments": "-retryAttempts:6 -retryInterval:10000", + "RenameFilesFlag": "true", + "XmlTransformation": "false", + "XmlVariableSubstitution": "false", + "JSONFiles": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "Swap Slots", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectedServiceName": "$(subscriptionConnection)", + "Action": "Swap Slots", + "WebAppName": "$(webSiteName)", + "SpecifySlot": "false", + "ResourceGroupName": "$(resourceGroupName)", + "SourceSlot": "stage", + "SwapWithProduction": "true", + "TargetSlot": "", + "PreserveVnet": "false", + "Slot": "production", + "ExtensionsList": "", + "OutputVariable": "", + "AppInsightsResourceGroupName": "", + "ApplicationInsightsResourceName": "", + "ApplicationInsightsWebTestName": "" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Prod Infra", + "timeToDeploy": 2.531066666666667, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2165, + "releaseId": 178, + "name": "Prod Database", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "prod" + }, + "resourceGroupName": { + "value": "PTracker-Prod" + }, + "TestWebAppUrl": { + "value": "http://www.peopletracker.us/" + }, + "dnsRecordName": { + "value": "www" + } + }, + "type": "Vsts", + "id": 3, + "name": "PTracker Prod", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3622, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:26:03.493Z", + "modifiedOn": "2019-07-13T16:26:03.5Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2165, + "name": "Prod Database", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2165", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3622" + } + ], + "postDeployApprovals": [ + { + "id": 3628, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:26:53.773Z", + "modifiedOn": "2019-07-13T16:26:53.78Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2165, + "name": "Prod Database", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2165", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3628" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3623, + "deploymentId": 1259, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1251, + "phaseId": "1251", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:26:10.287Z", + "dateEnded": "2019-07-13T16:26:51.67Z", + "startTime": "2019-07-13T16:26:10.287Z", + "finishTime": "2019-07-13T16:26:51.67Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2165/deployPhases/1251/tasks/8/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:26:10.477Z", + "dateEnded": "2019-07-13T16:26:10.923Z", + "startTime": "2019-07-13T16:26:10.477Z", + "finishTime": "2019-07-13T16:26:10.923Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2165/deployPhases/1251/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - win", + "dateStarted": "2019-07-13T16:26:10.937Z", + "dateEnded": "2019-07-13T16:26:14.1Z", + "startTime": "2019-07-13T16:26:10.937Z", + "finishTime": "2019-07-13T16:26:14.1Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2165/deployPhases/1251/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T16:26:14.1Z", + "dateEnded": "2019-07-13T16:26:21.577Z", + "startTime": "2019-07-13T16:26:14.1Z", + "finishTime": "2019-07-13T16:26:21.577Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2165/deployPhases/1251/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy DACPAC to Sql Azure", + "dateStarted": "2019-07-13T16:26:21.577Z", + "dateEnded": "2019-07-13T16:26:51.61Z", + "startTime": "2019-07-13T16:26:21.577Z", + "finishTime": "2019-07-13T16:26:51.61Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "SqlAzureDacpacDeployment", + "version": "1.153.0" + }, + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2165/deployPhases/1251/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:26:51.617Z", + "dateEnded": "2019-07-13T16:26:51.667Z", + "startTime": "2019-07-13T16:26:51.617Z", + "finishTime": "2019-07-13T16:26:51.667Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 5, + "issues": [], + "agentName": "WinBldBox-3_Service3", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2165/deployPhases/1251/tasks/7/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:26:07.67Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:26:03.297Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:26:53.79Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 17, + "definitionEnvironmentId": 24, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Prod Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:26:03.297Z", + "modifiedOn": "2019-07-13T16:26:53.78Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "win/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionId)\n\n$servername= az sql server list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=servername]$servername\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "1.*", + "name": "Deploy DACPAC to Sql Azure", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "ConnectedServiceNameSelector": "ConnectedServiceNameARM", + "ConnectedServiceName": "", + "ConnectedServiceNameARM": "$(subscriptionConnection)", + "AuthenticationType": "server", + "ServerName": "$(servername).database.windows.net", + "DatabaseName": "ptracker", + "SqlUsername": "$(dblogin)", + "SqlPassword": "$(dbpassword)", + "aad.redacted": "", + "ConnectionString": "", + "TaskNameSelector": "DacpacTask", + "DeploymentAction": "Publish", + "DacpacFile": "$(System.DefaultWorkingDirectory)/artifact/win/PeopleTracker.Database.dacpac", + "BacpacFile": "", + "SqlFile": "", + "SqlInline": "", + "PublishProfile": "", + "AdditionalArguments": "/p:BlockOnPossibleDataLoss=False", + "SqlAdditionalArguments": "", + "InlineAdditionalArguments": "", + "IpDetectionMethod": "AutoDetect", + "StartIpAddress": "", + "EndIpAddress": "", + "DeleteFirewallRule": "true" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Prod Infra", + "timeToDeploy": 0.8365, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2166, + "releaseId": 178, + "name": "Prod K8s", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "prod" + }, + "resourceGroupName": { + "value": "PTracker-Prod" + }, + "TestWebAppUrl": { + "value": "http://www.peopletracker.us/" + }, + "dnsRecordName": { + "value": "www" + } + }, + "type": "Vsts", + "id": 3, + "name": "PTracker Prod", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3624, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:26:03.59Z", + "modifiedOn": "2019-07-13T16:26:03.597Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2166, + "name": "Prod K8s", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3624" + } + ], + "postDeployApprovals": [ + { + "id": 3630, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:28:40.9Z", + "modifiedOn": "2019-07-13T16:28:40.907Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 3, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2166, + "name": "Prod K8s", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3630" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3625, + "deploymentId": 1260, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1252, + "phaseId": "1252", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 15, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:26:11.01Z", + "dateEnded": "2019-07-13T16:28:38.14Z", + "startTime": "2019-07-13T16:26:11.01Z", + "finishTime": "2019-07-13T16:28:38.14Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/15/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:26:11.247Z", + "dateEnded": "2019-07-13T16:26:14.21Z", + "startTime": "2019-07-13T16:26:11.247Z", + "finishTime": "2019-07-13T16:26:14.21Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Pre-job: helm init", + "dateStarted": "2019-07-13T16:26:14.22Z", + "dateEnded": "2019-07-13T16:26:14.86Z", + "startTime": "2019-07-13T16:26:14.22Z", + "finishTime": "2019-07-13T16:26:14.86Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Pre-job: helm upgrade", + "dateStarted": "2019-07-13T16:26:14.86Z", + "dateEnded": "2019-07-13T16:26:15.327Z", + "startTime": "2019-07-13T16:26:14.86Z", + "finishTime": "2019-07-13T16:26:15.327Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T16:26:15.327Z", + "dateEnded": "2019-07-13T16:26:18.267Z", + "startTime": "2019-07-13T16:26:15.327Z", + "finishTime": "2019-07-13T16:26:18.267Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T16:26:18.267Z", + "dateEnded": "2019-07-13T16:26:32.72Z", + "startTime": "2019-07-13T16:26:18.267Z", + "finishTime": "2019-07-13T16:26:32.72Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Install Helm 2.10.0", + "dateStarted": "2019-07-13T16:26:32.72Z", + "dateEnded": "2019-07-13T16:26:36.147Z", + "startTime": "2019-07-13T16:26:32.72Z", + "finishTime": "2019-07-13T16:26:36.147Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmInstaller", + "version": "0.154.0" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "helm init", + "dateStarted": "2019-07-13T16:26:36.147Z", + "dateEnded": "2019-07-13T16:26:54.97Z", + "startTime": "2019-07-13T16:26:36.147Z", + "finishTime": "2019-07-13T16:26:54.97Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmDeploy", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "helm upgrade", + "dateStarted": "2019-07-13T16:26:54.97Z", + "dateEnded": "2019-07-13T16:28:19.083Z", + "startTime": "2019-07-13T16:26:54.97Z", + "finishTime": "2019-07-13T16:28:19.083Z", + "status": "succeeded", + "rank": 8, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "HelmDeploy", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/10/logs" + }, + { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Update DNS", + "dateStarted": "2019-07-13T16:28:19.083Z", + "dateEnded": "2019-07-13T16:28:37.633Z", + "startTime": "2019-07-13T16:28:19.083Z", + "finishTime": "2019-07-13T16:28:37.633Z", + "status": "succeeded", + "rank": 9, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/11/logs" + }, + { + "id": 12, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Post-job: helm upgrade", + "dateStarted": "2019-07-13T16:28:37.633Z", + "dateEnded": "2019-07-13T16:28:37.88Z", + "startTime": "2019-07-13T16:28:37.633Z", + "finishTime": "2019-07-13T16:28:37.88Z", + "status": "succeeded", + "rank": 10, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/12/logs" + }, + { + "id": 13, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Post-job: helm init", + "dateStarted": "2019-07-13T16:28:37.88Z", + "dateEnded": "2019-07-13T16:28:38.11Z", + "startTime": "2019-07-13T16:28:37.88Z", + "finishTime": "2019-07-13T16:28:38.11Z", + "status": "succeeded", + "rank": 11, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/13/logs" + }, + { + "id": 14, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:28:38.117Z", + "dateEnded": "2019-07-13T16:28:38.137Z", + "startTime": "2019-07-13T16:28:38.117Z", + "finishTime": "2019-07-13T16:28:38.137Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 12, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2166/deployPhases/1252/tasks/14/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:26:08.12Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:26:03.313Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:28:40.917Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "issues": [] + } + ], + "rank": 18, + "definitionEnvironmentId": 25, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Prod Infra", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:26:03.313Z", + "modifiedOn": "2019-07-13T16:28:40.907Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionId)\n\n$repository= az acr list --resource-group $(commonResourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=repository]$repository\"\n\n$cluster = az aks list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=cluster]$cluster\"\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "Install Helm 2.10.0", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "helmVersion": "2.10.0", + "checkLatestHelmVersion": "true", + "installKubeCtl": "true", + "kubectlVersion": "1.8.9", + "checkLatestKubeCtl": "true" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "helm init", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectionType": "Azure Resource Manager", + "azureSubscriptionEndpoint": "$(subscriptionConnection)", + "azureResourceGroup": "$(resourceGroupName)", + "kubernetesCluster": "$(cluster)", + "kubernetesServiceEndpoint": "", + "namespace": "", + "command": "init", + "chartType": "Name", + "chartName": "", + "chartPath": "", + "version": "", + "releaseName": "", + "overrideValues": "", + "valueFile": "", + "destination": "$(Build.ArtifactStagingDirectory)", + "canaryimage": "false", + "upgradetiller": "true", + "updatedependency": "false", + "save": "true", + "install": "true", + "recreate": "false", + "resetValues": "false", + "force": "false", + "waitForExecution": "true", + "arguments": "--service-account tiller", + "enableTls": "false", + "caCert": "", + "certificate": "", + "privatekey": "", + "tillernamespace": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "0.*", + "name": "helm upgrade", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectionType": "Azure Resource Manager", + "azureSubscriptionEndpoint": "$(subscriptionConnection)", + "azureResourceGroup": "$(resourceGroupName)", + "kubernetesCluster": "$(cluster)", + "kubernetesServiceEndpoint": "", + "namespace": "", + "command": "upgrade", + "chartType": "FilePath", + "chartName": "", + "chartPath": "$(System.DefaultWorkingDirectory)/artifact/iac/$(chart)", + "version": "", + "releaseName": "$(deploymentName)", + "overrideValues": "image.tag=$(Build.BuildId),service.url=\"http://$(webSiteName).azurewebsites.net\",image.repository=\"$(repository).azurecr.io/peopletracker\"", + "valueFile": "", + "destination": "$(Build.ArtifactStagingDirectory)", + "canaryimage": "false", + "upgradetiller": "true", + "updatedependency": "false", + "save": "true", + "install": "true", + "recreate": "false", + "resetValues": "false", + "force": "false", + "waitForExecution": "true", + "arguments": "", + "enableTls": "false", + "caCert": "", + "certificate": "", + "privatekey": "", + "tillernamespace": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Update DNS", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "filePath", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/updatedns.ps1", + "arguments": "-resourceGroupName $(resourceGroupName) -servicePrincipal $(servicePrincipal) -clientSecret $(clientSecret) -goDaddyKey $(GoDaddyKey) -goDaddySecret $(GoDaddySecret) -deploymentName $(deploymentName) -name '$(dnsRecordName)' -subscriptionId $(subscriptionId) -tenatId $(tenatId) -Verbose", + "script": "# Write your powershell commands here.\n\nWrite-Host \"Hello World\"\n\n# Use the environment variables input below to pass secret variables to this script.", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/iac" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Prod Infra", + "timeToDeploy": 2.6203333333333334, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + }, + { + "id": 2167, + "releaseId": 178, + "name": "Prod Mobile", + "status": "succeeded", + "variables": {}, + "variableGroups": [ + { + "variables": { + "deploymentName": { + "value": "prod" + }, + "resourceGroupName": { + "value": "PTracker-Prod" + }, + "TestWebAppUrl": { + "value": "http://www.peopletracker.us/" + }, + "dnsRecordName": { + "value": "www" + } + }, + "type": "Vsts", + "id": 3, + "name": "PTracker Prod", + "isShared": false, + "variableGroupProjectReferences": null + } + ], + "preDeployApprovals": [ + { + "id": 3631, + "revision": 1, + "approvalType": "preDeploy", + "createdOn": "2019-07-13T16:28:41.223Z", + "modifiedOn": "2019-07-13T16:28:41.23Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 1, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2167, + "name": "Prod Mobile", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3631" + } + ], + "postDeployApprovals": [ + { + "id": 3634, + "revision": 1, + "approvalType": "postDeploy", + "createdOn": "2019-07-13T16:34:25.653Z", + "modifiedOn": "2019-07-13T16:34:25.66Z", + "status": "approved", + "comments": "", + "isAutomated": true, + "isNotificationOn": false, + "trialNumber": 1, + "attempt": 1, + "rank": 4, + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": {} + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": {} + }, + "releaseEnvironment": { + "id": 2167, + "name": "Prod Mobile", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167", + "_links": {} + }, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/approvals/3634" + } + ], + "preApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "postApprovalsSnapshot": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 0 + } + ], + "approvalOptions": { + "requiredApproverCount": null, + "releaseCreatorCanBeApprover": false, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "afterSuccessfulGates" + } + }, + "deploySteps": [ + { + "id": 3633, + "deploymentId": 1261, + "attempt": 1, + "reason": "automated", + "status": "succeeded", + "operationStatus": "Approved", + "releaseDeployPhases": [ + { + "id": 1254, + "phaseId": "1254", + "name": "Agent job", + "rank": 1, + "phaseType": "agentBasedDeployment", + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 11, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Agent job", + "dateStarted": "2019-07-13T16:33:52.597Z", + "dateEnded": "2019-07-13T16:34:23.303Z", + "startTime": "2019-07-13T16:33:52.597Z", + "finishTime": "2019-07-13T16:34:23.303Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/11/logs" + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Initialize job", + "dateStarted": "2019-07-13T16:33:52.863Z", + "dateEnded": "2019-07-13T16:33:53.247Z", + "startTime": "2019-07-13T16:33:52.863Z", + "finishTime": "2019-07-13T16:33:53.247Z", + "status": "succeeded", + "rank": 1, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/3/logs" + }, + { + "id": 4, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - iac", + "dateStarted": "2019-07-13T16:33:53.26Z", + "dateEnded": "2019-07-13T16:33:55.463Z", + "startTime": "2019-07-13T16:33:53.26Z", + "finishTime": "2019-07-13T16:33:55.463Z", + "status": "succeeded", + "rank": 2, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/4/logs" + }, + { + "id": 5, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Download artifact - artifact - mobile", + "dateStarted": "2019-07-13T16:33:55.467Z", + "dateEnded": "2019-07-13T16:33:58.537Z", + "startTime": "2019-07-13T16:33:55.467Z", + "finishTime": "2019-07-13T16:33:58.537Z", + "status": "succeeded", + "rank": 3, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "DownloadBuildArtifacts", + "version": "0.154.2" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/5/logs" + }, + { + "id": 6, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Get Resource Names", + "dateStarted": "2019-07-13T16:33:58.537Z", + "dateEnded": "2019-07-13T16:34:06.97Z", + "startTime": "2019-07-13T16:33:58.537Z", + "finishTime": "2019-07-13T16:34:06.97Z", + "status": "succeeded", + "rank": 4, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/6/logs" + }, + { + "id": 7, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Update BER", + "dateStarted": "2019-07-13T16:34:06.97Z", + "dateEnded": "2019-07-13T16:34:09.363Z", + "startTime": "2019-07-13T16:34:06.97Z", + "finishTime": "2019-07-13T16:34:09.363Z", + "status": "succeeded", + "rank": 5, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PowerShell", + "version": "2.151.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/7/logs" + }, + { + "id": 8, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy Android to Beta Testers", + "dateStarted": "2019-07-13T16:34:09.363Z", + "dateEnded": "2019-07-13T16:34:15.143Z", + "startTime": "2019-07-13T16:34:09.363Z", + "finishTime": "2019-07-13T16:34:15.143Z", + "status": "succeeded", + "rank": 6, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AppCenterDistribute", + "version": "3.154.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/8/logs" + }, + { + "id": 9, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Deploy iOS to Beta Testers", + "dateStarted": "2019-07-13T16:34:15.143Z", + "dateEnded": "2019-07-13T16:34:23.287Z", + "startTime": "2019-07-13T16:34:15.143Z", + "finishTime": "2019-07-13T16:34:23.287Z", + "status": "succeeded", + "rank": 7, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "AppCenterDistribute", + "version": "3.154.1" + }, + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/9/logs" + }, + { + "id": 10, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Finalize Job", + "dateStarted": "2019-07-13T16:34:23.293Z", + "dateEnded": "2019-07-13T16:34:23.3Z", + "startTime": "2019-07-13T16:34:23.293Z", + "finishTime": "2019-07-13T16:34:23.3Z", + "status": "succeeded", + "percentComplete": 100, + "rank": 8, + "issues": [], + "agentName": "WinBldBox-3_Service2", + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/deployPhases/1254/tasks/10/logs" + } + ] + } + ], + "manualInterventions": [], + "startedOn": "2019-07-13T16:33:49.807Z" + } + ], + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "queuedOn": "2019-07-13T16:28:40.95Z", + "lastModifiedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "descriptor": "s2s.MDAwMDAwMGQtMDAwMC04ODg4LTgwMDAtMDAwMDAwMDAwMDAwQDJjODk1OTA4LTA0ZTAtNDk1Mi04OWZkLTU0YjAwNDZkNjI4OA" + }, + "lastModifiedOn": "2019-07-13T16:34:25.673Z", + "hasStarted": true, + "tasks": [], + "runPlanId": "00000000-0000-0000-0000-000000000000", + "preDeploymentGates": { + "id": 3632, + "status": "succeeded", + "runPlanId": "00000000-0000-0000-0000-000000000000", + "deploymentJobs": [ + { + "job": { + "id": 0, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Release", + "dateStarted": "2019-07-13T16:33:42.497Z", + "dateEnded": "2019-07-13T16:33:45.607Z", + "startTime": "2019-07-13T16:33:42.497Z", + "finishTime": "2019-07-13T16:33:45.607Z", + "status": "succeeded", + "rank": 2, + "issues": [] + }, + "tasks": [ + { + "id": 3, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Invoke REST API: GET", + "dateStarted": "2019-07-13T16:33:45.187Z", + "dateEnded": "2019-07-13T16:33:45.49Z", + "startTime": "2019-07-13T16:33:45.187Z", + "finishTime": "2019-07-13T16:33:45.49Z", + "status": "succeeded", + "rank": null, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "InvokeRESTAPI", + "version": "1.152.1" + }, + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/gates/3632/tasks/3/logs" + } + ] + }, + { + "job": { + "id": 0, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Release", + "dateStarted": "2019-07-13T16:28:41.56Z", + "dateEnded": "2019-07-13T16:28:43.427Z", + "startTime": "2019-07-13T16:28:41.56Z", + "finishTime": "2019-07-13T16:28:43.427Z", + "status": "succeeded", + "rank": 1, + "issues": [] + }, + "tasks": [ + { + "id": 2, + "timelineRecordId": "00000000-0000-0000-0000-000000000000", + "name": "Invoke REST API: GET", + "dateStarted": "2019-07-13T16:28:43.05Z", + "dateEnded": "2019-07-13T16:28:43.327Z", + "startTime": "2019-07-13T16:28:43.05Z", + "finishTime": "2019-07-13T16:28:43.327Z", + "status": "succeeded", + "rank": null, + "issues": [], + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "InvokeRESTAPI", + "version": "1.152.1" + }, + "logUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2167/gates/3632/tasks/2/logs" + } + ] + } + ], + "startedOn": "2019-07-13T16:28:41.243Z", + "lastModifiedOn": "2019-07-13T16:33:46.007Z", + "stabilizationCompletedOn": "2019-07-13T16:33:41.703Z", + "succeedingSince": "2019-07-13T16:33:45.867Z" + }, + "issues": [] + } + ], + "rank": 19, + "definitionEnvironmentId": 26, + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": true, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [ + { + "result": true, + "name": "Prod K8s", + "conditionType": "environmentState", + "value": "4" + }, + { + "result": true, + "name": "Prod Database", + "conditionType": "environmentState", + "value": "4" + }, + { + "result": true, + "name": "Prod Web Service", + "conditionType": "environmentState", + "value": "4" + } + ], + "createdOn": "2019-07-13T16:28:40.95Z", + "modifiedOn": "2019-07-13T16:34:25.66Z", + "workflowTasks": [], + "deployPhasesSnapshot": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "agentSpecification": null, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [ + { + "alias": "artifact", + "artifactType": "Build", + "artifactDownloadMode": "Selective", + "artifactItems": [ + "mobile/**", + "iac/**" + ] + } + ] + }, + "queueId": 81, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Agent job", + "refName": null, + "workflowTasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Get Resource Names", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "", + "arguments": "", + "script": "az login --service-principal --username $(servicePrincipal) --password $(clientSecret) --tenant $(tenatId) --output $(output)\naz account set --subscription $(subscriptionId)\n\n$webSiteName= az webapp list --resource-group $(resourceGroupName) --query [].name --output tsv\nWrite-Output \"##vso[task.setvariable variable=webSiteName]$webSiteName\"", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "2.*", + "name": "Update BER", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "targetType": "inline", + "filePath": "$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1", + "arguments": "-value 'http://$(webSiteName).azurewebsites.net'", + "script": "# Read the version from the file passed in by build\n$version = Get-Content .\\version.txt -Raw\n$version = $version.Trim()\n\n\n$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1 -berUrl $(berUrl) -appName $(appName) -dataType $(dataType) -version $version -value 'http://$(webSiteName).azurewebsites.net' -verbose\n\n$(System.DefaultWorkingDirectory)/artifact/iac/ber.ps1 -berUrl $(berUrl) -appName $(appName) -dataType Env -version $version -value 'Prod' -verbose", + "errorActionPreference": "stop", + "failOnStderr": "false", + "ignoreLASTEXITCODE": "false", + "pwsh": "false", + "workingDirectory": "$(System.DefaultWorkingDirectory)/artifact/mobile" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "3.*", + "name": "Deploy Android to Beta Testers", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "serverEndpoint": "00000000-0000-0000-0000-000000000000", + "appSlug": "Trackyon/People-Tracker-Android", + "app": "$(System.DefaultWorkingDirectory)/artifact/mobile/PeopleTracker.Mobile.Droid.apk", + "symbolsType": "Apple", + "symbolsPath": "", + "pdbPath": "**/*.pdb", + "dsymPath": "", + "mappingTxtPath": "", + "packParentFolder": "false", + "releaseNotesSelection": "file", + "releaseNotesInput": "", + "releaseNotesFile": "$(System.DefaultWorkingDirectory)/artifact/mobile/ReleaseNotes.txt", + "isMandatory": "false", + "destinationType": "groups", + "destinationGroupIds": "", + "destinationStoreId": "", + "isSilent": "false" + } + }, + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "3.*", + "name": "Deploy iOS to Beta Testers", + "refName": "", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "serverEndpoint": "00000000-0000-0000-0000-000000000000", + "appSlug": "Trackyon/People-Tracker", + "app": "$(System.DefaultWorkingDirectory)/artifact/mobile/PeopleTrackerMobileiOS.ipa", + "symbolsType": "Apple", + "symbolsPath": "", + "pdbPath": "**/*.pdb", + "dsymPath": "", + "mappingTxtPath": "", + "packParentFolder": "false", + "releaseNotesSelection": "file", + "releaseNotesInput": "", + "releaseNotesFile": "$(System.DefaultWorkingDirectory)/artifact/mobile/ReleaseNotes.txt", + "isMandatory": "false", + "destinationType": "groups", + "destinationGroupIds": "", + "destinationStoreId": "", + "isSilent": "false" + } + } + ] + } + ], + "owner": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "schedules": [], + "release": { + "id": 178, + "name": "Release-132", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + } + } + }, + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + }, + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + } + } + }, + "releaseCreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com", + "imageUrl": "https://dev.azure.com/test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "triggerReason": "After successful deployment of Prod K8s,Prod Database,Prod Web Service", + "timeToDeploy": 0.6587333333333334, + "processParameters": {}, + "preDeploymentGatesSnapshot": { + "id": 92, + "gatesOptions": { + "isEnabled": true, + "timeout": 1440, + "samplingInterval": 5, + "stabilizationTime": 5, + "minimumSuccessDuration": 0 + }, + "gates": [ + { + "tasks": [ + { + "environment": {}, + "taskId": "00000000-0000-0000-0000-000000000000", + "version": "1.*", + "name": "Invoke REST API: GET", + "enabled": true, + "alwaysRun": false, + "continueOnError": false, + "timeoutInMinutes": 0, + "definitionType": "task", + "overrideInputs": {}, + "condition": "succeeded()", + "inputs": { + "connectedServiceNameSelector": "connectedServiceName", + "connectedServiceName": "00000000-0000-0000-0000-000000000000", + "connectedServiceNameARM": "", + "method": "GET", + "headers": "{\n}", + "body": "", + "urlSuffix": "", + "waitForCompletion": "false", + "successCriteria": "" + } + } + ] + } + ] + }, + "postDeploymentGatesSnapshot": { + "id": 0, + "gatesOptions": null, + "gates": [] + } + } + ], + "variables": { + "appName": { + "value": "PeopleTracker.Mobile" + }, + "berUrl": { + "value": "http://ber.peopletracker.us" + }, + "BrowserToUse": { + "value": "phantomjs" + }, + "chart": { + "value": "peopletracker" + }, + "clientSecret": { + "value": null, + "isSecret": true + }, + "commonResourceGroupName": { + "value": "PTracker-Common" + }, + "dataType": { + "value": "back-end" + }, + "dblogin": { + "value": "dbrown" + }, + "dbpassword": { + "value": null, + "isSecret": true + }, + "endip": { + "value": "0.0.0.0" + }, + "GoDaddyKey": { + "value": "36LRyZAEoG_FcWauys457N1MqNNCC3P1H" + }, + "GoDaddySecret": { + "value": null, + "isSecret": true + }, + "JWTTokenKey": { + "value": null, + "isSecret": true + }, + "location": { + "value": "eastus2" + }, + "output": { + "value": "jsonc" + }, + "servicePrincipal": { + "value": "00000000-0000-0000-0000-000000000000" + }, + "startip": { + "value": "0.0.0.0" + }, + "subscriptionId": { + "value": "00000000-0000-0000-0000-000000000000", + "allowOverride": true + }, + "system.debug": { + "value": "false", + "allowOverride": true + }, + "tenatId": { + "value": "00000000-0000-0000-0000-000000000000" + }, + "subscriptionConnection": { + "value": "PM_DONOVANBROWN" + } + }, + "variableGroups": [], + "artifacts": [ + { + "sourceId": "00000000-0000-0000-0000-000000000000:23", + "type": "Build", + "alias": "artifact", + "definitionReference": { + "artifactSourceDefinitionUrl": { + "id": "https://dev.azure.com/test/_permalink/_build/index?collectionId=00000000-0000-0000-0000-000000000000&projectId=00000000-0000-0000-0000-000000000000&definitionId=23", + "name": "" + }, + "buildUri": { + "id": "vstfs:///Build/Build/358", + "name": null + }, + "definition": { + "id": "23", + "name": "PTracker-CI" + }, + "IsTriggeringArtifact": { + "id": "True", + "name": "True" + }, + "IsXamlBuildArtifactType": { + "id": "False", + "name": null + }, + "pullRequestMergeCommitId": { + "id": "cada3319a0970da5028d37adf65bb226db53724f", + "name": null + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "azcliTest" + }, + "repository.provider": { + "id": "TfsGit", + "name": null + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker" + }, + "requestedFor": { + "id": "Donovan Brown", + "name": null + }, + "requestedForId": { + "id": "00000000-0000-0000-0000-000000000000", + "name": null + }, + "sourceVersion": { + "id": "cada3319a0970da5028d37adf65bb226db53724f", + "name": null + }, + "version": { + "id": "358", + "name": "358" + }, + "artifactSourceVersionUrl": { + "id": "https://dev.azure.com/test/_permalink/_build/index?collectionId=00000000-0000-0000-0000-000000000000&projectId=00000000-0000-0000-0000-000000000000&buildId=358", + "name": "" + }, + "branch": { + "id": "refs/heads/ai", + "name": "refs/heads/ai" + } + }, + "isPrimary": true, + "isRetained": true + } + ], + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + }, + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + } + } + }, + "releaseDefinitionRevision": 75, + "description": "Triggered by PTracker-CI 358.", + "reason": "continuousIntegration", + "releaseNameFormat": "Release-$(rev:r)", + "keepForever": false, + "definitionSnapshotRevision": 1, + "logsContainerUrl": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/logs", + "url": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178" + }, + "web": { + "href": "https://dev.azure.com/test/00000000-0000-0000-0000-000000000000/_release?releaseId=178&_a=release-summary" + } + }, + "tags": [], + "triggeringArtifactAlias": null, + "projectReference": { + "id": "00000000-0000-0000-0000-000000000000", + "name": null + }, + "properties": {} +} diff --git a/Tests/SampleFiles/Get-VSTeamRelease.json b/Tests/SampleFiles/Get-VSTeamRelease.json new file mode 100644 index 000000000..a3612ad05 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamRelease.json @@ -0,0 +1,177 @@ +{ + "count": 2, + "value": [ + { + "id": 259, + "name": "Release-194", + "status": "active", + "createdOn": "2019-11-14T00:56:09.397Z", + "modifiedOn": "2019-11-14T00:56:09.397Z", + "modifiedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted", + "descriptor": "aad.Redacted" + }, + "createdBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted", + "descriptor": "aad.Redacted" + }, + "createdFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted", + "descriptor": "aad.Redacted" + }, + "variables": {}, + "variableGroups": [], + "releaseDefinition": { + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + } + } + }, + "releaseDefinitionRevision": 118, + "description": "Triggered by PTracker-CI 568.", + "reason": "continuousIntegration", + "releaseNameFormat": "Release-$(rev:r)", + "keepForever": false, + "definitionSnapshotRevision": 1, + "logsContainerUrl": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/259/logs", + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/259", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/259" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_release?releaseId=259&_a=release-summary" + } + }, + "tags": [], + "triggeringArtifactAlias": null, + "projectReference": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker" + }, + "properties": {} + }, + { + "id": 258, + "name": "Release-17", + "status": "active", + "createdOn": "2019-11-13T23:01:55.823Z", + "modifiedOn": "2019-11-13T23:01:55.823Z", + "modifiedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted", + "descriptor": "aad.Redacted" + }, + "createdBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted", + "descriptor": "aad.Redacted" + }, + "createdFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.Redacted", + "descriptor": "aad.Redacted" + }, + "variables": {}, + "variableGroups": [], + "releaseDefinition": { + "id": 7, + "name": "PTracker-CD - NoMobile", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/7", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/7" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_release?definitionId=7" + } + } + }, + "releaseDefinitionRevision": 6, + "description": "Triggered by PTracker-CI-NoMobile 567.", + "reason": "continuousIntegration", + "releaseNameFormat": "Release-$(rev:r)", + "keepForever": false, + "definitionSnapshotRevision": 1, + "logsContainerUrl": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/258/logs", + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/258", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/258" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_release?releaseId=258&_a=release-summary" + } + }, + "tags": [], + "triggeringArtifactAlias": null, + "projectReference": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker" + }, + "properties": {} + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamReleaseDefinition-ReleaseId40.json b/Tests/SampleFiles/Get-VSTeamReleaseDefinition-ReleaseId40.json new file mode 100644 index 000000000..c5d05a394 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamReleaseDefinition-ReleaseId40.json @@ -0,0 +1,186 @@ +{ + "source": "restApi", + "revision": 1, + "description": null, + "createdBy": { + "displayName": "Chuck Reinhart", + "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/fabrikam/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "fabfiber@outlook.com", + "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "createdOn": "2018-12-11T04:48:42.657Z", + "modifiedBy": { + "displayName": "Chuck Reinhart", + "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/fabrikam/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "fabfiber@outlook.com", + "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "modifiedOn": "2018-12-11T04:48:42.657Z", + "isDeleted": false, + "variables": {}, + "variableGroups": [], + "environments": [ + { + "id": 40, + "name": "PROD", + "rank": 1, + "owner": { + "displayName": "Chuck Reinhart", + "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/fabrikam/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "fabfiber@outlook.com", + "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "variables": {}, + "variableGroups": [], + "preDeployApprovals": { + "approvals": [ + { + "rank": 1, + "isAutomated": false, + "isNotificationOn": false, + "approver": { + "displayName": "Chuck Reinhart", + "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/fabrikam/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "fabfiber@outlook.com", + "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000", + "descriptor": "aad.redacted" + }, + "id": 118 + } + ], + "approvalOptions": { + "requiredApproverCount": 0, + "releaseCreatorCanBeApprover": true, + "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, + "enforceIdentityRevalidation": false, + "timeoutInMinutes": 0, + "executionOrder": "beforeGates" + } + }, + "deployStep": { + "id": 119 + }, + "postDeployApprovals": { + "approvals": [ + { + "rank": 1, + "isAutomated": true, + "isNotificationOn": false, + "id": 120 + } + ] + }, + "deployPhases": [ + { + "deploymentInput": { + "parallelExecution": { + "parallelExecutionType": "none" + }, + "skipArtifactsDownload": false, + "artifactsDownloadInput": { + "downloadInputs": [] + }, + "queueId": 15, + "demands": [], + "enableAccessToken": false, + "timeoutInMinutes": 0, + "jobCancelTimeoutInMinutes": 1, + "condition": "succeeded()", + "overrideInputs": {} + }, + "rank": 1, + "phaseType": "agentBasedDeployment", + "name": "Run on agent", + "refName": null, + "workflowTasks": [] + } + ], + "environmentOptions": { + "emailNotificationType": "OnlyOnFailure", + "emailRecipients": "release.environment.owner;release.creator", + "skipArtifactsDownload": false, + "timeoutInMinutes": 0, + "enableAccessToken": false, + "publishDeploymentStatus": false, + "badgeEnabled": false, + "autoLinkWorkItems": false, + "pullRequestDeploymentEnabled": false + }, + "demands": [], + "conditions": [], + "executionPolicy": { + "concurrencyCount": 0, + "queueDepthCount": 0 + }, + "schedules": [], + "currentRelease": { + "id": 0, + "url": "https://vsrm.dev.azure.com/fabrikam/00000000-0000-0000-0000-000000000000/_apis/Release/releases/0", + "_links": {} + }, + "retentionPolicy": { + "daysToKeep": 30, + "releasesToKeep": 3, + "retainBuild": true + }, + "properties": {}, + "preDeploymentGates": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "postDeploymentGates": { + "id": 0, + "gatesOptions": null, + "gates": [] + }, + "environmentTriggers": [], + "badgeUrl": "https://vsrm.dev.azure.com/fabrikam/_apis/public/Release/badge/00000000-0000-0000-0000-000000000000/40/40" + } + ], + "artifacts": [], + "triggers": [], + "releaseNameFormat": "", + "tags": [], + "properties": {}, + "id": 40, + "name": "Fabrikam-web", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/fabrikam/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/40", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/fabrikam/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/40" + }, + "web": { + "href": "https://dev.azure.com/fabrikam/00000000-0000-0000-0000-000000000000/_release?definitionId=40" + } + } +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamReleaseDefinition.json b/Tests/SampleFiles/Get-VSTeamReleaseDefinition.json new file mode 100644 index 000000000..579e6020c --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamReleaseDefinition.json @@ -0,0 +1,172 @@ +{ + "count": 2, + "value": [ + { + "source": "userInterface", + "revision": 118, + "description": null, + "createdBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "createdOn": "2019-03-24T16:46:08.79Z", + "modifiedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "modifiedOn": "2019-09-16T14:32:37.323Z", + "isDeleted": true, + "variableGroups": null, + "artifacts": [ + { + "sourceId": "00000000-0000-0000-0000-000000000000:ptrackeracra7617e.azurecr.io:peopletracker", + "type": "AzureContainerRepository", + "alias": "acr", + "definitionReference": { + "connection": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "ca-dbrown-demo-test" + }, + "defaultVersionType": { + "id": "latestType", + "name": "Latest" + }, + "definition": { + "id": "peopletracker", + "name": "peopletracker" + }, + "registryurl": { + "id": "ptrackeracra7617e.azurecr.io", + "name": "ptrackeracra7617e" + }, + "resourcegroup": { + "id": "PTracker-Common", + "name": "PTracker-Common" + } + }, + "isRetained": false + }, + { + "sourceId": "00000000-0000-0000-0000-000000000000:23", + "type": "Build", + "alias": "artifact", + "definitionReference": { + "artifactSourceDefinitionUrl": { + "id": "https://dev.azure.com/Test/_permalink/_build/index?collectionId=00000000-0000-0000-0000-000000000000&projectId=00000000-0000-0000-0000-000000000000&definitionId=23", + "name": "" + }, + "defaultVersionBranch": { + "id": "", + "name": "" + }, + "defaultVersionSpecific": { + "id": "", + "name": "" + }, + "defaultVersionTags": { + "id": "", + "name": "" + }, + "defaultVersionType": { + "id": "latestType", + "name": "Latest" + }, + "definition": { + "id": "23", + "name": "azcliTest-CI" + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "azcliTest" + } + }, + "isPrimary": true, + "isRetained": false + } + ], + "releaseNameFormat": "Release-$(rev:r)", + "properties": {}, + "id": 2, + "name": "PTracker-CD", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_release?definitionId=2" + } + } + }, + { + "source": "userInterface", + "revision": 6, + "description": null, + "createdBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "createdOn": "2019-08-09T21:36:56.31Z", + "modifiedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@Test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", + "descriptor": "aad.redacted" + }, + "modifiedOn": "2019-08-09T22:16:43.213Z", + "isDeleted": false, + "variableGroups": null, + "releaseNameFormat": "Release-$(rev:r)", + "properties": {}, + "id": 7, + "name": "PTracker-CD - NoMobile", + "path": "\\", + "projectReference": null, + "url": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/7", + "_links": { + "self": { + "href": "https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/7" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_release?definitionId=7" + } + } + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamRelease_2017.json b/Tests/SampleFiles/Get-VSTeamRelease_2017.json new file mode 100644 index 000000000..fb02b4809 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamRelease_2017.json @@ -0,0 +1,42 @@ +{ + "count": 1, + "value": [ + { + "source": "userInterface", + "id": 1, + "revision": 2, + "name": "CD", + "description": null, + "createdBy": { + "id": "fc43189b-9a5a-4887-933c-efaabf280e6e", + "displayName": "Administrator", + "uniqueName": "TFS2017\\Administrator", + "url": "http://tfs2017:8080/tfs/DefaultCollection/_apis/Identities/fc43189b-9a5a-4887-933c-efaabf280e6e", + "imageUrl": "http://tfs2017:8080/tfs/DefaultCollection/_api/_common/identityImage?id=fc43189b-9a5a-4887-933c-efaabf280e6e" + }, + "createdOn": "2020-09-07T14:23:07.98Z", + "modifiedBy": { + "id": "fc43189b-9a5a-4887-933c-efaabf280e6e", + "displayName": "Administrator", + "uniqueName": "TFS2017\\Administrator", + "url": "http://tfs2017:8080/tfs/DefaultCollection/_apis/Identities/fc43189b-9a5a-4887-933c-efaabf280e6e", + "imageUrl": "http://tfs2017:8080/tfs/DefaultCollection/_api/_common/identityImage?id=fc43189b-9a5a-4887-933c-efaabf280e6e" + }, + "modifiedOn": "2020-09-07T14:23:24.92Z", + "lastRelease": null, + "path": "\\", + "variableGroups": null, + "releaseNameFormat": "Release-$(rev:r)", + "url": "http://tfs2017:8080/tfs/DefaultCollection/6d9e468a-4961-4b69-a855-96b15e758f63/_apis/Release/definitions/1", + "_links": { + "self": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/6d9e468a-4961-4b69-a855-96b15e758f63/_apis/Release/definitions/1" + }, + "web": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/6d9e468a-4961-4b69-a855-96b15e758f63/_release?definitionId=1" + } + }, + "properties": {} + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamResourceArea.json b/Tests/SampleFiles/Get-VSTeamResourceArea.json new file mode 100644 index 000000000..5d4348aea --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamResourceArea.json @@ -0,0 +1,15 @@ +{ + "count": 2, + "value": [ + { + "id": "fb13a388-40dd-4a04-b530-013a739c72ef", + "name": "policy", + "locationUrl": "https://dev.azure.com/Test/" + }, + { + "id": "c73a23a1-59bb-458c-8ce3-02c83215e015", + "name": "Licensing", + "locationUrl": "https://vssps.dev.azure.com/Test/" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamSecurityNamespace.json b/Tests/SampleFiles/Get-VSTeamSecurityNamespace.json new file mode 100644 index 000000000..1f93271ed --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamSecurityNamespace.json @@ -0,0 +1,323 @@ +{ + "count": 6, + "value": [ + { + "namespaceId": "00000000-0000-0000-0000-000000000000", + "name": "Analytics", + "displayName": "Analytics", + "separatorValue": "/", + "elementLength": -1, + "writePermission": 2, + "readPermission": 1, + "dataspaceCategory": "Default", + "actions": [ + { + "bit": 1, + "name": "Read", + "displayName": "View analytics", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 2, + "name": "Administer", + "displayName": "Manage analytics permissions", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 4, + "name": "Stage", + "displayName": "Push the data to staging area", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 8, + "name": "ExecuteUnrestrictedQuery", + "displayName": "Execute query without any restrictions on the query form", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 16, + "name": "ReadEuii", + "displayName": "Read EUII data", + "namespaceId": "00000000-0000-0000-0000-000000000000" + } + ], + "structureValue": 1, + "extensionType": null, + "isRemotable": false, + "useTokenTranslator": false, + "systemBitMask": 30 + }, + { + "namespaceId": "00000000-0000-0000-0000-000000000000", + "name": "AnalyticsViews", + "displayName": "AnalyticsViews", + "separatorValue": "/", + "elementLength": -1, + "writePermission": 1024, + "readPermission": 1, + "dataspaceCategory": "Default", + "actions": [ + { + "bit": 1, + "name": "Read", + "displayName": "View shared Analytics views", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 2, + "name": "Edit", + "displayName": "Edit shared Analytics views", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 4, + "name": "Delete", + "displayName": "Delete shared Analytics views", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 8, + "name": "Execute", + "displayName": "Execute Analytics views", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 1024, + "name": "ManagePermissions", + "displayName": "Manage", + "namespaceId": "00000000-0000-0000-0000-000000000000" + } + ], + "structureValue": 1, + "extensionType": "Microsoft.VisualStudio.Services.Analytics.AnalyticsViewsSecurityExtension", + "isRemotable": false, + "useTokenTranslator": false, + "systemBitMask": 8 + }, + { + "namespaceId": "00000000-0000-0000-0000-000000000000", + "name": "PipelineCachePrivileges", + "displayName": null, + "separatorValue": "/", + "elementLength": -1, + "writePermission": 2, + "readPermission": 1, + "dataspaceCategory": "Default", + "actions": [ + { + "bit": 1, + "name": "Read", + "displayName": "Read pipeline cache entries", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 2, + "name": "Write", + "displayName": "Write pipeline cache entries", + "namespaceId": "00000000-0000-0000-0000-000000000000" + } + ], + "structureValue": 1, + "extensionType": null, + "isRemotable": false, + "useTokenTranslator": false, + "systemBitMask": 0 + }, + { + "namespaceId": "00000000-0000-0000-0000-000000000000", + "name": "ReleaseManagement", + "displayName": "ReleaseManagement", + "separatorValue": "/", + "elementLength": -1, + "writePermission": 0, + "readPermission": 0, + "dataspaceCategory": "ReleaseManagement", + "actions": [ + { + "bit": 1, + "name": "ViewTaskEditor", + "displayName": "View task editor", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 2, + "name": "ViewCDWorkflowEditor", + "displayName": "View CD workflow editor", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 4, + "name": "ExportReleaseDefinition", + "displayName": "Export release pipeline", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 8, + "name": "ViewLegacyUI", + "displayName": "View legacy UI", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 16, + "name": "DeploymentSummaryAcrossProjects", + "displayName": "Deployment summary across projects", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 32, + "name": "ViewExternalArtifactCommitsAndWorkItems", + "displayName": "View external artifact commits and work items", + "namespaceId": "00000000-0000-0000-0000-000000000000" + } + ], + "structureValue": 1, + "extensionType": null, + "isRemotable": false, + "useTokenTranslator": false, + "systemBitMask": 0 + }, + { + "namespaceId": "00000000-0000-0000-0000-000000000000", + "name": "ReleaseManagement", + "displayName": "ReleaseManagement", + "separatorValue": "/", + "elementLength": -1, + "writePermission": 512, + "readPermission": 0, + "dataspaceCategory": "ReleaseManagement", + "actions": [ + { + "bit": 1, + "name": "ViewReleaseDefinition", + "displayName": "View release pipeline", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 2, + "name": "EditReleaseDefinition", + "displayName": "Edit release pipeline", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 4, + "name": "DeleteReleaseDefinition", + "displayName": "Delete release pipeline", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 8, + "name": "ManageReleaseApprovers", + "displayName": "Manage release approvers", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 16, + "name": "ManageReleases", + "displayName": "Manage releases", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 32, + "name": "ViewReleases", + "displayName": "View releases", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 64, + "name": "CreateReleases", + "displayName": "Create releases", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 128, + "name": "EditReleaseEnvironment", + "displayName": "Edit release stage", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 256, + "name": "DeleteReleaseEnvironment", + "displayName": "Delete release stage", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 512, + "name": "AdministerReleasePermissions", + "displayName": "Administer release permissions", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 1024, + "name": "DeleteReleases", + "displayName": "Delete releases", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 2048, + "name": "ManageDeployments", + "displayName": "Manage deployments", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 4096, + "name": "ManageReleaseSettings", + "displayName": "Manage release settings", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 8192, + "name": "ManageTaskHubExtension", + "displayName": "Manage TaskHub Extension", + "namespaceId": "00000000-0000-0000-0000-000000000000" + } + ], + "structureValue": 1, + "extensionType": null, + "isRemotable": false, + "useTokenTranslator": false, + "systemBitMask": 0 + }, + { + "namespaceId": "00000000-0000-0000-0000-000000000000", + "name": "AuditLog", + "displayName": "AuditLog", + "separatorValue": "\u0000", + "elementLength": -1, + "writePermission": 2, + "readPermission": 1, + "dataspaceCategory": "Default", + "actions": [ + { + "bit": 1, + "name": "Read", + "displayName": "View audit log", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 2, + "name": "Write", + "displayName": "Write to the audit log", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 4, + "name": "Manage_Streams", + "displayName": "Manage audit streams", + "namespaceId": "00000000-0000-0000-0000-000000000000" + }, + { + "bit": 8, + "name": "Delete_Streams", + "displayName": "Delete audit streams", + "namespaceId": "00000000-0000-0000-0000-000000000000" + } + ], + "structureValue": 0, + "extensionType": "Microsoft.TeamFoundation.Framework.Server.FrameworkSecurityNamespaceExtension", + "isRemotable": false, + "useTokenTranslator": false, + "systemBitMask": 2 + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamTaskGroup.json b/Tests/SampleFiles/Get-VSTeamTaskGroup.json new file mode 100644 index 000000000..762cf2a22 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamTaskGroup.json @@ -0,0 +1,192 @@ +{ + "count": 1, + "value": [ + { + "tasks": [ + { + "environment": {}, + "displayName": "Use .NET Core sdk 2.2.203", + "alwaysRun": false, + "continueOnError": false, + "condition": "succeeded()", + "enabled": true, + "timeoutInMinutes": 0, + "inputs": { + "packageType": "sdk", + "useGlobalJson": "false", + "workingDirectory": "", + "version": "2.2.203", + "vsVersion": "", + "includePreviewVersions": "false", + "installationPath": "$(Agent.ToolsDirectory)/dotnet", + "performMultiLevelLookup": "false" + }, + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + } + }, + { + "environment": {}, + "displayName": "Restore, Build & Test", + "alwaysRun": false, + "continueOnError": false, + "condition": "succeeded()", + "enabled": true, + "timeoutInMinutes": 0, + "inputs": { + "command": "test", + "publishWebProjects": "true", + "projects": "src/PeopleTracker.BerService.Tests/PeopleTracker.BerService.Tests.csproj", + "custom": "", + "arguments": "--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude=\"[xunit*]*\" /p:CoverletOutput=src/PeopleTracker.BerService.Tests/TestResults/Coverage/", + "restoreArguments": "", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "true", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "" + }, + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + } + }, + { + "environment": {}, + "displayName": "Publish", + "alwaysRun": false, + "continueOnError": false, + "condition": "succeeded()", + "enabled": true, + "timeoutInMinutes": 0, + "inputs": { + "command": "publish", + "publishWebProjects": "false", + "projects": "src/PeopleTracker.BerService/*.csproj", + "custom": "", + "arguments": "-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory)", + "restoreArguments": "", + "publishTestResults": "true", + "testRunTitle": "", + "zipAfterPublish": "true", + "modifyOutputPath": "false", + "selectOrConfig": "select", + "feedRestore": "", + "includeNuGetOrg": "true", + "nugetConfigPath": "", + "externalEndpoints": "", + "noCache": "false", + "packagesDirectory": "", + "verbosityRestore": "Detailed", + "searchPatternPush": "$(Build.ArtifactStagingDirectory)/*.nupkg", + "nuGetFeedType": "internal", + "feedPublish": "", + "publishPackageMetadata": "true", + "externalEndpoint": "", + "searchPatternPack": "**/*.csproj", + "configurationToPack": "$(BuildConfiguration)", + "outputDir": "$(Build.ArtifactStagingDirectory)", + "nobuild": "false", + "includesymbols": "false", + "includesource": "false", + "versioningScheme": "off", + "versionEnvVar": "", + "requestedMajorVersion": "1", + "requestedMinorVersion": "0", + "requestedPatchVersion": "0", + "buildProperties": "", + "verbosityPack": "Detailed", + "workingDirectory": "src/PeopleTracker.BerService" + }, + "task": { + "id": "00000000-0000-0000-0000-000000000000", + "versionSpec": "2.*", + "definitionType": "task" + } + } + ], + "runsOn": [ + "Agent" + ], + "revision": 1, + "createdBy": { + "displayName": "Donovan Brown", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com" + }, + "createdOn": "2020-09-14T00:39:45.73Z", + "modifiedBy": { + "displayName": "Donovan Brown", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "test@test.com" + }, + "modifiedOn": "2020-09-14T00:39:45.73Z", + "id": "00000000-0000-0000-0000-000000000000", + "name": "dotnet", + "version": { + "major": 1, + "minor": 0, + "patch": 0, + "isTest": false + }, + "iconUrl": "https://cdn.vsassets.io/v/M174_20200910.4/_content/icon-meta-task.png", + "friendlyName": "dotnet", + "description": "Installs dotnet, builds, tests, and published the project.", + "category": "Build", + "definitionType": "metaTask", + "author": "Donovan Brown", + "demands": [], + "groups": [], + "inputs": [ + { + "aliases": [], + "options": {}, + "properties": {}, + "name": "BuildConfiguration", + "label": "BuildConfiguration", + "defaultValue": "release", + "required": true, + "type": "string", + "helpMarkDown": "", + "groupName": "" + } + ], + "satisfies": [], + "sourceDefinitions": [], + "dataSourceBindings": [], + "instanceNameFormat": "Task group: dotnet $(BuildConfiguration)", + "preJobExecution": {}, + "execution": {}, + "postJobExecution": {} + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamTfvcBranch-ProjectName.json b/Tests/SampleFiles/Get-VSTeamTfvcBranch-ProjectName.json new file mode 100644 index 000000000..03ac6e9eb --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamTfvcBranch-ProjectName.json @@ -0,0 +1,34 @@ +{ + "count": 2, + "value": [ + { + "path": "$/iStay/Trunk", + "owner": { + "displayName": "Test User", + "url": "https://spsprodwus21.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000" + }, + "createdDate": "2020-09-08T23:59:27.933Z", + "url": "https://dev.azure.com/Test/iStay/_apis/tfvc/branches/$/iStay/Trunk", + "relatedBranches": [], + "mappings": [] + }, + { + "path": "$/iStay/Feature1", + "description": "Branched from $/iStay/Trunk", + "owner": { + "displayName": "Test User", + "url": "https://spsprodwus21.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_api/_common/identityImage?id=00000000-0000-0000-0000-000000000000" + }, + "createdDate": "2020-09-09T00:00:31.273Z", + "url": "https://dev.azure.com/Test/iStay/_apis/tfvc/branches/$/iStay/Feature1", + "relatedBranches": [], + "mappings": [] + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamUser.json b/Tests/SampleFiles/Get-VSTeamUser.json new file mode 100644 index 000000000..92b8d7cda --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamUser.json @@ -0,0 +1,119 @@ +{ + "count": 4, + "value": [ + { + "subjectKind": "user", + "domain": "AgentPool", + "principalName": "00000000-0000-0000-0000-000000000011", + "mailAddress": "", + "origin": "vsts", + "originId": "00000000-0000-0000-0000-000000000001", + "displayName": "Agent Pool Service (10)", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Users/redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/redacted" + }, + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "url": "https://vssps.dev.azure.com/Test/_apis/Graph/Users/redacted", + "descriptor": "redacted" + }, + { + "subjectKind": "user", + "domain": "GitHub App", + "principalName": "00000000-0000-0000-0000-000000000000", + "mailAddress": "", + "origin": "vsts", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "GitHub", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Users/Redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/Redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/Redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/Redacted" + }, + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/Redacted" + } + }, + "url": "https://vssps.dev.azure.com/Test/_apis/Graph/Users/Redacted", + "descriptor": "Redacted" + }, + { + "subjectKind": "user", + "domain": "Build", + "principalName": "00000000-0000-0000-0000-000000000000", + "mailAddress": "", + "origin": "vsts", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "SmartHotel Build Service (Test)", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Users/Redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/Redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/Redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/Redacted" + }, + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/Redacted" + } + }, + "url": "https://vssps.dev.azure.com/Test/_apis/Graph/Users/Redacted", + "descriptor": "Redacted" + }, + { + "subjectKind": "user", + "metaType": "member", + "directoryAlias": "test", + "domain": "00000000-0000-0000-0000-000000000088", + "principalName": "test@microsoft.com", + "mailAddress": "test@microsoft.com", + "origin": "aad", + "originId": "00000000-0000-0000-0000-000000000008", + "displayName": "Donovan Brown", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Users/Redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/Redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/Redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/Redacted" + }, + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/Redacted" + } + }, + "url": "https://vssps.dev.azure.com/Test/_apis/Graph/Users/Redacted", + "descriptor": "Redacted" + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamUserEntitlement-Id.json b/Tests/SampleFiles/Get-VSTeamUserEntitlement-Id.json new file mode 100644 index 000000000..ff69ed5e9 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamUserEntitlement-Id.json @@ -0,0 +1,74 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "user": { + "subjectKind": "user", + "metaType": "member", + "directoryAlias": "dbrown", + "domain": "00000000-0000-0000-0000-000000000000", + "principalName": "test@test.com", + "mailAddress": "test@test.com", + "origin": "aad", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Donovan Brown", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Memberships/aad.redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/MembershipStates/aad.redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/StorageKeys/aad.redacted" + }, + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "url": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted", + "descriptor": "aad.redacted" + }, + "accessLevel": { + "licensingSource": "account", + "accountLicenseType": "earlyAdopter", + "msdnLicenseType": "none", + "licenseDisplayName": "Early Adopter", + "status": "active", + "statusMessage": "", + "assignmentSource": "unknown" + }, + "lastAccessedDate": "2020-09-09T15:38:08.1632123Z", + "dateCreated": "2017-12-24T16:41:16.743Z", + "projectEntitlements": [ + { + "projectRef": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "iStay" + }, + "group": { + "groupType": "custom", + "displayName": "Custom" + }, + "projectPermissionInherited": "notInherited", + "teamRefs": [], + "assignmentSource": "unknown" + }, + { + "projectRef": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "Scrum" + }, + "group": { + "groupType": "projectAdministrator", + "displayName": "Project Administrators" + }, + "projectPermissionInherited": "notInherited", + "teamRefs": [], + "assignmentSource": "unknown" + } + ], + "extensions": [], + "groupAssignments": [] +} diff --git a/Tests/SampleFiles/Get-VSTeamUserEntitlement.json b/Tests/SampleFiles/Get-VSTeamUserEntitlement.json new file mode 100644 index 000000000..de17b3395 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamUserEntitlement.json @@ -0,0 +1,288 @@ +{ + "members": [ + { + "id": "00000000-0000-0000-0000-000000000000", + "user": { + "subjectKind": "user", + "metaType": "member", + "domain": "00000000-0000-0000-0000-000000000000", + "principalName": "mlastName@test.com", + "mailAddress": "mlastName@test.com", + "origin": "aad", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Math lastName", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Memberships/aad.redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/MembershipStates/aad.redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/StorageKeys/aad.redacted" + }, + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "url": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted", + "descriptor": "aad.redacted" + }, + "accessLevel": { + "licensingSource": "account", + "accountLicenseType": "earlyAdopter", + "msdnLicenseType": "none", + "licenseDisplayName": "Early Adopter", + "status": "active", + "statusMessage": "", + "assignmentSource": "unknown" + }, + "lastAccessedDate": "2020-09-09T06:43:29.0769722Z", + "dateCreated": "2020-02-25T05:27:12.1277176Z", + "projectEntitlements": [], + "extensions": [], + "groupAssignments": [] + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "user": { + "subjectKind": "user", + "metaType": "guest", + "directoryAlias": "dlbm3_test.com#EXT#", + "domain": "00000000-0000-0000-0000-000000000000", + "principalName": "dlbm3@test.com", + "mailAddress": "dlbm3@test.com", + "origin": "aad", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Donovan Brown", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Memberships/aad.redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/MembershipStates/aad.redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/StorageKeys/aad.redacted" + }, + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "url": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted", + "descriptor": "aad.redacted" + }, + "accessLevel": { + "licensingSource": "account", + "accountLicenseType": "earlyAdopter", + "msdnLicenseType": "none", + "licenseDisplayName": "Early Adopter", + "status": "pending", + "statusMessage": "", + "assignmentSource": "unknown" + }, + "lastAccessedDate": "0001-01-01T00:00:00Z", + "dateCreated": "2020-09-07T18:29:19.290717Z", + "projectEntitlements": [], + "extensions": [], + "groupAssignments": [] + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "user": { + "subjectKind": "user", + "metaType": "member", + "directoryAlias": "test", + "domain": "00000000-0000-0000-0000-000000000000", + "principalName": "test@test.com", + "mailAddress": "test@test.com", + "origin": "aad", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Donovan Brown", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Memberships/aad.redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/MembershipStates/aad.redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/StorageKeys/aad.redacted" + }, + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "url": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted", + "descriptor": "aad.redacted" + }, + "accessLevel": { + "licensingSource": "account", + "accountLicenseType": "earlyAdopter", + "msdnLicenseType": "none", + "licenseDisplayName": "Early Adopter", + "status": "active", + "statusMessage": "", + "assignmentSource": "unknown" + }, + "lastAccessedDate": "2020-09-09T15:38:08.1632123Z", + "dateCreated": "2017-12-24T16:41:16.743Z", + "projectEntitlements": [], + "extensions": [], + "groupAssignments": [] + } + ], + "continuationToken": null, + "totalCount": 0, + "items": [ + { + "id": "00000000-0000-0000-0000-000000000000", + "user": { + "subjectKind": "user", + "metaType": "member", + "domain": "00000000-0000-0000-0000-000000000000", + "principalName": "mlastName@test.com", + "mailAddress": "mlastName@test.com", + "origin": "aad", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Math lastName", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Memberships/aad.redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/MembershipStates/aad.redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/StorageKeys/aad.redacted" + }, + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "url": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted", + "descriptor": "aad.redacted" + }, + "accessLevel": { + "licensingSource": "account", + "accountLicenseType": "earlyAdopter", + "msdnLicenseType": "none", + "licenseDisplayName": "Early Adopter", + "status": "active", + "statusMessage": "", + "assignmentSource": "unknown" + }, + "lastAccessedDate": "2020-09-09T06:43:29.0769722Z", + "dateCreated": "2020-02-25T05:27:12.1277176Z", + "projectEntitlements": [], + "extensions": [], + "groupAssignments": [] + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "user": { + "subjectKind": "user", + "metaType": "guest", + "directoryAlias": "dlbm3_test.com#EXT#", + "domain": "00000000-0000-0000-0000-000000000000", + "principalName": "dlbm3@test.com", + "mailAddress": "dlbm3@test.com", + "origin": "aad", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Donovan Brown", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Memberships/aad.redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/MembershipStates/aad.redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/StorageKeys/aad.redacted" + }, + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "url": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted", + "descriptor": "aad.redacted" + }, + "accessLevel": { + "licensingSource": "account", + "accountLicenseType": "earlyAdopter", + "msdnLicenseType": "none", + "licenseDisplayName": "Early Adopter", + "status": "pending", + "statusMessage": "", + "assignmentSource": "unknown" + }, + "lastAccessedDate": "0001-01-01T00:00:00Z", + "dateCreated": "2020-09-07T18:29:19.290717Z", + "projectEntitlements": [], + "extensions": [], + "groupAssignments": [] + }, + { + "id": "00000000-0000-0000-0000-000000000000", + "user": { + "subjectKind": "user", + "metaType": "member", + "directoryAlias": "test", + "domain": "00000000-0000-0000-0000-000000000000", + "principalName": "test@test.com", + "mailAddress": "test@test.com", + "origin": "aad", + "originId": "00000000-0000-0000-0000-000000000000", + "displayName": "Donovan Brown", + "_links": { + "self": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted" + }, + "memberships": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Memberships/aad.redacted" + }, + "membershipState": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/MembershipStates/aad.redacted" + }, + "storageKey": { + "href": "https://vssps.dev.azure.com/toolTester/_apis/Graph/StorageKeys/aad.redacted" + }, + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/aad.redacted" + } + }, + "url": "https://vssps.dev.azure.com/toolTester/_apis/Graph/Users/aad.redacted", + "descriptor": "aad.redacted" + }, + "accessLevel": { + "licensingSource": "account", + "accountLicenseType": "earlyAdopter", + "msdnLicenseType": "none", + "licenseDisplayName": "Early Adopter", + "status": "active", + "statusMessage": "", + "assignmentSource": "unknown" + }, + "lastAccessedDate": "2020-09-09T15:38:08.1632123Z", + "dateCreated": "2017-12-24T16:41:16.743Z", + "projectEntitlements": [], + "extensions": [], + "groupAssignments": [] + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamVariableGroup-Id.json b/Tests/SampleFiles/Get-VSTeamVariableGroup-Id.json new file mode 100644 index 000000000..9af538ab2 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamVariableGroup-Id.json @@ -0,0 +1,38 @@ +{ + "variables": { + "key1": { + "value": "value" + }, + "key2": { + "value": null, + "isSecret": true + } + }, + "id": 270, + "type": "Vsts", + "name": "Testing", + "description": "Used for unit tests", + "createdBy": { + "displayName": "Test User", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com" + }, + "createdOn": "2020-09-10T22:05:50.38Z", + "modifiedBy": { + "displayName": "Test User", + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com" + }, + "modifiedOn": "2020-09-10T22:05:50.38Z", + "isShared": false, + "variableGroupProjectReferences": [ + { + "projectReference": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "iStay" + }, + "name": "Testing", + "description": "Used for unit tests" + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamVariableGroup.json b/Tests/SampleFiles/Get-VSTeamVariableGroup.json new file mode 100644 index 000000000..f7bd15aca --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamVariableGroup.json @@ -0,0 +1,64 @@ +{ + "count": 2, + "value": [ + { + "variables": { + "key1": { + "value": "value1" + }, + "key2": { + "value": null, + "isSecret": true + } + }, + "id": 1, + "type": "Vsts", + "name": "TestVariableGroup1", + "description": "A test variable group", + "createdBy": { + "displayName": "Test User", + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "uniqueName": "test.user@the.cloud" + }, + "createdOn": "2019-06-28T21:04:30.56Z", + "modifiedBy": { + "displayName": "Test User", + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "uniqueName": "test.user@the.cloud" + }, + "modifiedOn": "2019-06-28T21:04:30.56Z", + "isShared": false + }, + { + "variables": { + "key3": { + "enabled": true, + "contentType": "", + "value": null, + "isSecret": true + } + }, + "id": 2, + "type": "AzureKeyVault", + "name": "TestVariableGroup2", + "description": "A test variable group linked to an Azure KeyVault", + "providerData": { + "serviceEndpointId": "0228e842-65a7-4c64-90f7-0f07f3aa4e10", + "vault": "keyVaultName" + }, + "createdBy": { + "displayName": "Test User", + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "uniqueName": "test.user@the.cloud" + }, + "createdOn": "2019-06-21T05:51:23.8866667Z", + "modifiedBy": { + "displayName": "Test User", + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "uniqueName": "test.user@the.cloud" + }, + "modifiedOn": "2019-06-21T05:51:24.5666667Z", + "isShared": false + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/Get-VSTeamWiql.json b/Tests/SampleFiles/Get-VSTeamWiql.json new file mode 100644 index 000000000..969ada0fb --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamWiql.json @@ -0,0 +1,32 @@ +{ + "queryType": "flat", + "queryResultType": "workItem", + "asOf": "2020-09-09T17:41:59.82Z", + "columns": [ + { + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/toolTester/_apis/wit/fields/System.Id" + }, + { + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/toolTester/_apis/wit/fields/System.Title" + }, + { + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/toolTester/_apis/wit/fields/System.State" + } + ], + "workItems": [ + { + "id": 179, + "url": "https://dev.azure.com/toolTester/00000000-0000-0000-0000-000000000000/_apis/wit/workItems/179" + }, + { + "id": 180, + "url": "https://dev.azure.com/toolTester/00000000-0000-0000-0000-000000000000/_apis/wit/workItems/180" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamWorkItem-Id.json b/Tests/SampleFiles/Get-VSTeamWorkItem-Id.json new file mode 100644 index 000000000..790e841e2 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamWorkItem-Id.json @@ -0,0 +1,97 @@ +{ + "count": 2, + "value": [ + { + "id": 179, + "rev": 1, + "fields": { + "System.AreaPath": "iStay", + "System.TeamProject": "iStay", + "System.IterationPath": "iStay", + "System.WorkItemType": "Task", + "System.State": "New", + "System.Reason": "New", + "System.CreatedDate": "2020-09-09T17:40:58.497Z", + "System.CreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodwus21.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/add.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/add.redacted", + "descriptor": "add.redacted" + }, + "System.ChangedDate": "2020-09-09T17:40:58.497Z", + "System.ChangedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodwus21.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/add.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/add.redacted", + "descriptor": "add.redacted" + }, + "System.CommentCount": 0, + "System.Title": "Run Unit Tests", + "Microsoft.VSTS.Common.StateChangeDate": "2020-09-09T17:40:58.497Z", + "Microsoft.VSTS.Common.Priority": 2 + }, + "url": "https://dev.azure.com/toolTester/00000000-0000-0000-0000-000000000000/_apis/wit/workItems/179" + }, + { + "id": 180, + "rev": 1, + "fields": { + "System.AreaPath": "iStay", + "System.TeamProject": "iStay", + "System.IterationPath": "iStay", + "System.WorkItemType": "Bug", + "System.State": "New", + "System.Reason": "New", + "System.CreatedDate": "2020-09-09T17:41:56.017Z", + "System.CreatedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodwus21.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/add.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/add.redacted", + "descriptor": "add.redacted" + }, + "System.ChangedDate": "2020-09-09T17:41:56.017Z", + "System.ChangedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodwus21.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/add.redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/toolTester/_apis/GraphProfile/MemberAvatars/add.redacted", + "descriptor": "add.redacted" + }, + "System.CommentCount": 0, + "System.Title": "Fix failed tests", + "Microsoft.VSTS.Common.StateChangeDate": "2020-09-09T17:41:56.017Z", + "Microsoft.VSTS.Common.Priority": 2, + "Microsoft.VSTS.Common.Severity": "3 - Medium", + "Microsoft.VSTS.Common.ValueArea": "Business" + }, + "url": "https://dev.azure.com/toolTester/00000000-0000-0000-0000-000000000000/_apis/wit/workItems/180" + } + ] +} diff --git a/Tests/SampleFiles/Get-VSTeamWorkItem-Id16.json b/Tests/SampleFiles/Get-VSTeamWorkItem-Id16.json new file mode 100644 index 000000000..5536e8196 --- /dev/null +++ b/Tests/SampleFiles/Get-VSTeamWorkItem-Id16.json @@ -0,0 +1,44 @@ +{ + "id": 16, + "rev": 1, + "fields": { + "System.AreaPath": "TeamModuleIntegration-9ee352af251", + "System.TeamProject": "TeamModuleIntegration-9ee352af251", + "System.IterationPath": "TeamModuleIntegration-9ee352af251", + "System.WorkItemType": "Task", + "System.State": "To Do", + "System.Reason": "New task", + "System.CreatedDate": "2020-09-07T15:05:42.213Z", + "System.CreatedBy": "Administrator ", + "System.ChangedDate": "2020-09-07T15:05:42.213Z", + "System.ChangedBy": "Administrator ", + "System.Title": "Test", + "Microsoft.VSTS.Common.Priority": 2, + "Microsoft.VSTS.Common.StateChangeDate": "2020-09-07T15:05:42.213Z", + "System.Description": "Unit testing" + }, + "_links": { + "self": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/_apis/wit/workItems/16" + }, + "workItemUpdates": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/_apis/wit/workItems/16/updates" + }, + "workItemRevisions": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/_apis/wit/workItems/16/revisions" + }, + "workItemHistory": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/_apis/wit/workItems/16/history" + }, + "html": { + "href": "http://tfs2017:8080/tfs/web/wi.aspx?pcguid=383b3ccd-9646-4a84-b6af-4a5683c8baf9&id=16" + }, + "workItemType": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/6d9e468a-4961-4b69-a855-96b15e758f63/_apis/wit/workItemTypes/Task" + }, + "fields": { + "href": "http://tfs2017:8080/tfs/DefaultCollection/_apis/wit/fields" + } + }, + "url": "http://tfs2017:8080/tfs/DefaultCollection/_apis/wit/workItems/16" +} \ No newline at end of file diff --git a/Tests/SampleFiles/accessControlEntryResult.json b/Tests/SampleFiles/accessControlEntryResult.json new file mode 100644 index 000000000..09007a2c9 --- /dev/null +++ b/Tests/SampleFiles/accessControlEntryResult.json @@ -0,0 +1,13 @@ +{ + "count": 1, + "value": [ + { + "descriptor": "Microsoft.TeamFoundation.Identity;S-00000000-0000-0000-0000-000000000000-00000000-0000-0000-0000-000000000000-0-3", + "allow": 8, + "deny": 0, + "extendedInfo": { + "message": "Hello World" + } + } + ] +} \ No newline at end of file diff --git a/unit/test/sampleFiles/accessControlListResult.json b/Tests/SampleFiles/accessControlListResult.json similarity index 100% rename from unit/test/sampleFiles/accessControlListResult.json rename to Tests/SampleFiles/accessControlListResult.json diff --git a/unit/test/sampleFiles/azure-pipelines.test.yml b/Tests/SampleFiles/azure-pipelines.test.yml similarity index 100% rename from unit/test/sampleFiles/azure-pipelines.test.yml rename to Tests/SampleFiles/azure-pipelines.test.yml diff --git a/Tests/SampleFiles/bug.json b/Tests/SampleFiles/bug.json new file mode 100644 index 000000000..c501efe0e --- /dev/null +++ b/Tests/SampleFiles/bug.json @@ -0,0 +1,1129 @@ +{ + "name": "Bug", + "referenceName": "Microsoft.VSTS.WorkItemTypes.Bug", + "description": "Describes a divergence between required and actual behavior, and tracks the work done to correct the defect and verify the correction.", + "color": "CC293D", + "icon": { + "id": "icon_insect", + "url": "https://tfsprodcus3.visualstudio.com/_apis/wit/workItemIcons/icon_insect?color=CC293D&v=2" + }, + "isDisabled": false, + "xmlForm": "
", + "fields": [ + { + "defaultValue": null, + "helpText": "The iteration within which this bug will be fixed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this bug is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Stories affected and how", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = for triage; Active = not yet fixed; Resolved = fixed not yet verified; Closed = fix verified.", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the bug is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this bug", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The size of work estimated for fixing the bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StoryPoints", + "name": "Story Points", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StoryPoints" + }, + { + "defaultValue": null, + "helpText": "An estimate of the number of units of work remaining to complete this bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.RemainingWork", + "name": "Remaining Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.RemainingWork" + }, + { + "defaultValue": null, + "helpText": "Initial value for Remaining Work - set once, when work begins", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.OriginalEstimate", + "name": "Original Estimate", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.OriginalEstimate" + }, + { + "defaultValue": null, + "helpText": "The number of units of work that have been spent on this bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.CompletedWork", + "name": "Completed Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.CompletedWork" + }, + { + "defaultValue": null, + "helpText": "Type of work involved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Activity", + "name": "Activity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Activity" + }, + { + "defaultValue": null, + "helpText": "Test context, provided automatically by test infrastructure", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.SystemInfo", + "name": "System Info", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.SystemInfo" + }, + { + "defaultValue": null, + "helpText": "How to see the bug. End by contrasting expected with actual behavior.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.ReproSteps", + "name": "Repro Steps", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.ReproSteps" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the bug was resolved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Business importance. 1=must fix; 4=unimportant.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": "3 - Medium", + "helpText": "Assessment of the effect of the bug on the project.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Severity", + "name": "Severity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Severity" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": "Business", + "helpText": "The type should be set to Business primarily to represent customer-facing issues. Work to change the architecture should be added as a Requirement", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was found", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.FoundIn", + "name": "Found In", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.FoundIn" + } + ], + "fieldInstances": [ + { + "defaultValue": null, + "helpText": "The iteration within which this bug will be fixed", + "alwaysRequired": false, + "referenceName": "System.IterationPath", + "name": "Iteration Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationPath" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.IterationId", + "name": "Iteration ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ExternalLinkCount", + "name": "External Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ExternalLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel7", + "name": "Iteration Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel6", + "name": "Iteration Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel5", + "name": "Iteration Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel4", + "name": "Iteration Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel3", + "name": "Iteration Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel2", + "name": "Iteration Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.IterationLevel1", + "name": "Iteration Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.IterationLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel7", + "name": "Area Level 7", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel7" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel6", + "name": "Area Level 6", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel6" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel5", + "name": "Area Level 5", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel5" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel4", + "name": "Area Level 4", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel4" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel3", + "name": "Area Level 3", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel3" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel2", + "name": "Area Level 2", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel2" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AreaLevel1", + "name": "Area Level 1", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaLevel1" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.TeamProject", + "name": "Team Project", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.TeamProject" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Parent", + "name": "Parent", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Parent" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RemoteLinkCount", + "name": "Remote Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RemoteLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CommentCount", + "name": "Comment Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CommentCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.HyperLinkCount", + "name": "Hyperlink Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.HyperLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AttachedFileCount", + "name": "Attached File Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AttachedFileCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.NodeName", + "name": "Node Name", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.NodeName" + }, + { + "defaultValue": null, + "helpText": "The area of the product with which this bug is associated", + "alwaysRequired": false, + "referenceName": "System.AreaPath", + "name": "Area Path", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaPath" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RevisedDate", + "name": "Revised Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RevisedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedDate", + "name": "Changed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Id", + "name": "ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Id" + }, + { + "defaultValue": null, + "alwaysRequired": true, + "referenceName": "System.AreaId", + "name": "Area ID", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AreaId" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedAs", + "name": "Authorized As", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedAs" + }, + { + "defaultValue": null, + "helpText": "Stories affected and how", + "alwaysRequired": true, + "referenceName": "System.Title", + "name": "Title", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Title" + }, + { + "defaultValue": "New", + "helpText": "New = for triage; Active = not yet fixed; Resolved = fixed not yet verified; Closed = fix verified.", + "alwaysRequired": true, + "referenceName": "System.State", + "name": "State", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.State" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.AuthorizedDate", + "name": "Authorized Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AuthorizedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Watermark", + "name": "Watermark", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Watermark" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Rev", + "name": "Rev", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Rev" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.ChangedBy", + "name": "Changed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.ChangedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the bug is in the current state", + "alwaysRequired": false, + "referenceName": "System.Reason", + "name": "Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Reason" + }, + { + "defaultValue": null, + "helpText": "The person currently working on this bug", + "alwaysRequired": false, + "referenceName": "System.AssignedTo", + "name": "Assigned To", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.AssignedTo" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.WorkItemType", + "name": "Work Item Type", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.WorkItemType" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedDate", + "name": "Created Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.CreatedBy", + "name": "Created By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.CreatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Description", + "name": "Description", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Description" + }, + { + "defaultValue": null, + "helpText": "Discussion thread plus automatic record of changes", + "alwaysRequired": false, + "referenceName": "System.History", + "name": "History", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.History" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.RelatedLinkCount", + "name": "Related Link Count", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.RelatedLinkCount" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.Tags", + "name": "Tags", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.Tags" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumn", + "name": "Board Column", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumn" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardColumnDone", + "name": "Board Column Done", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardColumnDone" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "System.BoardLane", + "name": "Board Lane", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/System.BoardLane" + }, + { + "defaultValue": null, + "helpText": "The size of work estimated for fixing the bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.StoryPoints", + "name": "Story Points", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.StoryPoints" + }, + { + "defaultValue": null, + "helpText": "An estimate of the number of units of work remaining to complete this bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.RemainingWork", + "name": "Remaining Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.RemainingWork" + }, + { + "defaultValue": null, + "helpText": "Initial value for Remaining Work - set once, when work begins", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.OriginalEstimate", + "name": "Original Estimate", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.OriginalEstimate" + }, + { + "defaultValue": null, + "helpText": "The number of units of work that have been spent on this bug", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Scheduling.CompletedWork", + "name": "Completed Work", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Scheduling.CompletedWork" + }, + { + "defaultValue": null, + "helpText": "Type of work involved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Activity", + "name": "Activity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Activity" + }, + { + "defaultValue": null, + "helpText": "Test context, provided automatically by test infrastructure", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.SystemInfo", + "name": "System Info", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.SystemInfo" + }, + { + "defaultValue": null, + "helpText": "How to see the bug. End by contrasting expected with actual behavior.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.TCM.ReproSteps", + "name": "Repro Steps", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.TCM.ReproSteps" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StateChangeDate", + "name": "State Change Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StateChangeDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedDate", + "name": "Activated Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ActivatedBy", + "name": "Activated By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ActivatedBy" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedDate", + "name": "Resolved Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedBy", + "name": "Resolved By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedBy" + }, + { + "defaultValue": null, + "helpText": "The reason why the bug was resolved", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ResolvedReason", + "name": "Resolved Reason", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ResolvedReason" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedDate", + "name": "Closed Date", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedDate" + }, + { + "defaultValue": null, + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.ClosedBy", + "name": "Closed By", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ClosedBy" + }, + { + "defaultValue": "2", + "helpText": "Business importance. 1=must fix; 4=unimportant.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Priority", + "name": "Priority", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Priority" + }, + { + "defaultValue": "3 - Medium", + "helpText": "Assessment of the effect of the bug on the project.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.Severity", + "name": "Severity", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.Severity" + }, + { + "defaultValue": null, + "helpText": "Work first on items with lower-valued stack rank. Set in triage.", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Common.StackRank", + "name": "Stack Rank", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.StackRank" + }, + { + "defaultValue": "Business", + "helpText": "The type should be set to Business primarily to represent customer-facing issues. Work to change the architecture should be added as a Requirement", + "alwaysRequired": true, + "referenceName": "Microsoft.VSTS.Common.ValueArea", + "name": "Value Area", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Common.ValueArea" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was fixed", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.IntegrationBuild", + "name": "Integration Build", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.IntegrationBuild" + }, + { + "defaultValue": null, + "helpText": "The build in which the bug was found", + "alwaysRequired": false, + "referenceName": "Microsoft.VSTS.Build.FoundIn", + "name": "Found In", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/fields/Microsoft.VSTS.Build.FoundIn" + } + ], + "transitions": { + "Active": [ + { + "to": "Active", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + }, + { + "to": "New", + "actions": [ + "Microsoft.VSTS.Actions.StopWork" + ] + } + ], + "Closed": [ + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ], + "New": [ + { + "to": "New", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Resolved", + "actions": [ + "Microsoft.VSTS.Actions.Checkin" + ] + }, + { + "to": "Active", + "actions": [ + "Microsoft.VSTS.Actions.StartWork" + ] + } + ], + "Resolved": [ + { + "to": "Resolved", + "actions": null + }, + { + "to": "Closed", + "actions": null + }, + { + "to": "Active", + "actions": null + }, + { + "to": "New", + "actions": null + } + ] + }, + "states": [ + { + "name": "New", + "color": "b2b2b2", + "category": "Proposed" + }, + { + "name": "Active", + "color": "007acc", + "category": "InProgress" + }, + { + "name": "Resolved", + "color": "ff9d00", + "category": "Resolved" + }, + { + "name": "Closed", + "color": "339933", + "category": "Completed" + } + ], + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/workItemTypes/Bug" +} \ No newline at end of file diff --git a/unit/test/sampleFiles/buildDef.json b/Tests/SampleFiles/buildDef.json similarity index 100% rename from unit/test/sampleFiles/buildDef.json rename to Tests/SampleFiles/buildDef.json diff --git a/unit/test/sampleFiles/buildDef2017.json b/Tests/SampleFiles/buildDef2017.json similarity index 100% rename from unit/test/sampleFiles/buildDef2017.json rename to Tests/SampleFiles/buildDef2017.json diff --git a/unit/test/sampleFiles/buildDef2018.json b/Tests/SampleFiles/buildDef2018.json similarity index 100% rename from unit/test/sampleFiles/buildDef2018.json rename to Tests/SampleFiles/buildDef2018.json diff --git a/unit/test/sampleFiles/buildDefAzD.json b/Tests/SampleFiles/buildDefAzD.json similarity index 100% rename from unit/test/sampleFiles/buildDefAzD.json rename to Tests/SampleFiles/buildDefAzD.json diff --git a/unit/test/sampleFiles/buildDefHierarchyQuery.json b/Tests/SampleFiles/buildDefHierarchyQuery.json similarity index 100% rename from unit/test/sampleFiles/buildDefHierarchyQuery.json rename to Tests/SampleFiles/buildDefHierarchyQuery.json diff --git a/unit/test/sampleFiles/buildDefHierarchyQuery_Update.json b/Tests/SampleFiles/buildDefHierarchyQuery_Update.json similarity index 100% rename from unit/test/sampleFiles/buildDefHierarchyQuery_Update.json rename to Tests/SampleFiles/buildDefHierarchyQuery_Update.json diff --git a/unit/test/sampleFiles/buildDefvsts.json b/Tests/SampleFiles/buildDefvsts.json similarity index 100% rename from unit/test/sampleFiles/buildDefvsts.json rename to Tests/SampleFiles/buildDefvsts.json diff --git a/unit/test/sampleFiles/buildDefyaml.json b/Tests/SampleFiles/buildDefyaml.json similarity index 100% rename from unit/test/sampleFiles/buildDefyaml.json rename to Tests/SampleFiles/buildDefyaml.json diff --git a/Tests/SampleFiles/buildResults.json b/Tests/SampleFiles/buildResults.json new file mode 100644 index 000000000..a114c1250 --- /dev/null +++ b/Tests/SampleFiles/buildResults.json @@ -0,0 +1,697 @@ +{ + "count": 5, + "value": [ + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=568" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [ + "Testing", + "Test123", + "Test245" + ], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 568, + "buildNumber": "568", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-11-14T00:49:33.4869922Z", + "startTime": "2019-11-14T00:49:37.916511Z", + "finishTime": "2019-11-14T00:56:02.1824107Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/568", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-11-14T00:56:14.133Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": true, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/567" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=567" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 567, + "buildNumber": "567", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-11-13T22:57:31.1366485Z", + "startTime": "2019-11-13T22:57:35.3378265Z", + "finishTime": "2019-11-13T23:01:48.4753281Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/567", + "definition": { + "drafts": [], + "id": 35, + "name": "PTracker-CI-NoMobile", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=7", + "uri": "vstfs:///Build/Definition/35", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 7, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/567", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-11-13T23:02:00.413Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": true, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/561" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=561" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 561, + "buildNumber": "561", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-24T09:47:50.3503432Z", + "startTime": "2019-09-24T09:47:55.8261537Z", + "finishTime": "2019-09-24T09:54:09.609426Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/561", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/561", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-09-24T09:54:22.31Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/560" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=560" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 560, + "buildNumber": "560", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-16T14:07:31.5444889Z", + "startTime": "2019-09-16T14:07:36.8564926Z", + "finishTime": "2019-09-16T14:13:54.1086977Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/560", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/560", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-09-16T14:14:07.007Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + }, + { + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/559" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=559" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 559, + "buildNumber": "559", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-09-16T13:34:59.7905462Z", + "startTime": "2019-09-16T13:35:06.5445281Z", + "finishTime": "2019-09-16T13:41:24.5546558Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/559", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/559", + "sourceBranch": "refs/heads/master", + "sourceVersion": "b3ffb9a7c9c4a3d78da50c581aaaf3fc708d1b6c", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "individualCI", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Microsoft.VisualStudio.Services.TFS", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-09-16T13:41:36.677Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": false, + "retainedByRelease": true, + "triggeredByBuild": null + } + ] +} \ No newline at end of file diff --git a/Tests/SampleFiles/buildSingleResult.json b/Tests/SampleFiles/buildSingleResult.json new file mode 100644 index 000000000..ec55f9ce4 --- /dev/null +++ b/Tests/SampleFiles/buildSingleResult.json @@ -0,0 +1,142 @@ +{ + "_links": { + "self": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568" + }, + "web": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=568" + }, + "sourceVersionDisplayUri": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/sources" + }, + "timeline": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/Timeline" + }, + "badge": { + "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" + } + }, + "properties": {}, + "tags": [ + "Testing", + "Test123", + "Test245" + ], + "validationResults": [], + "plans": [ + { + "planId": "00000000-0000-0000-0000-000000000000" + } + ], + "triggerInfo": {}, + "id": 568, + "buildNumber": "568", + "status": "completed", + "result": "succeeded", + "queueTime": "2019-11-14T00:49:33.4869922Z", + "startTime": "2019-11-14T00:49:37.916511Z", + "finishTime": "2019-11-14T00:56:02.1824107Z", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568", + "definition": { + "drafts": [], + "id": 23, + "name": "PTracker-CI", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", + "uri": "vstfs:///Build/Definition/23", + "path": "\\", + "type": "build", + "queueStatus": "enabled", + "revision": 163, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + } + }, + "project": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", + "state": "wellFormed", + "revision": 150, + "visibility": "private", + "lastUpdateTime": "2019-09-25T20:47:14.247Z" + }, + "uri": "vstfs:///Build/Build/568", + "sourceBranch": "refs/heads/master", + "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", + "queue": { + "id": 81, + "name": "Default", + "pool": { + "id": 1, + "name": "Default" + } + }, + "priority": "normal", + "reason": "manual", + "requestedFor": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "requestedBy": { + "displayName": "Donovan Brown", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "Test@test.com", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "lastChangedDate": "2019-11-14T00:56:14.133Z", + "lastChangedBy": { + "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", + "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", + "_links": { + "avatar": { + "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted" + } + }, + "id": "00000000-0000-0000-0000-000000000000", + "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", + "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", + "descriptor": "redacted" + }, + "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", + "orchestrationPlan": { + "planId": "00000000-0000-0000-0000-000000000000" + }, + "logs": { + "id": 0, + "type": "Container", + "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs" + }, + "repository": { + "id": "00000000-0000-0000-0000-000000000000", + "type": "TfsGit", + "name": "PeopleTracker", + "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", + "clean": null, + "checkoutSubmodules": false + }, + "keepForever": true, + "retainedByRelease": true, + "triggeredByBuild": null +} \ No newline at end of file diff --git a/unit/test/sampleFiles/buildTimeline.json b/Tests/SampleFiles/buildTimeline.json similarity index 100% rename from unit/test/sampleFiles/buildTimeline.json rename to Tests/SampleFiles/buildTimeline.json diff --git a/unit/test/sampleFiles/buildTimelineEmptyRecords.json b/Tests/SampleFiles/buildTimelineEmptyRecords.json similarity index 100% rename from unit/test/sampleFiles/buildTimelineEmptyRecords.json rename to Tests/SampleFiles/buildTimelineEmptyRecords.json diff --git a/unit/test/sampleFiles/classificationNodeResult.json b/Tests/SampleFiles/classificationNodeResult.json similarity index 100% rename from unit/test/sampleFiles/classificationNodeResult.json rename to Tests/SampleFiles/classificationNodeResult.json diff --git a/unit/test/sampleFiles/descriptor.scope.TestProject.json b/Tests/SampleFiles/descriptor.scope.TestProject.json similarity index 100% rename from unit/test/sampleFiles/descriptor.scope.TestProject.json rename to Tests/SampleFiles/descriptor.scope.TestProject.json diff --git a/unit/test/sampleFiles/extensionResults.json b/Tests/SampleFiles/extensionResults.json similarity index 100% rename from unit/test/sampleFiles/extensionResults.json rename to Tests/SampleFiles/extensionResults.json diff --git a/unit/test/sampleFiles/get-vsteamworkitemtype.json b/Tests/SampleFiles/get-vsteamworkitemtype.json similarity index 100% rename from unit/test/sampleFiles/get-vsteamworkitemtype.json rename to Tests/SampleFiles/get-vsteamworkitemtype.json diff --git a/unit/test/sampleFiles/gitCommitResults.json b/Tests/SampleFiles/gitCommitResults.json similarity index 100% rename from unit/test/sampleFiles/gitCommitResults.json rename to Tests/SampleFiles/gitCommitResults.json diff --git a/unit/test/sampleFiles/gitReopHierarchyQuery_Update.json b/Tests/SampleFiles/gitReopHierarchyQuery_Update.json similarity index 100% rename from unit/test/sampleFiles/gitReopHierarchyQuery_Update.json rename to Tests/SampleFiles/gitReopHierarchyQuery_Update.json diff --git a/unit/test/sampleFiles/gitStatMultipleResults.json b/Tests/SampleFiles/gitStatMultipleResults.json similarity index 100% rename from unit/test/sampleFiles/gitStatMultipleResults.json rename to Tests/SampleFiles/gitStatMultipleResults.json diff --git a/unit/test/sampleFiles/gitStatSingleResult.json b/Tests/SampleFiles/gitStatSingleResult.json similarity index 100% rename from unit/test/sampleFiles/gitStatSingleResult.json rename to Tests/SampleFiles/gitStatSingleResult.json diff --git a/unit/test/sampleFiles/groups.json b/Tests/SampleFiles/groups.json similarity index 100% rename from unit/test/sampleFiles/groups.json rename to Tests/SampleFiles/groups.json diff --git a/unit/test/sampleFiles/groupsSingle.json b/Tests/SampleFiles/groupsSingle.json similarity index 100% rename from unit/test/sampleFiles/groupsSingle.json rename to Tests/SampleFiles/groupsSingle.json diff --git a/unit/test/sampleFiles/jobrequests2017.json b/Tests/SampleFiles/jobrequests2017.json similarity index 100% rename from unit/test/sampleFiles/jobrequests2017.json rename to Tests/SampleFiles/jobrequests2017.json diff --git a/unit/test/sampleFiles/jobrequestsAzD.json b/Tests/SampleFiles/jobrequestsAzD.json similarity index 100% rename from unit/test/sampleFiles/jobrequestsAzD.json rename to Tests/SampleFiles/jobrequestsAzD.json diff --git a/unit/test/sampleFiles/pipelineDefYamlResult.json b/Tests/SampleFiles/pipelineDefYamlResult.json similarity index 100% rename from unit/test/sampleFiles/pipelineDefYamlResult.json rename to Tests/SampleFiles/pipelineDefYamlResult.json diff --git a/unit/test/sampleFiles/projectResult.json b/Tests/SampleFiles/projectResult.json similarity index 100% rename from unit/test/sampleFiles/projectResult.json rename to Tests/SampleFiles/projectResult.json diff --git a/unit/test/sampleFiles/releaseDefAzD.json b/Tests/SampleFiles/releaseDefAzD.json similarity index 100% rename from unit/test/sampleFiles/releaseDefAzD.json rename to Tests/SampleFiles/releaseDefAzD.json diff --git a/unit/test/sampleFiles/releaseDefHierarchyQuery.json b/Tests/SampleFiles/releaseDefHierarchyQuery.json similarity index 100% rename from unit/test/sampleFiles/releaseDefHierarchyQuery.json rename to Tests/SampleFiles/releaseDefHierarchyQuery.json diff --git a/unit/test/sampleFiles/releaseDefHierarchyQuery_Update.json b/Tests/SampleFiles/releaseDefHierarchyQuery_Update.json similarity index 100% rename from unit/test/sampleFiles/releaseDefHierarchyQuery_Update.json rename to Tests/SampleFiles/releaseDefHierarchyQuery_Update.json diff --git a/unit/test/sampleFiles/repoAccesscontrollists.json b/Tests/SampleFiles/repoAccesscontrollists.json similarity index 100% rename from unit/test/sampleFiles/repoAccesscontrollists.json rename to Tests/SampleFiles/repoAccesscontrollists.json diff --git a/unit/test/sampleFiles/securityNamespace.json b/Tests/SampleFiles/securityNamespace.json similarity index 100% rename from unit/test/sampleFiles/securityNamespace.json rename to Tests/SampleFiles/securityNamespace.json diff --git a/unit/test/sampleFiles/securityNamespace.single.json b/Tests/SampleFiles/securityNamespace.single.json similarity index 100% rename from unit/test/sampleFiles/securityNamespace.single.json rename to Tests/SampleFiles/securityNamespace.single.json diff --git a/unit/test/sampleFiles/securityNamespaces.json b/Tests/SampleFiles/securityNamespaces.json similarity index 100% rename from unit/test/sampleFiles/securityNamespaces.json rename to Tests/SampleFiles/securityNamespaces.json diff --git a/unit/test/sampleFiles/serviceEndpointTypeSample.json b/Tests/SampleFiles/serviceEndpointTypeSample.json similarity index 100% rename from unit/test/sampleFiles/serviceEndpointTypeSample.json rename to Tests/SampleFiles/serviceEndpointTypeSample.json diff --git a/unit/test/sampleFiles/singleExtensionResult.json b/Tests/SampleFiles/singleExtensionResult.json similarity index 100% rename from unit/test/sampleFiles/singleExtensionResult.json rename to Tests/SampleFiles/singleExtensionResult.json diff --git a/unit/test/sampleFiles/singleGitRepo.json b/Tests/SampleFiles/singleGitRepo.json similarity index 100% rename from unit/test/sampleFiles/singleGitRepo.json rename to Tests/SampleFiles/singleGitRepo.json diff --git a/unit/test/sampleFiles/taskGroup.json b/Tests/SampleFiles/taskGroup.json similarity index 100% rename from unit/test/sampleFiles/taskGroup.json rename to Tests/SampleFiles/taskGroup.json diff --git a/unit/test/sampleFiles/taskGroups.json b/Tests/SampleFiles/taskGroups.json similarity index 100% rename from unit/test/sampleFiles/taskGroups.json rename to Tests/SampleFiles/taskGroups.json diff --git a/unit/test/sampleFiles/updatePullRequestResponse.json b/Tests/SampleFiles/updatePullRequestResponse.json similarity index 100% rename from unit/test/sampleFiles/updatePullRequestResponse.json rename to Tests/SampleFiles/updatePullRequestResponse.json diff --git a/unit/test/sampleFiles/users.json b/Tests/SampleFiles/users.json similarity index 100% rename from unit/test/sampleFiles/users.json rename to Tests/SampleFiles/users.json diff --git a/unit/test/sampleFiles/users.single.json b/Tests/SampleFiles/users.single.json similarity index 100% rename from unit/test/sampleFiles/users.single.json rename to Tests/SampleFiles/users.single.json diff --git a/unit/test/sampleFiles/variableGroupSamples2017.json b/Tests/SampleFiles/variableGroupSamples2017.json similarity index 96% rename from unit/test/sampleFiles/variableGroupSamples2017.json rename to Tests/SampleFiles/variableGroupSamples2017.json index 6da45ebd3..fe22239ee 100644 --- a/unit/test/sampleFiles/variableGroupSamples2017.json +++ b/Tests/SampleFiles/variableGroupSamples2017.json @@ -1,31 +1,31 @@ -{ - "count": 1, - "value": [ - { - "variables": { - "key1": { - "value": "value1" - }, - "key2": { - "value": null, - "isSecret": true - } - }, - "id": 101, - "name": "TestVariableGroup1", - "description": "A test variable group", - "createdBy": { - "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", - "displayName": "tuser", - "uniqueName": "LOCAL\\tuser" - }, - "createdOn": "2019-06-25T13:49:52.3966667Z", - "modifiedBy": { - "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", - "displayName": "tuser", - "uniqueName": "LOCAL\\tuser" - }, - "modifiedOn": "2019-06-25T13:49:52.3966667Z" - } - ] +{ + "count": 1, + "value": [ + { + "variables": { + "key1": { + "value": "value1" + }, + "key2": { + "value": null, + "isSecret": true + } + }, + "id": 101, + "name": "TestVariableGroup1", + "description": "A test variable group", + "createdBy": { + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "displayName": "tuser", + "uniqueName": "LOCAL\\tuser" + }, + "createdOn": "2019-06-25T13:49:52.3966667Z", + "modifiedBy": { + "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", + "displayName": "tuser", + "uniqueName": "LOCAL\\tuser" + }, + "modifiedOn": "2019-06-25T13:49:52.3966667Z" + } + ] } \ No newline at end of file diff --git a/unit/test/sampleFiles/withoutChildNode.json b/Tests/SampleFiles/withoutChildNode.json similarity index 100% rename from unit/test/sampleFiles/withoutChildNode.json rename to Tests/SampleFiles/withoutChildNode.json diff --git a/Tests/function/tests/Add-VSTeam.Tests.ps1 b/Tests/function/tests/Add-VSTeam.Tests.ps1 new file mode 100644 index 000000000..f5ea70bf9 --- /dev/null +++ b/Tests/function/tests/Add-VSTeam.Tests.ps1 @@ -0,0 +1,55 @@ +Set-StrictMode -Version Latest + +Describe "VSTeam" { + BeforeAll { + # Prepares everything for the tests below. + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + # The index parameter returns that instance of the value array + # in the sample json file + Mock _callAPI { Open-SampleFile 'Get-VSTeam.json' -Index 0 } + + # The Parameter Filter makes sure this mock is only called if the + # function under test request the correct service version + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context "Add-VSTeam" -Tag 'Add' { + It 'should create a team with team name only' { + $team = Add-VSTeam -ProjectName Test ` + -TeamName "Test Team" + + $team | Should -Not -Be $null -Because 'Team must be returned' + $team.Name | Should -Be 'Test Team' -Because 'Name must be set' + $team.ProjectName | Should -Be 'Test' -Because 'Project Name must match' + $team.Id | Should -Be "00000000-0000-0000-0000-000000000000" -Because 'Id must be set' + + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'POST' -and + $NoProject -eq $true -and + $Resource -eq 'projects/Test/teams' -and + $Body -eq '{ "name": "Test Team", "description": "" }' -and + $Version -eq '1.0-unitTests' + } + } + + It 'should create a team with team name and description' { + $team = Add-VSTeam -ProjectName Test ` + -TeamName "Test Team" ` + -Description "The default project team." + + $team | Should -Not -Be $null -Because 'Team must be returned' + $team.ProjectName | Should -Be 'Test' -Because 'Project Name must match' + $team.Id | Should -Be "00000000-0000-0000-0000-000000000000" -Because 'Id must be set' + $team.Description | Should -Be 'The default project team.' -Because 'Description must be set' + + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'POST' -and + $NoProject -eq $true -and + $Resource -eq 'projects/Test/teams' -and + $Body -eq '{ "name": "Test Team", "description": "The default project team." }' -and + $Version -eq '1.0-unitTests' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamAccessControlEntry.Tests.ps1 b/Tests/function/tests/Add-VSTeamAccessControlEntry.Tests.ps1 new file mode 100644 index 000000000..af27426a7 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamAccessControlEntry.Tests.ps1 @@ -0,0 +1,108 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamAccessControlEntry' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + # Some of the functions return VSTeam classes so turn the PSCustomeObject + # into the correct type. + $securityNamespaceObject = [vsteam_lib.SecurityNamespace]::new($(Open-SampleFile 'securityNamespace.json' -Index 0)) + + # Set the account to use for testing. A normal user would do this using the + # Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + + # This is only called when you need to test that the function can handle an + # exception. To make sure this mock is called make sure the descriptor in + # the body of your call has the value of 'boom'. + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Body -like "*`"descriptor`": `"boom`",*" } + Mock Invoke-RestMethod { Open-SampleFile 'accessControlEntryResult.json' } + } + + Context 'Add-VSTeamAccessControlEntry' -Tag 'Add' { + It 'should return ACEs by SecurityNamespace (pipeline)' { + ## Act + $securityNamespaceObject | Add-VSTeamAccessControlEntry -Descriptor abc ` + -Token xyz ` + -AllowMask 12 ` + -DenyMask 15 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + # The write-host below is great for seeing how many ways the mock is called. + # Write-Host "Assert Mock $Uri" + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"xyz`",*" -and + $Body -like "*`"descriptor`": `"abc`",*" -and + $Body -like "*`"allow`": 12,*" -and + $Body -like "*`"deny`": 15,*" -and + $Method -eq "Post" + } + } + + It 'should return ACEs by SecurityNamespaceId' { + ## Act + Add-VSTeamAccessControlEntry -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 ` + -Descriptor abc ` + -Token xyz ` + -AllowMask 12 ` + -DenyMask 15 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + # The write-host below is great for seeing how many ways the mock is called. + # Write-Host "Assert Mock $Uri" + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/5a27515b-ccd7-42c9-84f1-54c998f03866*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"xyz`",*" -and + $Body -like "*`"descriptor`": `"abc`",*" -and + $Body -like "*`"allow`": 12,*" -and + $Body -like "*`"deny`": 15,*" -and + $Method -eq "Post" + } + } + + It 'should return ACEs by SecurityNamespace' { + ## Act + Add-VSTeamAccessControlEntry -SecurityNamespace $securityNamespaceObject ` + -Descriptor abc ` + -Token xyz ` + -AllowMask 12 ` + -DenyMask 15 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + # The write-host below is great for seeing how many ways the mock is called. + # Write-Host "Assert Mock $Uri" + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"xyz`",*" -and + $Body -like "*`"descriptor`": `"abc`",*" -and + $Body -like "*`"allow`": 12,*" -and + $Body -like "*`"deny`": 15,*" -and + $Method -eq "Post" + } + } + + It 'by securityNamespaceId throws should throw' -Tag "Throws" { + ## Act / Assert + { Add-VSTeamAccessControlEntry -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 ` + -Descriptor boom ` + -Token xyz ` + -AllowMask 12 ` + -DenyMask 15 } | Should -Throw + } + + It 'by SecurityNamespace should throw' -Tag "Throws" { + ## Act / Assert + { Add-VSTeamAccessControlEntry -SecurityNamespace $securityNamespaceObject ` + -Descriptor boom ` + -Token xyz ` + -AllowMask 12 ` + -DenyMask 15 } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamArea.Tests.ps1 b/Tests/function/tests/Add-VSTeamArea.Tests.ps1 new file mode 100644 index 000000000..e2314054c --- /dev/null +++ b/Tests/function/tests/Add-VSTeamArea.Tests.ps1 @@ -0,0 +1,63 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamArea' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Add-VSTeamClassificationNode" + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'classificationNodeResult.json' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Add-VSTeamArea' -Tag "Add" { + It 'area should return Nodes' { + ## Act + Add-VSTeamArea -ProjectName "Public Demo" ` + -Name "MyClassificationNodeName" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + + It 'with Path "" should return Nodes' -TestCases @( + @{ Path = "SubPath" } + @{ Path = "Path/SubPath" } + ) { + param ($Path) + ## Act + Add-VSTeamArea -ProjectName "Public Demo" ` + -Name "MyClassificationNodeName" ` + -Path $Path + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas/$Path*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + + It 'with empty Path "" should return Nodes' -TestCases @( + @{ Path = "" } + @{ Path = $null } + ) { + param ($Path) + ## Act + Add-VSTeamArea -ProjectName "Public Demo" ` + -Name "MyClassificationNodeName" ` + -Path $Path + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas?*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamBuild.Tests.ps1 b/Tests/function/tests/Add-VSTeamBuild.Tests.ps1 new file mode 100644 index 000000000..9420ea41a --- /dev/null +++ b/Tests/function/tests/Add-VSTeamBuild.Tests.ps1 @@ -0,0 +1,152 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuild' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamQueue.ps1" + . "$baseFolder/Source/Public/Get-VSTeamBuildDefinition.ps1" + } + + Context 'Add-VSTeamBuild' -Tag "Add" { + ## Arrange + BeforeAll { + $singleResult = Open-SampleFile 'buildSingleResult.json' + + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } + } + + Context 'Services' -Tag "Services" { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod { return $singleResult } + Mock Get-VSTeamBuildDefinition { Open-SampleFile 'buildDefvsts.json' -ReturnValue } + } + + It 'should add build by name' { + ## Act + Add-VSTeamBuild -ProjectName project ` + -BuildDefinitionName 'aspdemo-CI' + + ## Assert + # Call to queue build. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Body -like "*699*" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" + } + } + + It 'should add build by id' { + ## Act + Add-VSTeamBuild -ProjectName project ` + -BuildDefinitionId 2 + + ## Assert + # Call to queue build. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Body -like "*2*" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" + } + } + + It 'should add build with source branch' { + ## Act + Add-VSTeamBuild -ProjectName project ` + -BuildDefinitionId 2 ` + -SourceBranch 'refs/heads/dev' + + ## Assert + # Call to queue build. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Body -like "*2*" -and + $Body -like "*refs/heads/dev*" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" + } + } + + It 'should add build with parameters' { + ## Act + Add-VSTeamBuild -ProjectName project ` + -BuildDefinitionId 2 ` + -BuildParameters @{'system.debug' = 'true' } + + ## Assert + # Call to queue build. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Body -like "*2*" -and + $Body -like "*true*" -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Server' -Tag "Server" { + BeforeAll { + ## Arrange + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + + Mock Invoke-RestMethod { return $singleResult } + + Mock Get-VSTeamQueue { return [PSCustomObject]@{ + name = "MyQueue" + id = 3 + } + } + + Mock Get-VSTeamBuildDefinition { return @{ name = "MyBuildDef" } } + } + + It 'should add build by id on TFS local auth' { + ## Act + Add-VSTeamBuild -projectName project ` + -BuildDefinitionId 2 ` + -QueueName MyQueue + + ## Assert + # Call to queue build. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and + $Body -like "*2*" -and + $Body -like "*3*" + } + } + + It 'should add build with parameters on TFS local auth' { + ## Act + Add-VSTeamBuild -projectName project ` + -BuildDefinitionId 2 ` + -QueueName MyQueue ` + -BuildParameters @{'system.debug' = 'true' } + + ## Assert + # Call to queue build. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and + $Body -like "*2*" -and + $Body -like "*3*" -and + $Body -like "*system.debug*" + } + } + + It 'should add build with source branch on TFS local auth' { + ## Act + Add-VSTeamBuild -projectName project ` + -BuildDefinitionId 2 ` + -QueueName MyQueue ` + -SourceBranch refs/heads/dev + + ## Assert + # Call to queue build. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and + $Body -like "*2*" -and + $Body -like "*3*" -and + $Body -like "*refs/heads/dev*" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamBuildDefinition.Tests.ps1 b/Tests/function/tests/Add-VSTeamBuildDefinition.Tests.ps1 new file mode 100644 index 000000000..9d19504d3 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamBuildDefinition.Tests.ps1 @@ -0,0 +1,56 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuildDefinition' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Add-VSTeamBuildDefinition' { + ## Arrange + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'buildDefvsts.json' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } + } + + Context 'Services' -Tag "Services" { + ## Arrange + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + it 'Should add build' { + ## Act + Add-VSTeamBuildDefinition -projectName project ` + -inFile 'sampleFiles/builddef.json' + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $InFile -eq 'sampleFiles/builddef.json' -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Server' -Tag "Server" { + ## Arrange + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + it 'Should add build' { + ## Act + Add-VSTeamBuildDefinition -projectName project ` + -inFile 'sampleFiles/builddef.json' + + ## Assert + Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $InFile -eq 'sampleFiles/builddef.json' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions?api-version=$(_getApiVersion Build)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamBuildTag.Tests.ps1 b/Tests/function/tests/Add-VSTeamBuildTag.Tests.ps1 new file mode 100644 index 000000000..55985d6d4 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamBuildTag.Tests.ps1 @@ -0,0 +1,44 @@ +Set-StrictMode -Version Latest + +# Adds a tag to a build. +# Get-VSTeamOption 'build' 'tags' +# id : 6e6114b2-8161-44c8-8f6c-c5505782427f +# area : build +# resourceName : tags +# routeTemplate : {project}/_apis/{area}/builds/{buildId}/{resource}/{*tag} + +Describe 'VSTeamBuildTag' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Add-VSTeamBuildTag' -Tag "Add" { + ## Arrange + BeforeAll { + Mock _callAPI + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } + } + + It 'should add tags to Build' { + ## Arrange + $inputTags = "Test1", "Test2", "Test3" + + ## Act + Add-VSTeamBuildTag -ProjectName project ` + -id 2 ` + -Tags $inputTags + + ## Assert + foreach ($inputTag in $inputTags) { + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Put' -and + $ProjectName -eq "project" -and + $Area -eq "build/builds/2" -and + $Resource -eq "tags" -and + $Id -eq $inputTag -and + $Version -eq $(_getApiVersion Build) + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamClassificationNode.Tests.ps1 b/Tests/function/tests/Add-VSTeamClassificationNode.Tests.ps1 new file mode 100644 index 000000000..967413a3d --- /dev/null +++ b/Tests/function/tests/Add-VSTeamClassificationNode.Tests.ps1 @@ -0,0 +1,77 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamClassificationNode' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Add-VSTeamClassificationNode' { + ## Arrange + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'classificationNodeResult.json' } + } + + It 'should return Nodes with StructureGroup ""' -TestCases @( + @{ StructureGroup = "areas" } + @{ StructureGroup = "iterations" } + ) { + param ($StructureGroup) + ## Act + Add-VSTeamClassificationNode -ProjectName "Public Demo" ` + -StructureGroup $StructureGroup ` + -Name "MyClassificationNodeName" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + + It 'should return Nodes with StructureGroup "" by Path ""' -TestCases @( + @{ StructureGroup = "areas"; Path = "SubPath" } + @{ StructureGroup = "areas"; Path = "Path/SubPath" } + @{ StructureGroup = "iterations"; Path = "SubPath" } + @{ StructureGroup = "iterations"; Path = "Path/SubPath" } + ) { + param ($StructureGroup, $Path) + ## Act + Add-VSTeamClassificationNode -ProjectName "Public Demo" ` + -StructureGroup $StructureGroup ` + -Name "MyClassificationNodeName" ` + -Path $Path + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup/$Path*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + + It 'should return Nodes with StructureGroup "" by empty Path ""' -TestCases @( + @{ StructureGroup = "areas"; Path = "" } + @{ StructureGroup = "areas"; Path = $null } + @{ StructureGroup = "iterations"; Path = "" } + @{ StructureGroup = "iterations"; Path = $null } + ) { + param ($StructureGroup, $Path) + ## Act + Add-VSTeamClassificationNode -ProjectName "Public Demo" ` + -StructureGroup $StructureGroup ` + -Name "MyClassificationNodeName" ` + -Path $Path + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup?*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamExtension.Tests.ps1 b/Tests/function/tests/Add-VSTeamExtension.Tests.ps1 new file mode 100644 index 000000000..26549631d --- /dev/null +++ b/Tests/function/tests/Add-VSTeamExtension.Tests.ps1 @@ -0,0 +1,49 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamExtension' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Add-VSTeamExtension' { + ## Arrange + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _callAPI { Open-SampleFile 'Get-VSTeamExtension.json' -Index 0 } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ExtensionsManagement' } + } + + It 'should add an extension without version' { + ## Act + Add-VSTeamExtension -PublisherId 'test' ` + -ExtensionId 'test' + + ## Assert + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'POST' -and + $subDomain -eq 'extmgmt' -and + $Area -eq 'extensionmanagement' -and + $Resource -eq 'installedextensionsbyname' -and + $Id -eq 'test/test' -and + $version -eq $(_getApiVersion ExtensionsManagement) + } + } + + It 'should add an extension with version' { + ## Act + Add-VSTeamExtension -PublisherId 'test' ` + -ExtensionId 'test' ` + -Version '1.0.0' + + ## Assert + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'POST' -and + $subDomain -eq 'extmgmt' -and + $Area -eq 'extensionmanagement' -and + $Resource -eq 'installedextensionsbyname' -and + $Id -eq 'test/test/1.0.0' -and + $version -eq $(_getApiVersion ExtensionsManagement) + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamFeed.Tests.ps1 b/Tests/function/tests/Add-VSTeamFeed.Tests.ps1 new file mode 100644 index 000000000..10f97a390 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamFeed.Tests.ps1 @@ -0,0 +1,44 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamFeed' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Add-VSTeamFeed' { + ## Arrange + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamFeed.json' -Index 0 } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Packaging' } + } + + it 'should add feed with description' { + ## Act + Add-VSTeamFeed -Name 'module' ` + -Description 'Test Module' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds?api-version=$(_getApiVersion Packaging)" -and + $Method -eq 'Post' -and + $Body -like '*"name":*"module"*' + } + } + + it 'should add feed with upstream sources' { + ## Act + Add-VSTeamFeed -Name 'module' ` + -EnableUpstreamSources ` + -showDeletedPackageVersions + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds?api-version=$(_getApiVersion packaging)" -and + $Method -eq 'Post' -and + $Body -like '*"upstreamEnabled":*true*' -and + $Body -like '*"hideDeletedPackageVersions":*false*' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamGitRepository.Tests.ps1 b/Tests/function/tests/Add-VSTeamGitRepository.Tests.ps1 new file mode 100644 index 000000000..273b22d1f --- /dev/null +++ b/Tests/function/tests/Add-VSTeamGitRepository.Tests.ps1 @@ -0,0 +1,29 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamGitRepository" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Add-VSTeamGitRepository' { + ## Arrange + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamGitRepository.json' -Index 0 } + Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } + } + + It 'should add Git repo by name' { + ## Act + Add-VSTeamGitRepository -ProjectName 'test' ` + -Name 'testRepo' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Post" -and + $Uri -eq "https://dev.azure.com/test/test/_apis/git/repositories?api-version=1.0-gitUnitTests" -and + $Body -like "*testRepo*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamGitRepositoryPermission.Tests.ps1 b/Tests/function/tests/Add-VSTeamGitRepositoryPermission.Tests.ps1 new file mode 100644 index 000000000..28c899fc8 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamGitRepositoryPermission.Tests.ps1 @@ -0,0 +1,209 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamGitRepositoryPermission' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Add-VSTeamAccessControlEntry.ps1" + } + + Context 'Add-VSTeamGitRepositoryPermission' { + ## Arrange + BeforeAll { + $projectResultObject = [vsteam_lib.Project]::new($(Open-SampleFile 'projectResult.json')) + $userSingleResultObject = [vsteam_lib.User]::new($(Open-SampleFile 'users.single.json')) + $groupSingleResultObject = [vsteam_lib.Group]::new($(Open-SampleFile 'groupsSingle.json')) + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod { Open-SampleFile 'accessControlEntryResult.json' } + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + It 'by ProjectUser should return ACEs' { + ## Act + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -User $userSingleResultObject ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + + It 'by ProjectGroup should return ACEs' { + ## Act + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -Group $groupSingleResultObject ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + + It 'by ProjectDescriptor should return ACEs' { + ## Act + # The S-1-9 number is on digit off from the calls above so the same mock can be used + # as above with the exactly 1 parameter. If you don't use different S-1-9 the count + # of calls will be off. + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-2551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-2551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + + It 'by RepositoryUser should return ACEs' { + ## Act + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -RepositoryId "12345678-1234-1234-1234-123456789012" ` + -User $userSingleResultObject ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789012`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + + It 'by RepositoryGroup should return ACEs' { + ## Act + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -RepositoryId "12345678-1234-1234-1234-123456789012" ` + -Group $groupSingleResultObject ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789012`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + + It 'by RepositoryDescriptor should return ACEs' { + ## Act + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -RepositoryId "12345678-1234-1234-1234-123456789013" ` + -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789013`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + + It 'by RepositoryBranchUser should return ACEs' { + ## Act + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -RepositoryId "12345678-1234-1234-1234-123456789012" ` + -BranchName "trunk" ` + -User $userSingleResultObject ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789012/refs/heads/7400720075006e006b00`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + + It 'by RepositoryBranchGroup should return ACEs' { + ## Act + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -RepositoryId "12345678-1234-1234-1234-123456789012" ` + -BranchName "trunk" ` + -Group $groupSingleResultObject ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789012/refs/heads/7400720075006e006b00`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + + It 'by RepositoryBranchDescriptor should return ACEs' { + ## Act + Add-VSTeamGitRepositoryPermission -Project $projectResultObject ` + -RepositoryId "12345678-1234-1234-1234-123456789015" ` + -BranchName "trunk" ` + -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" ` + -Allow ([vsteam_lib.GitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') ` + -Deny ([vsteam_lib.GitRepositoryPermissions]'EditPolicies,ForcePush') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789015/refs/heads/7400720075006e006b00`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 34048,*" -and + $Body -like "*`"deny`": 2056,*" -and + $Method -eq "Post" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamIteration.Tests.ps1 b/Tests/function/tests/Add-VSTeamIteration.Tests.ps1 new file mode 100644 index 000000000..8176c5e08 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamIteration.Tests.ps1 @@ -0,0 +1,59 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamIteration' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Add-VSTeamClassificationNode" + + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'classificationNodeResult.json' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Add-VSTeamIteration' { + It 'iteration should return Nodes' { + ## Act + Add-VSTeamIteration -ProjectName "Public Demo" -Name "MyClassificationNodeName" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + + It 'with Path "" should return Nodes' -TestCases @( + @{ Path = 'SubPath' } + @{ Path = 'Path/SubPath' } + ) { + param ($Path) + ## Act + Add-VSTeamIteration -ProjectName "Public Demo" -Name "MyClassificationNodeName" -Path $Path + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations/$Path*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + + It 'with empty Path "" should return Nodes' -TestCases @( + @{ Path = "" } + @{ Path = $null } + ) { + param ($Path) + ## Act + Add-VSTeamIteration -ProjectName "Public Demo" -Name "MyClassificationNodeName" -Path $Path + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations?*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like '*"name":*"MyClassificationNodeName"*' + } + } + } +} diff --git a/Tests/function/tests/Add-VSTeamKubernetesEndpoint.Tests.ps1 b/Tests/function/tests/Add-VSTeamKubernetesEndpoint.Tests.ps1 new file mode 100644 index 000000000..509b82de3 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamKubernetesEndpoint.Tests.ps1 @@ -0,0 +1,51 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamKubernetesEndpoint' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Add-VSTeamServiceEndpoint.ps1" + . "$baseFolder/Source/Public/Get-VSTeamServiceEndpoint.ps1" + } + + Context 'Add-VSTeamKubernetesEndpoint' { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } + + Mock Write-Progress + Mock Invoke-RestMethod { _trackProcess } + Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } + } + + It 'not accepting untrusted certs and not generating a pfx should create a new Kubernetes Serviceendpoint' { + Add-VSTeamKubernetesEndpoint -projectName 'project' ` + -endpointName 'KubTest' ` + -kubernetesUrl 'http://myK8s.local' ` + -clientKeyData '00000000-0000-0000-0000-000000000000' ` + -kubeconfig '{name: "myConfig"}' ` + -clientCertificateData 'someClientCertData' + + # On PowerShell 5 the JSON has two spaces but on PowerShell 6 it only has one so + # test for both. + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + ($Body -like '*"acceptUntrustedCerts": false*' -or $Body -like '*"acceptUntrustedCerts": false*') -and + ($Body -like '*"generatePfx": false*' -or $Body -like '*"generatePfx": false*') + } + } + + It 'accepting untrusted certs and generating a pfx should create a new Kubernetes Serviceendpoint' { + Add-VSTeamKubernetesEndpoint -projectName 'project' -endpointName 'KubTest' ` + -kubernetesUrl 'http://myK8s.local' -clientKeyData '00000000-0000-0000-0000-000000000000' ` + -kubeconfig '{name: "myConfig"}' -clientCertificateData 'someClientCertData' -acceptUntrustedCerts -generatePfx + + # On PowerShell 5 the JSON has two spaces but on PowerShell 6 it only has one so + # test for both. + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + ($Body -like '*"acceptUntrustedCerts": true*' -or $Body -like '*"acceptUntrustedCerts": true*') -and + ($Body -like '*"generatePfx": true*' -or $Body -like '*"generatePfx": true*') + } + } + } +} diff --git a/Tests/function/tests/Add-VSTeamMembership.Tests.ps1 b/Tests/function/tests/Add-VSTeamMembership.Tests.ps1 new file mode 100644 index 000000000..74d4cbd86 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamMembership.Tests.ps1 @@ -0,0 +1,37 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamMembership' { + ## Arrange + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Private/callMembershipAPI.ps1" + + # You have to set the version or the api-version will not be added when [vsteam_lib.Versions]::Graph = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod + Mock _supportsGraph + } + + Context 'Add-VSTeamMembership' { + It 'Should add membership' { + ## Arrange + $UserDescriptor = 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' + $GroupDescriptor = 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' + + ## Act + $null = Add-VSTeamMembership -MemberDescriptor $UserDescriptor -ContainerDescriptor $GroupDescriptor + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Put" -and + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$UserDescriptor/$GroupDescriptor*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" + } + } + } +} diff --git a/Tests/function/tests/Add-VSTeamNuGetEndpoint.Tests.ps1 b/Tests/function/tests/Add-VSTeamNuGetEndpoint.Tests.ps1 new file mode 100644 index 000000000..c42a13ca1 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamNuGetEndpoint.Tests.ps1 @@ -0,0 +1,67 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamNuGetEndpoint' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Add-VSTeamServiceEndpoint.ps1" + . "$baseFolder/Source/Public/Get-VSTeamServiceEndpoint.ps1" + } + + Context 'Add-VSTeamNuGetEndpoint' { + BeforeAll { + 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 'ServiceEndpoints' } + + Mock Write-Progress + Mock Invoke-RestMethod { _trackProcess } + Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } + } + + It 'with ApiKey should create a new NuGet Serviceendpoint' { + Add-VSTeamNuGetEndpoint -ProjectName 'project' ` + -EndpointName 'PowerShell Gallery' ` + -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' ` + -ApiKey '00000000-0000-0000-0000-000000000000' + + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/serviceendpoints?api-version=$(_getApiVersion DistributedTask)" -and + $Method -eq 'POST' -and + $Body -like '*"nugetkey": *"00000000-0000-0000-0000-000000000000"*' -and + $Body -like '*"scheme": *"None"*' + } + } + + It 'with Username and Password should create a new NuGet Serviceendpoint' { + $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force + Add-VSTeamNuGetEndpoint -ProjectName 'project' ` + -EndpointName 'PowerShell Gallery' ` + -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' ` + -Username 'testUser' ` + -SecurePassword $password + + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/serviceendpoints?api-version=$(_getApiVersion DistributedTask)" -and + $Method -eq 'POST' -and + $Body -like '*"username": *"testUser"*' -and + $Body -like '*"password": *"00000000-0000-0000-0000-000000000000"*' -and + $Body -like '*"scheme": *"UsernamePassword"*' + } + } + + It 'with Token should create a new NuGet Serviceendpoint' { + Add-VSTeamNuGetEndpoint -ProjectName 'project' ` + -EndpointName 'PowerShell Gallery' ` + -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' ` + -PersonalAccessToken '00000000-0000-0000-0000-000000000000' + + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/serviceendpoints?api-version=$(_getApiVersion DistributedTask)" -and + $Method -eq 'POST' -and + $Body -like '*"apitoken":*"00000000-0000-0000-0000-000000000000"*' -and + $Body -like '*"scheme":*"Token"*' + } + } + } +} diff --git a/Tests/function/tests/Add-VSTeamPolicy.Tests.ps1 b/Tests/function/tests/Add-VSTeamPolicy.Tests.ps1 new file mode 100644 index 000000000..ed6d24a12 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamPolicy.Tests.ps1 @@ -0,0 +1,75 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPolicy' { + ## Arrange + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } + + Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Policy' } + } + + Context 'Add-VSTeamPolicy' { + It 'should add the policy' { + ## Act + Add-VSTeamPolicy -ProjectName Demo ` + -type babcf51f-d853-43a2-9b05-4a64ca577be0 ` + -enabled ` + -blocking ` + -settings @{ + MinimumApproverCount = 1 + scope = @( + @{ + refName = 'refs/heads/trunk' + matchKind = 'Exact' + repositoryId = '10000000-0000-0000-0000-0000000000001' + }) + } + + ## Assert + # With PowerShell core the order of the boty string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + # The general string should look like this: + # '{"isBlocking":true,"isEnabled":true,"type":{"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"},"settings":{"scope":[{"repositoryId":"10000000-0000-0000-0000-0000000000001","matchKind":"Exact","refName":"refs/heads/trunk"}],"MinimumApproverCount":1}}' + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations?api-version=$(_getApiVersion Policy)" -and + $Body -like '*"isBlocking":true*' -and + $Body -like '*"isEnabled":true*' -and + $Body -like '*"type":{"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"}*' -and + $Body -like '*"MinimumApproverCount":1*' -and + $Body -like '*"settings":*' -and + $Body -like '*"scope":*' -and + $Body -like '*"repositoryId":"10000000-0000-0000-0000-0000000000001"*' -and + $Body -like '*"matchKind":"Exact"*' -and + $Body -like '*"refName":"refs/heads/trunk"*' + } + } + + It 'should throw' { + ## Act / Assert + { Add-VSTeamPolicy -ProjectName boom ` + -type babcf51f-d853-43a2-9b05-4a64ca577be0 ` + -enabled ` + -blocking ` + -settings @{ + MinimumApproverCount = 1 + scope = @( + @{ + refName = 'refs/heads/trunk' + matchKind = 'Exact' + repositoryId = '10000000-0000-0000-0000-0000000000001' + }) + } + } | Should -Throw + } + } +} diff --git a/unit/test/Add-VSTeamProfile.Tests.ps1 b/Tests/function/tests/Add-VSTeamProfile.Tests.ps1 similarity index 94% rename from unit/test/Add-VSTeamProfile.Tests.ps1 rename to Tests/function/tests/Add-VSTeamProfile.Tests.ps1 index 6a501f22d..909dca548 100644 --- a/unit/test/Add-VSTeamProfile.Tests.ps1 +++ b/Tests/function/tests/Add-VSTeamProfile.Tests.ps1 @@ -2,12 +2,9 @@ Set-StrictMode -Version Latest Describe 'VSTeamProfile' { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProfile" - . "$PSScriptRoot/../../Source/Public/$sut" + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + . "$baseFolder/Source/Public/Get-VSTeamProfile" $expectedPath = "$HOME/vsteam_profiles.json" diff --git a/Tests/function/tests/Add-VSTeamProject.Tests.ps1 b/Tests/function/tests/Add-VSTeamProject.Tests.ps1 new file mode 100644 index 000000000..25de5ec07 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamProject.Tests.ps1 @@ -0,0 +1,112 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProject' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProject.ps1" + . "$baseFolder/Source/Public/Get-VSTeamProcess.ps1" + + # Get-VSTeamProject to return project after creation + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamProject-NamePeopleTracker.json' } -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" + } + + Mock Start-Sleep + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } + Mock _callApi { Open-SampleFile 'Get-VSTeamProcess.json' } -ParameterFilter { $area -eq 'work' -and $resource -eq 'processes' } + + # Get-VSTeamProject for cache + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*`$top=100*" -and + $Uri -like "*stateFilter=WellFormed*" + } + } + + Context 'Add-VSTeamProject' { + BeforeAll { + Mock Write-Progress + + # Add Project + Mock Invoke-RestMethod { return @{status = 'inProgress'; id = '123-5464-dee43'; url = 'https://someplace.com' } } -ParameterFilter { + $Method -eq 'POST' -and + $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" + } + + # Track Progress + Mock Invoke-RestMethod { + # This $i is in the module. Because we use InModuleScope + # we can see it + if ($i -gt 9) { + return @{status = 'succeeded' } + } + + return @{status = 'inProgress' } + } -ParameterFilter { + $Uri -eq 'https://someplace.com' + } + } + + It 'with tfvc should create project with tfvc' { + Add-VSTeamProject -Name Test -tfvc + + Should -Invoke Invoke-RestMethod -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" + } + + Should -Invoke Invoke-RestMethod -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" -and + $Body -like '*"name":*"Test"*' -and + $Body -like '*"templateTypeId":*6b724908-ef14-45cf-84f8-768b5384da45*' -and + $Body -like '*"sourceControlType":*"Tfvc"*' + } + } + } + + Context 'Add-VSTeamProject with Agile' { + BeforeAll { + 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 + } + + It 'Should create project with Agile' { + Add-VSTeamProject -ProjectName Test -processTemplate Agile + + Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } + Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" } + } + } + + Context 'Add-VSTeamProject with CMMI' { + BeforeAll { + 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 Get-VSTeamProcess { return [PSCustomObject]@{ + name = 'CMMI' + id = 1 + Typeid = '00000000-0000-0000-0000-000000000002' + } + } + } + + It 'Should create project with CMMI' { + Add-VSTeamProject -ProjectName Test -processTemplate CMMI + + Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } + Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" } + } + } + + Context 'Add-VSTeamProject throws error' { + BeforeAll { + 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 Write-Error + Mock _trackProjectProgress { throw 'Test error' } + } + + It '_trackProjectProgress errors should throw' { + { Add-VSTeamProject -projectName Test -processTemplate CMMI } | Should -Throw + } + } +} diff --git a/Tests/function/tests/Add-VSTeamProjectPermission.Tests.ps1 b/Tests/function/tests/Add-VSTeamProjectPermission.Tests.ps1 new file mode 100644 index 000000000..bae51b2d0 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamProjectPermission.Tests.ps1 @@ -0,0 +1,102 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProjectPermission' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Add-VSTeamAccessControlEntry.ps1" + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + $userSingleResult = Open-SampleFile 'users.single.json' + $userSingleResultObject = [vsteam_lib.User]::new($userSingleResult) + + $groupSingleResult = Open-SampleFile 'groupsSingle.json' + $groupSingleResultObject = [vsteam_lib.Group]::new($groupSingleResult) + + $projectResult = [PSCustomObject]@{ + name = 'Test Project Public' + description = '' + url = '' + id = '010d06f0-00d5-472a-bb47-58947c230876' + state = '' + visibility = '' + revision = [long]0 + defaultTeam = [PSCustomObject]@{ } + _links = [PSCustomObject]@{ } + } + + $projectResultObject = [vsteam_lib.Project]::new($projectResult) + + $accessControlEntryResult = + @" +{ + "count": 1, + "value": [ + { + "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1", + "allow": 8, + "deny": 0, + "extendedInfo": {} + } + ] +} +"@ | ConvertFrom-Json + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Add-VSTeamProjectPermission by ProjectUser' { + BeforeAll { + Mock Invoke-RestMethod { + # If this test fails uncomment the line below to see how the mock was called. + # Write-Host $args + + return $accessControlEntryResult + } -Verifiable + } + + It 'by ProjectUser should return ACEs' { + Add-VSTeamProjectPermission -Project $projectResultObject -User $userSingleResultObject -Allow ([vsteam_lib.ProjectPermissions]'GENERIC_READ,GENERIC_WRITE,WORK_ITEM_DELETE,RENAME') -Deny ([vsteam_lib.ProjectPermissions]'CHANGE_PROCESS,VIEW_TEST_RESULTS') + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/52d39943-cb85-4d7f-8fa8-c6baac873819*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"`$PROJECT:vstfs:///Classification/TeamProject/010d06f0-00d5-472a-bb47-58947c230876`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and + $Body -like "*`"allow`": 73731,*" -and + $Body -like "*`"deny`": 8389120,*" -and + $Method -eq "Post" + } + } + + It 'by ProjectGroup should return ACEs' { + Add-VSTeamProjectPermission -Project $projectResultObject -Group $groupSingleResultObject -Allow ([vsteam_lib.ProjectPermissions]'GENERIC_READ,GENERIC_WRITE,WORK_ITEM_DELETE,RENAME') -Deny ([vsteam_lib.ProjectPermissions]'CHANGE_PROCESS,VIEW_TEST_RESULTS') + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/52d39943-cb85-4d7f-8fa8-c6baac873819*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"`$PROJECT:vstfs:///Classification/TeamProject/010d06f0-00d5-472a-bb47-58947c230876`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 73731,*" -and + $Body -like "*`"deny`": 8389120,*" -and + $Method -eq "Post" + } + } + + It 'by ProjectDescriptor should return ACEs' { + Add-VSTeamProjectPermission -Project $projectResultObject -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([vsteam_lib.ProjectPermissions]'GENERIC_READ,GENERIC_WRITE,WORK_ITEM_DELETE,RENAME') -Deny ([vsteam_lib.ProjectPermissions]'CHANGE_PROCESS,VIEW_TEST_RESULTS') + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/52d39943-cb85-4d7f-8fa8-c6baac873819*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"`$PROJECT:vstfs:///Classification/TeamProject/010d06f0-00d5-472a-bb47-58947c230876`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 73731,*" -and + $Body -like "*`"deny`": 8389120,*" -and + $Method -eq "Post" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamPullRequest.Tests.ps1 b/Tests/function/tests/Add-VSTeamPullRequest.Tests.ps1 new file mode 100644 index 000000000..f4bb1a935 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamPullRequest.Tests.ps1 @@ -0,0 +1,82 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPullRequest' { + ## Arrange + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProject" + + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } + + # Get-VSTeamProject for cache + Mock Invoke-RestMethod { return @() } -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/projects*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$top=100*" -and + $Uri -like "*stateFilter=WellFormed*" + } + + $result = Open-SampleFile 'updatePullRequestResponse.json' + } + + Context 'Add-VSTeamPullRequest' { + BeforeAll { + Mock Invoke-RestMethod { return $result } + } + + It 'Add-VSTeamPullRequest as Draft' { + ## Act + Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` + -Title "PR Title" -Description "PR Description" ` + -SourceRefName "refs/heads/test" -TargetRefName "refs/heads/trunk" ` + -Draft -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests*" -and + $Body -eq '{"sourceRefName": "refs/heads/test", "targetRefName": "refs/heads/trunk", "title": "PR Title", "description": "PR Description", "isDraft": true}' + } + } + + It 'Add-VSTeamPullRequest as Published' { + ## Act + Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` + -Title "PR Title" -Description "PR Description" ` + -SourceRefName "refs/heads/test" -TargetRefName "refs/heads/trunk" ` + -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests*" -and + $Body -eq '{"sourceRefName": "refs/heads/test", "targetRefName": "refs/heads/trunk", "title": "PR Title", "description": "PR Description", "isDraft": false}' + } + } + + It 'Add-VSTeamPullRequest with wrong -SourceRefName throws' { + ## Act / Assert + { + Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` + -Title "PR Title" -Description "PR Description" ` + -SourceRefName "garbage" -TargetRefName "refs/heads/trunk" ` + -Draft -Force + } | Should -Throw + } + + It 'Add-VSTeamPullRequest with wrong -TargetRefName throws' { + ## Act / Assert + { + Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` + -Title "PR Title" -Description "PR Description" ` + -SourceRefName "refs/heads/test" -TargetRefName "garbage" ` + -Draft -Force + } | Should -Throw + } + } +} diff --git a/Tests/function/tests/Add-VSTeamRelease.Tests.ps1 b/Tests/function/tests/Add-VSTeamRelease.Tests.ps1 new file mode 100644 index 000000000..36df3751d --- /dev/null +++ b/Tests/function/tests/Add-VSTeamRelease.Tests.ps1 @@ -0,0 +1,120 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamRelease' { + ## Arrange + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamBuild.ps1" + . "$baseFolder/Source/Public/Get-VSTeamReleaseDefinition.ps1" + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } + } + + Context 'Add-VSTeamRelease' { + ## Arrange + BeforeAll { + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'project' + + Mock Get-VSTeamReleaseDefinition { + $def1 = New-Object -TypeName PSObject -Prop @{ name = 'Test1'; id = 1; artifacts = @(@{ alias = 'drop' }) } + $def2 = New-Object -TypeName PSObject -Prop @{ name = 'Tests'; id = 2; artifacts = @(@{ alias = 'drop' }) } + + return @($def1, $def2) + } + + Mock Get-VSTeamBuild { + $bld1 = New-Object -TypeName PSObject -Prop @{name = "Bld1"; id = 1 } + + return @($bld1) + } + + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamRelease-id178-expandEnvironments.json' } + Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Body -like "*101*" } + + Mock _buildDynamicParam { + param( + [string] $ParameterName = 'QueueName', + [array] $arrSet, + [bool] $Mandatory = $false, + [string] $ParameterSetName + ) + + # Create the collection of attributes + $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] + + # Create and set the parameters' attributes + $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute + $ParameterAttribute.Mandatory = $Mandatory + $ParameterAttribute.ValueFromPipelineByPropertyName = $true + + if ($ParameterSetName) { + $ParameterAttribute.ParameterSetName = $ParameterSetName + } + + # Add the attributes to the attributes collection + $AttributeCollection.Add($ParameterAttribute) + + if ($arrSet) { + # Generate and set the ValidateSet + $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) + + # Add the ValidateSet to the attributes collection + $AttributeCollection.Add($ValidateSetAttribute) + } + + # Create and return the dynamic parameter + return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) + } + } + + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'by name should add a release' { + ## Act + Add-VSTeamRelease -ProjectName project ` + -BuildNumber 'Bld1' ` + -DefinitionName 'Test1' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '*"definitionId": 1*' -and + $Body -like '*"description": ""*' -and + $Body -like '*"alias": "drop"*' -and + $Body -like '*"id": "1"*' -and + $Body -like '*"sourceBranch": ""*' -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)" + } + } + + It 'by Id should add a release' { + ## Act + Add-VSTeamRelease -ProjectName project ` + -DefinitionId 1 ` + -ArtifactAlias drop ` + -BuildId 2 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '*"definitionId": 1*' -and + $Body -like '*"description": ""*' -and + $Body -like '*"alias": "drop"*' -and + $Body -like '*"id": "2"*' -and + $Body -like '*"sourceBranch": ""*' -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)" + } + } + + It 'should throw' { + ## Act / Assert + { Add-VSTeamRelease -ProjectName project ` + -DefinitionId 101 ` + -ArtifactAlias drop ` + -BuildId 101 } | Should -Throw + } + } +} diff --git a/Tests/function/tests/Add-VSTeamReleaseDefinition.Tests.ps1 b/Tests/function/tests/Add-VSTeamReleaseDefinition.Tests.ps1 new file mode 100644 index 000000000..87f45d86e --- /dev/null +++ b/Tests/function/tests/Add-VSTeamReleaseDefinition.Tests.ps1 @@ -0,0 +1,52 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamReleaseDefinition' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } + } + + Context 'Add-VSTeamReleaseDefinition' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamReleaseDefinition.json' } + } + + Context 'Services' { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + it 'should add release' { + ## Act + Add-VSTeamReleaseDefinition -projectName project -inFile 'Releasedef.json' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $InFile -eq 'Releasedef.json' -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)" + } + } + } + + Context 'Server' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + it 'local Auth should add release' { + ## Act + Add-VSTeamReleaseDefinition -projectName project -inFile 'Releasedef.json' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $InFile -eq 'Releasedef.json' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/release/definitions?api-version=$(_getApiVersion Release)" + } + } + } + } +} diff --git a/Tests/function/tests/Add-VSTeamServiceFabricEndpoint.Tests.ps1 b/Tests/function/tests/Add-VSTeamServiceFabricEndpoint.Tests.ps1 new file mode 100644 index 000000000..0ad6e5a65 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamServiceFabricEndpoint.Tests.ps1 @@ -0,0 +1,89 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamServiceFabricEndpoint' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Add-VSTeamServiceEndpoint.ps1" + . "$baseFolder/Source/Public/Get-VSTeamServiceEndpoint.ps1" + } + + Context 'Add-VSTeamServiceFabricEndpoint' { + Context 'Services' { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } + + Mock Write-Progress + Mock Invoke-RestMethod { _trackProcess } + Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } + } + + It 'should create a new Service Fabric Serviceendpoint' { + Add-VSTeamServiceFabricEndpoint -projectName 'project' ` + -endpointName 'PM_DonovanBrown' ` + -url "tcp://0.0.0.0:19000" ` + -useWindowsSecurity $false + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } + } + + It 'with AzureAD authentication should create a new Service Fabric Serviceendpoint' { + $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force + $username = "Test User" + $serverCertThumbprint = "0000000000000000000000000000000000000000" + + Add-VSTeamServiceFabricEndpoint -projectName 'project' ` + -endpointName 'PM_DonovanBrown' ` + -url "tcp://0.0.0.0:19000" ` + -username $username ` + -password $password ` + -serverCertThumbprint $serverCertThumbprint + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } + } + + It 'with Certificate authentication should create a new Service Fabric Serviceendpoint' { + $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force + $base64Cert = "0000000000000000000000000000000000000000" + $serverCertThumbprint = "0000000000000000000000000000000000000000" + + Add-VSTeamServiceFabricEndpoint -projectName 'project' ` + -endpointName 'PM_DonovanBrown' ` + -url "tcp://0.0.0.0:19000" ` + -serverCertThumbprint $serverCertThumbprint ` + -certificate $base64Cert ` + -certificatePassword $password + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } + } + } + + Context 'Server' { + BeforeAll { + Mock _getApiVersion { return 'TFS2017' } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } + } + + Context 'Add-VSTeamServiceFabricEndpoint' { + BeforeAll { + Mock Add-VSTeamServiceEndpoint -ParameterFilter { + $endpointType -eq 'servicefabric' + } + } + + # 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 -Not -Throw + } + + It 'Add-VSTeamServiceEndpoint should be called' { + Should -Invoke Add-VSTeamServiceEndpoint -Exactly -Times 1 -Scope Context + } + } + } + } +} diff --git a/Tests/function/tests/Add-VSTeamSonarQubeEndpoint.Tests.ps1 b/Tests/function/tests/Add-VSTeamSonarQubeEndpoint.Tests.ps1 new file mode 100644 index 000000000..d5f173656 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamSonarQubeEndpoint.Tests.ps1 @@ -0,0 +1,46 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamSonarQubeEndpoint' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Add-VSTeamServiceEndpoint.ps1" + . "$baseFolder/Source/Public/Get-VSTeamServiceEndpoint.ps1" + } + + Context 'Add-VSTeamSonarQubeEndpoint' { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } + + Mock Write-Warning + Mock Write-Error -Verifiable + Mock Invoke-RestMethod { + $e = [System.Management.Automation.ErrorRecord]::new( + [System.Net.WebException]::new("Endpoint type couldn't be recognized 'sonarqube'", [System.Net.WebExceptionStatus]::ProtocolError), + "Endpoint type couldn't be recognized 'sonarqube'", + [System.Management.Automation.ErrorCategory]::ProtocolError, + $null) + + # The error message is different on TFS and VSTS + $msg = ConvertTo-Json @{ + '$id' = 1 + message = "Unable to find service endpoint type 'sonarqube' using authentication scheme 'UsernamePassword'." + } + + $e.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($msg) + + $PSCmdlet.ThrowTerminatingError($e) + } + } + + It 'should not create SonarQube Serviceendpoint' { + Add-VSTeamSonarQubeEndpoint -projectName 'project' ` + -endpointName 'PM_DonovanBrown' ` + -sonarqubeUrl 'http://mysonarserver.local' ` + -personalAccessToken '00000000-0000-0000-0000-000000000000' + + ## Verify that Write-Error was called + Should -InvokeVerifiable + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamTaskGroup.Tests.ps1 b/Tests/function/tests/Add-VSTeamTaskGroup.Tests.ps1 new file mode 100644 index 000000000..c504118ac --- /dev/null +++ b/Tests/function/tests/Add-VSTeamTaskGroup.Tests.ps1 @@ -0,0 +1,41 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamTaskGroup' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + $taskGroupJson = "$sampleFiles\taskGroup.json" + $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'TaskGroups' } + } + + Context 'Add-VSTeamTaskGroup' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'taskGroup.json' } + } + + It 'should create a task group using body param' { + Add-VSTeamTaskGroup -ProjectName Project -Body $taskGroupJsonAsString + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/Project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" -and + $Body -eq $taskGroupJsonAsString -and + $Method -eq "Post" + } + } + + It 'should create a task group using infile param' { + Add-VSTeamTaskGroup -ProjectName Project -InFile $taskGroupJson + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/Project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" -and + $InFile -eq $taskGroupJson -and + $Method -eq "Post" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamUserEntitlement.Tests.ps1 b/Tests/function/tests/Add-VSTeamUserEntitlement.Tests.ps1 new file mode 100644 index 000000000..6e1dd3921 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamUserEntitlement.Tests.ps1 @@ -0,0 +1,31 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamUserEntitlement" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Add-VSTeamUserEntitlement' { + BeforeAll { + [vsteam_lib.Versions]::ModuleVersion = '0.0.0' + + Mock _callAPI + Mock _getApiVersion { return 'VSTS' } + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'Should add a user' { + Add-VSTeamUserEntitlement -License earlyAdopter ` + -LicensingSource msdn ` + -MSDNLicenseType enterprise ` + -Email 'test@user.com' + + Should -Invoke _callAPI -ParameterFilter { + $Method -eq 'Post' -and + $SubDomain -eq 'vsaex' -and + $Body -like '*"principalName":*"test@user.com"*' -and + $Body -like '*"subjectKind":*"user"*' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamVariableGroup.Tests.ps1 b/Tests/function/tests/Add-VSTeamVariableGroup.Tests.ps1 new file mode 100644 index 000000000..4bf603ea8 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamVariableGroup.Tests.ps1 @@ -0,0 +1,95 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamVariableGroup' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Set-VSTeamAPIVersion.ps1" + . "$baseFolder/Source/Public/Get-VSTeamVariableGroup.ps1" + + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'VariableGroups' } + } + + Context 'Add-VSTeamVariableGroup' { + Context 'Services' { + BeforeAll { + $sampleFileVSTS = Open-SampleFile 'Get-VSTeamVariableGroup.json' + + Mock _getInstance { return 'https://dev.azure.com/test' } + + Set-VSTeamAPIVersion -Target VSTS + + Mock Invoke-RestMethod { return $sampleFileVSTS.value[0] } + } + + It 'should create a new AzureRM Key Vault Variable Group' { + $testParameters = @{ + ProjectName = "project" + Name = "TestVariableGroup2" + Description = "A test variable group linked to an Azure KeyVault" + Type = "AzureKeyVault" + Variables = @{ + key3 = @{ + enabled = $true + contentType = "" + value = "" + isSecret = $true + } + } + ProviderData = @{ + serviceEndpointId = "0228e842-65a7-4c64-90f7-0f07f3aa4e10" + vault = "keyVaultName" + } + } + + Add-VSTeamVariableGroup @testParameters + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' + } + } + + It "should create a new var group when passing the json as the body" { + $body = $sampleFileVSTS + $projName = "project" + + Add-VSTeamVariableGroup -Body $body -ProjectName $projName + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/$projName/_apis/distributedtask/variablegroups?api-version=$(_getApiVersion VariableGroups)" -and + $Method -eq 'Post' + } + } + } + + Context 'Server' { + BeforeAll { + $sampleFile2017 = Open-SampleFile 'variableGroupSamples2017.json' + + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable + + Set-VSTeamAPIVersion -Target TFS2017 + + Mock Invoke-RestMethod { return $sampleFile2017.value[0] } + } + + It 'should create a new Variable Group' { + $testParameters = @{ + ProjectName = "project" + Name = "TestVariableGroup2" + Description = "A test variable group linked to an Azure KeyVault" + Variables = @{ + key1 = @{ + value = "value" + } + } + } + + Add-VSTeamVariableGroup @testParameters + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' + } + } + } + } +} diff --git a/unit/test/Add-VSTeamWorkItem.Tests.ps1 b/Tests/function/tests/Add-VSTeamWorkItem.Tests.ps1 similarity index 80% rename from unit/test/Add-VSTeamWorkItem.Tests.ps1 rename to Tests/function/tests/Add-VSTeamWorkItem.Tests.ps1 index 872bb346e..af03a1fc2 100644 --- a/unit/test/Add-VSTeamWorkItem.Tests.ps1 +++ b/Tests/function/tests/Add-VSTeamWorkItem.Tests.ps1 @@ -2,43 +2,22 @@ Set-StrictMode -Version Latest Describe 'VSTeamWorkItem' { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/WorkItemTypeCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/WorkItemTypeValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamWorkItem-Id16.json' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - $obj = @{ - id = 47 - rev = 1 - url = "https://dev.azure.com/test/_apis/wit/workItems/47" - } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $obj - } } Context 'Add-VSTeamWorkItem' { It 'Without Default Project should add work item' { + ## Arrange $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + + ## Act Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Body -like '`[*' -and # Make sure the body is an array @@ -49,9 +28,13 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should add work item' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' + + ## Act Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Body -like '`[*' -and # Make sure the body is an array @@ -66,9 +49,13 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should add work item with parent' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' + + ## Act Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing -ParentId 25 + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Body -like '`[*' -and # Make sure the body is an array @@ -86,11 +73,14 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should add work item only with additional properties and parent id' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' - $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } + + ## Act Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing -ParentId 25 -AdditionalFields $additionalFields + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Body -like '`[*' -and # Make sure the body is an array @@ -109,11 +99,14 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should add work item only with additional properties' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' - $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } + + ## Act Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -AdditionalFields $additionalFields + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Body -like '`[*' -and # Make sure the body is an array @@ -128,10 +121,17 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should throw exception when adding existing parameters to additional properties and parent id' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' - $additionalFields = @{"System.Title" = "Test1"; "System.AreaPath" = "Project\\TestPath" } - { Add-VSTeamWorkItem -ProjectName test -WorkItemType Task -Title Test1 -Description Testing -ParentId 25 -AdditionalFields $additionalFields } | Should -Throw + + ## Act / Assert + { Add-VSTeamWorkItem -ProjectName test ` + -WorkItemType Task ` + -Title Test1 ` + -Description Testing ` + -ParentId 25 ` + -AdditionalFields $additionalFields } | Should -Throw } } } diff --git a/Tests/function/tests/Add-VSTeamWorkItemAreaPermission.Tests.ps1 b/Tests/function/tests/Add-VSTeamWorkItemAreaPermission.Tests.ps1 new file mode 100644 index 000000000..cabe75019 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamWorkItemAreaPermission.Tests.ps1 @@ -0,0 +1,156 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamWorkItemAreaPermission' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamClassificationNode.ps1" + . "$baseFolder/Source/Public/Add-VSTeamAccessControlEntry.ps1" + + ## Arrange + $userSingleResultObject = [vsteam_lib.User]::new($(Open-SampleFile 'users.single.json')) + $groupSingleResultObject = [vsteam_lib.Group]::new($(Open-SampleFile 'groupsSingle.json')) + $projectResultObject = [vsteam_lib.Project]::new($(Open-SampleFile 'Get-VSTeamProject-NamePeopleTracker.json')) + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Add-VSTeamWorkItemAreaPermission' { + BeforeAll { + ## Arrange + $areaRootNode = Open-SampleFile 'Get-VSTeamClassificationNode-Depth0-Ids24.json' -Index 0 + $classificationNodeById = Open-SampleFile 'Get-VSTeamClassificationNode-Depth0-Ids85.json' -ReturnValue + $parentClassificationNode = Open-SampleFile 'Get-VSTeamClassificationNode-Depth0-Ids43.json' -ReturnValue + + Mock Get-VSTeamClassificationNode { return [vsteam_lib.ClassificationNode]::new($areaRootNode, "test") } + Mock Get-VSTeamClassificationNode { return [vsteam_lib.ClassificationNode]::new($parentClassificationNode, "test") } -ParameterFilter { $Path -eq "Child%201%20Level%201" } + Mock Get-VSTeamClassificationNode { return [vsteam_lib.ClassificationNode]::new($classificationNodeById, "test") } -ParameterFilter { $Id -eq 85 -or $Path -eq "Child 1 Level 1/Child 1 Level 2" } + + Mock Invoke-RestMethod { Open-SampleFile 'accessControlEntryResult.json' } + } + + It 'by AreaID and User should return ACEs' { + ## Act + Add-VSTeamWorkItemAreaPermission -Project $projectResultObject ` + -AreaID 85 ` + -User $userSingleResultObject ` + -Allow ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') ` + -Deny ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_WRITE,DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and + $Body -like "*`"allow`": 65,*" -and + $Body -like "*`"deny`": 10,*" -and + $Method -eq "Post" + } + } + + It 'by AreaID and Group should return ACEs' { + ## Act + Add-VSTeamWorkItemAreaPermission -Project $projectResultObject ` + -AreaID 85 ` + -Group $groupSingleResultObject ` + -Allow ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') ` + -Deny ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_WRITE,DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 65,*" -and + $Body -like "*`"deny`": 10,*" -and + $Method -eq "Post" + } + } + + It 'by AreaID and Descriptor should return ACEs' { + ## Act + Add-VSTeamWorkItemAreaPermission -Project $projectResultObject ` + -AreaID 85 ` + -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" ` + -Allow ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') ` + -Deny ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_WRITE,DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 65,*" -and + $Body -like "*`"deny`": 10,*" -and + $Method -eq "Post" + } + } + + It 'by AreaPath and User should return ACEs' { + ## Act + Add-VSTeamWorkItemAreaPermission -Project $projectResultObject ` + -AreaPath "Child 1 Level 1/Child 1 Level 2" ` + -User $userSingleResultObject ` + -Allow ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') ` + -Deny ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_WRITE,DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and + $Body -like "*`"allow`": 65,*" -and + $Body -like "*`"deny`": 10,*" -and + $Method -eq "Post" + } + } + + It 'by AreaPath and Group should return ACEs' { + ## Act + Add-VSTeamWorkItemAreaPermission -Project $projectResultObject ` + -AreaPath "Child 1 Level 1/Child 1 Level 2" ` + -Group $groupSingleResultObject ` + -Allow ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') ` + -Deny ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_WRITE,DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 65,*" -and + $Body -like "*`"deny`": 10,*" -and + $Method -eq "Post" + } + } + + It 'by AreaPath and Descriptor should return ACEs' { + ## Act + Add-VSTeamWorkItemAreaPermission -Project $projectResultObject ` + -AreaPath "Child 1 Level 1/Child 1 Level 2" ` + -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" ` + -Allow ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') ` + -Deny ([vsteam_lib.WorkItemAreaPermissions]'GENERIC_WRITE,DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 65,*" -and + $Body -like "*`"deny`": 10,*" -and + $Method -eq "Post" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Add-VSTeamWorkItemIterationPermission.Tests.ps1 b/Tests/function/tests/Add-VSTeamWorkItemIterationPermission.Tests.ps1 new file mode 100644 index 000000000..f1f51a021 --- /dev/null +++ b/Tests/function/tests/Add-VSTeamWorkItemIterationPermission.Tests.ps1 @@ -0,0 +1,154 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamWorkItemIterationPermission' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamClassificationNode.ps1" + . "$baseFolder/Source/Public/Add-VSTeamAccessControlEntry.ps1" + + ## Arrange + $userSingleResultObject = [vsteam_lib.User]::new($(Open-SampleFile 'users.single.json')) + $groupSingleResultObject = [vsteam_lib.Group]::new($(Open-SampleFile 'groupsSingle.json')) + $projectResultObject = [vsteam_lib.Project]::new($(Open-SampleFile 'Get-VSTeamProject-NamePeopleTracker.json')) + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Add-VSTeamWorkItemIterationPermission' { + BeforeAll { + ## Arrange + $classificationNodeIterationId = Open-SampleFile 'Get-VSTeamClassificationNode-Depth0-Ids20.json' -ReturnValue + $iterationRootNode = Open-SampleFile 'Get-VSTeamClassificationNode-depth3-ids16.json' + + Mock Get-VSTeamClassificationNode { return [vsteam_lib.ClassificationNode]::new($iterationRootNode, "test") } + Mock Get-VSTeamClassificationNode { return [vsteam_lib.ClassificationNode]::new($classificationNodeIterationId, "test") } -ParameterFilter { $Id -eq 44 -or $Path -eq "Sprint 1" } + + Mock Invoke-RestMethod { Open-SampleFile 'accessControlEntryResult.json' } + } + + It 'by IterationID and User should return ACEs' { + ## Act + Add-VSTeamWorkItemIterationPermission -Project $projectResultObject ` + -IterationID 44 ` + -User $userSingleResultObject ` + -Allow ([vsteam_lib.WorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') ` + -Deny ([vsteam_lib.WorkItemIterationPermissions]'DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and + $Body -like "*`"allow`": 5,*" -and + $Body -like "*`"deny`": 8,*" -and + $Method -eq "Post" + } + } + + It 'by IterationID and Group should return ACEs' { + ## Act + Add-VSTeamWorkItemIterationPermission -Project $projectResultObject ` + -IterationID 44 ` + -Group $groupSingleResultObject ` + -Allow ([vsteam_lib.WorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') ` + -Deny ([vsteam_lib.WorkItemIterationPermissions]'DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 5,*" -and + $Body -like "*`"deny`": 8,*" -and + $Method -eq "Post" + } + } + + It 'by IterationID and Descriptor should return ACEs' { + ## Act + Add-VSTeamWorkItemIterationPermission -Project $projectResultObject ` + -IterationID 44 ` + -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" ` + -Allow ([vsteam_lib.WorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') ` + -Deny ([vsteam_lib.WorkItemIterationPermissions]'DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 5,*" -and + $Body -like "*`"deny`": 8,*" -and + $Method -eq "Post" + } + } + + It 'by IterationPath and User should return ACEs' { + ## Act + Add-VSTeamWorkItemIterationPermission -Project $projectResultObject ` + -IterationPath "Sprint 1" ` + -User $userSingleResultObject ` + -Allow ([vsteam_lib.WorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') ` + -Deny ([vsteam_lib.WorkItemIterationPermissions]'DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and + $Body -like "*`"allow`": 5,*" -and + $Body -like "*`"deny`": 8,*" -and + $Method -eq "Post" + } + } + + It 'by IterationPath and Group should return ACEs' { + ## Act + Add-VSTeamWorkItemIterationPermission -Project $projectResultObject ` + -IterationPath "Sprint 1" ` + -Group $groupSingleResultObject ` + -Allow ([vsteam_lib.WorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') ` + -Deny ([vsteam_lib.WorkItemIterationPermissions]'DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 5,*" -and + $Body -like "*`"deny`": 8,*" -and + $Method -eq "Post" + } + } + + It 'by IterationPath and Descriptor should return ACEs' { + ## Act + Add-VSTeamWorkItemIterationPermission -Project $projectResultObject ` + -IterationPath "Sprint 1" ` + -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" ` + -Allow ([vsteam_lib.WorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') ` + -Deny ([vsteam_lib.WorkItemIterationPermissions]'DELETE') + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and + $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and + $Body -like "*`"allow`": 5,*" -and + $Body -like "*`"deny`": 8,*" -and + $Method -eq "Post" + } + } + } +} \ No newline at end of file diff --git a/unit/test/Clear-VSTeamDefaultAPITimeout.Tests.ps1 b/Tests/function/tests/Clear-VSTeamDefaultAPITimeout.Tests.ps1 similarity index 86% rename from unit/test/Clear-VSTeamDefaultAPITimeout.Tests.ps1 rename to Tests/function/tests/Clear-VSTeamDefaultAPITimeout.Tests.ps1 index 221b519e6..8c00f93ef 100644 --- a/unit/test/Clear-VSTeamDefaultAPITimeout.Tests.ps1 +++ b/Tests/function/tests/Clear-VSTeamDefaultAPITimeout.Tests.ps1 @@ -2,13 +2,7 @@ Set-StrictMode -Version Latest Describe 'VSTeamDefaultAPITimeout' -Tag 'APITimeout' { BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath } Context 'Clear-VSTeamDefaultAPITimeout on Non Windows' { diff --git a/Tests/function/tests/Clear-VSTeamDefaultProject.Tests.ps1 b/Tests/function/tests/Clear-VSTeamDefaultProject.Tests.ps1 new file mode 100644 index 000000000..f17ae08aa --- /dev/null +++ b/Tests/function/tests/Clear-VSTeamDefaultProject.Tests.ps1 @@ -0,0 +1,65 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamDefaultProject' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Clear-VSTeamDefaultProject on Non Windows' { + BeforeAll { + Mock _isOnWindows { return $false } + } + + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'should clear default project' { + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' + + Clear-VSTeamDefaultProject + + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -BeNullOrEmpty + } + } + + Context 'Clear-VSTeamDefaultProject as Non-Admin on Windows' { + BeforeAll { + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $false } + } + + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'should clear default project' { + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' + + Clear-VSTeamDefaultProject + + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -BeNullOrEmpty + } + } + + Context 'Clear-VSTeamDefaultProject as Admin on Windows' { + BeforeAll { + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $true } + } + + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'should clear default project' { + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' + + Clear-VSTeamDefaultProject + + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -BeNullOrEmpty + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Disable-VSTeamAgent.Tests.ps1 b/Tests/function/tests/Disable-VSTeamAgent.Tests.ps1 new file mode 100644 index 000000000..ba46ce8e7 --- /dev/null +++ b/Tests/function/tests/Disable-VSTeamAgent.Tests.ps1 @@ -0,0 +1,39 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamAgent' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _callAPI + Mock _handleException + Mock _callAPI { throw 'boom' } -ParameterFilter { $id -eq "101" } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } + } + + Context 'Disable-VSTeamAgent' { + It 'should handle exception' { + ## Act + Disable-VSTeamAgent -Pool 36 -Id 101 -Force + + ##Assert + Should -Invoke _handleException -Exactly -Times 1 -Scope It + } + + It 'should disable the agent with passed in Id' { + ## Act + Disable-VSTeamAgent -Pool 36 -Id 950 -Force + + ## Assert + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $method -eq 'PATCH' -and + $NoProject -eq $true -and + $area -eq 'distributedtask/pools/36' -and + $resource -eq 'agents' -and + $id -eq 950 -and + $body -eq "{'enabled':false,'id':950,'maxParallelism':1}" -and + $version -eq '1.0-unitTests' + } + } + } +} diff --git a/Tests/function/tests/Enable-VSTeamAgent.Tests.ps1 b/Tests/function/tests/Enable-VSTeamAgent.Tests.ps1 new file mode 100644 index 000000000..0be188010 --- /dev/null +++ b/Tests/function/tests/Enable-VSTeamAgent.Tests.ps1 @@ -0,0 +1,36 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamAgent' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Enable-VSTeamAgent' { + ## Arrnage + BeforeAll { + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } + + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + # Mock the call to Get-Projects by the dynamic parameter for ProjectName + Mock Invoke-RestMethod -ParameterFilter { $Uri -like "*950*" } + Mock Invoke-RestMethod { throw 'boom' } -ParameterFilter { $Uri -like "*101*" } + } + + It 'by Id should enable the agent with passed in Id' { + ## Act + Enable-VSTeamAgent -Pool 36 -Id 950 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/36/agents/950?api-version=$(_getApiVersion DistributedTask)" + } + } + + It 'should throw' { + ## Act / ## Assert + { Enable-VSTeamAgent -Pool 36 -Id 101 } | Should -Throw + } + } +} diff --git a/unit/test/Get-VSTeam.Tests.ps1 b/Tests/function/tests/Get-VSTeam.Tests.ps1 similarity index 85% rename from unit/test/Get-VSTeam.Tests.ps1 rename to Tests/function/tests/Get-VSTeam.Tests.ps1 index b215a36e1..e4c433798 100644 --- a/unit/test/Get-VSTeam.Tests.ps1 +++ b/Tests/function/tests/Get-VSTeam.Tests.ps1 @@ -2,45 +2,13 @@ Set-StrictMode -Version Latest Describe "VSTeam" { BeforeAll { - Import-Module SHiPS + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeam.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ - id = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - description = 'team description' - } - } - - $singleResult = [PSCustomObject]@{ - id = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - description = 'team description' - } + $results = Open-SampleFile 'Get-VSTeam.json' + $singleResult = Open-SampleFile 'Get-VSTeam.json' -Index 0 } Context "Get-VSTeam" { - BeforeAll { - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - Mock _hasProjectCacheExpired { return $true } - } - Context "services" { BeforeAll { Mock _getInstance { return 'https://dev.azure.com/test' } @@ -53,7 +21,9 @@ Describe "VSTeam" { } It 'Should return teams' { - Get-VSTeam -ProjectName Test + $team = Get-VSTeam -ProjectName Test + + $team.Name | Should -Be 'Test Team' -Because 'Name should be set' # Make sure it was called with the correct URI Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { @@ -154,7 +124,6 @@ Describe "VSTeam" { Context "Server" { BeforeAll { Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } } diff --git a/Tests/function/tests/Get-VSTeamAccessControlList.Tests.ps1 b/Tests/function/tests/Get-VSTeamAccessControlList.Tests.ps1 new file mode 100644 index 000000000..d7b20f76e --- /dev/null +++ b/Tests/function/tests/Get-VSTeamAccessControlList.Tests.ps1 @@ -0,0 +1,95 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamAccessControlList' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Set-VSTeamDefaultProject.ps1" + + ## Arrange + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + + $securityNamespaceObject = [vsteam_lib.SecurityNamespace]::new($(Open-SampleFile 'securityNamespace.json' -Index 0)) + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Get-VSTeamAccessControlList' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'accessControlListResult.json' } + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*token=boom*" } + } + + It 'by SecurityNamespaceId should return ACLs' { + ## Arrange + # Even with a default set this URI should not have the project added. + Set-VSTeamDefaultProject -Project Testing + + ## Act + Get-VSTeamAccessControlList -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 ` + -Token "SomeToken" ` + -Descriptors "SomeDescriptor" ` + -IncludeExtendedInfo ` + -Recurse + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/5a27515b-ccd7-42c9-84f1-54c998f03866*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*descriptors=SomeDescriptor*" -and + $Uri -like "*includeExtendedInfo=True*" -and + $Uri -like "*token=SomeToken*" -and + $Uri -like "*recurse=True*" + } + } + + It 'by SecurityNamespace should return ACLs' { + ## Act + Get-VSTeamAccessControlList -SecurityNamespace $securityNamespaceObject ` + -Token "SomeToken" ` + -Descriptors "SomeDescriptor" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*descriptors=SomeDescriptor*" -and + $Uri -like "*token=SomeToken*" + } + } + + It 'by SecurityNamespace (pipeline) should return ACEs' { + ## Act + $securityNamespaceObject | Get-VSTeamAccessControlList -Token "AcesToken" -Descriptors "AcesDescriptor" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*descriptors=AcesDescriptor*" -and + $Uri -like "*token=AcesToken*" + } + } + + It 'by SecurityNamespaceId should throw' { + ## Act / Assert + { Get-VSTeamAccessControlList -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 ` + -Token "boom" ` + -Descriptors "SomeDescriptor" ` + -IncludeExtendedInfo ` + -Recurse } | Should -Throw + } + + It 'by SecurityNamespace should throw' { + ## Act / Assert + { Get-VSTeamAccessControlList -SecurityNamespace $securityNamespaceObject ` + -Token "boom" ` + -Descriptors "SomeDescriptor" ` + -IncludeExtendedInfo ` + -Recurse } | Should -Throw + } + } +} diff --git a/Tests/function/tests/Get-VSTeamAgent.Tests.ps1 b/Tests/function/tests/Get-VSTeamAgent.Tests.ps1 new file mode 100644 index 000000000..1a784f607 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamAgent.Tests.ps1 @@ -0,0 +1,54 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamAgent' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Set-VSTeamDefaultProject.ps1" + + ## Arrange + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTaskReleased' } + + Mock _getInstance { return 'https://dev.azure.com/test' } + + # Even with a default set this URI should not have the project added. + Set-VSTeamDefaultProject -Project Testing + } + + Context 'Get-VSTeamAgent' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamAgent-PoolId1.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamAgent-PoolId1.json' -Index 0 } -ParameterFilter { $Uri -like "*101*" } + } + + it 'by pool id should return all the agents' { + ## Act + Get-VSTeamAgent -PoolId 1 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/1/agents?api-version=$(_getApiVersion DistributedTaskReleased)" + } + } + + it 'with agent id parameter should return on agent' { + ## Act + Get-VSTeamAgent -PoolId 1 -id 101 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/1/agents/101?api-version=$(_getApiVersion DistributedTaskReleased)" + } + } + + it 'PoolID from pipeline by value should return all the agents' { + ## Act + 1 | Get-VSTeamAgent + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/1/agents?api-version=$(_getApiVersion DistributedTaskReleased)" + } + } + } +} + diff --git a/Tests/function/tests/Get-VSTeamApproval.Tests.ps1 b/Tests/function/tests/Get-VSTeamApproval.Tests.ps1 new file mode 100644 index 000000000..06db45cc5 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamApproval.Tests.ps1 @@ -0,0 +1,90 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamApproval' -Tag 'unit', 'approvals' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamApproval.json' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } + } + + Context 'Get-VSTeamApproval' { + Context 'Services' { + It 'should return approvals' { + # Act + Get-VSTeamApproval -ProjectName TestProject + + # Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It ` + -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/TestProject/_apis/release/approvals?api-version=$(_getApiVersion Release)" + } + } + + It 'should pass exception to _handleException' { + # Arrange + Mock _handleException -Verifiable + Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Uri -like "*boom*" } + + # Act + Get-VSTeamApproval -ProjectName "boom" + + # Assert + Should -InvokeVerifiable + } + + It 'should return approvals only for value passed into AssignedToFilter with AssignedToFilter' { + # Act + Get-VSTeamApproval -projectName project -AssignedToFilter 'Test User' + + # Assert + # With PowerShell core the order of the query string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It ` + -ParameterFilter { + $Uri -like "*https://vsrm.dev.azure.com/test/project/_apis/release/approvals*" -and + $Uri -like "*api-version=$(_getApiVersion Release)*" -and + $Uri -like "*assignedtoFilter=Test User*" -and + $Uri -like "*includeMyGroupApprovals=true*" + } + } + } + + Context 'Server' { + BeforeAll { + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'should return approvals' { + ## Act + Get-VSTeamApproval -projectName project ` + -ReleaseId 1 ` + -AssignedToFilter 'Test User' ` + -StatusFilter Pending + + ## Assert + # With PowerShell core the order of the query string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It ` + -ParameterFilter { + $Uri -like "*http://localhost:8080/tfs/defaultcollection/project/_apis/release/approvals*" -and + $Uri -like "*api-version=$(_getApiVersion Release)*" -and + $Uri -like "*statusFilter=Pending*" -and + $Uri -like "*assignedtoFilter=Test User*" -and + $Uri -like "*includeMyGroupApprovals=true*" -and + $Uri -like "*releaseIdsFilter=1*" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamArea.Tests.ps1 b/Tests/function/tests/Get-VSTeamArea.Tests.ps1 new file mode 100644 index 000000000..b7e64a2c3 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamArea.Tests.ps1 @@ -0,0 +1,39 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamArea' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamClassificationNode" + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamClassificationNode.json' -Index 0 } + } + + Context 'Get-VSTeamArea' { + It 'by path and depth should return areas' { + ## Act + Get-VSTeamArea -ProjectName "Public Demo" -Depth 5 -Path "test/test/test" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas/test/test/test*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$Depth=5*" + } + } + + It 'by Ids and depth should return areas' { + ## Act + Get-VSTeamArea -ProjectName "Public Demo" -Id @(1, 2, 3, 4) -Depth 5 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*Ids=1,2,3,4*" -and + $Uri -like "*`$Depth=5*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamBuild.Tests.ps1 b/Tests/function/tests/Get-VSTeamBuild.Tests.ps1 new file mode 100644 index 000000000..93af4d952 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamBuild.Tests.ps1 @@ -0,0 +1,80 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuild' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock Invoke-RestMethod { Open-SampleFile 'buildResults.json' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } + Mock Invoke-RestMethod { Open-SampleFile 'buildSingleResult.json' } -ParameterFilter { $Uri -like "*101*" } + } + + Context 'Get-VSTeamBuild' { + Context 'Services' { + BeforeAll { + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + } + + It 'with no parameters should return builds' { + ## Act + Get-VSTeamBuild -projectName project + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" + } + } + + It 'with Top parameter should return top builds' { + ## Act + Get-VSTeamBuild -projectName project -top 1 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)&`$top=1" + } + } + + It 'by id should return top builds' { + ## Act + Get-VSTeamBuild -projectName project -id 101 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/101?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Server' { + BeforeAll { + ## Arrange + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable + } + + It 'with no parameters on TFS local Auth should return builds' { + ## Act + Get-VSTeamBuild -projectName project + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" + } + } + + It 'should return builds' { + ## Act + Get-VSTeamBuild -projectName project -id 101 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/101?api-version=$(_getApiVersion Build)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamBuildArtifact.Tests.ps1 b/Tests/function/tests/Get-VSTeamBuildArtifact.Tests.ps1 new file mode 100644 index 000000000..4a276ffb8 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamBuildArtifact.Tests.ps1 @@ -0,0 +1,47 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuildArtifact' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context "Get-VSTeamBuildArtifact" { + BeforeAll { + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamBuildArtifact-Id568.json' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } + } + + Context "Services" { + It 'should return the build artifact data' { + ## Act + Get-VSTeamBuildArtifact -projectName project -id 1 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1/artifacts?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Server' { + BeforeAll { + ## Arrange + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + It 'should return the build artifact data calls correct Url on TFS local Auth' { + ## Act + Get-VSTeamBuildArtifact -projectName project -id 1 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1/artifacts?api-version=$(_getApiVersion Build)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamBuildDefinition.Tests.ps1 b/Tests/function/tests/Get-VSTeamBuildDefinition.Tests.ps1 new file mode 100644 index 000000000..22a798c63 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamBuildDefinition.Tests.ps1 @@ -0,0 +1,177 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuildDefinition' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Get-VSTeamBuildDefinition' { + BeforeAll { + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } + Mock Invoke-RestMethod { Open-SampleFile 'buildDefAzD.json' } -ParameterFilter { $Uri -like "*azd*" } + Mock Invoke-RestMethod { Open-SampleFile 'buildDefvsts.json' } -ParameterFilter { $Uri -like "*vsts*" } + Mock Invoke-RestMethod { Open-SampleFile 'buildDef2017.json' } -ParameterFilter { $Uri -like "*2017Project*" } + Mock Invoke-RestMethod { Open-SampleFile 'buildDef2018.json' } -ParameterFilter { $Uri -like "*2018Project*" } + Mock Invoke-RestMethod { Open-SampleFile 'buildDefvsts.json' -ReturnValue } -ParameterFilter { $Uri -like "*101*" } + } + + Context 'Server' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'TFS 2017 with no parameters should return build definitions' { + ## Act + Get-VSTeamBuildDefinition -projectName "2017Project" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*http://localhost:8080/tfs/defaultcollection/2017Project/_apis/build/definitions*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" + } + } + + It 'TFS 2018 with no parameters should return build definitions' { + ## Act + Get-VSTeamBuildDefinition -projectName "2018Project" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*http://localhost:8080/tfs/defaultcollection/2018Project/_apis/build/definitions*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" + } + } + + It 'by ID local auth should return build definition' { + ## Act + Get-VSTeamBuildDefinition -projectName project -id 101 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Services' { + BeforeAll { + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'AzD v5.0 of API with no parameters should return build definitions' { + ## Act + Get-VSTeamBuildDefinition -projectName azd + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/azd/_apis/build/definitions*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" + } + } + + It 'should return build definitions' { + ## Act + Get-VSTeamBuildDefinition -projectName vsts + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/vsts/_apis/build/definitions*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" + } + } + + It 'with type parameter "build" should return build definitions by type' { + ## Arrange + # This has not been supported since version 2.0 of the API which we + # no longer support. https://github.com/DarqueWarrior/vsteam/issues/87 + Mock Write-Warning + + ## Act + Get-VSTeamBuildDefinition -projectName vsts + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/vsts/_apis/build/definitions*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" + } + } + + It 'with filter parameter should return build definitions by filter' { + ## Act + Get-VSTeamBuildDefinition -projectName vsts -filter 'click*' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/vsts/_apis/build/definitions*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" -and + $Uri -like "*name=click*" + } + } + + It 'with both parameters should return build definitions by filter' { + ## Arrange + # This has not been supported since version 2.0 of the API which we + # no longer support. https://github.com/DarqueWarrior/vsteam/issues/87 + Mock Write-Warning + + ## Act + Get-VSTeamBuildDefinition -projectName vsts -filter 'click*' + + ## Asset + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/vsts/_apis/build/definitions*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" -and + $Uri -like "*name=click*" + } + } + + It 'by id should return build definition' { + ## Act + $b = Get-VSTeamBuildDefinition -projectName project -id 101 + + ## Assert + $b | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'vsteam_lib.BuildDefinition' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)" + } + } + + It 'by ID -Raw should return build definition' { + ## Act + $raw = Get-VSTeamBuildDefinition -projectName project -id 101 -Raw + + ## Assert + $raw | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'System.Management.Automation.PSCustomObject' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)" + } + } + + It 'by ID -Json should return build definition' { + ## Act + $b = Get-VSTeamBuildDefinition -projectName project -id 101 -Json + + ## Assert + $b | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'System.String' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)" + } + } + + It 'with revision parameter should return build definitions by revision' { + ## Act + Get-VSTeamBuildDefinition -projectName project -id 101 -revision 1 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)&revision=1" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamBuildLog.Tests.ps1 b/Tests/function/tests/Get-VSTeamBuildLog.Tests.ps1 new file mode 100644 index 000000000..be433513f --- /dev/null +++ b/Tests/function/tests/Get-VSTeamBuildLog.Tests.ps1 @@ -0,0 +1,80 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuildLog' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Get-VSTeamBuildLog' { + BeforeAll { + ## Arrange + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamBuildLog-Id568.json' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } + } + + Context 'Services' { + BeforeAll { + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'with build id should return full log' { + ## Act + Get-VSTeamBuildLog -projectName project -Id 1 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1/logs?api-version=$(_getApiVersion Build)" + } + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1/logs/61?api-version=$(_getApiVersion Build)" + } + } + + It 'with build id and index should return full log' { + ## Act + Get-VSTeamBuildLog -projectName project -Id 1 -Index 2 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1/logs/2?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Server' { + BeforeAll { + ## Arrange + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'with index on TFS local Auth Should return full log' { + ## Act + Get-VSTeamBuildLog -projectName project -Id 1 -Index 2 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1/logs/2?api-version=$(_getApiVersion Build)" + } + } + + It 'on TFS local Auth should return full log' { + ## Act + Get-VSTeamBuildLog -projectName project -Id 1 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1/logs?api-version=$(_getApiVersion Build)" + } + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1/logs/61?api-version=$(_getApiVersion Build)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamBuildTag.Tests.ps1 b/Tests/function/tests/Get-VSTeamBuildTag.Tests.ps1 new file mode 100644 index 000000000..aefe049f7 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamBuildTag.Tests.ps1 @@ -0,0 +1,53 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuildTag' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } + + $tags = Open-SampleFile 'Get-VSTeamBuildTag-Id568.json' -ReturnValue + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamBuildTag-Id568.json' } + } + + Context 'Get-VSTeamBuildTag' { + Context 'Services' { + BeforeAll { + $returndata = Get-VSTeamBuildTag -projectName project -id 2 + } + + It 'should create correct URL.' { + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + } + } + + It 'should return correct data.' { + Compare-Object $tags $returndata | Should -Be $null + } + } + + Context 'Server' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + + $returndata = Get-VSTeamBuildTag -projectName project -id 2 + } + + It 'should create correct URL.' { + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + } + } + + It 'should return correct data.' { + Compare-Object $tags $returndata | Should -Be $null + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamBuildTimeline.Tests.ps1 b/Tests/function/tests/Get-VSTeamBuildTimeline.Tests.ps1 new file mode 100644 index 000000000..9717286db --- /dev/null +++ b/Tests/function/tests/Get-VSTeamBuildTimeline.Tests.ps1 @@ -0,0 +1,99 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuildTimeline' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrnage + [vsteam_lib.Versions]::Build = '1.0-unitTest' + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + } + + Context 'Get-VSTeamBuildTimeline by ID' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'buildTimeline.json' } + } + + It 'should get timeline with multiple build IDs' { + Get-VSTeamBuildTimeline -Id @(1, 2) ` + -TimelineId 00000000-0000-0000-0000-000000000000 ` + -ProjectName "MyProject" + + Should -Invoke Invoke-RestMethod -Scope It -Times 2 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/*" -and + ($Uri -like "*builds/1/*" -or $Uri -like "*builds/2/*") + $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*api-version=$([vsteam_lib.Versions]::Build)*" + } + } + + It 'should get timeline with changeId and PlanId' { + Get-VSTeamBuildTimeline -Id 1 ` + -TimelineId 00000000-0000-0000-0000-000000000000 ` + -ProjectName "MyProject" ` + -ChangeId 4 ` + -PlanId 00000000-0000-0000-0000-000000000000 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/builds/1/*" -and + $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*planId=00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*changeId=4*" -and + $Uri -like "*api-version=$([vsteam_lib.Versions]::Build)*" + } + } + + It 'should get timeline without changeId' { + Get-VSTeamBuildTimeline -Id 1 ` + -TimelineId 00000000-0000-0000-0000-000000000000 ` + -ProjectName "MyProject" ` + -PlanId 00000000-0000-0000-0000-000000000000 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/builds/1/*" -and + $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*planId=00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*api-version=$([vsteam_lib.Versions]::Build)*" + } + } + + It 'should get timeline without planId' { + Get-VSTeamBuildTimeline -Id 1 ` + -TimelineId 00000000-0000-0000-0000-000000000000 ` + -ProjectName "MyProject" ` + -ChangeId 4 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/builds/1/*" -and + $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*changeId=4*" -and + $Uri -like "*api-version=$([vsteam_lib.Versions]::Build)*" + } + } + + It 'should get timeline without planId and changeID' { + Get-VSTeamBuildTimeline -Id 1 ` + -TimelineId 00000000-0000-0000-0000-000000000000 ` + -ProjectName "MyProject" + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/builds/1/*" -and + $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*api-version=$([vsteam_lib.Versions]::Build)*" + } + } + + It 'should get timeline without records and no exception' { + Mock Invoke-RestMethod { Open-SampleFile 'buildTimelineEmptyRecords.json' } + + $null = Get-VSTeamBuildTimeline -Id 1 ` + -TimelineId 00000000-0000-0000-0000-000000000000 ` + -ProjectName "MyProject" ` + -ChangeId 4 ` + -PlanId 00000000-0000-0000-0000-000000000000 + + { Get-VSTeamBuildTimeline -Id 1 ` + -ProjectName "MyProject" } | Should -Not -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamClassificationNode.Tests.ps1 b/Tests/function/tests/Get-VSTeamClassificationNode.Tests.ps1 new file mode 100644 index 000000000..45a0e871a --- /dev/null +++ b/Tests/function/tests/Get-VSTeamClassificationNode.Tests.ps1 @@ -0,0 +1,82 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamClassificationNode' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Get-VSTeamClassificationNode' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'classificationNodeResult.json' } + Mock Invoke-RestMethod { Open-SampleFile 'withoutChildNode.json' } -ParameterFilter { + $Uri -like "*Ids=43,44*" + } + } + + It 'with StructureGroup should return Nodes' { + ## Act + Get-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup "Iterations" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/Iterations*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'with depth should return Nodes' { + ## Act + Get-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup "Iterations" -Depth 10 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/Iterations*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$Depth=10*" + } + } + + It 'by Path should return Nodes' { + ## Act + Get-VSTeamClassificationNode -ProjectName "Public Demo" ` + -StructureGroup "Iterations" ` + -Path "test/test/test" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/Iterations/test/test/test*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'by ids should return Nodes' { + ## Act + Get-VSTeamClassificationNode -ProjectName "Public Demo" -Id @(1, 2, 3, 4) + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*Ids=1,2,3,4*" + } + } + + It 'should handle when there is no child nodes' { + ## Act + Get-VSTeamClassificationNode -ProjectName "Public Demo" -Id @(43, 44) + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*Ids=43,44*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamCloudSubscription.Tests.ps1 b/Tests/function/tests/Get-VSTeamCloudSubscription.Tests.ps1 new file mode 100644 index 000000000..76961276d --- /dev/null +++ b/Tests/function/tests/Get-VSTeamCloudSubscription.Tests.ps1 @@ -0,0 +1,43 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamCloudSubscription' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Get-VSTeamCloudSubscription' { + BeforeAll { + Mock Invoke-RestMethod { return @{value = 'subs' } } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } + } + + Context 'Services' { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'should return all AzureRM Subscriptions' { + Get-VSTeamCloudSubscription + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointproxy/azurermsubscriptions?api-version=$(_getApiVersion DistributedTask)" + } + } + } + + Context 'Server' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'should return all AzureRM Subscriptions' { + Get-VSTeamCloudSubscription + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/serviceendpointproxy/azurermsubscriptions?api-version=$(_getApiVersion DistributedTask)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamDescriptor.Tests.ps1 b/Tests/function/tests/Get-VSTeamDescriptor.Tests.ps1 new file mode 100644 index 000000000..e94085177 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamDescriptor.Tests.ps1 @@ -0,0 +1,56 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamDescriptor" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Get-VSTeamDescriptor' { + Context 'Services' { + BeforeAll { + ## Arrange + Mock _supportsGraph + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod { Open-SampleFile 'descriptor.scope.TestProject.json' } + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } + } + + It 'by StorageKey Should return groups' { + ## Act + Get-VSTeamDescriptor -StorageKey '010d06f0-00d5-472a-bb47-58947c230876' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://vssps.dev.azure.com/test/_apis/graph/descriptors/010d06f0-00d5-472a-bb47-58947c230876?api-version=$(_getApiVersion Graph)" + } + } + } + + Context 'Server' { + BeforeAll { + ## Arrange + # TFS 2017 does not support this feature + Mock _callAPI { throw 'Should not be called' } -Verifiable + + # It is not supported on 2017 + Mock _getApiVersion { return 'TFS2017' } + Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Graph' } + } + + It 'Should throw' { + ## Act / Assert + { Get-VSTeamDescriptor -StorageKey '010d06f0-00d5-472a-bb47-58947c230876' } | Should -Throw + } + + It 'should not call _callAPI' { + Should -Invoke _callAPI -Exactly 0 + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamExtension.Tests.ps1 b/Tests/function/tests/Get-VSTeamExtension.Tests.ps1 new file mode 100644 index 000000000..fd116a124 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamExtension.Tests.ps1 @@ -0,0 +1,65 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamExtension' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ExtensionsManagement' } + } + + Context 'Get-VSTeamExtension' { + BeforeAll { + ## Arrange + $env:Team_TOKEN = '1234' + + Mock _callAPI { Open-SampleFile 'extensionResults.json' } + Mock _callAPI { Open-SampleFile 'singleExtensionResult.json' } -ParameterFilter { $id -eq "test/test" } + } + + AfterAll { + $env:TEAM_TOKEN = $null + } + + It 'Should return extensions' { + ## Act + Get-VSTeamExtension + + ## Assert + Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { + $subDomain -eq 'extmgmt' -and + $area -eq 'extensionmanagement' -and + $resource -eq 'installedextensions' -and + $version -eq $(_getApiVersion ExtensionsManagement) + } + } + + It 'Should return extensions with optional parameters' { + ## Act + Get-VSTeamExtension -IncludeInstallationIssues -IncludeDisabledExtensions -IncludeErrors + + ## Assert + Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { + $subDomain -eq 'extmgmt' -and + $area -eq 'extensionmanagement' -and + $resource -eq 'installedextensions' -and + $version -eq $(_getApiVersion ExtensionsManagement) + } + } + + It 'Should return the extension' { + ## Act + Get-VSTeamExtension -PublisherId test -ExtensionId test + + ## Assert + Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { + $id -eq 'test/test' -and + $subDomain -eq 'extmgmt' -and + $area -eq 'extensionmanagement' -and + $resource -eq 'installedextensionsbyname' -and + $version -eq $(_getApiVersion ExtensionsManagement) + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamFeed.Tests.ps1 b/Tests/function/tests/Get-VSTeamFeed.Tests.ps1 new file mode 100644 index 000000000..9a80fa17e --- /dev/null +++ b/Tests/function/tests/Get-VSTeamFeed.Tests.ps1 @@ -0,0 +1,42 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamFeed' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Get-VSTeamFeed' { + BeforeAll { + ## Arrange + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { + $Service -eq 'Packaging' + } + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamFeed.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamFeed.json' -Index 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)" + } + } + + It 'by id should return one feed' { + ## Act + Get-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' + + ## 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)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamGitCommit.Tests.ps1 b/Tests/function/tests/Get-VSTeamGitCommit.Tests.ps1 new file mode 100644 index 000000000..3ba8f5f70 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamGitCommit.Tests.ps1 @@ -0,0 +1,89 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamGitCommit" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } + } + + Context 'Get-VSTeamGitCommit' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'gitCommitResults.json' } + } + + It 'should return all commits for the repo' { + ## Act + Get-VSTeamGitCommit -ProjectName Test -RepositoryId 06E176BE-D3D2-41C2-AB34-5F4D79AEC86B + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" + } + } + + It 'should return all commits for the repo with many Parameters' { + ## Act + Get-VSTeamGitCommit -ProjectName Test ` + -RepositoryId '06E176BE-D3D2-41C2-AB34-5F4D79AEC86B' ` + -FromDate '2020-01-01' ` + -ToDate '2020-03-01' ` + -ItemVersionVersionType 'commit' ` + -ItemVersionVersion 'abcdef1234567890abcdef1234567890' ` + -ItemVersionVersionOptions 'previousChange' ` + -CompareVersionVersionType 'commit' ` + -CompareVersionVersion 'abcdef1234567890abcdef1234567890' ` + -CompareVersionVersionOptions 'previousChange' ` + -FromCommitId 'abcdef' ` + -ToCommitId 'fedcba' ` + -Author "Test" ` + -Top 100 ` + -Skip 50 ` + -User "Test" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" -and + $Uri -like "*searchCriteria.fromDate=2020-01-01T00:00:00Z*" -and + $Uri -like "*searchCriteria.toDate=2020-03-01T00:00:00Z*" -and + $Uri -like "*searchCriteria.itemVersion.versionType=commit*" -and + $Uri -like "*searchCriteria.itemVersion.version=abcdef1234567890abcdef1234567890*" -and + $Uri -like "*searchCriteria.itemVersion.versionOptions=previousChange*" -and + $Uri -like "*searchCriteria.compareVersion.versionType=commit*" -and + $Uri -like "*searchCriteria.compareVersion.version=abcdef1234567890abcdef1234567890*" -and + $Uri -like "*searchCriteria.compareVersion.versionOptions=previousChange*" -and + $Uri -like "*searchCriteria.fromCommitId=abcdef*" -and + $Uri -like "*searchCriteria.toCommitId=fedcba*" -and + $Uri -like "*searchCriteria.author=Test*" -and + $Uri -like "*searchCriteria.user=Test*" -and + $Uri -like "*searchCriteria.`$top=100*" -and + $Uri -like "*searchCriteria.`$skip=50*" + } + } + + It 'should return all commits for the repo with ItemPath parameters' { + ## Act + Get-VSTeamGitCommit -ProjectName Test ` + -RepositoryId '06E176BE-D3D2-41C2-AB34-5F4D79AEC86B' ` + -ItemPath 'test' ` + -ExcludeDeletes ` + -HistoryMode 'fullHistory' ` + -Top 100 -Skip 50 ` + -User "Test" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" -and + $Uri -like "*searchCriteria.itemPath=test*" -and + $Uri -like "*searchCriteria.excludeDeletes=true*" -and + $Uri -like "*searchCriteria.historyMode=fullHistory*" -and + $Uri -like "*searchCriteria.`$top=100*" -and + $Uri -like "*searchCriteria.`$skip=50*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamGitRef.Tests.ps1 b/Tests/function/tests/Get-VSTeamGitRef.Tests.ps1 new file mode 100644 index 000000000..db7f9183b --- /dev/null +++ b/Tests/function/tests/Get-VSTeamGitRef.Tests.ps1 @@ -0,0 +1,86 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamGitRef" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamGitRef.json' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } + Mock Invoke-RestMethod { throw [System.Net.WebException] "Test Exception." } -ParameterFilter { + $Uri -like "*00000000-0000-0000-0000-000000000001*" + } + } + + Context 'Get-VSTeamGitRef' { + It 'Should return a single ref by id' { + ## Act + Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/Test/_apis/git/repositories/00000000-0000-0000-0000-000000000000/refs?api-version=$(_getApiVersion Git)" + } + } + + It 'with Filter should return a single ref with filter' { + ## Act + Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -Filter "refs/heads" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*filter=refs*" + } + } + + It 'with FilterContains should return a single ref' { + ## Act + Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -FilterContains "test" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*filterContains=test" + } + } + + It 'Should return a single ref' { + ## Act + Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -Top 100 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*`$top=100" + } + } + + It 'with ContinuationToken should return a single ref' { + ## Act + Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -ContinuationToken "myToken" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*continuationToken=myToken" + } + } + + It 'with Filter, FilterContains, Top should return a single ref' { + ## Act + Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -Filter "/refs/heads" -FilterContains "test" -Top 500 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "*filter=/refs/heads*" -and + $Uri -like "*`$top=500*" -and + $Uri -like "*filterContains=test*" + } + } + + It 'by id throws should return a single repo by id' { + ## Act / Assert + { Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000001 } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamGitRepository.Tests.ps1 b/Tests/function/tests/Get-VSTeamGitRepository.Tests.ps1 new file mode 100644 index 000000000..0b71e0490 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamGitRepository.Tests.ps1 @@ -0,0 +1,115 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamGitRepository" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Clear-VSTeamDefaultProject.ps1" + + ## Arrange + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } + + ## If you don't call this and there is a default project in scope + ## these tests will fail. The API can be called with or without + ## a project and these tests are written to test without one. + Clear-VSTeamDefaultProject + + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamGitRepository.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamGitRepository-ProjectNamePeopleTracker-NamePeopleTracker.json' } -ParameterFilter { + $Uri -like "*00000000-0000-0000-0000-000000000000*" -or + $Uri -like "*testRepo*" + } + Mock Invoke-RestMethod { throw [System.Net.WebException] } -ParameterFilter { + $Uri -like "*00000000-0000-0000-0000-000000000101*" -or + $Uri -like "*boom*" + } + } + + Context 'Get-VSTeamGitRepository' { + Context 'Services' { + BeforeAll { + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'no parameters should return all repos for all projects' { + ## Act + Get-VSTeamGitRepository + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/git/repositories?api-version=$(_getApiVersion Git)" + } + } + + It 'by Id should return a single repo by id' { + ## Act + Get-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000000 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)" + } + } + + It 'by name should return a single repo by name' { + ## Act + Get-VSTeamGitRepository -Name 'testRepo' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/git/repositories/testRepo?api-version=$(_getApiVersion Git)" + } + } + + It 'by id should throw' { + ## Act / Assert + { Get-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000101 } | Should -Throw + } + + It 'by name should throw' { + ## Act / Assert + { Get-VSTeamGitRepository -Name 'boom' } | Should -Throw + } + } + + Context 'Server' { + BeforeAll { + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + + Mock _useWindowsAuthenticationOnPremise { return $true } + } + + It 'no parameters Should return Git repo' { + ## Act + Get-VSTeamGitRepository + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/git/repositories?api-version=$(_getApiVersion Git)" + } + } + + It 'by Id should return a single repo by id' { + ## Act + Get-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000000 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)" + } + } + + It 'by name should return a single repo by name' { + ## Act + Get-VSTeamGitRepository -Name 'testRepo' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/git/repositories/testRepo?api-version=$(_getApiVersion Git)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamGitStat.Tests.ps1 b/Tests/function/tests/Get-VSTeamGitStat.Tests.ps1 new file mode 100644 index 000000000..ca87de761 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamGitStat.Tests.ps1 @@ -0,0 +1,77 @@ +Set-StrictMode -Version Latest + +Describe "TeamGitStat" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'gitStatSingleResult.json' } + } + + Context 'Get-VSTeamGitStat' { + It 'should return multiple results' { + ## Act + Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*/Test/*" -and + $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" + } + } + + It 'by branch name should return multiple results' { + ## Act + Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName develop + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*/Test/*" -and + $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and + $Uri -like "*name=develop*" + } + } + + It 'by tag should return multiple results' { + ## Act + Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName "develop" -VersionType "tag" -Version "test" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*/Test/*" -and + $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and + $Uri -like "*baseVersionDescriptor.versionType=tag*" -and + $Uri -like "*baseVersionDescriptor.version=test*" + } + } + + It 'by tag with options should return multiple results' { + ## Act + Get-VSTeamGitStat -ProjectName Test ` + -RepositoryId 00000000-0000-0000-0000-000000000000 ` + -BranchName "develop" ` + -VersionType "tag" ` + -Version "test" ` + -VersionOptions previousChange + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*/Test/*" -and + $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and + $Uri -like "*baseVersionDescriptor.versionType=tag*" -and + $Uri -like "*baseVersionDescriptor.version=test*" -and + $Uri -like "*baseVersionDescriptor.versionOptions=previousChange*" + } + } + + It 'by commit should throw because of invalid parameters' { + ## Act / Assert + { Get-VSTeamGitStat -ProjectName Test ` + -RepositoryId 00000000-0000-0000-0000-000000000000 ` + -VersionType commit ` + -Version '' } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamGroup.Tests.ps1 b/Tests/function/tests/Get-VSTeamGroup.Tests.ps1 new file mode 100644 index 000000000..ccb3e682a --- /dev/null +++ b/Tests/function/tests/Get-VSTeamGroup.Tests.ps1 @@ -0,0 +1,122 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamGroup" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProject.ps1" + . "$baseFolder/Source/Public/Get-VSTeamDescriptor.ps1" + } + + Context 'Get-VSTeamGroup' { + Context 'Services' { + BeforeAll { + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock _supportsGraph + Mock Invoke-RestMethod { Open-SampleFile 'groups.json' } + Mock Get-VSTeamProject { Open-SampleFile 'projectResult.json' } -ParameterFilter { + $Name -like "Test Project Public" + } + } + + It 'should return groups by project' { + Mock Get-VSTeamDescriptor { return [vsteam_lib.Descriptor]::new($(Open-SampleFile 'descriptor.scope.TestProject.json')) } + + Get-VSTeamGroup -ProjectName "Test Project Public" + + # With PowerShell core the order of the query string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + # The general string should look like this: + # "https://vssps.dev.azure.com/test/_apis/graph/groups?api-version=$(_getApiVersion Graph)&scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2" + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" -and + $Uri -like "*scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2*" + } + } + + It 'should return groups by scopeDescriptor' { + Get-VSTeamGroup -ScopeDescriptor scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2 + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" -and + $Uri -like "*scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2*" + } + } + + It 'should return groups by subjectTypes' { + Get-VSTeamGroup -SubjectTypes vssgp, aadgp + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" -and + $Uri -like "*subjectTypes=vssgp,aadgp*" + } + } + + It 'should return groups by subjectTypes and scopeDescriptor' { + Get-VSTeamGroup -ScopeDescriptor scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2 -SubjectTypes vssgp, aadgp + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" -and + $Uri -like "*subjectTypes=vssgp,aadgp*" -and + $Uri -like "*scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2*" + } + } + + It 'should return the group by descriptor' { + Mock Invoke-RestMethod { Open-SampleFile 'groupsSingle.json' } + + Get-VSTeamGroup -GroupDescriptor 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups/vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" + } + } + + It 'Should throw' { + Mock Invoke-RestMethod { throw 'Error' } + { Get-VSTeamGroup -ProjectName Demo } | Should -Throw + } + + It 'Should throw' { + Mock Invoke-RestMethod { throw 'Error' } + { Get-VSTeamGroup -GroupDescriptor } | Should -Throw + } + } + } + + Context 'Server' { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + Mock _callAPI + + Mock _getApiVersion { return 'TFS2017' } + Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Graph' } + + # The Graph API is not supported on TFS + Mock _supportsGraph { throw 'This account does not support the graph API.' } + } + + It 'Should throw' { + { Get-VSTeamGroup } | Should -Throw + } + + It 'should not call _callAPI' { + Should -Invoke _callAPI -Exactly -Times 0 -Scope Context + } + } +} + diff --git a/Tests/function/tests/Get-VSTeamInfo.Tests.ps1 b/Tests/function/tests/Get-VSTeamInfo.Tests.ps1 new file mode 100644 index 000000000..187c3f1e2 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamInfo.Tests.ps1 @@ -0,0 +1,25 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamInfo' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Get-VSTeamInfo' { + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'should return account and default project' { + [vsteam_lib.Versions]::Account = "mydemos" + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'TestProject' + + ## Act + $info = Get-VSTeamInfo + + ## Assert + $info.Account | Should -Be "mydemos" + $info.DefaultProject | Should -Be "TestProject" + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamIteration.Tests.ps1 b/Tests/function/tests/Get-VSTeamIteration.Tests.ps1 new file mode 100644 index 000000000..39a34d783 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamIteration.Tests.ps1 @@ -0,0 +1,49 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamIteration' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamClassificationNode" + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { + $Service -eq 'Core' + } + } + + Context 'Get-VSTeamIteration' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'classificationNodeResult.json' } + Mock Invoke-RestMethod { Open-SampleFile 'withoutChildNode.json' } -ParameterFilter { + $Uri -like "*Ids=43,44*" + } + } + + It 'should return iterations by path and depth' { + ## Act + Get-VSTeamIteration -ProjectName "Public Demo" -Depth 5 -Path "test/test/test" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/Iterations/test/test/test*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$Depth=5*" + } + } + + It 'should return iterations by ids and depth' { + ## Act + Get-VSTeamIteration -ProjectName "Public Demo" -Id @(1, 2, 3, 4) -Depth 5 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*Ids=1,2,3,4*" -and + $Uri -like "*`$Depth=5*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamJobRequest.Tests.ps1 b/Tests/function/tests/Get-VSTeamJobRequest.Tests.ps1 new file mode 100644 index 000000000..bf29f36d7 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamJobRequest.Tests.ps1 @@ -0,0 +1,71 @@ +Set-StrictMode -Version Latest + +Describe "Get-VSTeamJobRequest" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { + $Service -eq 'DistributedTaskReleased' + } + } + + Context "Server" { + BeforeAll { + ## Arrnage + Mock Invoke-RestMethod { Open-SampleFile 'jobrequests2017.json' } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It "should return all jobs" { + ## Act + Get-VSTeamJobRequest -PoolId 5 -AgentID 4 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/pools/5/jobrequests*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTaskReleased)*" -and + $Uri -like "*agentid=4*" + } + } + + It "should return 2 jobs" { + Get-VSTeamJobRequest -PoolId 5 -AgentID 4 -completedRequestCount 2 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/pools/5/jobrequests*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTaskReleased)*" -and + $Uri -like "*agentid=4*" -and + $Uri -like "*completedRequestCount=2*" + } + } + } + + Context "Services" { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'jobrequestsAzD.json' } + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It "should return all jobs" { + Get-VSTeamJobRequest -PoolId 5 -AgentID 4 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/5/jobrequests*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTaskReleased)*" -and + $Uri -like "*agentid=4*" + } + } + + It "should return 2 jobs" { + Get-VSTeamJobRequest -PoolId 5 -AgentID 4 -completedRequestCount 2 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/5/jobrequests*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTaskReleased)*" -and + $Uri -like "*agentid=4*" -and + $Uri -like "*completedRequestCount=2*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamMember.Tests.ps1 b/Tests/function/tests/Get-VSTeamMember.Tests.ps1 new file mode 100644 index 000000000..8178768d9 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamMember.Tests.ps1 @@ -0,0 +1,119 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamMember" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Get-VSTeamMember for specific project and team' { + BeforeAll { + ## Arrange + Mock Invoke-RestMethod { return @{value = 'teams' } } + } + + It 'should return teammembers' { + ## Act + Get-VSTeamMember -ProjectName TestProject -TeamId TestTeam + + ## Assert + # Make sure it was called with the correct URI + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members?api-version=$(_getApiVersion Core)" + } + } + } + + Context 'Get-VSTeamMember for specific project and team, with top' { + BeforeAll { + ## Arrange + Mock Invoke-RestMethod { return @{value = 'teams' } } + } + + It 'should return teammembers' { + ## Act + Get-VSTeamMember -ProjectName TestProject -TeamId TestTeam -Top 10 + + ## Assert + # Make sure it was called with the correct URI + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$top=10*" + } + } + } + + Context 'Get-VSTeamMember for specific project and team, with skip' { + BeforeAll { + ## Arrange + Mock Invoke-RestMethod { return @{value = 'teams' } } + } + + It 'should return teammembers' { + ## Act + Get-VSTeamMember -ProjectName TestProject -TeamId TestTeam -Skip 5 + + ## Assert + # Make sure it was called with the correct URI + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$skip=5*" + } + } + } + + Context 'Get-VSTeamMember for specific project and team, with top and skip' { + BeforeAll { + ## Arrange + Mock Invoke-RestMethod { return @{value = 'teams' } } + } + + It 'should return teammembers' { + ## Act + Get-VSTeamMember -ProjectName TestProject -TeamId TestTeam -Top 10 -Skip 5 + + ## Assert + # Make sure it was called with the correct URI + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$top=10*" -and + $Uri -like "*`$skip=5*" + } + } + } + + Context 'Get-VSTeamMember for specific team, fed through pipeline' { + BeforeAll { + ## Arrange + Mock Invoke-RestMethod { return @{ value = 'teammembers' } } + } + + It 'should return teammembers' { + ## Act + New-Object -TypeName PSObject -Prop @{ projectname = "TestProject"; name = "TestTeam" } | Get-VSTeamMember + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members?api-version=$(_getApiVersion Core)" + } + } + } + + # Must be last because it sets [vsteam_lib.Versions]::Account to $null + Context '_buildURL handles exception' { + BeforeAll { + # Arrange + [vsteam_lib.Versions]::Account = $null + } + + It 'should return approvals' { + # Act / Assert + { _buildURL -ProjectName project -TeamId 1 } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamMembership.Tests.ps1 b/Tests/function/tests/Get-VSTeamMembership.Tests.ps1 new file mode 100644 index 000000000..7605f05b1 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamMembership.Tests.ps1 @@ -0,0 +1,46 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamMembership' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Private/callMembershipAPI.ps1" + + ## Arrange + # You have to set the version or the api-version will not be added when [vsteam_lib.Versions]::Graph = '' + Mock _supportsGraph + Mock Invoke-RestMethod + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + $UserDescriptor = 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' + $GroupDescriptor = 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' + } + + Context 'Get-VSTeamMembership' { + It "for member should get a container's members" { + ## Act + $null = Get-VSTeamMembership -MemberDescriptor $UserDescriptor + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$MemberDescriptor*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" + } + } + + It "for Group should get a container's members" { + ## Act + $null = Get-VSTeamMembership -ContainerDescriptor $GroupDescriptor + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$GroupDescriptor*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" -and + $Uri -like "*direction=Down*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamOption.Tests.ps1 b/Tests/function/tests/Get-VSTeamOption.Tests.ps1 new file mode 100644 index 000000000..8b3d3d3ec --- /dev/null +++ b/Tests/function/tests/Get-VSTeamOption.Tests.ps1 @@ -0,0 +1,38 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamOption' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Get-VSTeamOption' { + BeforeAll { + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamOption-Area_git-Resource_annotatedTags.json' } + } + + It 'Should return all options' { + ## Act + Get-VSTeamOption | Should -Not -Be $null + + ## Assert + Should -Invoke Invoke-RestMethod -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis" + } + } + + It 'Should return release options' { + ## Act + Get-VSTeamOption -subDomain vsrm | Should -Not -Be $null + + ## Assert + Should -Invoke Invoke-RestMethod -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/_apis" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamPermissionInheritance.Tests.ps1 b/Tests/function/tests/Get-VSTeamPermissionInheritance.Tests.ps1 new file mode 100644 index 000000000..b15277eeb --- /dev/null +++ b/Tests/function/tests/Get-VSTeamPermissionInheritance.Tests.ps1 @@ -0,0 +1,75 @@ +Set-StrictMode -Version Latest + +# This is an undocumented API +Describe 'VSTeamPermissionInheritance' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProject.ps1" + . "$baseFolder/Source/Public/Get-VSTeamBuildDefinition.ps1" + . "$baseFolder/Source/Public/Get-VSTeamReleaseDefinition.ps1" + . "$baseFolder/Source/Public/Get-VSTeamGitRepository.ps1" + . "$baseFolder/Source/Public/Get-VSTeamAccessControlList.ps1" + } + + Context 'Get-VSTeamPermissionInheritance' { + BeforeAll { + ## Arrange + Mock _supportsHierarchyQuery + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { + $Service -eq 'HierarchyQuery' + } + + Mock Get-VSTeamProject { Open-SampleFile 'projectResult.json' } -ParameterFilter { + $Name -like 'project' + } + Mock Get-VSTeamGitRepository { Open-SampleFile 'singleGitRepo.json' } + Mock Get-VSTeamBuildDefinition { Open-SampleFile 'buildDefAzD.json' -ReturnValue } + Mock Get-VSTeamReleaseDefinition { Open-SampleFile 'releaseDefAzD.json' -ReturnValue } + Mock Get-VSTeamAccessControlList { Open-SampleFile 'repoAccesscontrollists.json' -ReturnValue } + Mock Invoke-RestMethod { Open-SampleFile 'releaseDefHierarchyQuery.json' } -ParameterFilter { + $Body -like '*c788c23e-1b46-4162-8f5e-d7585343b5de*' + } + Mock Invoke-RestMethod { Open-SampleFile 'buildDefHierarchyQuery.json' } -ParameterFilter { + $Body -like '*010d06f0-00d5-472a-bb47-58947c230876/1432*' + } + } + + It 'should return true buildDef' { + ## Act + $actual = Get-VSTeamPermissionInheritance -projectName Project -Name dynamTest-Docker-CI -resourceType BuildDefinition + + ## Assert + $actual | Should -Be $true + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '*010d06f0-00d5-472a-bb47-58947c230876/1432*' -and + $Body -like '*33344d9c-fc72-4d6f-aba5-fa317101a7e9*' -and + $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/Project/010d06f0-00d5-472a-bb47-58947c230876*" -and + $Uri -like "*api-version=$(_getApiVersion HierarchyQuery)*" + } + } + + It 'should return true releaseDef' { + ## Act + Get-VSTeamPermissionInheritance -projectName project -Name PTracker-CD -resourceType ReleaseDefinition | Should -Be $true + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '*c788c23e-1b46-4162-8f5e-d7585343b5de*' -and + $Body -like '*010d06f0-00d5-472a-bb47-58947c230876//2*' -and + $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/project/010d06f0-00d5-472a-bb47-58947c230876*" -and + $Uri -like "*api-version=$(_getApiVersion HierarchyQuery)*" + } + } + + It 'should return true repository' { + ## Act + Get-VSTeamPermissionInheritance -projectName project -Name project -resourceType Repository | Should -Be $true + + ## Assert + Should -Invoke Get-VSTeamAccessControlList -Exactly -Scope It -Times 1 + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamPolicy.Tests.ps1 b/Tests/function/tests/Get-VSTeamPolicy.Tests.ps1 new file mode 100644 index 000000000..8b26bc9ad --- /dev/null +++ b/Tests/function/tests/Get-VSTeamPolicy.Tests.ps1 @@ -0,0 +1,46 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPolicy' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamPolicy.json' } + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } + } + + Context 'Get-VSTeamPolicy' { + It 'by project should return policies' { + ## Act + Get-VSTeamPolicy -ProjectName Demo + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations?api-version=$(_getApiVersion Git)" + } + } + + It 'by project and id should return the policy' { + ## Act + Get-VSTeamPolicy -ProjectName Demo -Id 4 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations/4?api-version=$(_getApiVersion Git)" + } + } + + It 'by project should throw' { + ## Act / Assert + { Get-VSTeamPolicy -ProjectName boom } | Should -Throw + } + + It 'by project and id throws should throw' { + ## Act / Assert + { Get-VSTeamPolicy -ProjectName boom -Id 4 } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamPolicyType.Tests.ps1 b/Tests/function/tests/Get-VSTeamPolicyType.Tests.ps1 new file mode 100644 index 000000000..510a247da --- /dev/null +++ b/Tests/function/tests/Get-VSTeamPolicyType.Tests.ps1 @@ -0,0 +1,50 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamPolicyType" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrnage + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Policy' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamPolicyType.json' } + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamPolicyType.json' -Index 0 } -ParameterFilter { + $Uri -like "*90a51335-0c53-4a5f-b6ce-d9aff3ea60e0*" + } + } + + Context 'Get-VSTeamPolicyType' { + It 'by project should return policies' { + ## Act + Get-VSTeamPolicyType -ProjectName VSTeamPolicyType + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/VSTeamPolicyType/_apis/policy/types?api-version=$(_getApiVersion Policy)" + } + } + + It 'by project throws should throw' { + ## Act / Assert + { Get-VSTeamPolicyType -ProjectName boom } | Should -Throw + } + + It 'Should return policies' { + ## Act + Get-VSTeamPolicyType -ProjectName VSTeamPolicyType -id 90a51335-0c53-4a5f-b6ce-d9aff3ea60e0 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/VSTeamPolicyType/_apis/policy/types/90a51335-0c53-4a5f-b6ce-d9aff3ea60e0?api-version=$(_getApiVersion Policy)" + } + } + + It 'Should return policies' { + ## Act / Assert + { Get-VSTeamPolicyType -ProjectName boom -id 90a51335-0c53-4a5f-b6ce-d9aff3ea60e1 } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamPool.Tests.ps1 b/Tests/function/tests/Get-VSTeamPool.Tests.ps1 new file mode 100644 index 000000000..86ee2cb40 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamPool.Tests.ps1 @@ -0,0 +1,40 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPool' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTaskReleased' } + } + + Context 'Get-VSTeamPool with no parameters' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamPool.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamPool.json' -Index 1 } -ParameterFilter { + $Uri -like "*101*" + } + } + + it 'with no parameters should return all the pools' { + ## Act + Get-VSTeamPool + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools?api-version=$(_getApiVersion DistributedTaskReleased)" + } + } + + it 'with id parameter should return all the pools' { + ## Act + Get-VSTeamPool -id 101 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/101?api-version=$(_getApiVersion DistributedTaskReleased)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamProcess.Tests.ps1 b/Tests/function/tests/Get-VSTeamProcess.Tests.ps1 new file mode 100644 index 000000000..06d0f56f3 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamProcess.Tests.ps1 @@ -0,0 +1,71 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProcess' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Processes' } + Mock Write-Warning + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamProcess.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamProcess.json' -Index 1 } -ParameterFilter { + $Uri -like "*123-5464-dee43*" + } + } + + Context 'Get-VSTeamProcess' { + It 'should use process area for old APIs' { + Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Processes' } + + ## Act + $p = Get-VSTeamProcess + + ## Assert + $p.count | should -Be 5 + $p[0].gettype().name | should -Be 'Process' # 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*" + } + } + + It 'with no parameters using BearerToken should return process' { + ## Act + $p = Get-VSTeamProcess + + ## Assert + $p.count | should -Be 5 + $p[0].gettype().name | should -Be 'Process' # 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/work/processes*" -and + $Uri -like "*api-version=$(_getApiVersion Processes)*" + } + } + + It 'by Name should return Process by Name' { + [vsteam_lib.ProcessTemplateCache]::Invalidate() + $p = Get-VSTeamProcess -Name Agile + + $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 Processes)*" + } + } + + It 'by Id should return Process by Id' { + Get-VSTeamProcess -Id '123-5464-dee43' + + # 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/work/processes/123-5464-dee43*" -and + $Uri -like "*api-version=$(_getApiVersion Processes)*" + } + } + } +} \ No newline at end of file diff --git a/unit/test/Get-VSTeamProfile.Tests.ps1 b/Tests/function/tests/Get-VSTeamProfile.Tests.ps1 similarity index 75% rename from unit/test/Get-VSTeamProfile.Tests.ps1 rename to Tests/function/tests/Get-VSTeamProfile.Tests.ps1 index 34515db20..ad494e9b9 100644 --- a/unit/test/Get-VSTeamProfile.Tests.ps1 +++ b/Tests/function/tests/Get-VSTeamProfile.Tests.ps1 @@ -2,37 +2,11 @@ Set-StrictMode -Version Latest Describe 'VSTeamProfile' { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $contents = @" - [ - { - "Name": "http://localhost:8080/tfs/defaultcollection", - "URL": "http://localhost:8080/tfs/defaultcollection", - "Pat": "", - "Type": "OnPremise", - "Version": "TFS2017" - }, - { - "Name": "http://192.168.1.3:8080/tfs/defaultcollection", - "URL": "http://192.168.1.3:8080/tfs/defaultcollection", - "Pat": "OnE2cXpseHk0YXp3dHpz", - "Type": "Pat", - "Version": "TFS2017" - }, - { - "Name": "test", - "URL": "https://dev.azure.com/test", - "Pat": "OndrejR0ZHpwbDM3bXUycGt5c3hm", - "Type": "Pat", - "Version": "VSTS" - } - ] -"@ + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + # We have to do this here because you can't mock Get-Content then + # try and call it to load a file. + $contents = Get-Content "$sampleFiles/Get-VSTeamProfile.json" -Raw } Context 'Get-VSTeamProfile' { diff --git a/Tests/function/tests/Get-VSTeamProject.Tests.ps1 b/Tests/function/tests/Get-VSTeamProject.Tests.ps1 new file mode 100644 index 000000000..1f9c04584 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamProject.Tests.ps1 @@ -0,0 +1,92 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProject' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Get-VSTeamProject' { + BeforeAll { + $env:TEAM_TOKEN = '1234' + + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamProject.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamProject-NamePeopleTracker.json' } -ParameterFilter { + $Uri -like "*PeopleTracker*" + } + } + + AfterAll { + $env:TEAM_TOKEN = $null + } + + It 'with no parameters using BearerToken should return projects' { + Get-VSTeamProject + + # 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/projects*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$top=100*" -and + $Uri -like "*stateFilter=WellFormed*" + } + } + + It 'with top 10 should return top 10 projects' { + Get-VSTeamProject -top 10 + + # 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/projects*" -and + $Uri -like "*`$top=10*" -and + $Uri -like "*stateFilter=WellFormed*" + } + } + + It 'with skip 1 should skip first project' { + Get-VSTeamProject -skip 1 + + # 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/projects*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$skip=1*" -and + $Uri -like "*`$top=100*" -and + $Uri -like "*stateFilter=WellFormed*" + } + } + + It 'with stateFilter All should return All projects' { + Get-VSTeamProject -stateFilter 'All' + + # 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/projects*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*`$top=100*" -and + $Uri -like "*stateFilter=All*" + } + } + + It 'with no Capabilities by name should return the project' { + Get-VSTeamProject -Name PeopleTracker + + # Make sure it was called with the correct URI + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/PeopleTracker?api-version=$(_getApiVersion Core)" + } + } + + It 'with Capabilities by name should return the project with capabilities' { + Get-VSTeamProject -projectId PeopleTracker -includeCapabilities + + # 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/projects/PeopleTracker*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*includeCapabilities=True*" + } + } + } +} \ No newline at end of file diff --git a/unit/test/Get-VSTeamPullRequest.Tests.ps1 b/Tests/function/tests/Get-VSTeamPullRequest.Tests.ps1 similarity index 82% rename from unit/test/Get-VSTeamPullRequest.Tests.ps1 rename to Tests/function/tests/Get-VSTeamPullRequest.Tests.ps1 index bd3bafbaa..44eb5f4de 100644 --- a/unit/test/Get-VSTeamPullRequest.Tests.ps1 +++ b/Tests/function/tests/Get-VSTeamPullRequest.Tests.ps1 @@ -2,53 +2,27 @@ Set-StrictMode -Version Latest Describe 'VSTeamPullRequest' { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath # You have to manually load the type file so the property reviewStatus # can be tested. - Update-TypeData -AppendPath "$PSScriptRoot/../../Source/types/Team.PullRequest.ps1xml" -ErrorAction Ignore - - Mock _getProjects { return $null } - Mock _hasProjectCacheExpired { return $true } + Update-TypeData -AppendPath "$baseFolder/Source/types/vsteam_lib.PullRequest.ps1xml" -ErrorAction Ignore Mock _getInstance { return 'https://dev.azure.com/test' } Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } - $singleResult = @{ - pullRequestId = 1 - repositoryName = "testreponame" - repository = @{ - project = @{ - name = "testproject" - } - } - reviewers = @{ - vote = 0 - } - } - - $collection = @{ - value = @($singleResult) - } + $singleResult = Open-SampleFile 'Get-VSTeamPullRequest-Id_17.json' } Context 'Get-VSTeamPullRequest' { BeforeAll { - Mock Invoke-RestMethod { return $collection } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamPullRequest.json' } Mock Invoke-RestMethod { $result = $singleResult - $result.reviewers.vote = 0 + $result.reviewers[0].vote = 10 + $result.reviewers[1].vote = 10 + $result.reviewers[2].vote = -10 + $result.reviewers[3].vote = 0 return $result } -ParameterFilter { $Uri -like "*101*" @@ -56,7 +30,10 @@ Describe 'VSTeamPullRequest' { Mock Invoke-RestMethod { $result = $singleResult - $result.reviewers.vote = 10 + $result.reviewers[0].vote = 10 + $result.reviewers[1].vote = 10 + $result.reviewers[2].vote = 10 + $result.reviewers[3].vote = 10 return $result } -ParameterFilter { $Uri -like "*110*" @@ -64,7 +41,10 @@ Describe 'VSTeamPullRequest' { Mock Invoke-RestMethod { $result = $singleResult - $result.reviewers.vote = -10 + $result.reviewers[0].vote = 10 + $result.reviewers[1].vote = 10 + $result.reviewers[2].vote = -10 + $result.reviewers[3].vote = 10 return $result } -ParameterFilter { $Uri -like "*100*" @@ -206,6 +186,7 @@ Describe 'VSTeamPullRequest' { It 'with RepositoryId and IncludeCommits' { Get-VSTeamPullRequest -Id 101 -RepositoryId "93BBA613-2729-4158-9217-751E952AB4AF" -IncludeCommits + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Uri -like "*test/_apis/git/repositories*" -and $Uri -like "*includeCommits=True" -and @@ -215,4 +196,3 @@ Describe 'VSTeamPullRequest' { } } } - diff --git a/Tests/function/tests/Get-VSTeamQuery.Tests.ps1 b/Tests/function/tests/Get-VSTeamQuery.Tests.ps1 new file mode 100644 index 000000000..45a623e60 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamQuery.Tests.ps1 @@ -0,0 +1,47 @@ +Set-StrictMode -Version Latest + +Describe "VSTeam" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context "Get-VSTeamQuery" { + BeforeAll { + ## Arrange + Mock _callAPI { Open-SampleFile 'Get-VSTeamQuery.json' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + It 'with project name only should return queries' { + ## Act + Get-VSTeamQuery -ProjectName Test + + ## Assert + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $ProjectName -eq 'Test' -and + $Area -eq 'wit' -and + $Resource -eq 'queries' -and + $QueryString['$depth'] -eq "1" -and + $QueryString['$expand'] -eq "none" -and + $QueryString['$includeDeleted'] -eq $false -and + $Version -eq '1.0-unitTests' + } + } + + It 'with project name and options should create a team' { + ## Act + Get-VSTeamQuery -ProjectName Test -Depth 2 -IncludeDeleted -Expand all + + ## Assert + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $ProjectName -eq 'Test' -and + $Area -eq 'wit' -and + $Resource -eq 'queries' -and + $QueryString['$depth'] -eq "2" -and + $QueryString['$expand'] -eq "all" -and + $QueryString['$includeDeleted'] -eq $true -and + $Version -eq '1.0-unitTests' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamQueue.Tests.ps1 b/Tests/function/tests/Get-VSTeamQueue.Tests.ps1 new file mode 100644 index 000000000..22adf9395 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamQueue.Tests.ps1 @@ -0,0 +1,76 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamQueue' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamQueue.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamQueue.json' -Index 0 } -ParameterFilter { $Uri -like "*101*" } + } + + Context 'Get-VSTeamQueue' { + It 'should return requested queue' { + ## Act + $queue = Get-VSTeamQueue -projectName project -queueId 101 + + ## Assert + $queue.Name | Should -Be 'Default' -Because 'Name should be set' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/queues/101?api-version=$(_getApiVersion DistributedTask)" + } + } + + it 'should return all the queues with actionFilter & queueName parameter' { + ## Act + Get-VSTeamQueue -projectName project -actionFilter 'None' -queueName 'Hosted' + + # With PowerShell core the order of the query string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/project/_apis/distributedtask/queues*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and + $Uri -like "*actionFilter=None*" -and + $Uri -like "*queueName=Hosted*" + } + } + + it 'should return all the queues with no parameters' { + ## Act + $queues = Get-VSTeamQueue -ProjectName project + + ## Assert + $queues.Count | Should -Be 11 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/queues?api-version=$(_getApiVersion DistributedTask)" + } + } + + it 'should return all the queues with queueName parameter' { + ## Act + Get-VSTeamQueue -projectName project -queueName 'Hosted' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/queues?api-version=$(_getApiVersion DistributedTask)&queueName=Hosted" + } + } + + it 'should return all the queues with actionFilter parameter' { + ## Act + Get-VSTeamQueue -projectName project -actionFilter 'None' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/queues?api-version=$(_getApiVersion DistributedTask)&actionFilter=None" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamRelease.Tests.ps1 b/Tests/function/tests/Get-VSTeamRelease.Tests.ps1 new file mode 100644 index 000000000..c025f6b5d --- /dev/null +++ b/Tests/function/tests/Get-VSTeamRelease.Tests.ps1 @@ -0,0 +1,83 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamRelease' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamRelease.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamRelease-id178-expandEnvironments.json' } -ParameterFilter { + $Uri -like "*178*" + } + } + + Context 'Get-VSTeamRelease' { + It 'by Id -Raw should return release as Raw' { + ## Act + $raw = Get-VSTeamRelease -ProjectName VSTeamRelease -Id 178 -Raw + + ## Assert + $raw | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'System.Management.Automation.PSCustomObject' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/VSTeamRelease/_apis/release/releases/178?api-version=$(_getApiVersion Release)" + } + } + + It 'by Id should return release as Object' { + ## Act + $r = Get-VSTeamRelease -ProjectName VSTeamRelease -Id 178 + + ## Assert + $r | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'vsteam_lib.Release' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/VSTeamRelease/_apis/release/releases/178?api-version=$(_getApiVersion Release)" + } + } + + It 'by Id -JSON should return release as JSON' { + ## Act + $r = Get-VSTeamRelease -ProjectName VSTeamRelease -Id 178 -JSON + + ## Assert + $r | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'System.String' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/VSTeamRelease/_apis/release/releases/178?api-version=$(_getApiVersion Release)" + } + } + + It 'with no parameters should return releases' { + ## Act + Get-VSTeamRelease -projectName VSTeamRelease + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/VSTeamRelease/_apis/release/releases?api-version=$(_getApiVersion Release)" + } + } + + It 'with expand environments should return releases' { + ## Act + Get-VSTeamRelease -projectName VSTeamRelease -expand environments + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/VSTeamRelease/_apis/release/releases?api-version=$(_getApiVersion Release)&`$expand=environments" + } + } + + It 'with no parameters & no project should return releases' { + ## Act + Get-VSTeamRelease + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/_apis/release/releases?api-version=$(_getApiVersion Release)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamReleaseDefinition.Tests.ps1 b/Tests/function/tests/Get-VSTeamReleaseDefinition.Tests.ps1 new file mode 100644 index 000000000..b971436a3 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamReleaseDefinition.Tests.ps1 @@ -0,0 +1,46 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamReleaseDefinition' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'releaseDefAzD.json' } + Mock Invoke-RestMethod { Open-SampleFile 'releaseDefAzD.json' -Index 0 } -ParameterFilter { + $Uri -like "*15*" + } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } + } + + Context 'Get-VSTeamReleaseDefinition' { + It 'no parameters should return Release definitions' { + ## Act + Get-VSTeamReleaseDefinition -projectName project + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)" + } + } + + It 'expand environments should return Release definitions' { + ## Act + Get-VSTeamReleaseDefinition -projectName project -expand environments + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)&`$expand=environments" + } + } + + It 'by Id should return Release definition' { + ## Act + Get-VSTeamReleaseDefinition -projectName project -id 15 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions/15?api-version=$(_getApiVersion Release)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamResourceArea.Tests.ps1 b/Tests/function/tests/Get-VSTeamResourceArea.Tests.ps1 new file mode 100644 index 000000000..e51b4afb1 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamResourceArea.Tests.ps1 @@ -0,0 +1,23 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamResourceArea' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Get-VSTeamResourceArea' { + BeforeAll { + ## Arrange + Mock _callAPI { Open-SampleFile 'Get-VSTeamResourceArea.json' } + } + + It 'Should return resources' { + ## Act + $actual = Get-VSTeamResourceArea + + ## Assert + $actual.Count | Should -Be 2 + $actual[0].name | Should -Be 'policy' + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamSecurityNamespace.Tests.ps1 b/Tests/function/tests/Get-VSTeamSecurityNamespace.Tests.ps1 new file mode 100644 index 000000000..e936bbe34 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamSecurityNamespace.Tests.ps1 @@ -0,0 +1,103 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamSecurityNamespace" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context "Get-VSTeamSecurityNamespace" { + Context 'Services' { + BeforeAll { + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _supportsSecurityNamespace { return $true } + + # You have to set the version or the api-version will not be added when versions = '' + Mock _getApiVersion { return 'AzD' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + + Mock Invoke-RestMethod { Open-SampleFile 'securityNamespaces.json' } + Mock Invoke-RestMethod { Open-SampleFile 'securityNamespace.single.json' } -ParameterFilter { + $Uri -like "*58450c49-b02d-465a-ab12-59ae512d6531*" + } + } + + It 'list should return namespaces' { + ## Act + Get-VSTeamSecurityNamespace + + ## Assert + # With PowerShell core the order of the query string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/securitynamespaces*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'by id should return a single namespace' { + ## Act + Get-VSTeamSecurityNamespace -Id 58450c49-b02d-465a-ab12-59ae512d6531 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/securitynamespaces/58450c49-b02d-465a-ab12-59ae512d6531*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'by name should return namespace' { + ## Act + Get-VSTeamSecurityNamespace -Name "WorkItemTracking" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/securitynamespaces*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'by list and localOnly should return namespaces' { + ## Act + Get-VSTeamSecurityNamespace -LocalOnly + + ## Assert + # With PowerShell core the order of the query string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://dev.azure.com/test/_apis/securitynamespaces*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*localOnly=true*" + } + } + } + + Context "Server" { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + + Mock _callAPI { throw 'Should not be called' } -Verifiable + Mock _getApiVersion { return 'TFS2017' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + It 'should throw' { + ## Act / Assert + { Get-VSTeamSecurityNamespace } | Should -Throw + } + + It '_callAPI should not be called' { + ## Assert + Should -Invoke _callAPI -Exactly 0 + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamServiceEndpointType.Tests.ps1 b/Tests/function/tests/Get-VSTeamServiceEndpointType.Tests.ps1 new file mode 100644 index 000000000..b239b1401 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamServiceEndpointType.Tests.ps1 @@ -0,0 +1,56 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamServiceEndpointType' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'serviceEndpointTypeSample.json' } + } + + Context 'Get-VSTeamServiceEndpointType' { + It 'should return all service endpoints types' { + ## Act + Get-VSTeamServiceEndpointType + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" + } + } + + It 'by Type should return all service endpoints types' { + ## Act + Get-VSTeamServiceEndpointType -Type azurerm + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" -and + $Body.type -eq 'azurerm' + } + } + + It 'by Type and scheme should return all service endpoints types' { + ## Act + Get-VSTeamServiceEndpointType -Type azurerm -Scheme Basic + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" -and + $Body.type -eq 'azurerm' -and + $Body.scheme -eq 'Basic' + } + } + + It 'by scheme should return all service endpoints types' { + ## Act + Get-VSTeamServiceEndpointType -Scheme Basic + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" -and + $Body.scheme -eq 'Basic' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamTaskGroup.Tests.ps1 b/Tests/function/tests/Get-VSTeamTaskGroup.Tests.ps1 new file mode 100644 index 000000000..0d73cc6d2 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamTaskGroup.Tests.ps1 @@ -0,0 +1,67 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamTaskGroup' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { + $Service -eq 'TaskGroups' + } + } + + Context 'Get-VSTeamTaskGroup list' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'taskGroups.json' } + } + + It 'Should return all task groups' { + ## Act + Get-VSTeamTaskGroup -projectName project + + ## Act + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" + } + } + } + + Context 'Get-VSTeamTaskGroup Id' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'taskGroup.json' } + } + + It 'Should return one task group' { + ## Act + $projectID = "d30f8b85-6b13-41a9-bb77-2e1a9c611def" + Get-VSTeamTaskGroup -projectName project -id $projectID + + ## Act + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($projectID)?api-version=$(_getApiVersion TaskGroups)" + } + } + } + + Context 'Get-VSTeamTaskGroup Name' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'taskGroups.json' } + } + + It 'Should return one task group' { + ## Act + $taskGroupName = "For Unit Tests 2" + $taskGroup = Get-VSTeamTaskGroup -projectName project -Name $taskGroupName + + ## Act + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" + } + + # Ensure that we only have one task group, in other words, that the name filter was applied. + $taskGroup.name | Should -Be $taskGroupName + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamTfvcBranch.Tests.ps1 b/Tests/function/tests/Get-VSTeamTfvcBranch.Tests.ps1 new file mode 100644 index 000000000..0ad05a513 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamTfvcBranch.Tests.ps1 @@ -0,0 +1,61 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamTfvcBranch' -Tag 'unit', 'tfvc' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Tfvc' } + } + + Context 'Get-VSTeamTfvcBranch' { + BeforeAll { + Mock _callApi { Open-SampleFile 'Get-VSTeamTfvcBranch-ProjectName.json' } + Mock _callApi { Open-SampleFile 'Get-VSTeamTfvcBranch-ProjectName.json' -Index 1 } -ParameterFilter { + $Path -ne $null + } + } + + It 'should return all branches of project' { + $actual = Get-VSTeamTfvcBranch -ProjectName 'TestProject' -IncludeChildren + + $actual.count | Should -Be 2 + + Should -Invoke _callApi -Scope It -Exactly -Times 1 -ParameterFilter { + $ProjectName -eq 'TestProject' -and + $Area -eq 'tfvc' -and + $Version -eq '1.0-unitTests' -and + $QueryString['includeChildren'] -eq $true -and + $QueryString['includeParent'] -eq $false -and + $QueryString['includeDeleted'] -eq $false -and + $Id -eq $null + } + } + + It 'should return branches under this path' { + $actual = '$/iStay/Feature1' | Get-VSTeamTfvcBranch -IncludeDeleted + + $actual | Should -Not -Be $null + + Should -Invoke _callApi -Scope It -Exactly -Times 1 -ParameterFilter { + $ProjectName -eq $null -and + $Area -eq 'tfvc' -and + $Version -eq '1.0-unitTests' -and + $QueryString['includeChildren'] -eq $false -and + $QueryString['includeParent'] -eq $false -and + $QueryString['includeDeleted'] -eq $true -and + $Id -eq '$/iStay/Feature1' + } + } + + It 'should return both paths' { + Get-VSTeamTfvcBranch -Path $/iStay/Trunk, $/iStay/Feature1 + + Should -Invoke _callApi -Scope It -Exactly -Times 1 -ParameterFilter { + $Id -eq '$/iStay/Trunk' + } + Should -Invoke _callApi -Scope It -Exactly -Times 1 -ParameterFilter { + $Id -eq '$/iStay/Feature1' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamTfvcRootBranch.Tests.ps1 b/Tests/function/tests/Get-VSTeamTfvcRootBranch.Tests.ps1 new file mode 100644 index 000000000..0df435552 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamTfvcRootBranch.Tests.ps1 @@ -0,0 +1,90 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamTfvcRootBranch' -Tag 'unit', 'tfvc', 'get' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + $multipleResults = Open-SampleFile 'Get-VSTeamTfvcBranch-ProjectName.json' + $singleResult = Open-SampleFile 'Get-VSTeamTfvcBranch-ProjectName.json' -Index 0 + + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Tfvc' } + } + + Context 'Get-VSTeamTfvcRootBranch' { + Context 'Services' { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Get-VSTeamTfvcRootBranch with no parameters and single result' { + BeforeAll { + Mock Invoke-RestMethod { + # If this test fails uncomment the line below to see how the mock was called. + # Write-Host $args + + return $singleResult + } + + $res = Get-VSTeamTfvcRootBranch + } + + It 'should get 1 branch' { + $res.path | Should -Be $singleResult.path + } + + It 'should call the REST endpoint with correct parameters' { + Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Context 'Get-VSTeamTfvcRootBranch with no parameters and multiple results' { + BeforeAll { + Mock Invoke-RestMethod { return $multipleResults } + + $res = Get-VSTeamTfvcRootBranch + } + + It 'should get 2 branches' { + $res.Count | Should -Be 2 + $multipleResults.value[0] | Should -BeIn $res + $multipleResults.value[1] | Should -BeIn $res + } + + It 'should call the REST endpoint with correct parameters' { + Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)" + } + } + } + + Context 'Get-VSTeamTfvcRootBranch' { + BeforeAll { + Mock Invoke-RestMethod { return $singleResult } + } + + It 'should call the REST endpoint with IncludeChildren' { + Get-VSTeamTfvcRootBranch -IncludeChildren + Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeChildren=True" + } + } + + It 'should call the REST endpoint with IncludeDeleted' { + Get-VSTeamTfvcRootBranch -IncludeDeleted + Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" + } + } + + It 'should call the REST endpoint with all switches' { + Get-VSTeamTfvcRootBranch -IncludeChildren -IncludeDeleted + Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeDeleted=True" + } + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamUser.Tests.ps1 b/Tests/function/tests/Get-VSTeamUser.Tests.ps1 new file mode 100644 index 000000000..56b84b3a9 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamUser.Tests.ps1 @@ -0,0 +1,104 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamUser' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context "Get-VSTeamUser" { + Context "Server" { + BeforeAll { + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + Context 'Get-VSTeamUser' { + BeforeAll { + Mock _getApiVersion { return 'TFS2017' } + Mock _callAPI { throw 'Should not be called' } + Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Graph' } + } + + It 'Should throw' { + { Get-VSTeamUser } | Should -Throw + } + } + } + + Context 'Services' { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + # You have to set the version or the api-version will not be added when [vsteam_lib.Versions]::Graph = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } + } + + Context 'Get-VSTeamUser' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'users.json' } + } + + It 'Should list users' { + Get-VSTeamUser + + # With PowerShell core the order of the query string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + # The general string should look like this: + # "https://vssps.dev.azure.com/test/_apis/graph/users?api-version=$(_getApiVersion Graph)" + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope Context -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/users*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" + } + } + + It 'Should return users by subjectTypes' { + Get-VSTeamUser -SubjectTypes vss, aad + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope Context -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/users*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" -and + $Uri -like "*subjectTypes=vss,aad*" + } + } + } + + Context 'Get-VSTeamUser by descriptor' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'users.single.json' } + } + + It 'Should return the user' { + Get-VSTeamUser -UserDescriptor 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/users/aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" + } + } + } + + Context 'Get-VSTeamUser list throws' { + BeforeAll { + Mock Invoke-RestMethod { throw 'Error' } + } + + It 'Should throw' { + { Get-VSTeamUser } | Should -Throw + } + } + + Context 'Get-VSTeamUser by descriptor throws' { + BeforeAll { + Mock Invoke-RestMethod { throw 'Error' } + } + + It 'Should throw' { + { Get-VSTeamUser -UserDescriptor } | Should -Throw + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamUserEntitlement.Tests.ps1 b/Tests/function/tests/Get-VSTeamUserEntitlement.Tests.ps1 new file mode 100644 index 000000000..66bdae0ad --- /dev/null +++ b/Tests/function/tests/Get-VSTeamUserEntitlement.Tests.ps1 @@ -0,0 +1,75 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamUserEntitlement" -Tag 'VSTeamUserEntitlement' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context "Get-VSTeamUserEntitlement" { + Context "Server" { + BeforeAll { + Mock _getApiVersion { return 'TFS2017' } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } + } + + Context 'Get-VSTeamUserEntitlement' { + BeforeAll { + Mock _callAPI { throw 'Should not be called' } + } + + It 'not supported should throw' { + { Get-VSTeamUserEntitlement } | Should -Throw + } + + It '_callAPI should not be called' { + Should -Invoke _callAPI -Exactly -Times 0 -Scope Context + } + } + } + + Context "Services" { + BeforeAll { + Mock _getApiVersion { return 'VSTS' } + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } + + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamUserEntitlement.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamUserEntitlement-Id.json' } -ParameterFilter { + $Uri -like "*00000000-0000-0000-0000-000000000000*" + } + } + + It 'no parameters should return users' { + $users = Get-VSTeamUserEntitlement + + $users.count | Should -Be 3 + $users[0].UserName | Should -Be 'Math lastName' + + # Make sure it was called with the correct URI + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://vsaex.dev.azure.com/test/_apis/userentitlements?api-version=$(_getApiVersion MemberEntitlementManagement)&top=100&skip=0" + } + } + + It 'by Id should return users with projects' { + $user = Get-VSTeamUserEntitlement -Id '00000000-0000-0000-0000-000000000000' + + $user.Email | Should -Be 'test@test.com' -Because 'email is from type' + $user.userName | Should -Be 'Donovan Brown' -Because 'userName is from type' + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://vsaex.dev.azure.com/test/_apis/userentitlements/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion MemberEntitlementManagement)" + } + } + + It 'with select for projects should return users with projects' { + Get-VSTeamUserEntitlement -Select Projects + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://vsaex.dev.azure.com/test/_apis/userentitlements?api-version=$(_getApiVersion MemberEntitlementManagement)&top=100&skip=0&select=Projects" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamVariableGroup.Tests.ps1 b/Tests/function/tests/Get-VSTeamVariableGroup.Tests.ps1 new file mode 100644 index 000000000..6b7fb3812 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamVariableGroup.Tests.ps1 @@ -0,0 +1,75 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamVariableGroup' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'VariableGroups' } + } + + Context 'Get-VSTeamVariableGroup' { + Context 'Services' { + BeforeAll { + Mock _getApiVersion { return 'VSTS' } + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamVariableGroup.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamVariableGroup.json' -Index 0 } -ParameterFilter { $Uri -like "*101*" } + } + + It 'list should return all variable groups' { + Get-VSTeamVariableGroup -projectName project + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups?api-version=$(_getApiVersion VariableGroups)" + } + } + + + It 'by Id should return one variable group' { + $projectID = 101 + Get-VSTeamVariableGroup -projectName project -id $projectID + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$(_getApiVersion VariableGroups)" + } + } + } + + Context 'Server' { + BeforeAll { + Mock _getApiVersion { return 'TFS2017' } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + + Mock Invoke-RestMethod { Open-SampleFile 'variableGroupSamples2017.json' } + Mock Invoke-RestMethod { Open-SampleFile 'variableGroupSamples2017.json' -Index 0 } -ParameterFilter { $Uri -like "*101*" } + } + + It 'list should return all variable groups' { + Get-VSTeamVariableGroup -projectName project + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups?api-version=$(_getApiVersion VariableGroups)" + } + } + + It 'by Id should return one variable group' { + $projectID = 101 + Get-VSTeamVariableGroup -projectName project -id $projectID + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$(_getApiVersion VariableGroups)" + } + } + + It 'by name should return one variable group' { + $varGroupName = "TestVariableGroup1" + Get-VSTeamVariableGroup -projectName project -Name $varGroupName + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups?api-version=$(_getApiVersion VariableGroups)&groupName=$varGroupName" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamWiql.Tests.ps1 b/Tests/function/tests/Get-VSTeamWiql.Tests.ps1 new file mode 100644 index 000000000..242b33cf6 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamWiql.Tests.ps1 @@ -0,0 +1,116 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamWiql' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamWorkItem.ps1" + + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Get-VSTeamWiql' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamWiql.json' } + + # function is mocked because it is used when switch 'Expanded' is being used. + Mock Get-VSTeamWorkItem { Open-SampleFile 'Get-VSTeamWorkItem-Id.json' } + + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + + $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" + } + + It 'Get work items with custom WIQL query' { + Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '`{*' -and # Make sure the body is an object + $Body -like "*[System.Id]*" -and + $Body -like "*[System.Title]*" -and + $Body -like "*[System.State]*" -and + $Body -like '*`}' -and # Make sure the body is an object + $ContentType -eq 'application/json' -and + $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)&`$top=100" + } + } + + It 'Get work items with custom WIQL query with -Top 250' { + Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Top 250 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '`{*' -and # Make sure the body is an object + $Body -like "*[System.Id]*" -and + $Body -like "*[System.Title]*" -and + $Body -like "*[System.State]*" -and + $Body -like '*`}' -and # Make sure the body is an object + $ContentType -eq 'application/json' -and + $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)&`$top=250" + } + } + + It 'Get work items with custom WIQL query with -Top 0' { + Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Top 0 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '`{*' -and # Make sure the body is an object + $Body -like "*[System.Id]*" -and + $Body -like "*[System.Title]*" -and + $Body -like "*[System.State]*" -and + $Body -like '*`}' -and # Make sure the body is an object + $ContentType -eq 'application/json' -and + $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)" + } + } + + It 'Get work items with custom WIQL query with expanded work items' { + Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Expand + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '`{*' -and # Make sure the body is an object + $Body -like "*[System.Id]*" -and + $Body -like "*[System.Title]*" -and + $Body -like "*[System.State]*" -and + $Body -like '*`}' -and # Make sure the body is an object + $ContentType -eq 'application/json' -and + $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)&`$top=100" + } + } + + It 'Get work items with custom WIQL query with time precision' { + Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -TimePrecision + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Body -like '`{*' -and # Make sure the body is an object + $Body -like "*[System.Id]*" -and + $Body -like "*[System.Title]*" -and + $Body -like "*[System.State]*" -and + $Body -like '*`}' -and # Make sure the body is an object + $ContentType -eq 'application/json' -and + $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' { + Get-VSTeamWiql -ProjectName "test" -Team "test team" -Id 1 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql/1?api-version=$(_getApiVersion Core)&`$top=100" + } + } + + It 'Get work items with query ID query with expanded work items' { + Get-VSTeamWiql -ProjectName "test" -Team "test team" -Id 1 -Expand + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql/1?api-version=$(_getApiVersion Core)&`$top=100" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamWorkItem.Tests.ps1 b/Tests/function/tests/Get-VSTeamWorkItem.Tests.ps1 new file mode 100644 index 000000000..ba21ecc83 --- /dev/null +++ b/Tests/function/tests/Get-VSTeamWorkItem.Tests.ps1 @@ -0,0 +1,44 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamWorkItem' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Get-VSTeamWorkItem' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamWorkItem-Id16.json' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamWorkItem-Id.json' } -ParameterFilter { $Uri -like "*ids=47,48*" } + } + + It 'by id should return work items' { + Get-VSTeamWorkItem -Id 47, 48 + + # With PowerShell core the order of the query string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + # The general string should look like this: + # https://dev.azure.com/test/test/_apis/wit/workitems/?api-version=$(_getApiVersion Core)&ids=47,48&`$Expand=None&errorPolicy=omit + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/wit/workitems*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*ids=47,48*" -and + $Uri -like "*`$Expand=None*" -and + $Uri -like "*errorPolicy=omit*" + } + } + + It 'by Id with Default Project should return single work item' { + Get-VSTeamWorkItem -Id 47 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/wit/workitems/47?api-version=$(_getApiVersion Core)&`$Expand=None" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Get-VSTeamWorkItemType.Tests.ps1 b/Tests/function/tests/Get-VSTeamWorkItemType.Tests.ps1 new file mode 100644 index 000000000..05676d64f --- /dev/null +++ b/Tests/function/tests/Get-VSTeamWorkItemType.Tests.ps1 @@ -0,0 +1,60 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamWorkItemType' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Get-VSTeamWorkItemType' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'get-vsteamworkitemtype.json' -Json } + Mock Invoke-RestMethod { Open-SampleFile 'bug.json' -Json } -ParameterFilter { + $Uri -like "*bug*" + } + } + + It 'with project only should return all work item types' { + ## Act + Get-VSTeamWorkItemType -ProjectName VSTeamWorkItemType + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/VSTeamWorkItemType/_apis/wit/workitemtypes?api-version=$(_getApiVersion Core)" + } + } + + It 'by type with default project should return 1 work item type' { + ## Arrange + $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'VSTeamWorkItemType' + + ## Act + Get-VSTeamWorkItemType -WorkItemType bug + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/VSTeamWorkItemType/_apis/wit/workitemtypes/bug?api-version=$(_getApiVersion Core)" + } + } + + It 'by type with explicit project should return 1 work item type' { + ## Arrange + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + + ## Act + Get-VSTeamWorkItemType -ProjectName VSTeamWorkItemType -WorkItemType bug + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/VSTeamWorkItemType/_apis/wit/workitemtypes/bug?api-version=$(_getApiVersion Core)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Invoke-VSTeamRequest.Tests.ps1 b/Tests/function/tests/Invoke-VSTeamRequest.Tests.ps1 new file mode 100644 index 000000000..9090c31d3 --- /dev/null +++ b/Tests/function/tests/Invoke-VSTeamRequest.Tests.ps1 @@ -0,0 +1,58 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamRequest' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProject.ps1" + } + + Context 'Invoke-VSTeamRequest Options' { + BeforeAll { + Mock Invoke-RestMethod + Mock _getInstance { return 'https://dev.azure.com/test' } + + $projectResult = Open-SampleFile 'projectResult.json' + + Mock _callAPI { return $projectResult } -ParameterFilter { + $Resource -eq 'projects' -and + $id -eq 'testproject' -and + $Version -eq "$(_getApiVersion Core)" -and + $IgnoreDefaultProject -eq $true + } + } + + It 'options should call API' { + Invoke-VSTeamRequest -Method OPTIONS -NoProject + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq "Options" -and + $Uri -eq "https://dev.azure.com/test/_apis" + } + } + + It 'release should call API' { + Invoke-VSTeamRequest -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' -ProjectName testproject -JSON + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/testproject/_apis/release/releases/1?api-version=4.1-preview" + } + } + + It 'AdditionalHeaders should call API' { + Invoke-VSTeamRequest -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' -ProjectName testproject -JSON -AdditionalHeaders @{Test = "Test" } + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Headers["Test"] -eq 'Test' -and + $Uri -eq "https://vsrm.dev.azure.com/test/testproject/_apis/release/releases/1?api-version=4.1-preview" + } + } + + It 'by Product Id should call API with product id instead of name' { + Invoke-VSTeamRequest -ProjectName testproject -UseProjectId -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/010d06f0-00d5-472a-bb47-58947c230876/_apis/release/releases/1?api-version=4.1-preview" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeam.Tests.ps1 b/Tests/function/tests/Remove-VSTeam.Tests.ps1 new file mode 100644 index 000000000..06ef74fc4 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeam.Tests.ps1 @@ -0,0 +1,36 @@ +Set-StrictMode -Version Latest + +Describe "VSTeam" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeam.ps1" + + Mock _callAPI + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + Mock Get-VSTeam { return New-Object -TypeName PSObject -Prop @{projectname = "TestProject"; name = "TestTeam" } } + } + + Context "Remove-VSTeam" { + It 'Should remove the team' { + Remove-VSTeam -ProjectName Test -TeamId "TestTeam" -Force + + Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { + $Resource -eq 'projects/Test/teams' -and + $Version -eq '1.0-unitTests' -and + $Id -eq 'TestTeam' -and + $Method -eq "Delete" + } + } + + It 'fed through pipeline Should remove the team' { + Get-VSTeam -ProjectName TestProject -TeamId "TestTeam" | Remove-VSTeam -Force + + Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { + $Resource -eq 'projects/TestProject/teams' -and + $Version -eq '1.0-unitTests' -and + $Id -eq 'TestTeam' -and + $Method -eq "Delete" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamAccessControlEntry.Tests.ps1 b/Tests/function/tests/Remove-VSTeamAccessControlEntry.Tests.ps1 new file mode 100644 index 000000000..f50c63035 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamAccessControlEntry.Tests.ps1 @@ -0,0 +1,126 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamSecurityNamespace' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamSecurityNamespace.ps1" + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + # You have to set the version or the api-version will not be Removed when + # versions = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + Mock Get-VSTeamSecurityNamespace { Open-SampleFile 'Get-VSTeamSecurityNamespace.json' -Index 0 } + + $secNamespaceId = "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" + $testDescriptor = @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTkxNDc4NTk1LTU1MDM1MzIxOC0yNDM3MjM2NDgzLTQyMjkyNzUyNDktMC0wLTAtOC04") + } + + Context 'Remove-VSTeamAccessControlEntry by SecurityNamespaceId' { + It 'Should succeed with a properly formatted descriptor if descriptor is on ACL' { + Mock _callAPI { return $true } + + Remove-VSTeamAccessControlEntry -SecurityNamespaceId $secNamespaceId ` + -Descriptor $testDescriptor ` + -Token xyz ` + -force | Should -Be "Removal of ACE from ACL succeeded." + } + + It 'Should fail with a properly formatted descriptor if descriptor is not on ACL already' { + Mock _callAPI { return $false } + + # The original implementation used -confirm:$false so I am leaving this test + Remove-VSTeamAccessControlEntry -SecurityNamespaceId $secNamespaceId ` + -Descriptor $testDescriptor ` + -Token xyz ` + -confirm:$false ` + -ErrorVariable err ` + -ErrorAction SilentlyContinue + + $err.count | Should -Be 1 + $err[0].Exception.Message | Should -Be "Removal of ACE from ACL failed. Ensure descriptor and token are correct." + } + + It 'Should fail with an improperly formatted descriptor' { + Remove-VSTeamAccessControlEntry -SecurityNamespaceId $secNamespaceId ` + -Descriptor @("vssgp.NotARealDescriptor") ` + -Token xyz ` + -force ` + -ErrorVariable err ` + -ErrorAction SilentlyContinue + + $err.count | Should -Be 2 + $err[1].Exception.Message | Should -Be "Could not convert base64 string to string." + } + + It 'Should fail if the REST API gives a non true/false response' { + Mock _callAPI { return "Not a valid return" } + + Remove-VSTeamAccessControlEntry -SecurityNamespaceId $secNamespaceId ` + -Descriptor $testDescriptor ` + -Token xyz ` + -force ` + -ErrorVariable err ` + -ErrorAction SilentlyContinue + + $err.count | Should -Be 1 + $err[0].Exception.Message | Should -Be "Unexpected response from REST API." + } + } + + Context 'Remove-VSTeamAccessControlEntry by SecurityNamespace' { + It 'Should succeed with a properly formatted descriptor if descriptor is on ACL' { + Mock _callAPI { return $true } + + $securityNamespace = Get-VSTeamSecurityNamespace -Id "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" + + Remove-VSTeamAccessControlEntry -SecurityNamespace $securityNamespace ` + -Descriptor $testDescriptor ` + -Token xyz ` + -force | Should -Be "Removal of ACE from ACL succeeded." + } + It 'Should fail with a properly formatted descriptor if descriptor is not on ACL already' { + Mock _callAPI { return $false } + + $securityNamespace = Get-VSTeamSecurityNamespace -Id "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" + + Remove-VSTeamAccessControlEntry -SecurityNamespace $securityNamespace ` + -Descriptor $testDescriptor ` + -Token xyz ` + -force ` + -ErrorVariable err ` + -ErrorAction SilentlyContinue + + $err.count | Should -Be 1 + $err[0].Exception.Message | Should -Be "Removal of ACE from ACL failed. Ensure descriptor and token are correct." + } + It 'Should fail with an improperly formatted descriptor' { + $securityNamespace = Get-VSTeamSecurityNamespace -Id "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" + + Remove-VSTeamAccessControlEntry -SecurityNamespace $securityNamespace ` + -Descriptor @("vssgp.NotARealDescriptor") ` + -Token xyz ` + -force ` + -ErrorVariable err ` + -ErrorAction SilentlyContinue + + $err.count | Should -Be 2 + $err[1].Exception.Message | Should -Be "Could not convert base64 string to string." + } + It 'Should fail if the REST API gives a non true/false response' { + Mock _callAPI { return "Not a valid return" } + + Remove-VSTeamAccessControlEntry -SecurityNamespaceId $secNamespaceId ` + -Descriptor $testDescriptor ` + -Token xyz ` + -force ` + -ErrorVariable err ` + -ErrorAction SilentlyContinue + + $err.count | Should -Be 1 + $err[0].Exception.Message | Should -Be "Unexpected response from REST API." + } + } +} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamAccount.Tests.ps1 b/Tests/function/tests/Remove-VSTeamAccount.Tests.ps1 similarity index 82% rename from unit/test/Remove-VSTeamAccount.Tests.ps1 rename to Tests/function/tests/Remove-VSTeamAccount.Tests.ps1 index 043c31879..d35151b62 100644 --- a/unit/test/Remove-VSTeamAccount.Tests.ps1 +++ b/Tests/function/tests/Remove-VSTeamAccount.Tests.ps1 @@ -2,24 +2,14 @@ Set-StrictMode -Version Latest Describe 'Remove-VSTeamAccount' { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + Mock _clearEnvironmentVariables } Context 'Remove-VSTeamAccount run as administrator' { BeforeAll { Mock _isOnWindows { return $true } Mock _testAdministrator { return $true } - Mock _clearEnvironmentVariables } It 'should clear env at process level' { @@ -37,7 +27,6 @@ Describe 'Remove-VSTeamAccount' { BeforeAll { Mock _isOnWindows { return $true } Mock _testAdministrator { return $false } - Mock _clearEnvironmentVariables } It 'should clear env at process level' { @@ -55,7 +44,6 @@ Describe 'Remove-VSTeamAccount' { Context 'Remove-VSTeamAccount with no arguments' { BeforeAll { Mock _isOnWindows { return $false } - Mock _clearEnvironmentVariables } It 'should clear env at process level' { @@ -74,7 +62,6 @@ Describe 'Remove-VSTeamAccount' { BeforeAll { Mock _isOnWindows { return $true } Mock _testAdministrator { return $false } - Mock _clearEnvironmentVariables } It 'should clear env at user level' { @@ -91,9 +78,8 @@ Describe 'Remove-VSTeamAccount' { Context 'Remove-VSTeamAccount at all levels as administrator' { BeforeAll { - Mock _testAdministrator { return $true } Mock _isOnWindows { return $true } - Mock _clearEnvironmentVariables + Mock _testAdministrator { return $true } } It 'should clear env at all levels' { @@ -117,10 +103,9 @@ Describe 'Remove-VSTeamAccount' { Context 'Remove-VSTeamAccount at all levels as normal user' { BeforeAll { - Mock _testAdministrator { return $false } - Mock _isOnWindows { return $true } Mock Write-Warning - Mock _clearEnvironmentVariables + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $false } } It 'should clear env at all levels' { diff --git a/Tests/function/tests/Remove-VSTeamAgent.Tests.ps1 b/Tests/function/tests/Remove-VSTeamAgent.Tests.ps1 new file mode 100644 index 000000000..5acc734b5 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamAgent.Tests.ps1 @@ -0,0 +1,41 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamAgent' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _handleException + Mock _getApiVersion { return '1.0-unitTests' } + } + + Context 'Remove-VSTeamAgent by ID' { + BeforeAll { + Mock _callAPI + } + + It 'should remove the agent with passed in Id' { + Remove-VSTeamAgent -Pool 36 -Id 950 -Force + + Should -Invoke _callAPI -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'DELETE' -and + $Area -eq 'distributedtask/pools/36' -and + $Resource -eq 'agents' -and + $ID -eq 950 -and + $Version -eq $(_getApiVersion DistributedTaskReleased) + } + } + } + + Context 'Remove-VSTeamAgent throws' { + BeforeAll { + Mock _callAPI { throw 'boom' } + } + + It 'should remove the agent with passed in Id' { + Remove-VSTeamAgent -Pool 36 -Id 950 -Force + + Should -Invoke _handleException -Exactly -Scope It -Times 1 + } + } +} + diff --git a/Tests/function/tests/Remove-VSTeamArea.Tests.ps1 b/Tests/function/tests/Remove-VSTeamArea.Tests.ps1 new file mode 100644 index 000000000..2c4767c98 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamArea.Tests.ps1 @@ -0,0 +1,34 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamArea' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Remove-VSTeamClassificationNode.ps1" + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Remove-VSTeamArea' { + BeforeAll { + Mock Invoke-RestMethod { return $null } + } + + It 'with Path "" should delete area' -TestCases @( + @{ Path = "SubPath" } + @{ Path = "Path/SubPath" } + ) { + param ($Path) + ## Act + Remove-VSTeamArea -ProjectName "Public Demo" -Path $Path -ReClassifyId 4 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Delete" -and + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas/$Path*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + } +} + diff --git a/Tests/function/tests/Remove-VSTeamBuild.Tests.ps1 b/Tests/function/tests/Remove-VSTeamBuild.Tests.ps1 new file mode 100644 index 000000000..c55fb254d --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamBuild.Tests.ps1 @@ -0,0 +1,66 @@ +Set-StrictMode -Version Latest + +Describe 'Remove-VSTeamBuild' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Service' { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + + # Arrange + Mock Invoke-RestMethod + + # Act + Remove-VSTeamBuild -projectName VSTeamBuild -id 2 -Force + } + + It 'should delete build' { + # Assert + Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://dev.azure.com/test/VSTeamBuild/_apis/build/builds/2?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Server local Auth' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable + Mock Invoke-RestMethod + } + + It 'should delete build' { + Remove-VSTeamBuild -projectName VSTeamBuild -id 2 -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/VSTeamBuild/_apis/build/builds/2?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Server local Auth handles exception' { + BeforeAll { + + # Arrange + Mock _handleException -Verifiable + Mock Invoke-RestMethod { throw 'Testing error handling.' } + + # Act + Remove-VSTeamBuild -ProjectName VSTeamBuild -id 2 -Force + } + + It 'should add tags to Build' { + + # Assert + Should -InvokeVerifiable + } + } +} + diff --git a/Tests/function/tests/Remove-VSTeamBuildDefinition.Tests.ps1 b/Tests/function/tests/Remove-VSTeamBuildDefinition.Tests.ps1 new file mode 100644 index 000000000..74e2dee70 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamBuildDefinition.Tests.ps1 @@ -0,0 +1,38 @@ +Set-StrictMode -Version Latest + +Describe 'Remove-VSTeamBuildDefinition' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock Invoke-RestMethod { Open-SampleFile 'buildDefvsts.json' } + + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + } + + Context 'Succeeds' { + It 'should delete build definition' { + Remove-VSTeamBuildDefinition -projectName project -id 2 -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Succeeds on TFS local Auth' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable + + Remove-VSTeamBuildDefinition -projectName project -id 2 -Force + } + + It 'should delete build definition' { + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamBuildTag.Tests.ps1 b/Tests/function/tests/Remove-VSTeamBuildTag.Tests.ps1 new file mode 100644 index 000000000..216bfe2c5 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamBuildTag.Tests.ps1 @@ -0,0 +1,54 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuildTag' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + Context 'Remove-VSTeamBuildTag' { + BeforeAll { + [string[]] $inputTags = "Test1", "Test2", "Test3" + Mock Invoke-RestMethod { return @{ value = $null } } + } + + Context 'Services' { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'should add tags to Build' { + Remove-VSTeamBuildTag -ProjectName VSTeamBuildTag -id 2 -Tags $inputTags + + foreach ($inputTag in $inputTags) { + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://dev.azure.com/test/VSTeamBuildTag/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" + } + } + } + } + + Context 'Server' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'should add tags to Build' { + Remove-VSTeamBuildTag -ProjectName VSTeamBuildTag -id 2 -Tags $inputTags + + foreach ($inputTag in $inputTags) { + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/VSTeamBuildTag/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" + } + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamClassificationNode.Tests.ps1 b/Tests/function/tests/Remove-VSTeamClassificationNode.Tests.ps1 new file mode 100644 index 000000000..291e5bf83 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamClassificationNode.Tests.ps1 @@ -0,0 +1,84 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamClassificationNode' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Remove-VSTeamClassificationNode' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'classificationNodeResult.json' } + } + + It 'with StructureGroup "" should delete Nodes' -TestCases @( + @{ StructureGroup = "areas" } + @{ StructureGroup = "iterations" } + ) { + param ($StructureGroup) + ## Act + Remove-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Delete" -and + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'with StructureGroup "" should delete Nodes with reclassification id ' -TestCases @( + @{ StructureGroup = "areas"; ReClassifyId = 4 } + @{ StructureGroup = "iterations"; ReClassifyId = 99 } + ) { + param ($StructureGroup, $ReClassifyId) + ## Act + Remove-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -ReClassifyId $ReClassifyId -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Delete" -and + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'with StructureGroup "" by Path "" should delete Nodes' -TestCases @( + @{ StructureGroup = "areas"; Path = "SubPath" } + @{ StructureGroup = "areas"; Path = "Path/SubPath" } + @{ StructureGroup = "iterations"; Path = "SubPath" } + @{ StructureGroup = "iterations"; Path = "Path/SubPath" } + ) { + param ($StructureGroup, $Path) + ## Act + Remove-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Path $Path -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Delete" -and + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup/$Path*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + + It 'with StructureGroup "" by empty Path "" should delete Nodes' -TestCases @( + @{ StructureGroup = "areas"; Path = "" } + @{ StructureGroup = "areas"; Path = $null } + @{ StructureGroup = "iterations"; Path = "" } + @{ StructureGroup = "iterations"; Path = $null } + ) { + param ($StructureGroup, $Path) + ## Act + Remove-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Path $Path -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Delete" -and + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup?*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamExtension.Tests.ps1 b/Tests/function/tests/Remove-VSTeamExtension.Tests.ps1 new file mode 100644 index 000000000..53e0dc0ac --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamExtension.Tests.ps1 @@ -0,0 +1,30 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamExtension' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Remove-VSTeamExtension' { + BeforeAll { + $env:Team_TOKEN = '1234' + Mock _callAPI { Open-SampleFile 'singleExtensionResult.json' } + Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable + } + + AfterAll { + $env:TEAM_TOKEN = $null + } + + It 'Should remove an extension' { + Remove-VSTeamExtension -PublisherId 'test' -ExtensionId 'test' -Force + + Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { + $Method -eq 'Delete' -and + $subDomain -eq 'extmgmt' -and + $version -eq [vsteam_lib.Versions]::ExtensionsManagement + $Url -like "*https://extmgmt.dev.azure.com/test/_apis/_apis/extensionmanagement/installedextensionsbyname/test/test*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamFeed.Tests.ps1 b/Tests/function/tests/Remove-VSTeamFeed.Tests.ps1 new file mode 100644 index 000000000..0604d2718 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamFeed.Tests.ps1 @@ -0,0 +1,22 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamFeed' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock Invoke-RestMethod + Mock _getApiVersion { return '1.0-unitTests' } + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Remove-VSTeamFeed' { + It 'should delete feed' { + Remove-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Packaging)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamGitRepository.Tests.ps1 b/Tests/function/tests/Remove-VSTeamGitRepository.Tests.ps1 new file mode 100644 index 000000000..c3a16784c --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamGitRepository.Tests.ps1 @@ -0,0 +1,60 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamGitRepository" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamGitRepository-ProjectNamePeopleTracker-NamePeopleTracker.json' } -ParameterFilter { + $Uri -like "*00000000-0000-0000-0000-000000000000*" -or + $Uri -like "*testRepo*" + } + + Mock Invoke-RestMethod { throw [System.Net.WebException] } -ParameterFilter { + $Uri -like "*00000000-0000-0000-0000-000000000101*" -or + $Uri -like "*boom*" + } + } + + Context 'Remove-VSTeamGitRepository' { + Context 'Services' { + BeforeAll { + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'by id should remove Git repo' { + ## Act + Remove-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000000 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://dev.azure.com/test/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)" + } + } + + It 'by Id should throw' { + { Remove-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000101 -Force } | Should -Throw + } + } + + Context 'Server' { + BeforeAll { + ## Arrange + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'by id should remove Git repo' { + ## Act + Remove-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000000 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamIteration.Tests.ps1 b/Tests/function/tests/Remove-VSTeamIteration.Tests.ps1 new file mode 100644 index 000000000..ed8dedc6c --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamIteration.Tests.ps1 @@ -0,0 +1,33 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamIteration' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Remove-VSTeamClassificationNode.ps1" + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Remove-VSTeamIteration' { + BeforeAll { + Mock Invoke-RestMethod { return $null } + } + + It 'with Path "" should delete iteration' -TestCases @( + @{ Path = "SubPath" } + @{ Path = "Path/SubPath" } + ) { + param ($Path) + ## Act + Remove-VSTeamIteration -ProjectName "Public Demo" -Path $Path -ReClassifyId 4 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Delete" -and + $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations/$Path*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamMembership.Tests.ps1 b/Tests/function/tests/Remove-VSTeamMembership.Tests.ps1 new file mode 100644 index 000000000..60c92b560 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamMembership.Tests.ps1 @@ -0,0 +1,36 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamMembership' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Private/callMembershipAPI.ps1" + + ## Arrange + # You have to set the version or the api-version will not be added when [vsteam_lib.Versions]::Graph = '' + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } + Mock _supportsGraph + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod + + $UserDescriptor = 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' + $GroupDescriptor = 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' + } + + Context 'Remove-VSTeamMembership' { + It 'Should remove a membership' { + ## Act + $null = Remove-VSTeamMembership -MemberDescriptor $UserDescriptor -ContainerDescriptor $GroupDescriptor -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Delete" -and + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$UserDescriptor/$GroupDescriptor*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamPolicy.Tests.ps1 b/Tests/function/tests/Remove-VSTeamPolicy.Tests.ps1 new file mode 100644 index 000000000..448864a9a --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamPolicy.Tests.ps1 @@ -0,0 +1,33 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPolicy' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } + } + + Context 'Remove-VSTeamPolicy' { + It 'by id should delete the policy' { + ## Act + Remove-VSTeamPolicy -ProjectName Demo -id 4 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations/4?api-version=$(_getApiVersion Git)" + } + } + + It 'Should throw' { + ## Act / Assert + { Remove-VSTeamPolicy -ProjectName boom -id 4 -Force } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamProfile.Tests.ps1 b/Tests/function/tests/Remove-VSTeamProfile.Tests.ps1 new file mode 100644 index 000000000..4ba6fd6a4 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamProfile.Tests.ps1 @@ -0,0 +1,37 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProfile' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProfile.ps1" + + ## Arrange + $expectedPath = "$HOME/vsteam_profiles.json" + + Mock Set-Content + Mock Get-VSTeamProfile { return Open-SampleFile 'Get-VSTeamProfile.json' | ForEach-Object { $_ } } + } + + Context 'Remove-VSTeamProfile' { + It 'should save remaining profiles to disk' { + ## Act + Remove-VSTeamProfile test + + ## Assert + Should -Invoke Set-Content -Exactly -Times 1 -Scope It -ParameterFilter { + $Path -eq $expectedPath -and + $Value -Notlike "*test*" + } + } + + It 'entry does not exist should save original profiles to disk' { + ## Act + Remove-VSTeamProfile demos + + ## Assert + Should -Invoke Set-Content -Exactly -Times 1 -Scope It -ParameterFilter { + $Path -eq $expectedPath -and $Value -like "*https://dev.azure.com/test*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamProject.Tests.ps1 b/Tests/function/tests/Remove-VSTeamProject.Tests.ps1 new file mode 100644 index 000000000..7d68afa71 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamProject.Tests.ps1 @@ -0,0 +1,36 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProject' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProject.ps1" + + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Write-Progress + Mock _trackProjectProgress + Mock Invoke-RestMethod + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamProject-NamePeopleTracker.json' } -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" + } + Mock Invoke-RestMethod { return @{ status = 'inProgress'; url = 'https://someplace.com' } } -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://dev.azure.com/test/_apis/projects/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Core)" + } + } + + Context 'Remove-VSTeamProject with Force' { + It 'Should not call Invoke-RestMethod' { + ## Act + Remove-VSTeamProject -ProjectName Test -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" + } + Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and $Uri -eq "https://dev.azure.com/test/_apis/projects/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Core)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamRelease.Tests.ps1 b/Tests/function/tests/Remove-VSTeamRelease.Tests.ps1 new file mode 100644 index 000000000..cdd978bd8 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamRelease.Tests.ps1 @@ -0,0 +1,34 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamRelease' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + } + + Context 'Remove-VSTeamRelease' { + BeforeAll { + Mock Invoke-RestMethod + Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Uri -like "*101*" } + } + + It 'by Id should remove release' { + ## Act + Remove-VSTeamRelease -ProjectName VSTeamRelease -Id 15 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://vsrm.dev.azure.com/test/VSTeamRelease/_apis/release/releases/15?api-version=$(_getApiVersion Release)" + } + } + + It 'by Id should throw' { + ## Act / Assert + { Remove-VSTeamRelease -ProjectName VSTeamRelease -Id 101 -Force } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamReleaseDefinition.Tests.ps1 b/Tests/function/tests/Remove-VSTeamReleaseDefinition.Tests.ps1 new file mode 100644 index 000000000..79576c444 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamReleaseDefinition.Tests.ps1 @@ -0,0 +1,51 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamReleaseDefinition' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + } + + Context 'Remove-VSTeamReleaseDefinition' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamReleaseDefinition.json' } + } + + Context 'Services' { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'should delete release definition' { + ## Act + Remove-VSTeamReleaseDefinition -projectName project -id 2 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions/2?api-version=$(_getApiVersion Release)" + } + } + } + + Context 'Server' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'local Auth should delete release definition' { + ## Act + Remove-VSTeamReleaseDefinition -projectName project -id 2 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Method -eq 'Delete' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/release/definitions/2?api-version=$(_getApiVersion Release)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamTaskGroup.Tests.ps1 b/Tests/function/tests/Remove-VSTeamTaskGroup.Tests.ps1 new file mode 100644 index 000000000..e8d1b8f74 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamTaskGroup.Tests.ps1 @@ -0,0 +1,24 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamTaskGroup' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock Invoke-RestMethod + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'TaskGroups' } + } + + Context 'Remove-VSTeamTaskGroup' { + It 'should delete Task group' { + $projectID = "d30f8b85-6b13-41a9-bb77-2e1a9c611def" + + Remove-VSTeamTaskGroup -projectName "project" -Id $projectID -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($projectID)?api-version=$(_getApiVersion TaskGroups)" -and + $Method -eq 'Delete' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamUserEntitlement.Tests.ps1 b/Tests/function/tests/Remove-VSTeamUserEntitlement.Tests.ps1 new file mode 100644 index 000000000..0a2168966 --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamUserEntitlement.Tests.ps1 @@ -0,0 +1,58 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamUserEntitlement" -Tag 'VSTeamUserEntitlement' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamUserEntitlement.ps1" + } + + Context "Remove-VSTeamUserEntitlement" { + BeforeAll { + Mock _getApiVersion { return 'VSTS' } + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } + } + + Context 'Remove-VSTeamUserEntitlement' { + BeforeAll { + # Get-VSTeamUserEntitlement by Id + Mock _callAPI { Open-SampleFile 'Get-VSTeamUserEntitlement-Id.json' } -ParameterFilter { + $Id -eq '00000000-0000-0000-0000-000000000000' + } + + # Get-VSTeamUserEntitlement by email + Mock _callAPI { Open-SampleFile 'Get-VSTeamUserEntitlement.json' } + + # Remove Call + Mock _callAPI -ParameterFilter { $Method -eq 'Delete' } + } + + It 'by Id should remove user' { + Remove-VSTeamUserEntitlement -UserId '00000000-0000-0000-0000-000000000000' -Force + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $subDomain -eq 'vsaex' -and + $id -eq '00000000-0000-0000-0000-000000000000' -and + $resource -eq 'userentitlements' -and + $method -eq 'Delete' -and + $version -eq $(_getApiVersion MemberEntitlementManagement) + } + } + + It 'bye email should remove user' { + Remove-VSTeamUserEntitlement -Email 'dlbm3@test.com' -Force + + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Delete' -and + $subDomain -eq 'vsaex' -and + $id -eq '00000000-0000-0000-0000-000000000000' -and + $resource -eq 'userentitlements' -and + $version -eq $(_getApiVersion MemberEntitlementManagement) + } + } + + It 'by invalid email should throw' { + { Remove-VSTeamUserEntitlement -Email 'not@found.com' -Force } | Should -Throw + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamVariableGroup.Tests.ps1 b/Tests/function/tests/Remove-VSTeamVariableGroup.Tests.ps1 new file mode 100644 index 000000000..e110f38bc --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamVariableGroup.Tests.ps1 @@ -0,0 +1,48 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamVariableGroup' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Set-VSTeamAPIVersion.ps1" + + Mock Invoke-RestMethod + } + + Context 'Remove-VSTeamVariableGroup' { + Context 'Services' { + BeforeAll { + Set-VSTeamAPIVersion -Target VSTS + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '5.0-preview.1' } -ParameterFilter { $Service -eq 'VariableGroups' } + } + + It 'should delete variable group' { + $projectID = 1 + Remove-VSTeamVariableGroup -projectName project -Id $projectID -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$(_getApiVersion VariableGroups)" -and + $Method -eq 'Delete' + } + } + } + + Context 'Server' { + BeforeAll { + Set-VSTeamAPIVersion -Target TFS2017 + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable + Mock _getApiVersion { return '3.2-preview.1' } -ParameterFilter { $Service -eq 'VariableGroups' } + } + + It 'should delete variable group' { + $projectID = 1 + Remove-VSTeamVariableGroup -projectName project -id $projectID -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$(_getApiVersion VariableGroups)" -and + $Method -eq 'Delete' + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Remove-VSTeamWorkItem.Tests.ps1 b/Tests/function/tests/Remove-VSTeamWorkItem.Tests.ps1 new file mode 100644 index 000000000..81613d29f --- /dev/null +++ b/Tests/function/tests/Remove-VSTeamWorkItem.Tests.ps1 @@ -0,0 +1,48 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamWorkItem' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock Invoke-RestMethod + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + } + + Context 'Remove-VSTeamWorkItem' { + It 'Should delete single work item' { + Remove-VSTeamWorkItem -Id 47 -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/wit/workitems*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + $Uri -like "*workitems/47*" + } + } + + It 'Should throw single work item with id equals $null' { + { Remove-VSTeamWorkItem -Id $null } | Should -Throw + } + + It 'Should delete multipe work items' { + Remove-VSTeamWorkItem -Id 47, 48 -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 2 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/wit/workitems*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + ($Uri -like "*workitems/47*" -or $Uri -like "*workitems/48*") + } + } + + It 'Single Work Item Should be deleted permanently' { + Remove-VSTeamWorkItem -Id 47, 48 -Destroy -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 2 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/_apis/wit/workitems*" -and + $Uri -like "*api-version=$(_getApiVersion Core)*" -and + ($Uri -like "*workitems/47*" -or $Uri -like "*workitems/48*") -and + $Uri -like "*destroy=True*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Set-VSTeamAPIVersion.Tests.ps1 b/Tests/function/tests/Set-VSTeamAPIVersion.Tests.ps1 new file mode 100644 index 000000000..f49169e47 --- /dev/null +++ b/Tests/function/tests/Set-VSTeamAPIVersion.Tests.ps1 @@ -0,0 +1,89 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamAPIVersion' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context 'Set-VSTeamAPIVersion' { + It 'Should default to TFS2017' { + Set-VSTeamAPIVersion + [vsteam_lib.Versions]::Version | Should -Be 'TFS2017' + } + + It 'Should return TFS2018' { + Set-VSTeamAPIVersion -Target TFS2018 + [vsteam_lib.Versions]::Version | Should -Be 'TFS2018' + } + + It 'Should return AzD2019' { + Set-VSTeamAPIVersion -Target AzD2019 + [vsteam_lib.Versions]::Version | Should -Be 'AzD2019' + } + + It 'Should VSTS' { + Set-VSTeamAPIVersion -Target VSTS + [vsteam_lib.Versions]::Version | Should -Be 'VSTS' + } + + It 'Should AzD' { + Set-VSTeamAPIVersion -Target AzD + [vsteam_lib.Versions]::Version | Should -Be 'AzD' + } + + It 'Should change just TaskGroups' { + Set-VSTeamAPIVersion -Service TaskGroups -Version '7.0' + [vsteam_lib.Versions]::TaskGroups | Should -Be '7.0' + } + + It 'Should change just Build' { + Set-VSTeamAPIVersion -Service Build -Version '7.0' + [vsteam_lib.Versions]::Build | Should -Be '7.0' + } + + It 'Should change just Git' { + Set-VSTeamAPIVersion -Service Git -Version '7.0' + [vsteam_lib.Versions]::Git | Should -Be '7.0' + } + + It 'Should change just Core' { + Set-VSTeamAPIVersion -Service Core -Version '7.0' + [vsteam_lib.Versions]::Core | Should -Be '7.0' + } + + It 'Should change just Release' { + Set-VSTeamAPIVersion -Service Release -Version '7.0' + [vsteam_lib.Versions]::Release | Should -Be '7.0' + } + + It 'Should change just DistributedTask' { + Set-VSTeamAPIVersion -Service DistributedTask -Version '7.0' + [vsteam_lib.Versions]::DistributedTask | Should -Be '7.0' + } + + It 'Should change just Tfvc' { + Set-VSTeamAPIVersion -Service Tfvc -Version '7.0' + [vsteam_lib.Versions]::Tfvc | Should -Be '7.0' + } + + It 'Should change just Packaging' { + Set-VSTeamAPIVersion -Service Packaging -Version '7.0' + [vsteam_lib.Versions]::Packaging | Should -Be '7.0' + } + + It 'Should change just MemberEntitlementManagement' { + Set-VSTeamAPIVersion -Service MemberEntitlementManagement -Version '7.0' + [vsteam_lib.Versions]::MemberEntitlementManagement | Should -Be '7.0' + } + + It 'Should change just ServiceFabricEndpoint' { + Set-VSTeamAPIVersion -Service ServiceEndpoints -Version '7.0' + [vsteam_lib.Versions]::ServiceEndpoints | Should -Be '7.0' + } + + It 'Should change just ExtensionsManagement' { + Set-VSTeamAPIVersion -Service ExtensionsManagement -Version '7.0' + [vsteam_lib.Versions]::ExtensionsManagement | Should -Be '7.0' + } + } +} \ No newline at end of file diff --git a/unit/test/Set-VSTeamAccount.Tests.ps1 b/Tests/function/tests/Set-VSTeamAccount.Tests.ps1 similarity index 81% rename from unit/test/Set-VSTeamAccount.Tests.ps1 rename to Tests/function/tests/Set-VSTeamAccount.Tests.ps1 index d95c54bcf..9c726babb 100644 --- a/unit/test/Set-VSTeamAccount.Tests.ps1 +++ b/Tests/function/tests/Set-VSTeamAccount.Tests.ps1 @@ -2,46 +2,11 @@ Set-StrictMode -Version Latest Describe 'VSTeamAccount' { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Clear-VSTeamDefaultProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProfile.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $contents = @" - [ - { - "Name": "http://localhost:8080/tfs/defaultcollection", - "URL": "http://localhost:8080/tfs/defaultcollection", - "Pat": "", - "Type": "OnPremise", - "Version": "TFS2017", - "Token": "" - }, - { - "Name": "mydemos", - "URL": "https://dev.azure.com/mydemos", - "Pat": "OjEyMzQ1", - "Type": "Pat", - "Token": "", - "Version": "VSTS" - }, - { - "Name": "demonstrations", - "URL": "https://dev.azure.com/demonstrations", - "Pat": "dzY2a2x5am13YWtkcXVwYmg0emE=", - "Type": "Pat", - "Token": "", - "Version": "VSTS" - } - ] -"@ + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Clear-VSTeamDefaultProject.ps1" + . "$baseFolder/Source/Public/Get-VSTeamProfile.ps1" + . "$baseFolder/Source/Public/Set-VSTeamAPIVersion.ps1" + . "$baseFolder/Source/Public/Remove-VSTeamAccount.ps1" } AfterAll { @@ -88,11 +53,11 @@ Describe 'VSTeamAccount' { Mock _isOnWindows { return $false } Mock _setEnvironmentVariables Mock Set-VSTeamAPIVersion - Mock Get-VSTeamProfile { return $contents | ConvertFrom-Json | ForEach-Object { $_ } } + Mock Get-VSTeamProfile { return Open-SampleFile 'Get-VSTeamProfile.json' | ForEach-Object { $_ } } } It 'should set env at process level' { - Set-VSTeamAccount -Profile mydemos + Set-VSTeamAccount -Profile test Should -Invoke Set-VSTeamAPIVersion -Exactly -Scope It -Times 1 -ParameterFilter { $Target -eq 'VSTS' @@ -100,7 +65,9 @@ Describe 'VSTeamAccount' { # Make sure set env vars was called with the correct parameters Should -Invoke _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + $Level -eq 'Process' -and + $Pat -eq 'OndrejR0ZHpwbDM3bXUycGt5c3hm' -and + $Acct -eq 'https://dev.azure.com/test' } } } @@ -111,11 +78,11 @@ Describe 'VSTeamAccount' { Mock _setEnvironmentVariables Mock Set-VSTeamAPIVersion Mock Write-Output -Verifiable - Mock Get-VSTeamProfile { return $contents | ConvertFrom-Json | ForEach-Object { $_ } } + Mock Get-VSTeamProfile { return Open-SampleFile 'Get-VSTeamProfile.json' | ForEach-Object { $_ } } } It 'should set env at process level' { - Set-VSTeamAccount -Profile mydemos -Drive mydemos + Set-VSTeamAccount -Profile test -Drive test Should -InvokeVerifiable @@ -125,7 +92,9 @@ Describe 'VSTeamAccount' { # Make sure set env vars was called with the correct parameters Should -Invoke _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + $Level -eq 'Process' -and + $Pat -eq 'OndrejR0ZHpwbDM3bXUycGt5c3hm' -and + $Acct -eq 'https://dev.azure.com/test' } } } @@ -146,7 +115,9 @@ Describe 'VSTeamAccount' { # Make sure set env vars was called with the correct parameters Should -Invoke _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + $Level -eq 'Process' -and + $Pat -eq 'OjEyMzQ1' -and + $Acct -eq 'https://dev.azure.com/mydemos' } } } @@ -167,7 +138,9 @@ Describe 'VSTeamAccount' { # Make sure set env vars was called with the correct parameters Should -Invoke _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + $Level -eq 'Process' -and + $Pat -eq 'OjEyMzQ1' -and + $Acct -eq 'https://dev.azure.com/mydemos' } } } @@ -188,7 +161,10 @@ Describe 'VSTeamAccount' { # Make sure set env vars was called with the correct parameters Should -Invoke _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq '' -and $BearerToken -eq 12345 -and $Acct -eq 'https://dev.azure.com/mydemos' + $Level -eq 'Process' -and + $Pat -eq '' -and + $BearerToken -eq 12345 -and + $Acct -eq 'https://dev.azure.com/mydemos' } } } @@ -211,7 +187,9 @@ Describe 'VSTeamAccount' { # Make sure set env vars was called with the correct parameters Should -Invoke _setEnvironmentVariables -Exactly -Scope It -Times 1 -ParameterFilter { - $Level -eq 'Process' -and $Pat -eq 'OjEyMzQ1' -and $Acct -eq 'https://dev.azure.com/mydemos' + $Level -eq 'Process' -and + $Pat -eq 'OjEyMzQ1' -and + $Acct -eq 'https://dev.azure.com/mydemos' } } } diff --git a/unit/test/Set-VSTeamAlias.Tests.ps1 b/Tests/function/tests/Set-VSTeamAlias.Tests.ps1 similarity index 99% rename from unit/test/Set-VSTeamAlias.Tests.ps1 rename to Tests/function/tests/Set-VSTeamAlias.Tests.ps1 index 8ec37eeb3..8079e41aa 100644 --- a/unit/test/Set-VSTeamAlias.Tests.ps1 +++ b/Tests/function/tests/Set-VSTeamAlias.Tests.ps1 @@ -2,9 +2,7 @@ Set-StrictMode -Version Latest Describe "VSTeamAlias" { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Public/$sut" + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath } Context "Set-VSTeamAlias" { diff --git a/Tests/function/tests/Set-VSTeamApproval.Tests.ps1 b/Tests/function/tests/Set-VSTeamApproval.Tests.ps1 new file mode 100644 index 000000000..f014ce61e --- /dev/null +++ b/Tests/function/tests/Set-VSTeamApproval.Tests.ps1 @@ -0,0 +1,57 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamApproval' -Tag 'unit', 'approvals' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamApproval.json' -Index 0 } + } + + Context 'Set-VSTeamApproval' { + It 'should set approval' { + Set-VSTeamApproval -projectName project -Id 1 -Status Rejected -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 ` + -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/approvals/1?api-version=$(_getApiVersion Release)" + } + } + } + + Context 'Set-VSTeamApproval handles exception' { + BeforeAll { + Mock _handleException + Mock Invoke-RestMethod { throw 'testing error handling' } + } + + It 'should set approval' { + Set-VSTeamApproval -projectName project -Id 1 -Status Rejected -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 ` + -ParameterFilter { + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/approvals/1?api-version=$(_getApiVersion Release)" + } + } + } + + Context 'Set-VSTeamApproval' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Set-VSTeamApproval -projectName project -Id 1 -Status Rejected -Force + } + + It 'should set approval' { + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 ` + -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/approvals/1?api-version=$(_getApiVersion Release)" + } + } + } +} + diff --git a/unit/test/Set-VSTeamDefaultAPITimeout.Tests.ps1 b/Tests/function/tests/Set-VSTeamDefaultAPITimeout.Tests.ps1 similarity index 86% rename from unit/test/Set-VSTeamDefaultAPITimeout.Tests.ps1 rename to Tests/function/tests/Set-VSTeamDefaultAPITimeout.Tests.ps1 index 978a797d7..dad15c819 100644 --- a/unit/test/Set-VSTeamDefaultAPITimeout.Tests.ps1 +++ b/Tests/function/tests/Set-VSTeamDefaultAPITimeout.Tests.ps1 @@ -2,13 +2,7 @@ Set-StrictMode -Version Latest Describe 'VSTeamDefaultAPITimeout' -Tag 'APITimeout' { BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath } Context 'Set-VSTeamDefaultAPITimeout' { diff --git a/Tests/function/tests/Set-VSTeamDefaultProject.Tests.ps1 b/Tests/function/tests/Set-VSTeamDefaultProject.Tests.ps1 new file mode 100644 index 000000000..f055d97d4 --- /dev/null +++ b/Tests/function/tests/Set-VSTeamDefaultProject.Tests.ps1 @@ -0,0 +1,64 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamDefaultProject' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Set-VSTeamDefaultProject' { + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'should set default project' { + Set-VSTeamDefaultProject 'DefaultProject' + + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -Be 'DefaultProject' + } + + It 'should update default project' { + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'DefaultProject' + + Set-VSTeamDefaultProject -Project 'NextProject' + + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -Be 'NextProject' + } + } + + Context 'Set-VSTeamDefaultProject on Non Windows' { + BeforeAll { + Mock _isOnWindows { return $false } -Verifiable + } + + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'should set default project' { + Set-VSTeamDefaultProject 'MyProject' + + Should -InvokeVerifiable + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -Be 'MyProject' + } + } + + Context 'Set-VSTeamDefaultProject As Admin on Windows' { + BeforeAll { + Mock _isOnWindows { return $true } + Mock _testAdministrator { return $true } -Verifiable + } + + AfterAll { + $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + } + + It 'should set default project' { + Set-VSTeamDefaultProject 'MyProject' + + Should -InvokeVerifiable + $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -Be 'MyProject' + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Set-VSTeamEnvironmentStatus.Tests.ps1 b/Tests/function/tests/Set-VSTeamEnvironmentStatus.Tests.ps1 new file mode 100644 index 000000000..495f54c97 --- /dev/null +++ b/Tests/function/tests/Set-VSTeamEnvironmentStatus.Tests.ps1 @@ -0,0 +1,38 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamReleaseStatus' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + } + + Context 'Set-VSTeamEnvironmentStatus by ID' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $false } + Mock Invoke-RestMethod + Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Uri -like "*101*" } + + $expectedBody = ConvertTo-Json ([PSCustomObject]@{ status = 'inProgress'; comment = ''; scheduledDeploymentTime = $null }) + } + + It 'should set environments' { + ## Act + Set-VSTeamEnvironmentStatus -ProjectName project -ReleaseId 1 -Id 15 -Status inProgress -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Patch' -and + $Body -eq $expectedBody -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/1/environments/15?api-version=$(_getApiVersion Release)" + } + } + + It 'by Id should throw' { + ## Act / Assert + { Set-VSTeamEnvironmentStatus -ProjectName project -ReleaseId 101 -Id 101 -Status inProgress -Force } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Set-VSTeamPermissionInheritance.Tests.ps1 b/Tests/function/tests/Set-VSTeamPermissionInheritance.Tests.ps1 new file mode 100644 index 000000000..91bfa385d --- /dev/null +++ b/Tests/function/tests/Set-VSTeamPermissionInheritance.Tests.ps1 @@ -0,0 +1,93 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPermissionInheritance' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProject.ps1" + . "$baseFolder/Source/Public/Get-VSTeamBuildDefinition.ps1" + . "$baseFolder/Source/Public/Get-VSTeamReleaseDefinition.ps1" + . "$baseFolder/Source/Public/Get-VSTeamGitRepository.ps1" + . "$baseFolder/Source/Public/Get-VSTeamAccessControlList.ps1" + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { + $Service -eq 'HierarchyQuery' + } + + Mock _callAPI { Open-SampleFile 'Get-VSTeamProject-NamePeopleTracker.json' } -ParameterFilter { + $Resource -eq 'projects' -and + $id -eq 'project' -and + $Version -eq "$(_getApiVersion Core)" -and + $IgnoreDefaultProject -eq $true + } + + Mock _useWindowsAuthenticationOnPremise { return $true } + } + + Context 'Set-VSTeamPermissionInheritance buildDef' { + BeforeAll { + Mock _callAPI { Open-SampleFile 'buildDefAzD.json' } -ParameterFilter { + $Area -eq 'build' -and + $Resource -eq 'definitions' -and + $Version -eq "$(_getApiVersion Build)" + } + + Mock Invoke-RestMethod { Open-SampleFile 'buildDefHierarchyQuery_Update.json' } + } + + It 'should return true' { + Set-VSTeamPermissionInheritance -projectName project ` + -Name dynamTest-Docker-CI ` + -resourceType BuildDefinition ` + -NewState $false ` + -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'POST' -and + $Body -like '*00000000-0000-0000-0000-000000000000/1432*' -and + $Body -like '*33344d9c-fc72-4d6f-aba5-fa317101a7e9*' -and + $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*api-version=$(_getApiVersion HierarchyQuery)*" + } + } + } + + Context 'Set-VSTeamPermissionInheritance releaseDef' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'releaseDefHierarchyQuery_Update.json' } + Mock Get-VSTeamReleaseDefinition { Open-SampleFile 'releaseDefAzD.json' -ReturnValue } + } + + It 'should return true' { + Set-VSTeamPermissionInheritance -projectName project -Name PTracker-CD -resourceType ReleaseDefinition -NewState $false -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'POST' -and + $Body -like '*c788c23e-1b46-4162-8f5e-d7585343b5de*' -and + $Body -like '*00000000-0000-0000-0000-000000000000//2*' -and + $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*api-version=$(_getApiVersion HierarchyQuery)*" + } + } + } + + Context 'Set-VSTeamPermissionInheritance repository' { + BeforeAll { + Mock Get-VSTeamGitRepository { Open-SampleFile 'singleGitRepo.json' } + Mock Invoke-RestMethod { Open-SampleFile 'gitReopHierarchyQuery_Update.json' } + Mock Get-VSTeamAccessControlList { Open-SampleFile 'repoAccesscontrollists.json' } + } + + It 'should return true' { + Set-VSTeamPermissionInheritance -projectName project -Name project -resourceType Repository -NewState $false -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'POST' -and + $Body -like '*2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*' -and + $Body -like '*repoV2/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000001*' -and + $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/00000000-0000-0000-0000-000000000000*" -and + $Uri -like "*api-version=$(_getApiVersion HierarchyQuery)*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Set-VSTeamReleaseStatus.Tests.ps1 b/Tests/function/tests/Set-VSTeamReleaseStatus.Tests.ps1 new file mode 100644 index 000000000..205ab0c65 --- /dev/null +++ b/Tests/function/tests/Set-VSTeamReleaseStatus.Tests.ps1 @@ -0,0 +1,38 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamReleaseStatus' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Set-VSTeamReleaseStatus' { + BeforeAll { + ## Arrange + Mock Invoke-RestMethod + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Uri -like "*101*" } + } + + It 'by Id should set release status' { + ## Act + Set-VSTeamReleaseStatus -ProjectName project -Id 15 -Status Abandoned -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Patch' -and + $Body -eq '{ "id": 15, "status": "Abandoned" }' -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" + } + } + + It 'by Id should throw' { + ## Act / Assert + { Set-VSTeamReleaseStatus -ProjectName project -Id 101 -Status Abandoned -Force } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeam.Tests.ps1 b/Tests/function/tests/Show-VSTeam.Tests.ps1 new file mode 100644 index 000000000..37ad075cb --- /dev/null +++ b/Tests/function/tests/Show-VSTeam.Tests.ps1 @@ -0,0 +1,21 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeam' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Show-Browser -Verifiable + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Show-VSTeam' { + It 'Should open browser' { + ## Act + Show-VSTeam + + ## Assert + Should -InvokeVerifiable + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeamApproval.Tests.ps1 b/Tests/function/tests/Show-VSTeamApproval.Tests.ps1 new file mode 100644 index 000000000..732e7bbb7 --- /dev/null +++ b/Tests/function/tests/Show-VSTeamApproval.Tests.ps1 @@ -0,0 +1,20 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamApproval' -Tag 'unit', 'approvals' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Show-Browser -Verifiable + } + + Context 'Show-VSTeamApproval' { + It 'should open in browser' { + ## Act + Show-VSTeamApproval -projectName project -ReleaseDefinitionId 1 + + ## Assert + Should -InvokeVerifiable + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeamBuild.Tests.ps1 b/Tests/function/tests/Show-VSTeamBuild.Tests.ps1 new file mode 100644 index 000000000..bcaeee5f7 --- /dev/null +++ b/Tests/function/tests/Show-VSTeamBuild.Tests.ps1 @@ -0,0 +1,23 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuild' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Show-Browser + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Show-VSTeamBuild' { + it 'By ID should return url for mine' { + ## Act + Show-VSTeamBuild -projectName project -Id 15 + + ## Assert + Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { + $url -eq 'https://dev.azure.com/test/project/_build/index?buildId=15' + } + } + } +} \ No newline at end of file diff --git a/unit/test/Show-VSTeamBuildDefinition.Tests.ps1 b/Tests/function/tests/Show-VSTeamBuildDefinition.Tests.ps1 similarity index 76% rename from unit/test/Show-VSTeamBuildDefinition.Tests.ps1 rename to Tests/function/tests/Show-VSTeamBuildDefinition.Tests.ps1 index 86e7c8683..04a7eeefb 100644 --- a/unit/test/Show-VSTeamBuildDefinition.Tests.ps1 +++ b/Tests/function/tests/Show-VSTeamBuildDefinition.Tests.ps1 @@ -2,69 +2,69 @@ Set-StrictMode -Version Latest Describe 'VSTeamBuildDefinition' { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - + ## Arrange Mock Show-Browser + Mock _getInstance { return 'https://dev.azure.com/test' } } Context 'Show-VSTeamBuildDefinition' { it 'by ID should return url for mine' { + ## Act Show-VSTeamBuildDefinition -projectName project -Id 15 + ## Assert Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { $url -eq 'https://dev.azure.com/test/project/_build/index?definitionId=15' } } it 'by type should return url for mine' { + ## Act Show-VSTeamBuildDefinition -projectName project -Type Mine + ## Assert Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { $url -eq 'https://dev.azure.com/test/project/_build/index?_a=mine&path=%5c' } } it 'type XAML should return url for XAML' { + ## Act Show-VSTeamBuildDefinition -projectName project -Type XAML + ## Assert Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { $url -eq 'https://dev.azure.com/test/project/_build/xaml&path=%5c' } } it 'type queued should return url for Queued' { + ## Act Show-VSTeamBuildDefinition -projectName project -Type Queued + ## Assert Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { $url -eq 'https://dev.azure.com/test/project/_build/index?_a=queued&path=%5c' } } it 'with path should return url for mine' { + ## Act Show-VSTeamBuildDefinition -projectName project -path '\test' + ## Assert Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { $url -like 'https://dev.azure.com/test/project/_Build/index?_a=allDefinitions&path=%5Ctest' } } it 'Mine with path missing \ should return url for mine with \ added' { + ## Act Show-VSTeamBuildDefinition -projectName project -path 'test' + ## Assert Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { $url -like 'https://dev.azure.com/test/project/_Build/index?_a=allDefinitions&path=%5Ctest' } diff --git a/Tests/function/tests/Show-VSTeamFeed.Tests.ps1 b/Tests/function/tests/Show-VSTeamFeed.Tests.ps1 new file mode 100644 index 000000000..f764a5a85 --- /dev/null +++ b/Tests/function/tests/Show-VSTeamFeed.Tests.ps1 @@ -0,0 +1,29 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamFeed' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Show-Browser + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Show-VSTeamFeed' { + It 'by name should call show-browser' { + ## Act + Show-VSTeamFeed -Name module + + ## Assert + Should -Invoke Show-Browser + } + + It 'by id should call show-browser' { + ## Act + Show-VSTeamFeed -Id '00000000-0000-0000-0000-000000000000' + + ## Assert + Should -Invoke Show-Browser + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeamGitRepository.Tests.ps1 b/Tests/function/tests/Show-VSTeamGitRepository.Tests.ps1 new file mode 100644 index 000000000..b4d3a3c11 --- /dev/null +++ b/Tests/function/tests/Show-VSTeamGitRepository.Tests.ps1 @@ -0,0 +1,28 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamGitRepository" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock Show-Browser + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Show-VSTeamGitRepository' { + it 'by project should return url for mine' { + Show-VSTeamGitRepository -projectName project + + Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { + $url -eq 'https://dev.azure.com/test/_git/project' + } + } + + it 'by remote url should return url for mine' { + Show-VSTeamGitRepository -RemoteUrl 'https://dev.azure.com/test/_git/project' + + Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { + $url -eq 'https://dev.azure.com/test/_git/project' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeamProject.Tests.ps1 b/Tests/function/tests/Show-VSTeamProject.Tests.ps1 new file mode 100644 index 000000000..26f087c94 --- /dev/null +++ b/Tests/function/tests/Show-VSTeamProject.Tests.ps1 @@ -0,0 +1,43 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProject' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Show-Browser + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Show-VSTeamProject' { + It 'by ID should call start' { + ## Act + Show-VSTeamProject -Id 123456 + + ## Assert + Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { + $Url -eq "https://dev.azure.com/test/123456" + } + } + + It 'by nameed ProjectName parameter should call open' { + ## Act + Show-VSTeamProject -ProjectName ShowProject + + ## Assert + Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { + $Url -eq "https://dev.azure.com/test/ShowProject" + } + } + + It 'by postion projectName parameter should call open' { + ## Act + Show-VSTeamProject ShowProject + + ## Assert + Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { + $Url -eq "https://dev.azure.com/test/ShowProject" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeamPullRequest.Tests.ps1 b/Tests/function/tests/Show-VSTeamPullRequest.Tests.ps1 new file mode 100644 index 000000000..4960cffc0 --- /dev/null +++ b/Tests/function/tests/Show-VSTeamPullRequest.Tests.ps1 @@ -0,0 +1,36 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPullRequest' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamPullRequest.ps1" + + # You have to manually load the type file so the property reviewStatus + # can be tested. + Update-TypeData -AppendPath "$baseFolder/Source/types/vsteam_lib.PullRequest.ps1xml" -ErrorAction Ignore + + ## Arrange + Mock Show-Browser + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Show-Browser { throw } -ParameterFilter { $id -eq 999999 } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamPullRequest-Id_17.json' } + Mock _getApiVersion { return '1.0-unitTest' } -ParameterFilter { $Service -eq 'Git' } + } + + Context 'Show-VSTeamPullRequest' { + It 'by Id' { + ## Act + Show-VSTeamPullRequest -Id 17 + + ## Assert + Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { + $url -eq "https://dev.azure.com/test/PeopleTracker/_git/PeopleTracker/pullrequest/17" + } + } + + It 'with invalid ID' { + ## Act / Assert + { Show-VSTeamPullRequest -Id 999999 } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeamRelease.Tests.ps1 b/Tests/function/tests/Show-VSTeamRelease.Tests.ps1 new file mode 100644 index 000000000..223e86256 --- /dev/null +++ b/Tests/function/tests/Show-VSTeamRelease.Tests.ps1 @@ -0,0 +1,30 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamRelease' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + + Mock Show-Browser + } + + Context 'Show-VSTeamRelease' { + it 'by Id should show release' { + ## Act + Show-VSTeamRelease -projectName project -Id 15 + + ## Assert + Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { + $url -eq 'https://dev.azure.com/test/project/_release?releaseId=15' + } + } + + it 'with invalid Id should throw' { + ## Act / Assert + { Show-VSTeamRelease -projectName project -Id 0 } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeamReleaseDefinition.Tests.ps1 b/Tests/function/tests/Show-VSTeamReleaseDefinition.Tests.ps1 new file mode 100644 index 000000000..3e1682afa --- /dev/null +++ b/Tests/function/tests/Show-VSTeamReleaseDefinition.Tests.ps1 @@ -0,0 +1,26 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamReleaseDefinition' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Show-Browser + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { + $Service -eq 'Release' + } + } + + Context 'Show-VSTeamReleaseDefinition' { + it 'by Id should return release definitions' { + ## Act + Show-VSTeamReleaseDefinition -projectName project -Id 15 + + ## Assert + Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { + $url -eq 'https://dev.azure.com/test/project/_release?definitionId=15' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Show-VSTeamWorkItem.Tests.ps1 b/Tests/function/tests/Show-VSTeamWorkItem.Tests.ps1 new file mode 100644 index 000000000..ead9cd4ab --- /dev/null +++ b/Tests/function/tests/Show-VSTeamWorkItem.Tests.ps1 @@ -0,0 +1,23 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamWorkItem' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Show-Browser + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Show-VSTeamWorkItem' { + it 'should return url for mine' { + ## Act + Show-VSTeamWorkItem -projectName project -Id 15 + + ## Assert + Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { + $url -eq 'https://dev.azure.com/test/project/_workitems/edit/15' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Stop-VSTeamBuild.Tests.ps1 b/Tests/function/tests/Stop-VSTeamBuild.Tests.ps1 new file mode 100644 index 000000000..7541364cb --- /dev/null +++ b/Tests/function/tests/Stop-VSTeamBuild.Tests.ps1 @@ -0,0 +1,38 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuild' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + ## Arrange + Mock Invoke-RestMethod + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Update Build status' { + It 'should post changes' { + ## Act + Stop-VSTeamBuild -projectName project -id 1 + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -ParameterFilter { + $Method -eq 'Patch' -and + $Body -eq '{"status":"Cancelling"}' -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1?api-version=$(_getApiVersion Build)" } + } + + It 'should process pipeline with multiple ids' { + ## Act + $idArr = (1..3) + $idArr | Stop-VSTeamBuild -projectName project + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times $idArr.Count -ParameterFilter { + $Method -eq 'Patch' -and + $Body -eq '{"status":"Cancelling"}' -and + $Uri -like "https://dev.azure.com/test/project/_apis/build/builds/*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Test-VSTeamMembership.Tests.ps1 b/Tests/function/tests/Test-VSTeamMembership.Tests.ps1 new file mode 100644 index 000000000..a2e817b8c --- /dev/null +++ b/Tests/function/tests/Test-VSTeamMembership.Tests.ps1 @@ -0,0 +1,37 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamMembership' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Private/callMembershipAPI.ps1" + + ## Arrange + Mock _supportsGraph + Mock _getApiVersion { return '5.0' } -ParameterFilter { $Service -eq 'Graph' } + + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod + + $UserDescriptor = 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' + $GroupDescriptor = 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' + } + + Context 'Test-VSTeamMembership' { + It 'Should test membership' { + ## Act + $result = Test-VSTeamMembership -MemberDescriptor $UserDescriptor -ContainerDescriptor $GroupDescriptor + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq "Head" -and + $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$UserDescriptor/$GroupDescriptor*" -and + $Uri -like "*api-version=$(_getApiVersion Graph)*" + } + + $result | Should -Be $true + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Test-VSTeamYamlPipeline.Tests.ps1 b/Tests/function/tests/Test-VSTeamYamlPipeline.Tests.ps1 new file mode 100644 index 000000000..ed0ab8506 --- /dev/null +++ b/Tests/function/tests/Test-VSTeamYamlPipeline.Tests.ps1 @@ -0,0 +1,55 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamYamlPipeline' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + $testYamlPath = "$sampleFiles\azure-pipelines.test.yml" + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'pipelineDefYamlResult.json' } + } + + Context 'Test-VSTeamYamlPipeline' { + + It 'With Pipeline with PipelineID and without extra YAML' { + Test-VSTeamYamlPipeline -projectName project -PipelineId 24 + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" -and + $Body -like '*"PreviewRun":*true*' -and + $Body -notlike '*YamlOverride*' + } + } + + It 'With Pipeline with PipelineID and YAML file path' { + Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -FilePath $testYamlPath + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" -and + $Body -like '*"PreviewRun":*true*' -and + $Body -like '*YamlOverride*' + } + } + + It 'With Pipeline with PipelineID and YAML code' { + $yamlOverride = [string](Get-Content -raw $testYamlPath) + + Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -YamlOverride $yamlOverride + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" -and + $Body -like '*"PreviewRun":*true*' -and + $Body -like '*YamlOverride*' + } + } + + It 'Should create Yaml result' { + $yamlResult = Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -FilePath $testYamlPath + + $yamlResult | Should -Not -Be $null + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeam.Tests.ps1 b/Tests/function/tests/Update-VSTeam.Tests.ps1 new file mode 100644 index 000000000..c311e2cf1 --- /dev/null +++ b/Tests/function/tests/Update-VSTeam.Tests.ps1 @@ -0,0 +1,105 @@ +Set-StrictMode -Version Latest + +Describe "VSTeam" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeam.ps1" + } + + Context "Update-VSTeam" { + Context "services" { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeam.json' -Index 0 } + Mock Get-VSTeam { return New-Object -TypeName PSObject -Prop @{ + projectname = "TestProject" + name = "OldTeamName" + } + } + } + + It 'Should update the team with new team name' { + ## Arrange + $expectedBody = '{ "name": "NewTeamName" }' + + ## Act + $team = Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" -NewTeamName "NewTeamName" + + ## Assert + $team.Name | Should -Be 'Test Team' -Because 'Name should be set' + + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and + $Method -eq "Patch" -and + $Body -eq $expectedBody + } + } + + It 'Should update the team with new description' { + Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" -Description "New Description" + + $expectedBody = '{"description": "New Description" }' + + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and + $Method -eq "Patch" -and + $Body -eq $expectedBody + } + } + + It 'Should update the team with new team name and description' { + ## Arrange + $expectedBody = '{ "name": "NewTeamName", "description": "New Description" }' + + ## Act + Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" -NewTeamName "NewTeamName" -Description "New Description" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and + $Method -eq "Patch" -and + $Body -eq $expectedBody + } + } + + It 'Should update the team fed through pipeline' { + ## Arrange + $expectedBody = '{ "name": "NewTeamName", "description": "New Description" }' + + ## Act + Get-VSTeam -ProjectName TestProject -TeamId "OldTeamName" | Update-VSTeam -NewTeamName "NewTeamName" -Description "New Description" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/TestProject/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and + $Method -eq "Patch" -and + $Body -eq $expectedBody + } + } + } + + Context "Server" { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeam.json' -Index 0 } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'Should update the team with new team name on TFS local Auth' { + ## Arrange + $expectedBody = '{ "name": "NewTeamName" }' + + ## Act + Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" -NewTeamName "NewTeamName" + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/projects/Test/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and + $Method -eq "Patch" -and + $Body -eq $expectedBody + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamAgent.Tests.ps1 b/Tests/function/tests/Update-VSTeamAgent.Tests.ps1 new file mode 100644 index 000000000..1a2f265cb --- /dev/null +++ b/Tests/function/tests/Update-VSTeamAgent.Tests.ps1 @@ -0,0 +1,37 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamAgent' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'DistributedTaskReleased' } + } + + Context 'Update-VSTeamAgent by ID' { + BeforeAll { + Mock Invoke-RestMethod + } + + It 'should update the agent with passed in Id' { + Update-VSTeamAgent -Pool 36 -Id 950 -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Post' -and + $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/36/messages*" -and + $Uri -like "*api-version=$(_getApiVersion DistributedTaskReleased)*" -and + $Uri -like "*agentId=950*" + } + } + } + + Context 'Update-VSTeamAgent throws' { + BeforeAll { + Mock Invoke-RestMethod { throw 'boom' } + } + + It 'should update the agent with passed in Id' { + { Update-VSTeamAgent -Pool 36 -Id 950 -Force } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamBuild.Tests.ps1 b/Tests/function/tests/Update-VSTeamBuild.Tests.ps1 new file mode 100644 index 000000000..910c5c00d --- /dev/null +++ b/Tests/function/tests/Update-VSTeamBuild.Tests.ps1 @@ -0,0 +1,42 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamBuild' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock Invoke-RestMethod + } + + Context 'Update Build keep forever' { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'should post changes' { + Update-VSTeamBuild -projectName project -id 1 -KeepForever $true -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Method -eq 'Patch' -and + $Body -eq '{"keepForever": true}' -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1?api-version=$(_getApiVersion Build)" } + } + } + + Context 'Update Build number' { + BeforeAll { + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'should post changes' { + Update-VSTeamBuild -projectName project -id 1 -BuildNumber 'TestNumber' -KeepForever $true -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Method -eq 'Patch' -and + $Body -eq '{"keepForever": true, "buildNumber": "TestNumber"}' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1?api-version=$(_getApiVersion Build)" } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamBuildDefinition.Tests.ps1 b/Tests/function/tests/Update-VSTeamBuildDefinition.Tests.ps1 new file mode 100644 index 000000000..f0f4a8845 --- /dev/null +++ b/Tests/function/tests/Update-VSTeamBuildDefinition.Tests.ps1 @@ -0,0 +1,60 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamBuildDefinition" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Remove-VSTeamAccount.ps1" + } + + Context "Update-VSTeamBuildDefinition" { + Context "Services" { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'buildDefvsts.json' } + } + + It "should update build definition from json" { + Update-VSTeamBuildDefinition -ProjectName Demo -Id 23 -BuildDefinition 'JSON' + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Put' -and + $Uri -like "*https://dev.azure.com/test/Demo/_apis/build/definitions/23*" -and + $Uri -like "*api-version=$(_getApiVersion Build)*" + } + } + + It 'should update build definition from file' { + Update-VSTeamBuildDefinition -projectName project -id 2 -inFile 'sampleFiles/builddef.json' -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Put' -and + $InFile -eq 'sampleFiles/builddef.json' -and + $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" + } + } + } + + Context 'Server' { + BeforeAll { + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Remove-VSTeamAccount + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock Invoke-RestMethod { Open-SampleFile 'buildDefvsts.json' } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } + } + + It 'should update build definition' { + Update-VSTeamBuildDefinition -projectName project -id 2 -inFile 'sampleFiles/builddef.json' -Force + + Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { + $Method -eq 'Put' -and + $InFile -eq 'sampleFiles/builddef.json' -and + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" + } + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamExtension.Tests.ps1 b/Tests/function/tests/Update-VSTeamExtension.Tests.ps1 new file mode 100644 index 000000000..b26b444da --- /dev/null +++ b/Tests/function/tests/Update-VSTeamExtension.Tests.ps1 @@ -0,0 +1,31 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamExtension' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Update-VSTeamExtension' { + BeforeAll { + $env:Team_TOKEN = '1234' + Mock _callAPI { Open-SampleFile 'Get-VSTeamExtension.json' -Index 0 } + } + + AfterAll { + $env:TEAM_TOKEN = $null + } + + It 'Should update an extension' { + Update-VSTeamExtension -PublisherId 'test' -ExtensionId 'test' -ExtensionState disabled -Force + + Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { + $Method -eq 'Post' -and + $subDomain -eq 'extmgmt' -and + $version -eq [vsteam_lib.Versions]::ExtensionsManagement + $Url -like "*https://extmgmt.dev.azure.com/test/_apis/_apis/extensionmanagement/installedextensionsbyname/test/test*" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamPolicy.Tests.ps1 b/Tests/function/tests/Update-VSTeamPolicy.Tests.ps1 new file mode 100644 index 000000000..d2f0e97cb --- /dev/null +++ b/Tests/function/tests/Update-VSTeamPolicy.Tests.ps1 @@ -0,0 +1,113 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPolicy' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamPolicy.ps1" + + ## Arrange + # Set the account to use for testing. A normal user would do this + # using the Set-VSTeamAccount function. + Mock _getInstance { return 'https://dev.azure.com/test' } + + Mock Invoke-RestMethod + Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } + Mock Get-VSTeamPolicy { return @{ type = @{ id = 'babcf51f-d853-43a2-9b05-4a64ca577be0' } } } + } + + Context 'Update-VSTeamPolicy' { + It 'with type should add the policy' { + ## Act + Update-VSTeamPolicy -ProjectName Demo ` + -id 1 ` + -type babcf51f-d853-43a2-9b05-4a64ca577be0 ` + -enabled ` + -blocking ` + -settings @{ + MinimumApproverCount = 1 + scope = @( + @{ + refName = 'refs/heads/release' + matchKind = 'Exact' + repositoryId = '20000000-0000-0000-0000-0000000000002' + }) + } + + ## Assert + # With PowerShell core the order of the boty string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Put' -and + $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations/1?api-version=$(_getApiVersion Policy)" -and + $Body -like '*"isBlocking":true*' -and + $Body -like '*"isEnabled":true*' -and + $Body -like '*"type":*' -and + $Body -like '*"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"*' -and + $Body -like '*"settings":*' -and + $Body -like '*"scope":*' -and + $Body -like '*"repositoryId":"20000000-0000-0000-0000-0000000000002"*' -and + $Body -like '*"matchKind":"Exact"*' -and + $Body -like '*"refName":"refs/heads/release"*' -and + $Body -like '*"MinimumApproverCount":1*' + } + } + + It 'without type should add the policy' { + ## Act + Update-VSTeamPolicy -ProjectName Demo ` + -id 1 ` + -enabled ` + -blocking ` + -settings @{ + MinimumApproverCount = 1 + scope = @( + @{ + refName = 'refs/heads/release' + matchKind = 'Exact' + repositoryId = '20000000-0000-0000-0000-0000000000002' + }) + } + + ## Assert + # With PowerShell core the order of the boty string is not the + # same from run to run! So instead of testing the entire string + # matches I have to search for the portions I expect but can't + # assume the order. + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Put' -and + $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations/1?api-version=$(_getApiVersion Policy)" -and + $Body -like '*"isBlocking":true*' -and + $Body -like '*"isEnabled":true*' -and + $Body -like '*"type":*' -and + $Body -like '*"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"*' -and + $Body -like '*"settings":*' -and + $Body -like '*"scope":*' -and + $Body -like '*"repositoryId":"20000000-0000-0000-0000-0000000000002"*' -and + $Body -like '*"matchKind":"Exact"*' -and + $Body -like '*"refName":"refs/heads/release"*' -and + $Body -like '*"MinimumApproverCount":1*' + } + } + + It 'should throw' { + ## Act / Assert + { Update-VSTeamPolicy -ProjectName boom ` + -id 1 ` + -type babcf51f-d853-43a2-9b05-4a64ca577be0 ` + -enabled ` + -blocking ` + -settings @{ + MinimumApproverCount = 1 + scope = @( + @{ + refName = 'refs/heads/release' + matchKind = 'Exact' + repositoryId = '20000000-0000-0000-0000-0000000000002' + }) + } + } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamProfile.Tests.ps1 b/Tests/function/tests/Update-VSTeamProfile.Tests.ps1 new file mode 100644 index 000000000..9132ed1ab --- /dev/null +++ b/Tests/function/tests/Update-VSTeamProfile.Tests.ps1 @@ -0,0 +1,89 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProfile' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProfile.ps1" + + Mock Test-Path { return $true } + $expectedPath = "$HOME/vsteam_profiles.json" + } + + Context 'Update-VSTeamProfile entry does not exist' { + BeforeAll { + Mock Get-VSTeamProfile { return Open-SampleFile 'Get-VSTeamProfile.json' | ForEach-Object { $_ } } + } + + It 'Should throw' { + { Update-VSTeamProfile -Name Testing -PersonalAccessToken 678910 } | Should -Throw + } + } + + Context 'Update-VSTeamProfile with PAT to empty file' { + BeforeAll { + Mock Set-Content + Mock Get-VSTeamProfile + Mock Write-Warning -Verifiable + } + + It 'Should save profile to disk' { + Update-VSTeamProfile -name demos -PersonalAccessToken 12345 + + Should -InvokeVerifiable + } + } + + Context 'Update-VSTeamProfile with securePersonalAccessToken' { + BeforeAll { + Mock Set-Content + Mock Get-VSTeamProfile { return Open-SampleFile 'Get-VSTeamProfile.json' | ForEach-Object { $_ } } + } + + It 'Should update profile' { + $password = '678910' | ConvertTo-SecureString -AsPlainText -Force + + Update-VSTeamProfile -Name test -SecurePersonalAccessToken $password + + Should -Invoke Set-Content -ParameterFilter { + $Path -eq $expectedPath -and + $Value -like "*OjY3ODkxMA==*" -and + $Value -like "*https://dev.azure.com/test*" -and + $Value -like "*VSTS*" + } + } + } + + Context 'Update-VSTeamProfile with PAT' { + BeforeAll { + Mock Set-Content + Mock Get-VSTeamProfile { return Open-SampleFile 'Get-VSTeamProfile.json' | ForEach-Object { $_ } } + } + + It 'Should update profile' { + Update-VSTeamProfile -Name test -PersonalAccessToken 678910 + + Should -Invoke Set-Content -ParameterFilter { + $Path -eq $expectedPath -and + $Value -like "*OjY3ODkxMA==*" -and + $Value -like "*https://dev.azure.com/test*" -and + $Value -like "*VSTS*" } + } + } + + Context 'Update-VSTeamProfile with old URL' { + BeforeAll { + Mock Set-Content + Mock Test-Path { return $true } + Mock Get-VSTeamProfile { return Open-SampleFile 'Get-VSTeamProfile.json' | ForEach-Object { $_ } } + } + + It 'Should update profile with new URL' { + Update-VSTeamProfile -Name test -PersonalAccessToken 678910 + Should -Invoke Set-Content -ParameterFilter { + $Path -eq $expectedPath -and + $Value -like "*OjY3ODkxMA==*" -and + $Value -like "*https://dev.azure.com/test*" -and + $Value -like "*VSTS*" } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamProject.Tests.ps1 b/Tests/function/tests/Update-VSTeamProject.Tests.ps1 new file mode 100644 index 000000000..c4b51cde4 --- /dev/null +++ b/Tests/function/tests/Update-VSTeamProject.Tests.ps1 @@ -0,0 +1,78 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamProject' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamProject.ps1" + + Mock _getApiVersion { return '1.0-unitTests' } + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + Context 'Update-VSTeamProject' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamProject-NamePeopleTracker.json' } + + Mock Invoke-RestMethod { + return @{ status = 'inProgress'; url = 'https://someplace.com' } + } -ParameterFilter { + $Method -eq 'Patch' + } + + Mock _trackProjectProgress + } + + It 'with no op by id should not call Invoke-RestMethod' { + ## Act + Update-VSTeamProject -id '123-5464-dee43' + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly 0 + } + + It 'with newName should change name' { + ## Act + Update-VSTeamProject -ProjectName Test -newName Testing123 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" + } + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Patch' -and $Body -eq '{"name": "Testing123"}' + } + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Testing123?api-version=$(_getApiVersion Core)" + } + } + + It 'with newDescription should change description' { + ## Act + Update-VSTeamProject -ProjectName Test -newDescription Testing123 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 2 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" + } + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Patch' -and $Body -eq '{"description": "Testing123"}' + } + } + + It 'with new name and description should not call Invoke-RestMethod' { + ## Act + Update-VSTeamProject -ProjectName Test -newName Testing123 -newDescription Testing123 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" + } + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Patch' + } + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/_apis/projects/Testing123?api-version=$(_getApiVersion Core)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamPullRequest.Tests.ps1 b/Tests/function/tests/Update-VSTeamPullRequest.Tests.ps1 new file mode 100644 index 000000000..7593ccb80 --- /dev/null +++ b/Tests/function/tests/Update-VSTeamPullRequest.Tests.ps1 @@ -0,0 +1,93 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamPullRequest' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamUser.ps1" + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTest' } -ParameterFilter { + $Service -eq 'Git' -or + $Service -eq 'Graph' + } + + Mock Invoke-RestMethod { Open-SampleFile 'users.single.json' } + Mock Invoke-RestMethod { Open-SampleFile 'updatePullRequestResponse.json' } -ParameterFilter { + $PullRequestId -eq 18000 + } + } + + Context 'Update-VSTeamPullRequest' { + It 'Update-VSTeamPullRequest to Draft' { + ## Act + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Draft -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"isDraft": true }' + } + } + + It 'Update-VSTeamPullRequest to Published' { + ## Act + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"isDraft": false }' + } + } + + It 'Update-VSTeamPullRequest to set status to abandoned' { + ## Act + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 18000 -Status abandoned -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/18000*" -and + $Body -eq '{"status": "abandoned"}' + } + } + + It 'Update-VSTeamPullRequest to set to enable auto complete' { + ## Arrange + $user = Get-VSTeamUser -Descriptor "aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj" + + ## Act + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" ` + -PullRequestId 19543 ` + -EnableAutoComplete ` + -AutoCompleteIdentity $user ` + -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"autoCompleteSetBy": "aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj"}' + } + } + + It 'Update-VSTeamPullRequest to set to disable auto complete' { + ## Act + Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -DisableAutoComplete -Force + + ## Assert + Should -Invoke Invoke-RestMethod -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and + $Uri -like "*pullrequests/19543*" -and + $Body -eq '{"autoCompleteSetBy": null}' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamRelease.Tests.ps1 b/Tests/function/tests/Update-VSTeamRelease.Tests.ps1 new file mode 100644 index 000000000..932152021 --- /dev/null +++ b/Tests/function/tests/Update-VSTeamRelease.Tests.ps1 @@ -0,0 +1,31 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamRelease' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamRelease.ps1" + + Mock _useWindowsAuthenticationOnPremise { return $true } + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamRelease-id178-expandEnvironments.json' } + } + + Context 'Update-VSTeamRelease' { + It 'should return releases' { + ## Arrange + $r = Get-VSTeamRelease -ProjectName project -Id 178 + $r.variables | Add-Member NoteProperty temp(@{value = 'temp' }) + + ## Act + Update-VSTeamRelease -ProjectName project -Id 178 -Release $r + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Put' -and + $Body -ne $null -and + $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/178?api-version=$(_getApiVersion Release)" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamReleaseDefinition.Tests.ps1 b/Tests/function/tests/Update-VSTeamReleaseDefinition.Tests.ps1 new file mode 100644 index 000000000..5286cee63 --- /dev/null +++ b/Tests/function/tests/Update-VSTeamReleaseDefinition.Tests.ps1 @@ -0,0 +1,45 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamReleaseDefinition" { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + } + + Context "Update-VSTeamReleaseDefinition" { + BeforeAll { + Mock _callApi + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } + } + + It "with infile should update release" { + ## Act + Update-VSTeamReleaseDefinition -ProjectName Test -InFile "releaseDef.json" -Force + + ## Assert + Should -Invoke _callApi -Scope It -Exactly -Times 1 -ParameterFilter { + $Method -eq "Put" -and + $SubDomain -eq 'vsrm' -and + $Area -eq 'Release' -and + $Resource -eq 'definitions' -and + $Version -eq "$(_getApiVersion Release)" -and + $InFile -eq 'releaseDef.json' + } + } + + It "with release definition should update release" { + ## Act + Update-VSTeamReleaseDefinition -ProjectName Test -ReleaseDefinition "{}" -Force + + ## Assert + Should -Invoke _callApi -Scope It -Exactly -Times 1 -ParameterFilter { + $Method -eq "Put" -and + $SubDomain -eq 'vsrm' -and + $Area -eq 'Release' -and + $Resource -eq 'definitions' -and + $Version -eq "$(_getApiVersion Release)" -and + $InFile -eq $null -and + $Body -eq "{}" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamServiceEndpoint.Tests.ps1 b/Tests/function/tests/Update-VSTeamServiceEndpoint.Tests.ps1 new file mode 100644 index 000000000..70251703a --- /dev/null +++ b/Tests/function/tests/Update-VSTeamServiceEndpoint.Tests.ps1 @@ -0,0 +1,36 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamServiceEndpoint' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamServiceEndpoint.ps1" + } + + Context 'Update-VSTeamServiceEndpoint' { + BeforeAll { + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { + $Service -eq 'ServiceEndpoints' + } + + Mock Write-Progress + Mock Invoke-RestMethod { _trackProcess } + Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { + $Method -eq 'Get' -or + $Method -eq 'Put' + } + } + + It 'should update Serviceendpoint' { + ## Act + Update-VSTeamServiceEndpoint -projectName 'project' ` + -id '23233-2342' ` + -object @{ key = 'value' } + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Method -eq 'Put' + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamTaskGroup.Tests.ps1 b/Tests/function/tests/Update-VSTeamTaskGroup.Tests.ps1 new file mode 100644 index 000000000..bb305a84e --- /dev/null +++ b/Tests/function/tests/Update-VSTeamTaskGroup.Tests.ps1 @@ -0,0 +1,49 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamTaskGroup' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamTaskGroup.ps1" + + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'TaskGroups' } + } + + Context 'Update-VSTeamTaskGroup' { + BeforeAll { + Mock Invoke-RestMethod { Open-SampleFile 'taskGroup.json' } + } + + It 'should update a task group using body param' { + ## Arrange + $taskGroupJsonAsString = Open-SampleFile 'taskGroup.json' -Json + $taskGroupToUpdate = Get-VSTeamTaskGroup -Name "For Unit Tests" -ProjectName 'project' + + ## Act + Update-VSTeamTaskGroup -ProjectName 'project' -Body $taskGroupJsonAsString -Id $taskGroupToUpdate.id + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($taskGroupToUpdate.id)?api-version=$(_getApiVersion TaskGroups)" -and + $Body -eq $taskGroupJsonAsString -and + $Method -eq "Put" + } + } + + It 'should update a task group using infile param' { + ## Arrange + $taskGroupJson = "$sampleFiles\taskGroup.json" + $taskGroupToUpdate = Get-VSTeamTaskGroup -Name "For Unit Tests" -ProjectName 'project' + + ## Act + Update-VSTeamTaskGroup -ProjectName 'project' -InFile $taskGroupJson -Id $taskGroupToUpdate.id + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($taskGroupToUpdate.id)?api-version=$(_getApiVersion TaskGroups)" -and + $InFile -eq $taskGroupJson -and + $Method -eq "Put" + } + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamUserEntitlement.Tests.ps1 b/Tests/function/tests/Update-VSTeamUserEntitlement.Tests.ps1 new file mode 100644 index 000000000..337ba1af9 --- /dev/null +++ b/Tests/function/tests/Update-VSTeamUserEntitlement.Tests.ps1 @@ -0,0 +1,63 @@ +Set-StrictMode -Version Latest + +Describe "VSTeamUserEntitlement" -Tag 'VSTeamUserEntitlement' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamUserEntitlement.ps1" + } + + Context 'Update-VSTeamUserEntitlement' { + BeforeAll { + Mock _getApiVersion { return 'VSTS' } + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } + + # Update Call + Mock _callAPI -ParameterFilter { $Method -eq 'Patch' } + + # Get-VSTeamUserEntitlement by email + Mock _callAPI { Open-SampleFile 'Get-VSTeamUserEntitlement.json' } + + # Get-VSTeamUserEntitlement by id + Mock _callAPI { Open-SampleFile 'Get-VSTeamUserEntitlement-Id.json' } -ParameterFilter { + $id -eq '00000000-0000-0000-0000-000000000000' + } + } + + It 'by email should update a user' { + Update-VSTeamUserEntitlement -License 'Stakeholder' ` + -LicensingSource msdn ` + -MSDNLicenseType enterprise ` + -Email 'dlbm3@test.com' ` + -Force + + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $subDomain -eq 'vsaex' -and + $id -eq '00000000-0000-0000-0000-000000000000' -and + $resource -eq 'userentitlements' -and + $version -eq $(_getApiVersion MemberEntitlementManagement) + } + } + + It 'by id should update a user' { + Update-VSTeamUserEntitlement -Id '00000000-0000-0000-0000-000000000000' -Force + + Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { + $Method -eq 'Patch' -and + $subDomain -eq 'vsaex' -and + $id -eq '00000000-0000-0000-0000-000000000000' -and + $resource -eq 'userentitlements' -and + $version -eq $(_getApiVersion MemberEntitlementManagement) + } + } + + It 'with wrong email should update user with invalid email should throw' { + { Update-VSTeamUserEntitlement -Email 'not@found.com' -License 'Express' -Force } | Should -Throw + } + + It 'with invalid id should update user with invalid id should throw' { + { Update-VSTeamUserEntitlement -Id '11111111-0000-0000-0000-000000000000' -License 'Express' -Force } | Should -Throw + } + } +} \ No newline at end of file diff --git a/Tests/function/tests/Update-VSTeamVariableGroup.Tests.ps1 b/Tests/function/tests/Update-VSTeamVariableGroup.Tests.ps1 new file mode 100644 index 000000000..0d8e6fa46 --- /dev/null +++ b/Tests/function/tests/Update-VSTeamVariableGroup.Tests.ps1 @@ -0,0 +1,105 @@ +Set-StrictMode -Version Latest + +Describe 'VSTeamVariableGroup' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath + . "$baseFolder/Source/Public/Get-VSTeamVariableGroup.ps1" + } + + Context 'Update-VSTeamVariableGroup' { + Context 'Services' { + BeforeAll { + Mock _getApiVersion { return 'VSTS' } + Mock _getInstance { return 'https://dev.azure.com/test' } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamVariableGroup.json' -Index 0 } + Mock _getApiVersion { return '5.0-preview.1-unitTests' } -ParameterFilter { $Service -eq 'VariableGroups' } + } + + It 'should update an exisiting Variable Group' { + $testParameters = @{ + ProjectName = "project" + Id = 1 + Name = "TestVariableGroup1" + Description = "A test variable group" + Type = "Vsts" + Variables = @{ + key1 = @{ + value = "value" + } + key2 = @{ + value = "" + isSecret = $true + } + } + ProviderData = @{ + serviceEndpointId = "AzureRMServiceEndpointGuid" + vault = "name_of_existing_key_vault" + } + } + + ## Act + Update-VSTeamVariableGroup @testParameters + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($testParameters.id)?api-version=$(_getApiVersion VariableGroups)" -and + $Method -eq 'Put' + } + } + + It "should update an existing var group when passing the json as the body" { + ## Arrange + $id = "1" + $projName = "project" + $body = Open-SampleFile 'Get-VSTeamVariableGroup.json' + + ## Act + Update-VSTeamVariableGroup -Body $body -ProjectName $projName -Id $id + + ## Assert + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "https://dev.azure.com/test/$projName/_apis/distributedtask/variablegroups/$($id)?api-version=$(_getApiVersion VariableGroups)" -and + $Method -eq 'Put' + } + } + } + + Context 'Server' { + BeforeAll { + $sampleFile2017 = Open-SampleFile 'variableGroupSamples2017.json' + + Mock _getApiVersion { return 'TFS2017' } + Mock _getApiVersion { return '3.2-preview.1-unitTests' } + Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable + + Mock Invoke-RestMethod { return $sampleFile2017.value[0] } + } + + It 'should update an exisiting Variable Group' { + $testParameters = @{ + ProjectName = "project" + id = 1 + Name = "TestVariableGroup1" + Description = "A test variable group" + Type = "AzureKeyVault" + Variables = @{ + key1 = @{ + value = "value" + } + key2 = @{ + value = "" + isSecret = $true + } + } + } + + Update-VSTeamVariableGroup @testParameters + + Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { + $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups/$($testParameters.id)?api-version=$(_getApiVersion VariableGroups)" -and + $Method -eq 'Put' + } + } + } + } +} \ No newline at end of file diff --git a/unit/test/Update-VSTeamWorkItem.Tests.ps1 b/Tests/function/tests/Update-VSTeamWorkItem.Tests.ps1 similarity index 83% rename from unit/test/Update-VSTeamWorkItem.Tests.ps1 rename to Tests/function/tests/Update-VSTeamWorkItem.Tests.ps1 index eb4ff93fb..88d9ec1d7 100644 --- a/unit/test/Update-VSTeamWorkItem.Tests.ps1 +++ b/Tests/function/tests/Update-VSTeamWorkItem.Tests.ps1 @@ -2,44 +2,24 @@ Set-StrictMode -Version Latest Describe 'VSTeamWorkItem' { BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath 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*" - } - - $obj = @{ - id = 47 - rev = 1 - url = "https://dev.azure.com/test/_apis/wit/workItems/47" - } } Context 'Update-VSTeamWorkItem' { BeforeAll { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $obj - } + Mock Invoke-RestMethod { Open-SampleFile 'Get-VSTeamWorkItem-Id16.json' } } It 'Without Default Project should update work item' { + ## Arrange $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") + + ## Act Update-VSTeamWorkItem -Id 1 -Title Test -Force + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Patch' -and $Body -like '`[*' -and # Make sure the body is an array @@ -50,9 +30,13 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should update work item' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' + + ## Act Update-VSTeamWorkItem 1 -Title Test1 -Description Testing -Force + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Patch' -and $Body -like '`[*' -and # Make sure the body is an array @@ -67,11 +51,14 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should update work item with 2 parameters and additional properties' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' - $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } + + ## Act Update-VSTeamWorkItem 1 -Title Test1 -Description Testing -AdditionalFields $additionalFields + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Patch' -and $Body -like '`[*' -and # Make sure the body is an array @@ -88,11 +75,14 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should update work item only with 1 parameter and additional properties' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' - $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } + + ## Act Update-VSTeamWorkItem 1 -Title Test1 -AdditionalFields $additionalFields + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Patch' -and $Body -like '`[*' -and # Make sure the body is an array @@ -107,11 +97,14 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should update work item only with additional properties' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' - $additionalFields = @{"System.Tags" = "TestTag"; "System.AreaPath" = "Project\\MyPath" } + + ## Act Update-VSTeamWorkItem 1 -AdditionalFields $additionalFields + ## Assert Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Patch' -and $Body -like '`[*' -and # Make sure the body is an array @@ -124,9 +117,11 @@ Describe 'VSTeamWorkItem' { } It 'With Default Project should throw exception when adding existing parameters to additional properties' { + ## Arrange $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' - $additionalFields = @{"System.Title" = "Test1"; "System.AreaPath" = "Project\\TestPath" } + + ## Act / Assert { Update-VSTeamWorkItem 1 -Title Test1 -Description Testing -AdditionalFields $additionalFields } | Should -Throw } } diff --git a/Tests/function/tests/_testInitialize.ps1 b/Tests/function/tests/_testInitialize.ps1 new file mode 100644 index 000000000..a222ff684 --- /dev/null +++ b/Tests/function/tests/_testInitialize.ps1 @@ -0,0 +1,79 @@ +# These lines were repeated in every test so I moved them here + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true, Position = 0)] + [string] $testPath, + [switch] $private, + [switch] $doNotPrimeCache +) +Import-Module SHiPS + +$baseFolder = "$PSScriptRoot/../../.." +$sampleFiles = "$PSScriptRoot/../../SampleFiles" + +Add-Type -Path "$baseFolder/dist/bin/vsteam-lib.dll" + +$sut = (Split-Path -Leaf $testPath).Replace(".Tests.", ".") + +. "$baseFolder/Source/Private/common.ps1" +. "$baseFolder/Source/Private/applyTypes.ps1" + +if ($private.IsPresent) { + . "$baseFolder/Source/Private/$sut" +} +else { + . "$baseFolder/Source/Public/$sut" +} + +if ($doNotPrimeCache.IsPresent) { + return +} + +# Prime the project cache with an empty list. This will make sure +# any project name used will pass validation and Get-VSTeamProject +# will not need to be called. +[vsteam_lib.ProjectCache]::Update([string[]]@(), 120) + +function Open-SampleFile { + param( + [Parameter(Mandatory = $true, Position = 0)] + [string] $file, + [switch] $ReturnValue, + # The index of the value array to return + [int] $index = -1, + [switch] $Json + ) + if ($Json.IsPresent) { + return $(Get-Content "$sampleFiles\$file" -Raw | ConvertTo-Json) + } + + if ($ReturnValue.IsPresent) { + return $(Get-Content "$sampleFiles\$file" -Raw | ConvertFrom-Json).value + } + else { + if ($index -eq -1) { + return $(Get-Content "$sampleFiles\$file" -Raw | ConvertFrom-Json) + } + else { + return $(Get-Content "$sampleFiles\$file" -Raw | ConvertFrom-Json).value[$index] + } + } +} + +function _trackProcess { + if ($iTracking -gt 9) { + return [PSCustomObject]@{ + isReady = $true + operationStatus = [PSCustomObject]@{ state = 'Ready' } + } + } + + return [PSCustomObject]@{ + isReady = $false + createdBy = [PSCustomObject]@{ } + authorization = [PSCustomObject]@{ } + data = [PSCustomObject]@{ } + operationStatus = [PSCustomObject]@{ state = 'InProgress' } + } +} \ No newline at end of file diff --git a/Tests/function/tests/common.Tests.ps1 b/Tests/function/tests/common.Tests.ps1 new file mode 100644 index 000000000..c45139b78 --- /dev/null +++ b/Tests/function/tests/common.Tests.ps1 @@ -0,0 +1,327 @@ +Set-StrictMode -Version Latest + +Describe 'Common' { + BeforeAll { + . "$PSScriptRoot\_testInitialize.ps1" $PSCommandPath -private + . "$baseFolder/Source/Public/Get-VSTeamProject.ps1" + . "$baseFolder/Source/Public/Get-VSTeamGitRepository.ps1" + . "$baseFolder/Source/Public/Get-VSTeamBuildDefinition.ps1" + . "$baseFolder/Source/Public/Get-VSTeamReleaseDefinition.ps1" + } + + context '_callAPI' { + BeforeAll { + Mock Invoke-RestMethod + Mock _getApiVersion { return '1.0-unitTests' } + Mock _getInstance { return 'https://dev.azure.com/test' } + } + + It 'Disable-VSTeamAgent' { + $item = 950 + $PoolId = 36 + + _callAPI -Method PATCH -NoProject ` + -Area "distributedtask/pools/$PoolId" ` + -Resource "agents" ` + -Id $item ` + -Body "{'enabled':false,'id':$item,'maxParallelism':1}" ` + -Version $(_getApiVersion DistributedTaskReleased) + + Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { + # The write-host below is great for seeing how many ways the mock is called. + # Write-Host "Assert Mock $Uri" + $Method -eq 'Patch' -and + $Body -eq "{'enabled':false,'id':950,'maxParallelism':1}" -and + $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/36/agents/950?api-version=$(_getApiVersion DistributedTaskReleased)" + } + } + } + + Context '_getPermissionInheritanceInfo' { + BeforeAll { + Mock Get-VSTeamBuildDefinition { Open-SampleFile 'Get-BuildDefinition_AzD.json' -ReturnValue } + Mock Get-VSTeamProject { Open-SampleFile 'Get-VSTeamProject-NamePeopleTracker.json' } + Mock Get-VSTeamReleaseDefinition { Open-SampleFile 'Get-VSTeamReleaseDefinition.json' -ReturnValue } + Mock Get-VSTeamGitRepository { Open-SampleFile 'Get-VSTeamGitRepository-ProjectNamePeopleTracker-NamePeopleTracker.json' } + } + + It 'Should return an object with build def details' { + $actual = _getPermissionInheritanceInfo -ProjectName 'PeopleTracker' -ResourceName 'PTracker-CI' -ResourceType 'BuildDefinition' + + $actual | Should -not -Be $null + $actual.Token | Should -Be "00000000-0000-0000-0000-000000000000/23" + $actual.SecurityNamespaceID | Should -Be "33344d9c-fc72-4d6f-aba5-fa317101a7e9" + } + + It 'Should return an object with release def details' { + $actual = _getPermissionInheritanceInfo -ProjectName 'PeopleTracker' -ResourceName 'PTracker-CD' -ResourceType 'ReleaseDefinition' + + $actual | Should -not -Be $null + $actual.SecurityNamespaceID | Should -Be "c788c23e-1b46-4162-8f5e-d7585343b5de" + $actual.Token | Should -Be "00000000-0000-0000-0000-000000000000//2" + } + + It 'Should return an object with repository details' { + $actual = _getPermissionInheritanceInfo -ProjectName 'PeopleTracker' -ResourceName 'PeopleTracker' -ResourceType 'Repository' + + $actual | Should -not -Be $null + $actual.SecurityNamespaceID | Should -Be "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" + $actual.Token | Should -Be "repoV2/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000" + } + } + + Context '_convertSecureStringTo_PlainText' { + It 'Should return plain text' { + $emptySecureString = ConvertTo-SecureString 'Test String' -AsPlainText -Force + + $actual = _convertSecureStringTo_PlainText -SecureString $emptySecureString + + $actual | Should -Be 'Test String' + } + } + + Context '_buildProjectNameDynamicParam set Alias' { + It 'Should set the alias of dynamic parameter' { + $actual = _buildProjectNameDynamicParam -AliasName TestAlias + $actual["ProjectName"].Attributes[1].AliasNames | Should -Be 'TestAlias' + } + } + + Context '_getUserAgent on Mac' { + BeforeAll { + Mock Get-OperatingSystem { return 'macOS' } + [vsteam_lib.Versions]::ModuleVersion = '0.0.0' + + $actual = _getUserAgent + } + + It 'Should return User Agent for macOS' { + $actual | Should -BeLike '*macOS*' + } + + It 'Should return User Agent for Module Version' { + $actual | Should -BeLike '*0.0.0*' + } + + It 'Should return User Agent for PowerShell Version' { + $actual | Should -BeLike "*$($PSVersionTable.PSVersion.ToString())*" + } + } + + Context '_getUserAgent on Linux' { + BeforeAll { + Mock Get-OperatingSystem { return 'Linux' } + [vsteam_lib.Versions]::ModuleVersion = '0.0.0' + + $actual = _getUserAgent + } + + It 'Should return User Agent for Linux' { + $actual | Should -BeLike '*Linux*' + } + + It 'Should return User Agent for Module Version' { + $actual | Should -BeLike '*0.0.0*' + } + + It 'Should return User Agent for PowerShell Version' { + $actual | Should -BeLike "*$($PSVersionTable.PSVersion.ToString())*" + } + } + + Context '_buildProjectNameDynamicParam' { + BeforeAll { + # PreFill the project cache with desired list. This will make sure + # the project name used will pass validation and Get-VSTeamProject + # will not need to be called. + [vsteam_lib.ProjectCache]::Update([string[]]@("Demo", "Universal")) + } + + It 'should return dynamic parameter' { + _buildProjectNameDynamicParam | Should -Not -BeNullOrEmpty + } + } + + Context '_buildDynamicParam no defaults' { + BeforeAll { + # PreFill the project cache with desired list. This will make sure + # the project name used will pass validation and Get-VSTeamProject + # will not need to be called. + [vsteam_lib.ProjectCache]::Update([string[]]@("Demo", "Universal")) + + $testParams = @{ + ParameterName = 'TestParam' + arrSet = @(@{A = 'A' }, @{B = 'B' }) + Mandatory = $true + ParameterSetName = "NewTest" + Position = 0 + ParameterType = ([hashtable]) + ValueFromPipelineByPropertyName = $false + AliasName = "TestAlieas" + HelpMessage = "Test Help Message" + } + $param = (_buildDynamicParam @testParams) + } + + It 'should return dynamic parameter' { + $param | Should -Not -BeNullOrEmpty + } + + It 'should return dynamic parameter name' { + $param.Name | Should -Be $testParams.ParameterName + } + + It 'should return dynamic parameter type' { + $param.ParameterType.FullName | Should -Be $testParams.ParameterType.FullName + } + + It 'Should set the basic attributes of the dynamic parameter' { + $param.Attributes[0].Position | Should -Be $testParams.Position + $param.Attributes[0].Mandatory | Should -Be $testParams.Mandatory + $param.Attributes[0].ParameterSetName | Should -Be $testParams.ParameterSetName + $param.Attributes[0].ValueFromPipelineByPropertyName | Should -Be $testParams.ValueFromPipelineByPropertyName + $param.Attributes[0].HelpMessage | Should -Be $testParams.HelpMessage + } + + It 'Should set the alias attributes of the dynamic parameter' { + $param.Attributes[1].AliasNames | Should -Be $testParams.AliasName + } + + It 'Should set the possible vaule attributes of the dynamic parameter' { + (Compare-Object -ReferenceObject $param.Attributes[2].ValidValues -DifferenceObject $testParams.arrSet) | Should -BeNullOrEmpty + } + } + + Context '_buildDynamicParam defaults' { + BeforeAll { + # PreFill the project cache with desired list. This will make sure + # the project name used will pass validation and Get-VSTeamProject + # will not need to be called. + [vsteam_lib.ProjectCache]::Update([string[]]@("Demo", "Universal")) + + $param = (_buildDynamicParam) + } + + It 'should return dynamic parameter' { + $param | Should -Not -BeNullOrEmpty + } + + It 'should return dynamic parameter name' { + $param.Name | Should -Be 'QueueName' + } + + It 'should return dynamic parameter type' { + $param.ParameterType.FullName | Should -Be ([string]).FullName + } + + It 'Should set the basic attributes of the dynamic parameter' { + ($param.Attributes[0].Position -lt 0) | Should -Be ($true) + $param.Attributes[0].Mandatory | Should -Be $false + $param.Attributes[0].ParameterSetName | Should -Be '__AllParameterSets' + $param.Attributes[0].ValueFromPipelineByPropertyName | Should -Be $true + $param.Attributes[0].HelpMessage | Should -BeNullOrEmpty + } + + It 'Should have no additoinal attributes of the dynamic parameter' { + $param.Attributes.Count | Should -Be 1 + } + } + + Context '_getWorkItemTypes' { + BeforeAll { + Mock _getInstance { return $null } -Verifiable + } + + It 'should return empty array' { + _getWorkItemTypes -ProjectName test | Should -Be @() + Should -InvokeVerifiable + } + } + + Context '_handleException' { + # Build a proper error + BeforeAll { + $obj = "{Value: {Message: 'Top Message'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '401'}}}" + + if ($PSVersionTable.PSEdition -ne 'Core') { + $r = [System.Net.HttpWebResponse]::new() + $e = [System.Net.WebException]::new("Test Exception", $null, [System.Net.WebExceptionStatus]::ProtocolError, $r) + } + else { + $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::Unauthorized) + $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) + } + $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue + $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) + } + + It 'Should Write two warnings' { + Mock Write-Warning -ParameterFilter { $Message -eq 'An error occurred: Test Exception' -or $Message -eq 'Top Message' } -Verifiable + + _handleException $ex + + Should -InvokeVerifiable + } + } + + Context '_handleException should re-throw' { + BeforeAll { + $e = [System.Management.Automation.RuntimeException]::new('You must call Set-VSTeamAccount before calling any other functions in this module.') + $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue + } + + It 'Should throw' { + + { _handleException $ex } | Should -Throw + } + } + + Context '_handleException message only' { + # Build a proper error + BeforeAll { + $obj = "{Value: {Message: 'Test Exception'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '400'}}}" + + if ($PSVersionTable.PSEdition -ne 'Core') { + $e = [System.Net.WebException]::new("Test Exception", $null) + } + else { + $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::BadRequest) + $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) + } + + $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue + $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) + } + + It 'Should Write one warnings' { + Mock Write-Warning -ParameterFilter { $Message -eq 'Test Exception' } -Verifiable + + _handleException $ex + + Should -InvokeVerifiable + } + } + + Context '_isVSTS' { + It '.visualstudio.com should return true' { + _isVSTS 'https://dev.azure.com/test' | Should -Be $true + } + + It '.visualstudio.com with / should return true' { + _isVSTS 'https://dev.azure.com/test/' | Should -Be $true + } + + It 'https://dev.azure.com should return true' { + _isVSTS 'https://dev.azure.com/test' | Should -Be $true + } + + It 'https://dev.azure.com with / should return true' { + _isVSTS 'https://dev.azure.com/test/' | Should -Be $true + } + + It 'should return false' { + _isVSTS 'http://localhost:8080/tfs/defaultcollection' | Should -Be $false + } + } +} + diff --git a/unit/test/readme.md b/Tests/function/tests/readme.md similarity index 100% rename from unit/test/readme.md rename to Tests/function/tests/readme.md diff --git a/integration/README.md b/Tests/integration/README.md similarity index 100% rename from integration/README.md rename to Tests/integration/README.md diff --git a/Tests/integration/Start-PSCountdown.ps1 b/Tests/integration/Start-PSCountdown.ps1 new file mode 100644 index 000000000..376c9f167 --- /dev/null +++ b/Tests/integration/Start-PSCountdown.ps1 @@ -0,0 +1,192 @@ +#requires -version 4.0 + +<# +Inspired from code originally published at: +https://github.com/Windos/powershell-depot/blob/master/livecoding.tv/StreamCountdown/StreamCountdown.psm1 + +This should work in Windows PowerShell and PowerShell Core, although not in VS Code. +The ProgressStyle parameter is dynamic and only appears if you are running the command in a Windows console. + +Even though are is no comment-based help or examples, if you run: help Start-PSCountdown -full you'll get the +help descriptions. +#> +function Start-PSCountdown { + + [cmdletbinding()] + [OutputType("None")] + Param( + [Parameter(Position = 0, HelpMessage = "Enter the number of minutes to countdown (1-60). The default is 5.")] + [ValidateRange(1, 60)] + [int32]$Minutes = 5, + [Parameter(HelpMessage = "Enter the text for the progress bar title.")] + [ValidateNotNullorEmpty()] + [string]$Title = "Counting Down ", + [Parameter(Position = 1, HelpMessage = "Enter a primary message to display in the parent window.")] + [ValidateNotNullorEmpty()] + [string]$Message = "Starting soon.", + [Parameter(HelpMessage = "Use this parameter to clear the screen prior to starting the countdown.")] + [switch]$ClearHost + ) + DynamicParam { + #this doesn't appear to work in PowerShell core on Linux + if ($host.PrivateData.ProgressBackgroundColor -And ( $PSVersionTable.Platform -eq 'Win32NT' -OR $PSEdition -eq 'Desktop')) { + + #define a parameter attribute object + $attributes = New-Object System.Management.Automation.ParameterAttribute + $attributes.ValueFromPipelineByPropertyName = $False + $attributes.Mandatory = $false + $attributes.HelpMessage = @" +Select a progress bar style. This only applies when using the PowerShell console or ISE. + +Default - use the current value of `$host.PrivateData.ProgressBarBackgroundColor +Transparent - set the progress bar background color to the same as the console +Random - randomly cycle through a list of console colors +"@ + + #define a collection for attributes + $attributeCollection = New-Object -Type System.Collections.ObjectModel.Collection[System.Attribute] + $attributeCollection.Add($attributes) + #define the validate set attribute + $validate = [System.Management.Automation.ValidateSetAttribute]::new("Default", "Random", "Transparent") + $attributeCollection.Add($validate) + + #add an alias + $alias = [System.Management.Automation.AliasAttribute]::new("style") + $attributeCollection.Add($alias) + + #define the dynamic param + $dynParam1 = New-Object -Type System.Management.Automation.RuntimeDefinedParameter("ProgressStyle", [string], $attributeCollection) + $dynParam1.Value = "Default" + + #create array of dynamic parameters + $paramDictionary = New-Object -Type System.Management.Automation.RuntimeDefinedParameterDictionary + $paramDictionary.Add("ProgressStyle", $dynParam1) + #use the array + return $paramDictionary + + } #if + } #dynamic parameter + Begin { + $loading = @( + 'Waiting for someone to hit enter', + 'Warming up processors', + 'Downloading the Internet', + 'Trying common passwords', + 'Commencing infinite loop', + 'Injecting double negatives', + 'Breeding bits', + 'Capturing escaped bits', + 'Dreaming of electric sheep', + 'Calculating gravitational constant', + 'Adding Hidden Agendas', + 'Adjusting Bell Curves', + 'Aligning Covariance Matrices', + 'Attempting to Lock Back-Buffer', + 'Building Data Trees', + 'Calculating Inverse Probability Matrices', + 'Calculating Llama Expectoration Trajectory', + 'Compounding Inert Tessellations', + 'Concatenating Sub-Contractors', + 'Containing Existential Buffer', + 'Deciding What Message to Display Next', + 'Increasing Accuracy of RCI Simulators', + 'Perturbing Matrices', + 'Initializing flux capacitors', + 'Brushing up on my Dothraki', + 'Preparing second breakfast', + 'Preparing the jump to lightspeed', + 'Initiating self-destruct sequence', + 'Mining cryptocurrency', + 'Aligning Heisenberg compensators', + 'Setting phasers to stun', + 'Deciding...blue pill or yellow?', + 'Bringing Skynet online', + 'Learning PowerShell', + 'On hold with Comcast customer service', + 'Waiting for Godot', + 'Folding proteins', + 'Searching for infinity stones', + 'Restarting the ARC reactor', + 'Learning regular expressions', + 'Trying to quit vi', + 'Waiting for the last Game_of_Thrones book', + 'Watching paint dry', + 'Aligning warp coils' + ) + if ($ClearHost) { + Clear-Host + } + $PSBoundParameters | out-string | Write-Verbose + if ($psboundparameters.ContainsKey('progressStyle')) { + + if ($PSBoundParameters.Item('ProgressStyle') -ne 'default') { + $saved = $host.PrivateData.ProgressBackgroundColor + } + if ($PSBoundParameters.Item('ProgressStyle') -eq 'transparent') { + $host.PrivateData.progressBackgroundColor = $host.ui.RawUI.BackgroundColor + } + } + $startTime = Get-Date + $endTime = $startTime.AddMinutes($Minutes) + $totalSeconds = (New-TimeSpan -Start $startTime -End $endTime).TotalSeconds + + $totalSecondsChild = Get-Random -Minimum 4 -Maximum 30 + $startTimeChild = $startTime + $endTimeChild = $startTimeChild.AddSeconds($totalSecondsChild) + $loadingMessage = $loading[(Get-Random -Minimum 0 -Maximum ($loading.Length - 1))] + + #used when progress style is random + $progcolors = "black", "darkgreen", "magenta", "blue", "darkgray" + + } #begin + Process { + #this does not work in VS Code + if ($host.name -match 'Visual Studio Code') { + Write-Warning "This command will not work in VS Code." + #bail out + Return + } + Do { + $now = Get-Date + $secondsElapsed = (New-TimeSpan -Start $startTime -End $now).TotalSeconds + $secondsRemaining = $totalSeconds - $secondsElapsed + $percentDone = ($secondsElapsed / $totalSeconds) * 100 + + Write-Progress -id 0 -Activity $Title -Status $Message -PercentComplete $percentDone -SecondsRemaining $secondsRemaining + + $secondsElapsedChild = (New-TimeSpan -Start $startTimeChild -End $now).TotalSeconds + $secondsRemainingChild = $totalSecondsChild - $secondsElapsedChild + $percentDoneChild = ($secondsElapsedChild / $totalSecondsChild) * 100 + + if ($percentDoneChild -le 100) { + Write-Progress -id 1 -ParentId 0 -Activity $loadingMessage -PercentComplete $percentDoneChild -SecondsRemaining $secondsRemainingChild + } + + if ($percentDoneChild -ge 100 -and $percentDone -le 98) { + if ($PSBoundParameters.ContainsKey('ProgressStyle') -AND $PSBoundParameters.Item('ProgressStyle') -eq 'random') { + $host.PrivateData.progressBackgroundColor = ($progcolors | Get-Random) + } + $totalSecondsChild = Get-Random -Minimum 4 -Maximum 30 + $startTimeChild = $now + $endTimeChild = $startTimeChild.AddSeconds($totalSecondsChild) + if ($endTimeChild -gt $endTime) { + $endTimeChild = $endTime + } + $loadingMessage = $loading[(Get-Random -Minimum 0 -Maximum ($loading.Length - 1))] + } + + Start-Sleep 0.2 + } Until ($now -ge $endTime) + } #progress + + End { + if ($saved) { + #restore value if it has been changed + $host.PrivateData.ProgressBackgroundColor = $saved + } + } #end + +} #end function + +#define an optional alias +Set-Alias -Name spc -Value Start-PSCountdown \ No newline at end of file diff --git a/Tests/integration/fullRun.ps1 b/Tests/integration/fullRun.ps1 new file mode 100644 index 000000000..790dc83fe --- /dev/null +++ b/Tests/integration/fullRun.ps1 @@ -0,0 +1,45 @@ +function Run-Tests { + [CmdletBinding()] + param ( + [string] $checkPoint, + [string] $version + ) + + begin { + Write-Host 'Applying checkpoint' + Restore-VMCheckpoint -VMName VSTeamOnPremTester -Name $checkPoint -Confirm:$false + + # Make sure the DVD is empty + Get-VM vsteamonpremtester | Get-VMDvdDrive | Set-VMDvdDrive -Path $null + + Write-Host 'Starting VM' + start-vm -VMName VSTeamOnPremTester + } + + process { + Write-Host 'Giving VM time to spin up' + Start-Sleep -Seconds 120 + + Write-Host 'Starting tests' + ./prime.ps1 -Version $version -RunTests + } + + end { + Write-Host 'Stopping VM' + stop-vm -VMName VSTeamOnPremTester + } +} + +Push-Location +Set-Location .. +./Build-Module.ps1 -ipmo +Pop-Location + +Write-Host 'Testing TFS2017 Update 3' +Run-Tests -checkPoint 'TFS2017 Update 3' -version 'TFS2017' + +# Write-Host 'Testing TFS2018 Update 3' +# Run-Tests -checkPoint 'TFS2018 Update 3' -version 'TFS2018' + +# Write-Host 'Testing AZD2019 Update 1' +# Run-Tests -checkPoint 'AZD2019 Update 1' -version 'AzD2019' diff --git a/integration/test/000_team.Tests.ps1 b/Tests/integration/tests/000_team.Tests.ps1 similarity index 98% rename from integration/test/000_team.Tests.ps1 rename to Tests/integration/tests/000_team.Tests.ps1 index 6c36d37a8..9fbd4e3ff 100644 --- a/integration/test/000_team.Tests.ps1 +++ b/Tests/integration/tests/000_team.Tests.ps1 @@ -2,7 +2,7 @@ Set-StrictMode -Version Latest Describe 'Team' -Tag 'integration' { BeforeAll { - . "$PSScriptRoot/testprep.ps1" + . "$PSScriptRoot/_testInitialize.ps1" Set-TestPrep diff --git a/integration/test/010_projects.Tests.ps1 b/Tests/integration/tests/010_projects.Tests.ps1 similarity index 81% rename from integration/test/010_projects.Tests.ps1 rename to Tests/integration/tests/010_projects.Tests.ps1 index 26b53d71f..f74b37a45 100644 --- a/integration/test/010_projects.Tests.ps1 +++ b/Tests/integration/tests/010_projects.Tests.ps1 @@ -5,10 +5,11 @@ Set-StrictMode -Version Latest $global:skippedOnTFS = ($env:ACCT -like "http://*") $global:skipVariableGroups = ($env:API_VERSION -eq 'TFS2017') $global:skipReleaseDefs = ($env:API_VERSION -eq 'TFS2017') +$global:skip2017Bugs = ($env:API_VERSION -eq 'TFS2017') Describe 'VSTeam Integration Tests' -Tag 'integration' { BeforeAll { - . "$PSScriptRoot/testprep.ps1" + . "$PSScriptRoot/_testInitialize.ps1" Set-TestPrep @@ -16,9 +17,9 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $email = $env:EMAIL $api = $env:API_VERSION - Write-Host "SkippedOnTFS = $($global:skippedOnTFS)" - Write-Host "SkipVariableGroups = $($global:skipVariableGroups)" - Write-Host "SkipReleaseDefs = $($global:skipReleaseDefs)" + Write-Verbose " SkippedOnTFS: $($global:skippedOnTFS)" + Write-Verbose "SkipVariableGroups: $($global:skipVariableGroups)" + Write-Verbose " SkipReleaseDefs: $($global:skipReleaseDefs)" $originalLocation = Get-Location @@ -30,7 +31,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { Set-Location $originalLocation } - Context 'Project full exercise' -Tag "Project" { + Context 'VSTeamProject' -Tag "Project" { It 'Get-VSTeamProject Should return projects' { Get-VSTeamProject -Name $target.Name -IncludeCapabilities | Should -Not -Be $null } @@ -49,7 +50,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Git full exercise' { + Context 'VSTeam' { BeforeAll { # Everytime you run the test a new "$newProjectName" is generated. # This is fine if you are running all the tests but not if you just @@ -57,27 +58,135 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { # target system change newProjectName to equal the name of the project # found with the correct description. $newProjectName = Get-ProjectName + + $global:id = (Get-VSTeam -ProjectName $newProjectName).Id } - It 'Get-VSTeamGitRepository Should return repository' { - Get-VSTeamGitRepository -ProjectName $newProjectName | Select-Object -ExpandProperty Name | Should -Be $newProjectName + It 'Get-VSTeam ByName Should return Teams' { + Get-VSTeam -ProjectName $newProjectName ` + -Name "$newProjectName Team" | Should -Not -Be $null } - It 'Add-VSTeamGitRepository Should create repository' { - Add-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' + It 'Get-VSTeam ById Should return Teams' { + Get-VSTeam -ProjectName $newProjectName -Id $global:id | Should -Not -Be $null + } - (Get-VSTeamGitRepository -ProjectName $newProjectName).Count | Should -Be 2 - Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' | Select-Object -ExpandProperty Name | Should -Be 'testing' + It 'Get-VSTeamMembers Should return TeamMembers' { + Get-VSTeamMember -ProjectName $newProjectName -TeamId $global:id | Should -Not -Be $null } - It 'Remove-VSTeamGitRepository Should delete repository' { - Get-VSTeamGitRepository -ProjectName $newProjectName -Name 'testing' | Select-Object -ExpandProperty Id | Remove-VSTeamGitRepository -Force + It 'Add-VSTeam should add a team' { + Add-VSTeam -ProjectName $newProjectName -Name 'testing' | Should -Not -Be $null + (Get-VSTeam -ProjectName $newProjectName).Count | Should -Be 2 + } - Get-VSTeamGitRepository -ProjectName $newProjectName | Where-Object { $_.Name -eq 'testing' } | Should -Be $null + It 'Update-VSTeam should update a team' { + Update-VSTeam -ProjectName $newProjectName -Name 'testing' -NewTeamName 'testing123' + Get-VSTeam -ProjectName $newProjectName -Name 'testing123' | Should -Not -Be $null + } + + It 'Remove-VSTeam should delete the team' { + Remove-VSTeam -ProjectName $newProjectName -Name 'testing123' -Force + Get-VSTeam -ProjectName $newProjectName | Where-Object { $_.Name -eq 'testing123' } | Should -Be $null + } + } + + Context 'VSTeamAccessControlList' -Skip:$skippedOnTFS { + It 'Get-VSTeamAccessControlList should return without error' { + $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList) | Should -Not -Be $null + } + + It 'Get-VSTeamAccessControlList -IncludeExtendedInfo should return without error' { + $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList -IncludeExtendedInfo) | Should -Not -Be $null + } + } + + Context 'VSTeamAgent' { + BeforeAll { + if ($acct -like "http://*") { + $pool = (Get-VSTeamPool)[0] + } + else { + # Grabbing the first hosted pool on VSTS. Skipping index 0 which is + # default and is empty on some accounts + $pool = (Get-VSTeamPool)[1] + } + + $agent = (Get-VSTeamAgent -PoolId $pool.Id)[0] + } + + It 'Get-VSTeamAgent Should return agents' { + ## Act + $actual = (Get-VSTeamAgent -PoolId $pool.Id)[0] + + $actual | Should -Not -Be $null + $actual.Enabled | Should -Be $true + } + + It 'Disable-VSTeamAgent Should disable agent' { + ## Act + Disable-VSTeamAgent -PoolId $pool.Id -Id $agent.AgentId -Force + + ## Assert + (Get-VSTeamAgent -PoolId $pool.Id)[0].Enabled | Should -Be $false + } + + It 'Enable-VSTeamAgent Should enable agent' { + ## Act + Enable-VSTeamAgent -PoolId $pool.Id -Id $agent.AgentId + + ## Assert + (Get-VSTeamAgent -PoolId $pool.Id)[0].Enabled | Should -Be $true + } + } + + Context 'VSTeamArea' { + BeforeAll { + # Everytime you run the test a new "$newProjectName" is generated. + # This is fine if you are running all the tests but not if you just + # want to run these. So if the newProjectName can't be found in the + # target system change newProjectName to equal the name of the project + # found with the correct description. + $newProjectName = Get-ProjectName + + $global:reClassifyId = (Get-VSTeamArea -ProjectName $newProjectName).Id + } + + It 'Add-VSTeamArea Should return add iteration' { + $actual = Add-VSTeamArea -ProjectName $newProjectName -Name 'UnitTest' + + $actual | Should -Not -Be $null + $global:areaId = $actual.Id + } + + It 'Get-VSTeamArea Should return one iteration' { + $actual = Get-VSTeamArea -ProjectName $newProjectName -Depth 1 + + $actual | Should -Not -Be $null + $actual.count | Should -Be 1 + $actual.Children | Should -Not -Be $null + } + + # There is a bug in TFS 2017 where this will return all classification nodes + # if you pass in ids + It 'Get-VSTeamArea by id Should return one iteration' -Skip:$skip2017Bugs { + $actual = Get-VSTeamArea -ProjectName $newProjectName -Id $global:areaId + + $actual | Should -Not -Be $null + $actual.count | Should -Be 1 + } + + It 'Remove-VSTeamArea should remove iteration' -Skip:$skip2017Bugs { + Remove-VSTeamArea -ProjectName $newProjectName ` + -ReClassifyId $global:reClassifyId ` + -Path 'UnitTest' ` + -Force + + $(Get-VSTeamArea -ProjectName $newProjectName -Depth 1).Children | Should -Be $null } } - Context 'BuildDefinition full exercise' -Tag "BuildDefinition" { + Context 'VSTeamBuildDefinition' -Tag "BuildDefinition" { BeforeAll { # Everytime you run the test a new "$newProjectName" is generated. # This is fine if you are running all the tests but not if you just @@ -97,7 +206,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $defaultQueue = Get-VSTeamQueue -ProjectName $newProjectName | Where-Object { $_.poolName -eq "Hosted" } } - $srcBuildDef = Get-Content "$PSScriptRoot\sampleFiles\010_builddef_1.json" -Raw | ConvertFrom-Json + $srcBuildDef = Open-SampleFile '010_builddef_1.json' $srcBuildDef.project.id = $project.Id $srcBuildDef.queue.id = $defaultQueue.Id $srcBuildDef.repository.id = $repo.Id @@ -105,7 +214,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $tmpBuildDef1 = (New-TemporaryFile).FullName $srcBuildDef | ConvertTo-Json -Depth 10 | Set-Content -Path $tmpBuildDef1 - $srcBuildDef = Get-Content "$PSScriptRoot\sampleFiles\010_builddef_2.json" -Raw | ConvertFrom-Json + $srcBuildDef = Open-SampleFile '010_builddef_2.json' $srcBuildDef.project.id = $project.Id $srcBuildDef.queue.id = $defaultQueue.Id $srcBuildDef.repository.id = $repo.Id @@ -130,12 +239,6 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $buildDefs.Count | Should -Be 2 } - It 'Get-VSTeamBuildDefinition by Type "build" should return 2 build definitions' { - Mock Write-Warning - $buildDefs = Get-VSTeamBuildDefinition -ProjectName $newProjectName -Type build - $buildDefs.Count | Should -Be 2 - } - It 'Get-VSTeamBuildDefinition by Id should return intended attribute values for 1st build definition' -Skip:$skippedOnTFS { $buildDefId = (Get-VSTeamBuildDefinition -ProjectName $newProjectName | Where-Object { $_.Name -eq $($newProjectName + "-CI1") }).Id $buildDefId | Should -Not -Be $null @@ -160,7 +263,82 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'ReleaseDefinition full exercise' -Skip:$skipReleaseDefs { + Context 'VSTeamIteration' { + BeforeAll { + # Everytime you run the test a new "$newProjectName" is generated. + # This is fine if you are running all the tests but not if you just + # want to run these. So if the newProjectName can't be found in the + # target system change newProjectName to equal the name of the project + # found with the correct description. + $newProjectName = Get-ProjectName + + $global:reClassifyId = (Get-VSTeamIteration -ProjectName $newProjectName).Id + } + + It 'Add-VSTeamIteration Should return add iteration' { + $actual = Add-VSTeamIteration -ProjectName $newProjectName -Name 'UnitTest' + + $actual | Should -Not -Be $null + $global:iterationId = $actual.Id + } + + It 'Get-VSTeamIteration Should return one iteration' { + $actual = Get-VSTeamIteration -ProjectName $newProjectName -Depth 1 + + $actual | Should -Not -Be $null + $actual.count | Should -Be 1 -Because 'Count: Only top should be returned' + $actual.Children | Should -Not -Be $null + $($(Get-VSTeamIteration -ProjectName $newProjectName -Depth 1).Children | Measure-Object).Count | Should -Be 7 + } + + # There is a bug in TFS 2017 where this will return all classification nodes + # if you pass in ids + It 'Get-VSTeamIteration by id Should return one iteration' -Skip:$skip2017Bugs { + $actual = Get-VSTeamIteration -ProjectName $newProjectName -Id $global:iterationId + + $actual | Should -Not -Be $null + $actual.count | Should -Be 1 + } + + It 'Remove-VSTeamIteration should remove iteration' -Skip:$skip2017Bugs { + Remove-VSTeamIteration -ProjectName $newProjectName ` + -ReClassifyId $global:reClassifyId ` + -Path 'UnitTest' ` + -Force + + $($(Get-VSTeamIteration -ProjectName $newProjectName -Depth 1).Children | Measure-Object).Count | Should -Be 6 + } + } + + Context 'VSTeamGitRepository' -Tag "Git" { + BeforeAll { + # Everytime you run the test a new "$newProjectName" is generated. + # This is fine if you are running all the tests but not if you just + # want to run these. So if the newProjectName can't be found in the + # target system change newProjectName to equal the name of the project + # found with the correct description. + $newProjectName = Get-ProjectName + } + + It 'Get-VSTeamGitRepository Should return repository' { + Get-VSTeamGitRepository -ProjectName $newProjectName | Select-Object -ExpandProperty Name | Should -Be $newProjectName + } + + 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 + } + } + + Context 'VSTeamReleaseDefinition' -Skip:$skipReleaseDefs { BeforeAll { # Everytime you run the test a new "$newProjectName" is generated. # This is fine if you are running all the tests but not if you just @@ -176,7 +354,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { $defaultQueue = Get-VSTeamQueue -ProjectName $newProjectName | Where-Object { $_.poolName -eq "Hosted" } } - $srcReleaseDef = Get-Content "$PSScriptRoot\sampleFiles\010_releasedef_1.json" -Raw | ConvertFrom-Json + $srcReleaseDef = Open-SampleFile '010_releasedef_1.json' $srcReleaseDef.name = "$newProjectName-CD1" $srcReleaseDef.environments[0].deployPhases[0].deploymentInput.queueId = $defaultQueue.Id $tmpReleaseDef1 = (New-TemporaryFile).FullName @@ -184,7 +362,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { Add-VSTeamReleaseDefinition -ProjectName $newProjectName -InFile $tmpReleaseDef1 - $srcReleaseDef = Get-Content "$PSScriptRoot\sampleFiles\010_releasedef_2.json" -Raw | ConvertFrom-Json + $srcReleaseDef = Open-SampleFile '010_releasedef_2.json' $srcReleaseDef.name = "$newProjectName-CD2" $srcReleaseDef.environments[0].deployPhases[0].deploymentInput.queueId = $defaultQueue.Id $tmpReleaseDef2 = (New-TemporaryFile).FullName @@ -221,7 +399,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'WorkItem full exercise' { + Context 'VSTeamWorkItem' { BeforeAll { # Everytime you run the test a new "$newProjectName" is generated. # This is fine if you are running all the tests but not if you just @@ -253,7 +431,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Pool full exercise' { + Context 'VSTeamPool' { It 'Get-VSTeamPool Should return agent pools' { $actual = Get-VSTeamPool @@ -267,23 +445,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Agent full exercise' { - It 'Get-VSTeamAgent Should return agents' { - if ($acct -like "http://*") { - $pool = (Get-VSTeamPool)[0] - } - else { - # Grabbing the first hosted pool on VSTS. Skipping index 0 which is - # default and is empty on some accounts - $pool = (Get-VSTeamPool)[1] - } - $actual = Get-VSTeamAgent -PoolId $pool.Id - - $actual | Should -Not -Be $null - } - } - - Context 'Queue full exercise' { + Context 'VSTeamQueue' { BeforeAll { # Everytime you run the test a new "$newProjectName" is generated. # This is fine if you are running all the tests but not if you just @@ -313,13 +475,13 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Get Service Endpoint types' { + Context 'VSTeamServiceEndpointType' { It 'Get-VSTeamServiceEndpointType' { Get-VSTeamServiceEndpointType | Should -Not -Be $null } } - Context 'Get Work Item Types' -Tag "WorkItemType" { + Context 'VSTeamWorkItemType' -Tag "WorkItemType" { BeforeAll { # Everytime you run the test a new "$newProjectName" is generated. # This is fine if you are running all the tests but not if you just @@ -470,7 +632,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Service Endpoints full exercise' { + Context 'VSTeamServiceEndpoint' { BeforeAll { $newProjectName = Get-ProjectName } @@ -493,7 +655,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Users exercise' -Skip:$skippedOnTFS { + Context 'VSTeamUserEntitlement' -Skip:$skippedOnTFS { It 'Get-VSTeamUserEntitlement Should return all users' { Get-VSTeamUserEntitlement | Should -Not -Be $null @@ -529,7 +691,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Feed exercise' -Tag 'Feed' -Skip:$skippedOnTFS { + Context 'VSTeamFeed' -Tag 'Feed' -Skip:$skippedOnTFS { BeforeAll { $FeedName = 'TeamModuleIntegration' + [guid]::NewGuid().toString().substring(0, 5) } @@ -558,58 +720,7 @@ Describe 'VSTeam Integration Tests' -Tag 'integration' { } } - Context 'Access control list' -Skip:$skippedOnTFS { - It 'Get-VSTeamAccessControlList should return without error' { - $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList) | Should -Not -Be $null - } - - It 'Get-VSTeamAccessControlList -IncludeExtendedInfo should return without error' { - $(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList -IncludeExtendedInfo) | Should -Not -Be $null - } - } - - Context 'Teams full exercise' { - BeforeAll { - # Everytime you run the test a new "$newProjectName" is generated. - # This is fine if you are running all the tests but not if you just - # want to run these. So if the newProjectName can't be found in the - # target system change newProjectName to equal the name of the project - # found with the correct description. - $newProjectName = Get-ProjectName - - $global:id = (Get-VSTeam -ProjectName $newProjectName).Id - } - - - It 'Get-VSTeam ByName Should return Teams' { - Get-VSTeam -ProjectName $newProjectName -Name "$newProjectName Team" | Should -Not -Be $null - } - - It 'Get-VSTeam ById Should return Teams' { - Get-VSTeam -ProjectName $newProjectName -Id $global:id | Should -Not -Be $null - } - - It 'Get-VSTeamMembers Should return TeamMembers' { - Get-VSTeamMember -ProjectName $newProjectName -TeamId $global:id | Should -Not -Be $null - } - - It 'Add-VSTeam should add a team' { - Add-VSTeam -ProjectName $newProjectName -Name 'testing' | Should -Not -Be $null - (Get-VSTeam -ProjectName $newProjectName).Count | Should -Be 2 - } - - It 'Update-VSTeam should update a team' { - Update-VSTeam -ProjectName $newProjectName -Name 'testing' -NewTeamName 'testing123' - Get-VSTeam -ProjectName $newProjectName -Name 'testing123' | Should -Not -Be $null - } - - It 'Remove-VSTeam should delete the team' { - Remove-VSTeam -ProjectName $newProjectName -Name 'testing123' -Force - Get-VSTeam -ProjectName $newProjectName | Where-Object { $_.Name -eq 'testing123' } | Should -Be $null - } - } - - Context 'Team full exercise' { + Context 'VSTeamAPIVersion' { BeforeAll { # Everytime you run the test a new "$newProjectName" is generated. # This is fine if you are running all the tests but not if you just diff --git a/Tests/integration/tests/020_.psDrive.Tests.ps1 b/Tests/integration/tests/020_.psDrive.Tests.ps1 new file mode 100644 index 000000000..d8e28424b --- /dev/null +++ b/Tests/integration/tests/020_.psDrive.Tests.ps1 @@ -0,0 +1,107 @@ +$global:skippedOnTFS = ($env:ACCT -like "http://*") + +Describe "PS Drive Full exercise" { + BeforeAll { + . "$PSScriptRoot/_testInitialize.ps1" + + Write-Verbose " SkippedOnTFS: $($global:skippedOnTFS)" + + Set-TestPrep + $target = Set-Project + + $originalLocation = Get-Location + } + + Context 'PS Drive full exercise' { + BeforeAll { + New-PSDrive -Name int -PSProvider SHiPS -Root 'VSTeam#vsteam_lib.Provider.Account' + $actual = Set-Location int: -PassThru + } + + It 'Should be able to mount drive' { + $actual | Should -Not -Be $null + } + + It "ItName" { + $actual = Get-ChildItem | Out-string + $lines = $actual -split "`n" + # Now you can test line by line + } + + It 'Should list Agent Pools' { + Push-Location + Set-Location 'Agent Pools' + $items = Get-ChildItem + Pop-Location + + $items | Should -Not -Be $null + } + + It 'Should list Extensions' { + Push-Location + Set-Location 'Extensions' + $items = Get-ChildItem + Pop-Location + + $items | Should -Not -Be $null + } + + # The point of this tests is to make sure no exceptions + # are thrown when calling Get-ChildItem + It 'Should list Feeds' -Skip:$skippedOnTFS { + Push-Location + Set-Location 'Feeds' + $items = Get-ChildItem + Pop-Location + + # There are no feeds on this account + $items | Should -Be $null + } + + It 'Should list projects' { + $projects = Get-ChildItem + $projects | Should -Not -Be $null + } + + It 'Should list Builds, Releases and Teams under project' { + Set-Location $target.Name + $projectChildren = Get-ChildItem + Start-Sleep -Seconds 2 + $projectChildren | Should -Not -Be $null + } + + It 'Should list Queues' { + Push-Location + Set-Location 'Queues' + $items = Get-ChildItem + Pop-Location + + $items | Should -Not -Be $null + } + + It 'Should list Repositories' { + Push-Location + Set-Location 'Repositories' + $repos = Get-ChildItem + Pop-Location + + $repos | Should -Not -Be $null + } + + It 'Should list Teams' { + Push-Location + Start-Sleep -Seconds 2 + Set-Location 'Teams' + Start-Sleep -Seconds 2 + $teamsChildren = Get-ChildItem + Pop-Location + + $teamsChildren | Should -Not -Be $null + } + } + + AfterAll { + # Put everything back + Set-Location $originalLocation + } +} \ No newline at end of file diff --git a/Tests/integration/tests/040_Format.Tests.ps1 b/Tests/integration/tests/040_Format.Tests.ps1 new file mode 100644 index 000000000..33d2aa145 --- /dev/null +++ b/Tests/integration/tests/040_Format.Tests.ps1 @@ -0,0 +1,133 @@ +# Formats play a very important role in VSTeam. Many types define formats for list and table. +# If the type is returned from a function and the provider it needs two different table formats. +# These tests are to ensure that the correct formats are used depending on if the type was returned +# by a function or a Get-ChildItem call to the provider. All the types returned from a provider +# should have 'Provider' in the type name. For example Get-VSTeamJobRequest returns a type of +# vsteam_lib.JobRequest. However, when executed via the provider the type returned is +# vsteam_lib.Provider.JobRequest. The type name is how the formats are selected. +Set-StrictMode -Version Latest + +Describe 'Table Formats for Provider classes' -Tag 'integration' { + BeforeAll { + . "$PSScriptRoot/_testInitialize.ps1" + + Set-TestPrep -skipEnvCheck + + function Get-Columns { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true, Position = 0)] + [string] $typeName + ) + + $gfd = Get-FormatData -TypeName $typeName + $cols = $gfd | Select-Object @{n = 'cols'; e = { $_.FormatViewDefinition.Control.Headers.Label } } | Select-Object -ExpandProperty cols + + return $cols + } + } + + Context 'Agent' { + # This is the formatter when returned from the provider + It 'vsteam_lib.Provider.Agent should have mode' { + $cols = Get-Columns -TypeName vsteam_lib.Provider.Agent + + $cols[0] | Should -Be 'Mode' + } + + # This is the formatter when returned from a function + It 'vsteam_lib.Agent should have name' { + $cols = Get-Columns -TypeName vsteam_lib.Agent + + $cols[0] | Should -Be 'Name' + } + } + + Context 'AgentPool' { + # This is the formatter when returned from the provider + It 'vsteam_lib.Provider.AgentPool should have mode' { + $cols = Get-Columns -TypeName vsteam_lib.Provider.AgentPool + + $cols[0] | Should -Be 'Mode' + } + + # This is the formatter when returned from a function + It 'vsteam_lib.AgentPool should have name' { + $cols = Get-Columns -TypeName vsteam_lib.AgentPool + + $cols[0] | Should -Be 'Name' + } + } + + Context 'Build' { + # This is the formatter when returned from the provider + It 'vsteam_lib.Provider.Build should have mode' { + $cols = Get-Columns -TypeName vsteam_lib.Provider.Build + + $cols[0] | Should -Be 'Mode' + $cols[1] | Should -Be 'Name' + $cols[2] | Should -Be 'Result' + } + + # This is the formatter when returned from a function + It 'vsteam_lib.Build should have name' { + $cols = Get-Columns -TypeName vsteam_lib.Build + + $cols[0] | Should -Be 'Definition' + $cols[1] | Should -Be 'Build Number' + $cols[2] | Should -Be 'Result' + } + } + + # Defined in vsteam_lib.PSDrive.Default.TableView.ps1xml + # Covers Feeds, Extensions, Agent Pools and other top level + # nodes that don't map to Azure DevOps types. + Context 'Directory' { + # This is the formatter when returned from the provider + It 'vsteam_lib.Provider.Directory should have mode' { + $cols = Get-Columns -TypeName vsteam_lib.Provider.Directory + + $cols[0] | Should -Be 'Mode' + } + } + + Context 'JobRequest' { + # This is the formatter when returned from the provider + It 'vsteam_lib.Provider.JobRequest should have mode' { + $cols = Get-Columns -TypeName vsteam_lib.Provider.JobRequest + + $cols[0] | Should -Be 'Mode' + } + + # This is the formatter when returned from a function + It 'vsteam_lib.JobRequest should have name' { + $cols = Get-Columns -TypeName vsteam_lib.JobRequest + + $cols[0] | Should -Be 'Name' + } + } + + Context 'Build Definitions' { + It 'vsteam_lib.Provider.BuildDefinitions should have mode' { + $cols = Get-Columns -TypeName vsteam_lib.Provider.BuildDefinitions + + $cols[0] | Should -Be 'Mode' + } + } + + Context 'Release Definitions' { + # This is the formatter when returned from the provider + It 'vsteam_lib.Provider.JobRequest should have mode' { + $cols = Get-Columns -TypeName vsteam_lib.Provider.JobRequest + + $cols[0] | Should -Be 'Mode' + } + + # This is the formatter when returned from a function + It 'vsteam_lib.JobRequest should have name' { + $cols = Get-Columns -TypeName vsteam_lib.JobRequest + + $cols[0] | Should -Be 'Name' + } + } +} \ No newline at end of file diff --git a/integration/test/999_VSTeam-RemoveProject.Tests.ps1 b/Tests/integration/tests/999_VSTeam-RemoveProject.Tests.ps1 similarity index 93% rename from integration/test/999_VSTeam-RemoveProject.Tests.ps1 rename to Tests/integration/tests/999_VSTeam-RemoveProject.Tests.ps1 index 423573f65..447057dd9 100644 --- a/integration/test/999_VSTeam-RemoveProject.Tests.ps1 +++ b/Tests/integration/tests/999_VSTeam-RemoveProject.Tests.ps1 @@ -1,6 +1,6 @@ Describe "VSTeamProject" { BeforeAll { - . "$PSScriptRoot/testprep.ps1" + . "$PSScriptRoot/_testInitialize.ps1" Set-TestPrep diff --git a/Tests/integration/tests/_testInitialize.ps1 b/Tests/integration/tests/_testInitialize.ps1 new file mode 100644 index 000000000..9e39e7f8d --- /dev/null +++ b/Tests/integration/tests/_testInitialize.ps1 @@ -0,0 +1,85 @@ +$sampleFiles = "$PSScriptRoot/../../SampleFiles" + +function Set-TestPrep { + [CmdletBinding()] + param( + [switch] $skipEnvCheck + ) + # Module must be loaded + if (-not (Get-Module VSTeam)) { + Write-Verbose " Importing: module" + Import-Module "$PSScriptRoot\..\..\..\dist\VSTeam.psd1" + } + + if (-not $skipEnvCheck.IsPresent) { + if ($null -eq $env:ACCT -or + $null -eq $env:API_VERSION -or + $null -eq $env:PAT -or + $null -eq $env:EMAIL) { + throw "You must set all environment variables that are needed first to run integration tests. Please see https://github.com/DarqueWarrior/vsteam/blob/master/.github/CONTRIBUTING.md#running-integration-tests for details." + } + + Write-Verbose " Target: $($env:ACCT)" + Write-Verbose " Version: $($env:API_VERSION)" + + Set-VSTeamAccount -Account $env:ACCT -PersonalAccessToken $env:PAT -Version $env:API_VERSION + } +} + +function Set-Project { + $projectName = 'TeamModuleIntegration-' + [guid]::NewGuid().toString().substring(0, 5) + $projectDescription = 'Project for VSTeam integration testing.' + + # This will search for a project with the description of our test projects + # if it finds one it will reuse that project instead of creating a new project. + # This makes debuging tests easier and faster. + $existingProject = $(Get-VSTeamProject | Where-Object Description -eq $projectDescription) + + if ($existingProject) { + Write-Verbose " Found Project: $($existingProject.Name)" + $projectName = $existingProject.Name + } + else { + Write-Verbose " Creating Project: $projectName" + Add-VSTeamProject -Name $projectName -Description $projectDescription | Should -Not -Be $null + Start-Sleep -Seconds 5 + } + + $target = @{ + Name = $projectName + Description = $projectDescription + NewName = $projectName + [guid]::NewGuid().toString().substring(0, 5) + '1' + } + + Write-Verbose " Project Name: $($target.Name)" + Write-Verbose " Project Desc: $($target.Description)" + Write-Verbose " Project NewName: $($target.NewName)" + + return $target +} + +function Get-ProjectName { + # Everytime you run the test a new "$newProjectName" is generated. + # This is fine if you are running all the tests but not if you just + # want to run these. So if the newProjectName can't be found in the + # target system change newProjectName to equal the name of the project + # found with the correct description. + $projectDescription = 'Project for VSTeam integration testing.' + + return ($(Get-VSTeamProject | Where-Object Description -eq $projectDescription)).Name +} + +function Open-SampleFile { + param( + [Parameter(Mandatory = $true, Position = 0)] + [string] $file, + [switch] $ReturnValue + ) + + if ($ReturnValue.IsPresent) { + return $(Get-Content "$sampleFiles\$file" -Raw | ConvertFrom-Json).value + } + else { + return $(Get-Content "$sampleFiles\$file" -Raw | ConvertFrom-Json) + } +} \ No newline at end of file diff --git a/Tests/library/Attribute/ProcessTemplateValidateAttributeTests.cs b/Tests/library/Attribute/ProcessTemplateValidateAttributeTests.cs new file mode 100644 index 000000000..4cd305963 --- /dev/null +++ b/Tests/library/Attribute/ProcessTemplateValidateAttributeTests.cs @@ -0,0 +1,79 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; + +namespace vsteam_lib.Test +{ + /// + /// This test derives from ProcessTemplateValidateAttribute to gain access + /// to the protected method we need to test. + /// + [TestClass] + [ExcludeFromCodeCoverage] + public sealed class ProcessTemplateValidateAttributeTests : ProcessTemplateValidateAttribute + { + private readonly Collection _empty = new Collection(); + private readonly Collection _templates = new Collection() { "Agile", "Basic", "CMMI", "Scrum", "Scrum with spaces" }; + + [TestMethod] + public void ProcessTemplateValidateAttribute_Invalid_Value_Throws() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._templates); + ProcessTemplateCache.Cache.Shell = ps; + ProcessTemplateCache.Invalidate(); + + // Act + // Assert + Assert.ThrowsException(() => this.Validate("Test", null)); + } + + [TestMethod] + public void ProcessTemplateValidateAttribute_Valid_Value_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._templates); + ProcessTemplateCache.Cache.Shell = ps; + ProcessTemplateCache.Invalidate(); + + // Act + this.Validate("Basic", null); + + // Assert + } + + [TestMethod] + public void ProcessTemplateValidateAttribute_Null_Value_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._templates); + ProcessTemplateCache.Cache.Shell = ps; + ProcessTemplateCache.Invalidate(); + + // Act + this.Validate(null, null); + + // Assert + } + + [TestMethod] + public void ProcessTemplateValidateAttribute_Empty_Cache_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._empty); + ProcessTemplateCache.Cache.Shell = ps; + ProcessTemplateCache.Invalidate(); + + // Act + this.Validate("Agile", null); + + // Assert + } + } +} diff --git a/Tests/library/Attribute/ProjectValidateAttributeTests.cs b/Tests/library/Attribute/ProjectValidateAttributeTests.cs new file mode 100644 index 000000000..d7f7fc888 --- /dev/null +++ b/Tests/library/Attribute/ProjectValidateAttributeTests.cs @@ -0,0 +1,99 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; + +namespace vsteam_lib.Test +{ + /// + /// This test derives from ProjectValidateAttribute to gain access + /// to the protected method we need to test. + /// + [TestClass] + [ExcludeFromCodeCoverage] + public sealed class ProjectValidateAttributeTests : ProjectValidateAttribute + { + public ProjectValidateAttributeTests() : base(false) + { + + } + + private readonly Collection _empty = new Collection(); + private readonly Collection _values = new Collection() { "Project1", "Project2", "Project3", "Project4", "Project 5" }; + + [TestMethod] + public void ProjectValidateAttribute_Invalid_Value_Throws() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._values); + ProjectCache.Cache.Shell = ps; + ProjectCache.Invalidate(); + + // Act + // Assert + Assert.ThrowsException(() => this.Validate("Test", null)); + } + + [TestMethod] + public void ProjectValidateAttribute_Valid_Value_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._values); + ProjectCache.Cache.Shell = ps; + ProjectCache.Invalidate(); + + // Act + this.Validate("Project2", null); + + // Assert + } + + [TestMethod] + public void ProjectValidateAttribute_Valid_Value_Wrong_Case_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._values); + ProjectCache.Cache.Shell = ps; + ProjectCache.Invalidate(); + + // Act + this.Validate("project2", null); + + // Assert + } + + [TestMethod] + public void ProjectValidateAttribute_Null_Value_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._values); + ProjectCache.Cache.Shell = ps; + ProjectCache.Invalidate(); + + // Act + this.Validate(null, null); + + // Assert + } + + [TestMethod] + public void ProjectValidateAttribute_Empty_Cache_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._empty); + ProjectCache.Cache.Shell = ps; + ProjectCache.Invalidate(); + + // Act + this.Validate("Project1", null); + + // Assert + } + } +} diff --git a/Tests/library/Attribute/QueryTransformToIDAttributeTests.cs b/Tests/library/Attribute/QueryTransformToIDAttributeTests.cs new file mode 100644 index 000000000..263cff609 --- /dev/null +++ b/Tests/library/Attribute/QueryTransformToIDAttributeTests.cs @@ -0,0 +1,52 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class QueryTransformToIDAttributeTests + { + [TestMethod] + public void QueryTransformToIDAttribute_Null() + { + // Arrange + string expected = null; + var target = new QueryTransformToIDAttribute(); + + // Act + var actual = target.Transform(null, null); + + // Assert + Assert.AreEqual(expected, actual); + } + + [TestMethod] + public void QueryTransformToIDAttribute_ID_Not_Found() + { + // Arrange + string expected = "UnitTest"; + var target = new QueryTransformToIDAttribute(); + + // Act + var actual = target.Transform(null, "UnitTest"); + + // Assert + Assert.AreEqual(expected, actual); + } + + [TestMethod] + public void QueryTransformToIDAttribute_GUID_Passed_In() + { + // Arrange + string expected = "24a9d798-5ad3-4130-840d-1368f2103cdb"; + var target = new QueryTransformToIDAttribute(); + + // Act + var actual = target.Transform(null, "24a9d798-5ad3-4130-840d-1368f2103cdb"); + + // Assert + Assert.AreEqual(expected, actual); + } + } +} diff --git a/Tests/library/Attribute/WorkItemTypeValidateAttributeTests.cs b/Tests/library/Attribute/WorkItemTypeValidateAttributeTests.cs new file mode 100644 index 000000000..ebd1ef581 --- /dev/null +++ b/Tests/library/Attribute/WorkItemTypeValidateAttributeTests.cs @@ -0,0 +1,80 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; + +namespace vsteam_lib.Test +{ + /// + /// This test derives from WorkItemTypeValidateAttribute to gain access + /// to the protected method we need to test. + /// + [TestClass] + [ExcludeFromCodeCoverage] + public sealed class WorkItemTypeValidateAttributeTests : WorkItemTypeValidateAttribute + { + private readonly Collection _emptyStrings = new Collection(); + private readonly Collection _defaultProject = new Collection() { "UnitTestProject" }; + private readonly Collection _workItemTypes = new Collection() { "Bug", "Task", "Issue", "Feature", "User Story" }; + + [TestMethod] + public void WorkItemTypeValidateAttribute_Invalid_Value_Throws() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._defaultProject, this._workItemTypes); + WorkItemTypeCache.Cache.Shell = ps; + WorkItemTypeCache.Invalidate(); + + // Act + // Assert + Assert.ThrowsException(() => this.Validate("Test", null)); + } + + [TestMethod] + public void WorkItemTypeValidateAttribute_Valid_Value_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._defaultProject, this._workItemTypes); + WorkItemTypeCache.Cache.Shell = ps; + WorkItemTypeCache.Invalidate(); + + // Act + this.Validate("Task", null); + + // Assert + } + + [TestMethod] + public void WorkItemTypeValidateAttribute_Null_Value_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._defaultProject, this._workItemTypes); + WorkItemTypeCache.Cache.Shell = ps; + WorkItemTypeCache.Invalidate(); + + // Act + this.Validate(null, null); + + // Assert + } + + [TestMethod] + public void WorkItemTypeValidateAttribute_Empty_Cache_Does_Not_Throw() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._defaultProject, this._emptyStrings); + WorkItemTypeCache.Cache.Shell = ps; + WorkItemTypeCache.Invalidate(); + + // Act + this.Validate("Agile", null); + + // Assert + } + } +} diff --git a/Tests/library/BaseTests.cs b/Tests/library/BaseTests.cs new file mode 100644 index 000000000..143421736 --- /dev/null +++ b/Tests/library/BaseTests.cs @@ -0,0 +1,39 @@ +using NSubstitute; +using NSubstitute.Extensions; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Management.Automation.Abstractions; + +namespace vsteam_lib.Test +{ + [ExcludeFromCodeCoverage] + internal class BaseTests + { + internal static IPowerShell PrepPowerShell() + { + var ps = Substitute.For(); + ps.ReturnsForAll(ps); + ps.Commands.Returns(new PSCommand()); + return ps; + } + + internal static Collection LoadJson(string file, bool selectValue = true) + { + var fullPath = $"../../../../SampleFiles/{file}"; + var contents = System.IO.File.ReadAllText(fullPath); + + var cmdlet = PowerShell.Create().AddCommand("ConvertFrom-Json") + .AddParameter("InputObject", contents) + .AddParameter("Depth", 100); + + if (selectValue) + { + cmdlet.AddCommand("Select-Object") + .AddParameter("ExpandProperty", "value"); + } + + return cmdlet.Invoke(); + } + } +} diff --git a/Tests/library/Cache/ProcessTemplateCacheTests.cs b/Tests/library/Cache/ProcessTemplateCacheTests.cs new file mode 100644 index 000000000..f94ffed57 --- /dev/null +++ b/Tests/library/Cache/ProcessTemplateCacheTests.cs @@ -0,0 +1,98 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ProcessTemplateCacheTests + { + private readonly Collection _items = new Collection() { "Agile", "Basic", "CMMI", "Scrum", "Scrum with spaces" }; + + [TestMethod] + public void ProcessTemplateCache_HasCacheExpired() + { + // Arrange + var expected = true; + + // Act + ProcessTemplateCache.Invalidate(); + + // Assert + Assert.AreEqual(expected, ProcessTemplateCache.HasCacheExpired, "Cache should be expired"); + + // Act + ProcessTemplateCache.Update(new List()); + + // Assert + Assert.AreNotEqual(expected, ProcessTemplateCache.HasCacheExpired, "Cache should not be expired"); + } + + [TestMethod] + public void ProcessTemplateCache_Update_With_Null_List() + { + // Arrange + var expected = 5; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._items); + ProcessTemplateCache.Cache.Shell = ps; + + // Act + ProcessTemplateCache.Update(null); + + // Assert + Assert.AreEqual(expected, ProcessTemplateCache.Cache.Values.Count); + } + + [TestMethod] + public void ProcessTemplateCache_GetCurrent() + { + // Arrange + var expected = 5; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._items); + ProcessTemplateCache.Cache.Shell = ps; + ProcessTemplateCache.Invalidate(); + + // Act + var actual = ProcessTemplateCache.GetCurrent(); + + // Assert + Assert.AreEqual(expected, actual.Count()); + } + + [TestMethod] + public void ProcessTemplateCache_Update_Returns_Null() + { + // Arrange + var expected = 0; + var ps = BaseTests.PrepPowerShell(); + ProcessTemplateCache.Cache.Shell = ps; + + // Act + ProcessTemplateCache.Update(null); + + // Assert + Assert.AreEqual(expected, ProcessTemplateCache.Cache.Values.Count); + } + + [TestMethod] + public void ProcessTemplateCache_Update_With_Empty_List() + { + // Arrange + var expected = 0; + var ps = BaseTests.PrepPowerShell(); + ProcessTemplateCache.Cache.Shell = ps; + + // Act + ProcessTemplateCache.Update(new List()); + + // Assert + Assert.AreEqual(expected, ProcessTemplateCache.Cache.Values.Count); + } + } +} diff --git a/Tests/library/Cache/ProjectCacheTests.cs b/Tests/library/Cache/ProjectCacheTests.cs new file mode 100644 index 000000000..9386e2b68 --- /dev/null +++ b/Tests/library/Cache/ProjectCacheTests.cs @@ -0,0 +1,98 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ProjectCacheTests + { + private readonly Collection _templates = new Collection() { "Project1", "Project 2" }; + + [TestMethod] + public void ProjectCache_HasCacheExpired() + { + // Arrange + var expected = true; + + // Act + ProjectCache.Invalidate(); + + // Assert + Assert.AreEqual(expected, ProjectCache.HasCacheExpired, "Cache should be expired"); + + // Act + ProjectCache.Update(new List()); + + // Assert + Assert.AreNotEqual(expected, ProjectCache.HasCacheExpired, "Cache should not be expired"); + } + + [TestMethod] + public void ProjectCache_Update_With_Null_List() + { + // Arrange + var expected = 2; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._templates); + ProjectCache.Cache.Shell = ps; + + // Act + ProjectCache.Update(null); + + // Assert + Assert.AreEqual(expected, ProjectCache.Cache.Values.Count); + } + + [TestMethod] + public void ProjectCache_GetCurrent() + { + // Arrange + var expected = 2; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._templates); + ProjectCache.Cache.Shell = ps; + ProjectCache.Invalidate(); + + // Act + var actual = ProjectCache.GetCurrent(false); + + // Assert + Assert.AreEqual(expected, actual.Count()); + } + + [TestMethod] + public void ProjectCache_Update_Returns_Null() + { + // Arrange + var expected = 0; + var ps = BaseTests.PrepPowerShell(); + ProjectCache.Cache.Shell = ps; + + // Act + ProjectCache.Update(null); + + // Assert + Assert.AreEqual(expected, ProjectCache.Cache.Values.Count); + } + + [TestMethod] + public void ProjectCache_Update_With_Empty_List() + { + // Arrange + var expected = 0; + var ps = BaseTests.PrepPowerShell(); + ProjectCache.Cache.Shell = ps; + + // Act + ProjectCache.Update(new List()); + + // Assert + Assert.AreEqual(expected, ProjectCache.Cache.Values.Count); + } + } +} diff --git a/Tests/library/Cache/QueryCacheTests.cs b/Tests/library/Cache/QueryCacheTests.cs new file mode 100644 index 000000000..a51778c39 --- /dev/null +++ b/Tests/library/Cache/QueryCacheTests.cs @@ -0,0 +1,143 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Management.Automation; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class QueryCacheTests + { + private readonly Collection _empty = new Collection(); + private readonly Collection _emptyStrings = new Collection(); + private readonly Collection _defaultProject = new Collection() { "UnitTestProject" }; + private readonly Collection _queryNames = new Collection() { "Query1", "Query 2" }; + private readonly Collection _queries = new Collection() { PSObject.AsPSObject(new { Name = "Shared Queries", Id = "10000000-1000-1000-1000-100000000000" }), + PSObject.AsPSObject(new { Name = "My Queries", Id = "20000000-2000-2000-2000-200000000000" })}; + + [TestMethod] + public void QueryCache_HasCacheExpired() + { + // Arrange + var expected = true; + + // Act + QueryCache.Invalidate(); + + // Assert + Assert.AreEqual(expected, QueryCache.HasCacheExpired, "Cache should be expired"); + + // Act + QueryCache.Update(new List()); + + // Assert + Assert.AreNotEqual(expected, QueryCache.HasCacheExpired, "Cache should not be expired"); + } + + [TestMethod] + public void QueryCache_Update_With_Null_List() + { + // Arrange + var expected = 2; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._queries); + ps.Invoke().Returns(this._defaultProject, this._queryNames); + QueryCache.Cache.Shell = ps; + + // Act + QueryCache.Update(null); + + // Assert + Assert.AreEqual(expected, QueryCache.Cache.Values.Count); + } + + [TestMethod] + public void QueryCache_GetCurrent() + { + // Arrange + var expected = 2; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._queries); + ps.Invoke().Returns(this._defaultProject, this._queryNames); + QueryCache.Invalidate(); + QueryCache.Cache.Shell = ps; + + // Act + var actual = QueryCache.GetCurrent(); + + // Assert + Assert.AreEqual(expected, actual.Count()); + } + + [TestMethod] + public void QueryCache_Update_Returns_Null() + { + // Arrange + var expected = 0; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._empty); + ps.Invoke().Returns(this._defaultProject, _emptyStrings); + QueryCache.Cache.Shell = ps; + + // Act + QueryCache.Update(null); + + // Assert + Assert.AreEqual(expected, QueryCache.Cache.Values.Count); + } + + [TestMethod] + public void QueryCache_Update_With_Empty_List() + { + // Arrange + var expected = 0; + var ps = BaseTests.PrepPowerShell(); + QueryCache.Cache.Shell = ps; + + // Act + QueryCache.Update(new List()); + + // Assert + Assert.AreEqual(expected, QueryCache.Cache.Values.Count); + } + + [TestMethod] + public void QueryCache_Get_Query_ID() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._queries); + ps.Invoke().Returns(this._defaultProject, this._queryNames); + QueryCache.Cache.Shell = ps; + + var expected = "20000000-2000-2000-2000-200000000000"; + + // Force an update + QueryCache.Update(null); + + // Act + var actual = QueryCache.GetId("My Queries"); + + // Assert + Assert.AreEqual(expected, actual); + } + + [TestMethod] + public void QueryCache_Get_Query_ID_Returns_Name_When_Not_Found() + { + // Arrange + var expected = "My Queries"; + QueryCache.Update(new List()); + + // Act + var actual = QueryCache.GetId("My Queries"); + + // Assert + Assert.AreEqual(expected, actual); + } + } +} diff --git a/Tests/library/Cache/WorkItemTypeCacheTests.cs b/Tests/library/Cache/WorkItemTypeCacheTests.cs new file mode 100644 index 000000000..6caf25bd2 --- /dev/null +++ b/Tests/library/Cache/WorkItemTypeCacheTests.cs @@ -0,0 +1,100 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class WorkItemTypeCacheTests + { + private readonly Collection _emptyStrings = new Collection(); + private readonly Collection _defaultProject = new Collection() { "UnitTestProject" }; + private readonly Collection _workItemTypes = new Collection() { "Bug", "Task", "Issue", "Feature", "User Story" }; + + [TestMethod] + public void WorkItemTypeCache_HasCacheExpired() + { + // Arrange + var expected = true; + + // Act + WorkItemTypeCache.Invalidate(); + + // Assert + Assert.AreEqual(expected, WorkItemTypeCache.HasCacheExpired, "Cache should be expired"); + + // Act + WorkItemTypeCache.Update(new List()); + + // Assert + Assert.AreNotEqual(expected, WorkItemTypeCache.HasCacheExpired, "Cache should not be expired"); + } + + [TestMethod] + public void WorkItemTypeCache_Update_With_Null_List() + { + // Arrange + var expected = 5; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._workItemTypes); + WorkItemTypeCache.Cache.Shell = ps; + + // Act + WorkItemTypeCache.Update(null); + + // Assert + Assert.AreEqual(expected, WorkItemTypeCache.Cache.Values.Count); + } + + [TestMethod] + public void WorkItemTypeCache_GetCurrent() + { + // Arrange + var expected = 5; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._workItemTypes); + WorkItemTypeCache.Cache.Shell = ps; + + // Act + var actual = WorkItemTypeCache.GetCurrent(); + + // Assert + Assert.AreEqual(expected, actual.Count()); + } + + [TestMethod] + public void WorkItemTypeCache_Update_Returns_Null() + { + // Arrange + var expected = 0; + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._defaultProject, _emptyStrings); + WorkItemTypeCache.Cache.Shell = ps; + + // Act + WorkItemTypeCache.Update(null); + + // Assert + Assert.AreEqual(expected, WorkItemTypeCache.Cache.Values.Count); + } + + [TestMethod] + public void WorkItemTypeCache_Update_With_Empty_List() + { + // Arrange + var expected = 0; + var ps = BaseTests.PrepPowerShell(); + WorkItemTypeCache.Cache.Shell = ps; + + // Act + WorkItemTypeCache.Update(new List()); + + // Assert + Assert.AreEqual(expected, WorkItemTypeCache.Cache.Values.Count); + } + } +} diff --git a/Tests/library/CommonTests.cs b/Tests/library/CommonTests.cs new file mode 100644 index 000000000..20c8a85b9 --- /dev/null +++ b/Tests/library/CommonTests.cs @@ -0,0 +1,38 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using System.Xml.Serialization; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class CommonTests + { + private class HasDateTime + { + [XmlAttribute("createdDate")] + public DateTime CreatedOn { get; set; } + } + + private class HasString + { + public string createdDate { get; set; } = "2020-08-27T10:37:32.367Z"; + } + + [TestMethod] + public void MoveProperties_StringToDateTime() + { + // Arrange + var target = new HasDateTime(); + var source = PSObject.AsPSObject(new HasString()); + + // Act + Common.MoveProperties(target, source); + + // Assert + Assert.AreEqual("8/27/2020 10:37:32 AM", target.CreatedOn.ToUniversalTime().ToString()); + } + } +} diff --git a/Tests/library/Completer/BuildCompleterTests.cs b/Tests/library/Completer/BuildCompleterTests.cs new file mode 100644 index 000000000..bfc921c29 --- /dev/null +++ b/Tests/library/Completer/BuildCompleterTests.cs @@ -0,0 +1,120 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class BuildCompleterTests + { + private readonly Collection _empty = new Collection(); + private readonly Collection _builds = new Collection() { "602", "700" }; + private readonly Collection _nullDefaultProject = new Collection() { null }; + + [TestMethod] + public void BuildCompleter_NoDefaultProject() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._nullDefaultProject); + + var target = new BuildCompleter(ps); + var fakeBoundParameters = new Dictionary(); + + // Act + var actual = target.CompleteArgument("Add-VSTeamRelease", "BuildNumber", "", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(0, actual.Count()); + } + + [TestMethod] + public void BuildCompleter_NoBuilds() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + + // Make the return of Get-VSTeamBuild to return zero builds + ps.Invoke().Returns(this._empty); + + var target = new BuildCompleter(ps); + var fakeBoundParameters = new Dictionary + { + { "ProjectName", "UnitTestProject" } + }; + + // Act + var actual = target.CompleteArgument(null, null, "", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(0, actual.Count()); + } + + [TestMethod] + public void BuildCompleter_HasBuilds() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + + ps.Invoke().Returns(this._builds); + + var target = new BuildCompleter(ps); + var fakeBoundParameters = new Dictionary + { + { "ProjectName", "UnitTestProject" } + }; + + // Act + var actual = target.CompleteArgument(null, null, "", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(2, actual.Count()); + } + + [TestMethod] + public void BuildCompleter_Build602() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + + ps.Invoke().Returns(this._builds); + + var target = new BuildCompleter(ps); + var fakeBoundParameters = new Dictionary + { + { "ProjectName", "UnitTestProject" } + }; + + // Act + var actual = target.CompleteArgument(null, null, "6", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(1, actual.Count()); + } + + [TestMethod] + public void BuildCompleter_Build800() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + + ps.Invoke().Returns(this._builds); + + var target = new BuildCompleter(ps); + var fakeBoundParameters = new Dictionary + { + { "ProjectName", "UnitTestProject" } + }; + + // Act + var actual = target.CompleteArgument(null, null, "8", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(0, actual.Count()); + } + } +} diff --git a/Tests/library/Completer/BuildDefinitionCompleterTests.cs b/Tests/library/Completer/BuildDefinitionCompleterTests.cs new file mode 100644 index 000000000..0487878e1 --- /dev/null +++ b/Tests/library/Completer/BuildDefinitionCompleterTests.cs @@ -0,0 +1,36 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class BuildDefinitionCompleterTests + { + private readonly Collection _empty = new Collection(); + + [TestMethod] + public void BuildDefinitionCompleter_GetValues() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._empty); + + var target = new BuildDefinitionCompleter(ps); + var fakeBoundParameters = new Dictionary + { + { "ProjectName", "UnitTestProject" } + }; + + // Act + var actual = target.CompleteArgument("Add-VSTeamBuild", "BuildDefinition", "", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(0, actual.Count()); + } + } +} diff --git a/Tests/library/Completer/InvokeCompleterTests.cs b/Tests/library/Completer/InvokeCompleterTests.cs new file mode 100644 index 000000000..b2d3bbb79 --- /dev/null +++ b/Tests/library/Completer/InvokeCompleterTests.cs @@ -0,0 +1,55 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class InvokeCompleterTests + { + private readonly Collection _resources = new Collection() { "approvals" }; + private readonly Collection _areas = new Collection() { "approval", "release" }; + + [TestMethod] + public void InvokeCompleter_Get_Areas_With_SubDomain_And_Area() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._areas); + + var target = new InvokeCompleter(ps); + var fakeBoundParameters = new Dictionary(); + + // Act + var actual = target.CompleteArgument("Invoke-VSTeamRequest", "area", "", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(2, actual.Count()); + } + + [TestMethod] + public void InvokeCompleter_Get_Resources_With_SubDomain_And_Area() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._resources); + + var target = new InvokeCompleter(ps); + var fakeBoundParameters = new Dictionary + { + { "area", "approval" }, + { "subDomain", "vsrm" } + }; + + // Act + var actual = target.CompleteArgument("Invoke-VSTeamRequest", "resource", "", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(1, actual.Count()); + } + } +} diff --git a/Tests/library/Completer/ProcessTemplateCompleterTests.cs b/Tests/library/Completer/ProcessTemplateCompleterTests.cs new file mode 100644 index 000000000..91b220512 --- /dev/null +++ b/Tests/library/Completer/ProcessTemplateCompleterTests.cs @@ -0,0 +1,46 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ProcessTemplateCompleterTests + { + private readonly Collection _templates = new Collection() { "Agile", "CMMI", "Scrum", "Scrum With Space", "Basic" }; + + [TestMethod] + public void ProcessTemplateCompleter_Exercise() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._templates); + ProcessTemplateCache.Cache.Shell = ps; + ProcessTemplateCache.Invalidate(); + + var target = new ProcessTemplateCompleter(ps); + var fakeBoundParameters = new Dictionary(); + + // Act + var actual = target.CompleteArgument(string.Empty, string.Empty, string.Empty, null, fakeBoundParameters); + + // Assert + Assert.AreEqual(5, actual.Count()); + var e = actual.GetEnumerator(); + e.MoveNext(); + Assert.AreEqual("Agile", e.Current.CompletionText, "Agile"); + e.MoveNext(); + Assert.AreEqual("CMMI", e.Current.CompletionText, "CMMI"); + e.MoveNext(); + Assert.AreEqual("Scrum", e.Current.CompletionText, "Scrum"); + e.MoveNext(); + Assert.AreEqual("'Scrum With Space'", e.Current.CompletionText, "Scrum With Space"); + e.MoveNext(); + Assert.AreEqual("Basic", e.Current.CompletionText, "Basic"); + } + } +} diff --git a/Tests/library/Completer/ProjectCompleterTests.cs b/Tests/library/Completer/ProjectCompleterTests.cs new file mode 100644 index 000000000..4a8500b37 --- /dev/null +++ b/Tests/library/Completer/ProjectCompleterTests.cs @@ -0,0 +1,40 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ProjectCompleterTests + { + private readonly Collection _values = new Collection() { "Project1", "Project 2" }; + + [TestMethod] + public void ProjectCompleter_Exercise() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._values); + ProjectCache.Cache.Shell = ps; + ProjectCache.Invalidate(); + + var target = new ProjectCompleter(ps); + var fakeBoundParameters = new Dictionary(); + + // Act + var actual = target.CompleteArgument(string.Empty, string.Empty, string.Empty, null, fakeBoundParameters); + + // Assert + Assert.AreEqual(2, actual.Count()); + var e = actual.GetEnumerator(); + e.MoveNext(); + Assert.AreEqual("Project1", e.Current.CompletionText, "Project1"); + e.MoveNext(); + Assert.AreEqual("'Project 2'", e.Current.CompletionText, "Project 2"); + } + } +} diff --git a/Tests/library/Completer/QueryCompleterTests.cs b/Tests/library/Completer/QueryCompleterTests.cs new file mode 100644 index 000000000..150e9c934 --- /dev/null +++ b/Tests/library/Completer/QueryCompleterTests.cs @@ -0,0 +1,40 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class QueryCompleterTests + { + private readonly Collection _values = new Collection() { "Query1", "Query 2" }; + + [TestMethod] + public void QueryCompleter_Exercise() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._values); + QueryCache.Cache.Shell = ps; + QueryCache.Invalidate(); + + var target = new QueryCompleter(ps); + var fakeBoundParameters = new Dictionary(); + + // Act + var actual = target.CompleteArgument(string.Empty, string.Empty, string.Empty, null, fakeBoundParameters); + + // Assert + Assert.AreEqual(2, actual.Count()); + var e = actual.GetEnumerator(); + e.MoveNext(); + Assert.AreEqual("Query1", e.Current.CompletionText, "Query1"); + e.MoveNext(); + Assert.AreEqual("'Query 2'", e.Current.CompletionText, "Query 2"); + } + } +} diff --git a/Tests/library/Completer/QueueCompleterTests.cs b/Tests/library/Completer/QueueCompleterTests.cs new file mode 100644 index 000000000..6a8fab47a --- /dev/null +++ b/Tests/library/Completer/QueueCompleterTests.cs @@ -0,0 +1,40 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class QueueCompleterTests + { + private readonly Collection _values = new Collection() { "Item1", "Item 2" }; + + [TestMethod] + public void QueueCompleter_Exercise() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._values); + QueryCache.Cache.Shell = ps; + QueryCache.Invalidate(); + + var target = new QueueCompleter(ps); + var fakeBoundParameters = new Dictionary(); + + // Act + var actual = target.CompleteArgument(string.Empty, string.Empty, string.Empty, null, fakeBoundParameters); + + // Assert + Assert.AreEqual(2, actual.Count()); + var e = actual.GetEnumerator(); + e.MoveNext(); + Assert.AreEqual("Item1", e.Current.CompletionText, "Item1"); + e.MoveNext(); + Assert.AreEqual("'Item 2'", e.Current.CompletionText, "Item 2"); + } + } +} diff --git a/Tests/library/Completer/ReleaseDefinitionCompleterTests.cs b/Tests/library/Completer/ReleaseDefinitionCompleterTests.cs new file mode 100644 index 000000000..f78fe5542 --- /dev/null +++ b/Tests/library/Completer/ReleaseDefinitionCompleterTests.cs @@ -0,0 +1,36 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ReleaseDefinitionCompleterTests + { + private readonly Collection _releases = new Collection() { "Item1", "Item 2" }; + + [TestMethod] + public void ReleaseDefinitionCompleter_GetValues() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._releases); + + var target = new ReleaseDefinitionCompleter(ps); + var fakeBoundParameters = new Dictionary + { + { "ProjectName", "UnitTestProject" } + }; + + // Act + var actual = target.CompleteArgument("Add-VSTeamBuild", "BuildDefinition", "", null, fakeBoundParameters); + + // Assert + Assert.AreEqual(2, actual.Count()); + } + } +} diff --git a/Tests/library/Completer/WorkItemTypeCompleterTests.cs b/Tests/library/Completer/WorkItemTypeCompleterTests.cs new file mode 100644 index 000000000..6b16bf75e --- /dev/null +++ b/Tests/library/Completer/WorkItemTypeCompleterTests.cs @@ -0,0 +1,40 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class WorkItemTypeCompleterTests + { + private readonly Collection _values = new Collection() { "Item1", "Item 2" }; + + [TestMethod] + public void WorkItemTypeCompleter_Exercise() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(this._values); + QueryCache.Cache.Shell = ps; + QueryCache.Invalidate(); + + var target = new WorkItemTypeCompleter(ps); + var fakeBoundParameters = new Dictionary(); + + // Act + var actual = target.CompleteArgument(string.Empty, string.Empty, string.Empty, null, fakeBoundParameters); + + // Assert + Assert.AreEqual(2, actual.Count()); + var e = actual.GetEnumerator(); + e.MoveNext(); + Assert.AreEqual("Item1", e.Current.CompletionText, "Item1"); + e.MoveNext(); + Assert.AreEqual("'Item 2'", e.Current.CompletionText, "Item 2"); + } + } +} diff --git a/Tests/library/Provider/AccessControlEntryTests.cs b/Tests/library/Provider/AccessControlEntryTests.cs new file mode 100644 index 000000000..3914b1e78 --- /dev/null +++ b/Tests/library/Provider/AccessControlEntryTests.cs @@ -0,0 +1,31 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class AccessControlEntryTests + { + [TestMethod] + public void AccessControlEntry_Contructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamAccessControlList.json"); + var en = ((PSObject)obj[0].Properties["acesDictionary"].Value).Properties.GetEnumerator(); + en.MoveNext(); + var ace = (PSObject)en.Current.Value; + + // Act + var target = new AccessControlEntry(ace); + + // Assert + Assert.AreEqual(0, target.Deny, "Deny"); + Assert.AreEqual(1, target.Allow, "Allow"); + Assert.IsNotNull(target.ExtendedInfo, "ExtendedInfo"); + Assert.AreEqual("Microsoft.TeamFoundation.Identity;S-00000000-0000-0000-0000-000000000000-00000000-0000-0000-0000-000000000000-0-3", target.Descriptor, "Descriptor"); + Assert.AreEqual("Microsoft.TeamFoundation.Identity;S-00000000-0000-0000-0000-000000000000-00000000-0000-0000-0000-000000000000-0-3: Allow=1, Deny=0", target.ToString(), "ToString()"); + } + } +} diff --git a/Tests/library/Provider/AccessControlListTests.cs b/Tests/library/Provider/AccessControlListTests.cs new file mode 100644 index 000000000..d36fcb7a2 --- /dev/null +++ b/Tests/library/Provider/AccessControlListTests.cs @@ -0,0 +1,26 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class AccessControlListTests + { + [TestMethod] + public void AccessControlList_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamAccessControlList.json"); + + // Act + var target = new AccessControlList(obj[0]); + + // Assert + Assert.AreEqual(1, target.Aces.Count, "Aces"); + Assert.AreEqual(true, target.InheritPermissions, "InheritPermissions"); + Assert.AreEqual("$/00000000-0000-0000-0000-000000000001", target.Token, "Token"); + Assert.AreEqual("$/00000000-0000-0000-0000-000000000001", target.ToString(), "ToString()"); + } + } +} diff --git a/Tests/library/Provider/AccountTests.cs b/Tests/library/Provider/AccountTests.cs new file mode 100644 index 000000000..d50d3a4bc --- /dev/null +++ b/Tests/library/Provider/AccountTests.cs @@ -0,0 +1,46 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class AccountTests + { + [TestMethod] + public void Account_Get_ChildItem_Should_Not_Return_Permissions() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(new Collection()); + var target = new Account("Accounts", ps); + Versions.Graph = string.Empty; + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(3, actual.Length); + } + + [TestMethod] + public void Account_Get_ChildItem_Should_Return_Permissions() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + ps.Invoke().Returns(new Collection()); + var target = new Account("Accounts", ps); + Versions.Graph = "6.0-preview"; + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(4, actual.Length); + } + } +} diff --git a/Tests/library/Provider/AgentPoolTests.cs b/Tests/library/Provider/AgentPoolTests.cs new file mode 100644 index 000000000..483b4ed71 --- /dev/null +++ b/Tests/library/Provider/AgentPoolTests.cs @@ -0,0 +1,66 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class AgentPoolTests + { + [TestMethod] + public void AgentPool_Constructor_NotHosted() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamPool.json"); + + // Act + var target = new AgentPool(obj[0], ps); + + // Assert + Assert.AreEqual(1, target.Id, "Id"); + Assert.AreEqual(4, target.Count, "Count"); + Assert.AreEqual(1, target.PoolId, "PoolId"); + Assert.AreEqual(false, target.IsHosted, "IsHosted"); + Assert.AreEqual("d-----", target.DisplayMode, "DisplayMode"); + } + + [TestMethod] + public void AgentPool_Constructor_Hosted() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamPool.json"); + + // Act + var target = new AgentPool(obj[1], ps); + + // Assert + Assert.AreEqual(2, target.Id, "Id"); + Assert.AreEqual(15, target.Count, "Count"); + Assert.AreEqual(true, target.IsHosted, "IsHosted"); + Assert.AreEqual("d-r-s-", target.DisplayMode, "DisplayMode"); + } + + [TestMethod] + public void AgentPool_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var pools = BaseTests.LoadJson("Get-VSTeamPool.json"); + var agents = BaseTests.LoadJson("Get-VSTeamAgent-PoolId1.json"); + + ps.Invoke().Returns(agents); + + var target = new AgentPool(pools[0], ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(4, actual.Length); + ps.Received().AddCommand("Get-VSTeamAgent"); + } + } +} diff --git a/Tests/library/Provider/AgentTests.cs b/Tests/library/Provider/AgentTests.cs new file mode 100644 index 000000000..218c1d0c4 --- /dev/null +++ b/Tests/library/Provider/AgentTests.cs @@ -0,0 +1,52 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class AgentTests + { + [TestMethod] + public void Agent_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var agents = BaseTests.LoadJson("Get-VSTeamAgent-PoolId1.json"); + + // Act + var target = new Agent(agents[0], 1, ps); + + // Assert + Assert.IsNotNull(target.SystemCapabilities); + Assert.AreEqual(1, target.PoolId, "PoolId"); + Assert.AreEqual(111, target.AgentId, "AgentId"); + Assert.AreEqual(true, target.Enabled, "Enabled"); + Assert.AreEqual("offline", target.Status, "Status"); + Assert.AreEqual("2.155.1", target.Version, "Version"); + Assert.AreEqual("WinBldBox-3_Service2", target.Name, "Name"); + Assert.AreEqual("Microsoft Windows 6.3.9600 ", target.OS, "OS"); + } + + [TestMethod] + public void Agent_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var agents = BaseTests.LoadJson("Get-VSTeamPool.json"); + var jobRequests = BaseTests.LoadJson("Get-VSTeamJobRequest-PoolId1-AgentID111.json"); + + ps.Invoke().Returns(jobRequests); + + var target = new Agent(agents[0], 1, ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(3, actual.Length); + ps.Received().AddCommand("Get-VSTeamJobRequest"); + } + } +} diff --git a/Tests/library/Provider/AttemptTests.cs b/Tests/library/Provider/AttemptTests.cs new file mode 100644 index 000000000..1278bb33a --- /dev/null +++ b/Tests/library/Provider/AttemptTests.cs @@ -0,0 +1,52 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class AttemptTests + { + [TestMethod] + public void Attempt_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamRelease-id178-expandEnvironments.json", false); + var envs = obj[0].GetValue("environments"); + var attempts = ((PSObject)envs[0]).GetValue("deploySteps"); + + // Act + var target = new Attempt((PSObject)attempts[0], "projectName"); + + // Assert + Assert.AreEqual(3578, target.Id, "Id"); + Assert.AreEqual(1, target.AttemptNo, "AttemptNo"); + Assert.AreEqual(4, target.Tasks.Count, "Task.Count"); + Assert.AreEqual("succeeded", target.Status, "Status"); + + Assert.AreEqual("succeeded", target.Tasks[0].Status, "Tasks[0].Status"); + Assert.AreEqual("WinBldBox-3_Service3", target.Tasks[0].AgentName, "Tasks[0].AgentName"); + Assert.AreEqual("https://vsrm.dev.azure.com/test/00000000-0000-0000-0000-000000000000/_apis/Release/releases/178/environments/2149/deployPhases/1237/tasks/3/logs", target.Tasks[0].LogUrl, "Tasks[0].LogUrl"); + } + + [TestMethod] + public void Attempt_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamRelease-id178-expandEnvironments.json", false); + var envs = obj[0].GetValue("environments"); + var attempts = ((PSObject)envs[0]).GetValue("deploySteps"); + var target = new Attempt((PSObject)attempts[0], "projectName"); + + // Act + var children = target.GetChildItem(); + + // Assert + Assert.AreEqual(4, children.Length); + } + } +} diff --git a/Tests/library/Provider/BuildDefinitionProcessPhaseTests.cs b/Tests/library/Provider/BuildDefinitionProcessPhaseTests.cs new file mode 100644 index 000000000..8d48ada79 --- /dev/null +++ b/Tests/library/Provider/BuildDefinitionProcessPhaseTests.cs @@ -0,0 +1,27 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class BuildDefinitionProcessPhaseTests + { + [TestMethod] + public void BuildDefinitionProcessPhase_GetChildren() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_AzD.json"); + var buildDef = new BuildDefinition(obj[0], "Project Name", ps); + var target = (PSObject)buildDef.GetChildItem()[0]; + + // Act + var actual = ((BuildDefinitionProcessPhase)target.ImmediateBaseObject).GetChildItem(); + + // Assert + Assert.AreEqual(4, actual.Length); + } + } +} diff --git a/Tests/library/Provider/BuildDefinitionTests.cs b/Tests/library/Provider/BuildDefinitionTests.cs new file mode 100644 index 000000000..3e983d74e --- /dev/null +++ b/Tests/library/Provider/BuildDefinitionTests.cs @@ -0,0 +1,314 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class BuildDefinitionTests + { + [TestMethod] + public void BuildDefinition_Constructor_2017_Git() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_2017.json"); + + // Act + var actual = new BuildDefinition(obj[0], "Project Name", ps); + + // Assert + Assert.IsNull(actual.Tags, "Tags"); + Assert.IsNull(actual.Demands, "Demands"); + + Assert.IsNotNull(actual.Queue, "Queue"); + Assert.IsNotNull(actual.Variables, "Variables"); + Assert.IsNotNull(actual.AuthoredBy, "AuthoredBy"); + Assert.IsNotNull(actual.Repository, "Repository"); + Assert.IsNotNull(actual.GitRepository, "GitRepository"); + Assert.IsNotNull(actual.RetentionRules, "RetentionRules"); + + Assert.AreEqual("BuildDefinition", actual.ResourceType, "ResourceType"); + + Assert.AreEqual(5, actual.JobCancelTimeoutInMinutes, "JobCancelTimeoutInMinutes"); + Assert.AreEqual("projectCollection", actual.JobAuthorizationScope, "JobAuthorizationScope"); + Assert.AreEqual("$(date:yyyyMMdd)$(rev:.r)", actual.BuildNumberFormat, "BuildNumberFormat"); + + Assert.AreEqual("8/23/2020 3:12:41 PM", actual.CreatedOn.ToString(), "CreatedOn"); + + Assert.IsNotNull(actual.Options, "Options"); + Assert.AreEqual(4, actual.Options.Count, "Options.Count"); + + Assert.IsNull(actual.Triggers, "Triggers"); + + Assert.AreEqual(17, actual.Id, "Id"); + Assert.AreEqual("CI", actual.Name, "Name"); + Assert.AreEqual("\\", actual.Path, "Path"); + Assert.AreEqual(1, actual.Revision, "Revision"); + + Assert.AreEqual("CI", actual.ToString(), "ToString()"); + + Assert.IsNull(actual.Process, "Process"); + + Assert.IsNotNull(actual.Steps, "Steps"); + Assert.AreEqual(5, actual.Steps.Count, "Steps.Count"); + + // Testing BuildDefinitionProcessPhaseStep properties + Assert.IsNotNull(actual.Steps[0].Task, "Steps[0].Task"); + Assert.IsNotNull(actual.Steps[0].Inputs, "Steps[0].Inputs"); + Assert.AreEqual(true, actual.Steps[0].Enabled, "Steps[0].Enabled"); + Assert.AreEqual(null, actual.Steps[0].Condition, "Steps[0].Condition"); + Assert.AreEqual(false, actual.Steps[0].AlwaysRun, "Steps[0].AlwaysRun"); + Assert.AreEqual("NuGet restore", actual.Steps[0].Name, "Steps[0].Name"); + Assert.AreEqual(0, actual.Steps[0].TimeoutInMinutes, "Steps[0].TimeoutInMinutes"); + Assert.AreEqual(false, actual.Steps[0].ContinueOnError, "Steps[0].ContinueOnError"); + } + + [TestMethod] + public void BuildDefinition_GetChildItem_2017_Git() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_2017.json"); + var target = new BuildDefinition(obj[0], "Project Name", ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.IsNotNull(actual); + Assert.AreEqual(5, actual.Length); + } + + [TestMethod] + public void BuildDefinition_Constructor_2017_Tfvc() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_2017.json"); + + // Act + var actual = new BuildDefinition(obj[1], "Project Name", ps); + + // Assert + Assert.IsNull(actual.Tags, "Tags"); + + Assert.IsNotNull(actual.Demands, "Demands"); + Assert.AreEqual(1, actual.Demands.Count, "Demands.Count"); + + Assert.IsNotNull(actual.Queue, "Queue"); + Assert.IsNotNull(actual.Variables, "Variables"); + Assert.IsNotNull(actual.AuthoredBy, "AuthoredBy"); + Assert.IsNotNull(actual.Repository, "Repository"); + Assert.IsNull(actual.GitRepository, "GitRepository"); + Assert.IsNotNull(actual.RetentionRules, "RetentionRules"); + + Assert.AreEqual("8/23/2020 10:30:31 PM", actual.CreatedOn.ToString(), "CreatedOn"); + + Assert.AreEqual(5, actual.JobCancelTimeoutInMinutes, "JobCancelTimeoutInMinutes"); + Assert.AreEqual("projectCollection", actual.JobAuthorizationScope, "JobAuthorizationScope"); + Assert.AreEqual("$(date:yyyyMMdd)$(rev:.r)", actual.BuildNumberFormat, "BuildNumberFormat"); + + Assert.IsNotNull(actual.Options, "Options"); + Assert.AreEqual(4, actual.Options.Count, "Options.Count"); + + Assert.IsNull(actual.Triggers, "Triggers"); + + Assert.AreEqual(18, actual.Id, "Id"); + Assert.AreEqual("\\", actual.Path, "Path"); + Assert.AreEqual("TFVC-CI", actual.Name, "Name"); + Assert.AreEqual(2, actual.Revision, "Revision"); + + Assert.IsNull(actual.Process, "Process"); + } + + [TestMethod] + public void BuildDefinition_Constructor_2018() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_2018.json"); + + // Act + var actual = new BuildDefinition(obj[0], "Project Name", ps); + + // Assert + Assert.IsNotNull(actual.Tags, "Tags"); + Assert.AreEqual(0, actual.Tags.Count, "Tags.Count"); + + Assert.IsNull(actual.Demands, "Demands"); + + Assert.IsNotNull(actual.Queue, "Queue"); + Assert.IsNotNull(actual.Variables, "Variables"); + Assert.IsNotNull(actual.AuthoredBy, "AuthoredBy"); + Assert.IsNotNull(actual.Repository, "Repository"); + Assert.IsNotNull(actual.GitRepository, "GitRepository"); + Assert.IsNotNull(actual.RetentionRules, "RetentionRules"); + + Assert.AreEqual("8/23/2020 3:16:22 PM", actual.CreatedOn.ToString(), "CreatedOn"); + + Assert.AreEqual(5, actual.JobCancelTimeoutInMinutes, "JobCancelTimeoutInMinutes"); + Assert.AreEqual("projectCollection", actual.JobAuthorizationScope, "JobAuthorizationScope"); + Assert.AreEqual("$(date:yyyyMMdd)$(rev:.r)", actual.BuildNumberFormat, "BuildNumberFormat"); + + Assert.IsNotNull(actual.Options, "Options"); + Assert.AreEqual(2, actual.Options.Count, "Options.Count"); + + Assert.IsNull(actual.Triggers, "Triggers"); + + Assert.AreEqual(27, actual.Id, "Id"); + Assert.AreEqual("CI", actual.Name, "Name"); + Assert.AreEqual("\\", actual.Path, "Path"); + Assert.AreEqual(1, actual.Revision, "Revision"); + + Assert.IsNotNull(actual.Process, "Process"); + Assert.AreEqual(1, actual.Process.Phases.Count, "Process.Steps.Count"); + Assert.AreEqual("Number of phases: 1", actual.Process.ToString(), "Process.ToString()"); + + Assert.IsNotNull(actual.Process.Phases[0].Steps, "Process.Phases[0].Steps"); + Assert.IsNotNull(actual.Process.Phases[0].Target, "Process.Phases[0].Target"); + Assert.AreEqual(6, actual.Process.Phases[0].StepCount, "Process.Phases[0].StepsCount"); + Assert.AreEqual(6, actual.Process.Phases[0].Steps.Count, "Process.Phases[0].Steps.Count"); + Assert.AreEqual("succeeded()", actual.Process.Phases[0].Condition, "Process.Phases[0].Condition"); + Assert.AreEqual(1, actual.Process.Phases[0].JobCancelTimeoutInMinutes, "Process.Phases[0].JobCancelTimeoutInMinutes"); + Assert.AreEqual("projectCollection", actual.Process.Phases[0].JobAuthorizationScope, "Process.Phases[0].JobAuthorizationScope"); + } + + [TestMethod] + public void BuildDefinition_GetChildItem_2018() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_2018.json"); + var target = new BuildDefinition(obj[0], "Project Name", ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.IsNotNull(actual, "actual"); + } + + [TestMethod] + public void BuildDefinition_Constructor_AzD_Classic() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_AzD.json"); + + // Act + var actual = new BuildDefinition(obj[0], "Project Name", ps); + + // Assert + Assert.IsNotNull(actual.Tags, "Tags"); + Assert.AreEqual(0, actual.Tags.Count, "Tags.Count"); + + Assert.IsNull(actual.Demands, "Demands"); + + Assert.AreEqual("9/16/2019 2:34:16 AM", actual.CreatedOn.ToString(), "CreatedOn"); + + // Not on this build def + Assert.AreEqual(null, actual.BuildNumberFormat, "BuildNumberFormat"); + Assert.AreEqual(5, actual.JobCancelTimeoutInMinutes, "JobCancelTimeoutInMinutes"); + Assert.AreEqual("projectCollection", actual.JobAuthorizationScope, "JobAuthorizationScope"); + + Assert.IsNotNull(actual.Queue, "Queue"); + Assert.IsNotNull(actual.Variables, "Variables"); + Assert.IsNotNull(actual.AuthoredBy, "AuthoredBy"); + Assert.IsNotNull(actual.Repository, "Repository"); + Assert.IsNotNull(actual.GitRepository, "GitRepository"); + Assert.IsNotNull(actual.RetentionRules, "RetentionRules"); + + Assert.IsNotNull(actual.Options, "Options"); + Assert.AreEqual(2, actual.Options.Count, "Options.Count"); + + Assert.IsNotNull(actual.Triggers, "Triggers"); + Assert.AreEqual(1, actual.Triggers.Count, "Triggers.Count"); + + Assert.AreEqual(23, actual.Id, "Id"); + Assert.AreEqual("\\", actual.Path, "Path"); + Assert.AreEqual("PTracker-CI", actual.Name, "Name"); + Assert.AreEqual(163, actual.Revision, "Revision"); + + Assert.IsNotNull(actual.Process, "Process"); + Assert.IsNotNull(actual.Process.Phases, "Process.Phases"); + } + + [TestMethod] + public void BuildDefinition_GetChildItem_AzD_Classic() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_AzD.json"); + var target = new BuildDefinition(obj[0], "Project Name", ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.IsNotNull(actual, "actual"); + Assert.AreEqual(4, actual.Length); + } + + [TestMethod] + public void BuildDefinition_Constructor_AzD_YAML() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_AzD.json"); + + // Act + var actual = new BuildDefinition(obj[7], "Project Name", ps); + + // Assert + Assert.IsNotNull(actual.Tags, "Tags"); + Assert.AreEqual(2, actual.Tags.Count, "Tags.Count"); + + Assert.IsNull(actual.Demands, "Demands"); + + Assert.AreEqual("9/25/2019 8:55:54 PM", actual.CreatedOn.ToString(), "CreatedOn"); + + // Not on this build def + Assert.AreEqual(0, actual.JobCancelTimeoutInMinutes, "JobCancelTimeoutInMinutes"); + Assert.AreEqual("projectCollection", actual.JobAuthorizationScope, "JobAuthorizationScope"); + Assert.AreEqual("$(date:yyyyMMdd)$(rev:.r)", actual.BuildNumberFormat, "BuildNumberFormat"); + + Assert.IsNotNull(actual.Queue, "Queue"); + Assert.IsNotNull(actual.Variables, "Variables"); + Assert.IsNotNull(actual.AuthoredBy, "AuthoredBy"); + Assert.IsNotNull(actual.Repository, "Repository"); + Assert.IsNull(actual.RetentionRules, "RetentionRules"); + Assert.IsNotNull(actual.GitRepository, "GitRepository"); + + Assert.IsNull(actual.Options, "Options"); + + Assert.IsNotNull(actual.Triggers, "Triggers"); + Assert.AreEqual(1, actual.Triggers.Count, "Triggers.Count"); + + Assert.AreEqual(46, actual.Id, "Id"); + Assert.AreEqual("\\Vars", actual.Path, "Path"); + Assert.AreEqual("Vars CI", actual.Name, "Name"); + Assert.AreEqual(1, actual.Revision, "Revision"); + + Assert.IsNotNull(actual.Process, "Process"); + Assert.IsNull(actual.Process.Phases, "Process.Phases"); + Assert.AreEqual("/azure-pipelines.yml", actual.Process.ToString(), "Process.ToString()"); + } + + [TestMethod] + public void BuildDefinition_GetChildItem_AzD_YAML() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-BuildDefinition_AzD.json"); + var target = new BuildDefinition(obj[7], "Project Name", ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.IsNotNull(actual, "actual"); + Assert.AreEqual(1, actual.Length, "actual.Length"); + } + } +} diff --git a/Tests/library/Provider/BuildTests.cs b/Tests/library/Provider/BuildTests.cs new file mode 100644 index 000000000..667abde63 --- /dev/null +++ b/Tests/library/Provider/BuildTests.cs @@ -0,0 +1,54 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class BuildTests + { + [TestMethod] + public void Build_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamBuild.json"); + + // Act + var actual = new Build(obj[0], "Project Name", ps); + + // Assert + Assert.AreEqual("81", actual.QueueId, "QueueId"); + Assert.IsNotNull(actual.RequestedBy, "RequestedBy"); + Assert.IsNotNull(actual.RequestedFor, "RequestedFor"); + Assert.AreEqual("completed", actual.Status, "Status"); + Assert.AreEqual("succeeded", actual.Result, "Result"); + Assert.IsNotNull(actual.LastChangedBy, "LastChangedBy"); + Assert.AreEqual("568", actual.BuildNumber, "BuildNumber"); + Assert.AreEqual("Default", actual.QueueName, "QueueName"); + Assert.AreEqual("TfsGit", actual.RepositoryType, "RepositoryType"); + Assert.AreEqual("PTracker-CI", actual.DefinitionName, "DefinitionName"); + Assert.AreEqual("Donovan Brown", actual.RequestedByUser, "RequestedByUser"); + Assert.AreEqual("Donovan Brown", actual.RequestedForUser, "RequestedForUser"); + Assert.AreEqual("11/14/2019 12:49:37 AM", actual.StartTime.ToString(), "startTime"); + Assert.AreEqual("Microsoft.VisualStudio.Services.ReleaseManagement", actual.LastChangedByUser, "LastChangedByUser"); + + Assert.IsNotNull(actual.Queue, "Queue"); + Assert.IsNotNull(actual.Queue.Pool, "Queue.Pool"); + Assert.AreEqual("81", actual.Queue.Id, "Queue.Id"); + Assert.AreEqual("Default", actual.Queue.PoolName, "Queue.PoolName"); + + Assert.IsNotNull(actual.BuildDefinition, "BuildDefinition"); + Assert.AreEqual(23, actual.BuildDefinition.Id, "BuildDefinition.Id"); + Assert.AreEqual("PTracker-CI", actual.BuildDefinition.Name, "BuildDefinition.Name"); + + Assert.IsNotNull(actual.Project, "Project"); + Assert.AreEqual("PeopleTracker", actual.Project.Name, "Project.Name"); + Assert.AreEqual("00000000-0000-0000-0000-000000000000", actual.Project.Id, "Project.Id"); + + Assert.AreEqual("Test@test.com", actual.RequestedBy.UniqueName, "RequestedBy.UniqueName"); + Assert.AreEqual("Donovan Brown", actual.RequestedFor.DisplayName, "RequestedFor.DisplayName"); + Assert.AreEqual("Microsoft.VisualStudio.Services.ReleaseManagement", actual.LastChangedBy.ToString(), "LastChangedBy.ToString()"); + } + } +} diff --git a/Tests/library/Provider/ClassificationNodeTests.cs b/Tests/library/Provider/ClassificationNodeTests.cs new file mode 100644 index 000000000..8eae3c250 --- /dev/null +++ b/Tests/library/Provider/ClassificationNodeTests.cs @@ -0,0 +1,69 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ClassificationNodeTests + { + [TestMethod] + public void ClassificationNodeTests_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamClassificationNode.json"); + + // Act + var target = new ClassificationNode(obj[1], "Project Name"); + + // Assert + Assert.IsNull(target.ParentUrl, "ParentUrl"); + Assert.IsNotNull(target.Children, "Children"); + Assert.AreEqual(true, target.HasChildren, "HasChildren"); + Assert.AreEqual(Guid.Empty, target.Identifier, "Identifier"); + Assert.AreEqual("\\PeopleTracker\\Iteration", target.Path, "Path"); + Assert.AreEqual("iteration", target.StructureType, "StructureType"); + Assert.AreEqual("https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations", target.Url, "Url"); + } + + [TestMethod] + public void ClassificationNodeTests_Constructor_ById() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamClassificationNode-depth3-ids82.json"); + + // Act + var target = new ClassificationNode(obj[0], "Project Name"); + + // Assert + Assert.IsNull(target.ParentUrl, "ParentUrl"); + Assert.IsNotNull(target.Children, "Children"); + Assert.AreEqual(true, target.HasChildren, "HasChildren"); + Assert.AreEqual(Guid.Empty, target.Identifier, "Identifier"); + Assert.AreEqual("\\PeopleTracker\\Iteration", target.Path, "Path"); + Assert.AreEqual("iteration", target.StructureType, "StructureType"); + Assert.AreEqual("https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations", target.Url, "Url"); + } + + [TestMethod] + public void ClassificationNodeTests_Constructor_WithParent() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamClassificationNode-depth4-ids84.json"); + + // Act + var target = new ClassificationNode(obj[0], "Project Name"); + + // Assert + Assert.IsNull(target.Children, "Children"); + Assert.IsNotNull(target.ParentUrl, "ParentUrl"); + Assert.AreEqual(false, target.HasChildren, "HasChildren"); + Assert.AreEqual(Guid.Empty, target.Identifier, "Identifier"); + Assert.AreEqual("iteration", target.StructureType, "StructureType"); + Assert.AreEqual("\\PeopleTracker\\Iteration\\Sprint 1", target.Path, "Path"); + Assert.AreEqual("https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations/Sprint%201", target.Url, "Url"); + Assert.AreEqual("https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/wit/classificationNodes/Iterations", target.ParentUrl, "ParentUrl"); + } + } +} diff --git a/Tests/library/Provider/DescriptorTests.cs b/Tests/library/Provider/DescriptorTests.cs new file mode 100644 index 000000000..8ecddac3d --- /dev/null +++ b/Tests/library/Provider/DescriptorTests.cs @@ -0,0 +1,29 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class DescriptorTests + { + [TestMethod] + public void DescriptorTests_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("descriptor.scope.TestProject.json", false); + var n = System.Environment.NewLine; + var expectedLinks = $"Self: https://vssps.dev.azure.com/test/_apis/Graph/Descriptors/010d06f0-00d5-472a-bb47-58947c230876{n}StorageKey: https://vssps.dev.azure.com/test/_apis/Graph/StorageKeys/scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2{n}Subject: https://vssps.dev.azure.com/test/_apis/Graph/Scopes/scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2{n}"; + + // Act + var target = new Descriptor(obj[0]); + + // Assert + Assert.IsNotNull(target.Links, "Links"); + Assert.AreEqual(expectedLinks, target.Links.ToString(), "ToString"); + Assert.AreEqual("scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2", target.Name, "Name"); + Assert.AreEqual("scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2", target.ToString(), "ToString"); + Assert.AreEqual("https://vssps.dev.azure.com/test/_apis/Graph/Scopes/scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2", target.Links.Subject, "Links.Subject"); + } + } +} diff --git a/Tests/library/Provider/DirectoryTest.cs b/Tests/library/Provider/DirectoryTest.cs new file mode 100644 index 000000000..a82d076a3 --- /dev/null +++ b/Tests/library/Provider/DirectoryTest.cs @@ -0,0 +1,67 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Diagnostics.CodeAnalysis; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class DirectoryTest + { + [TestMethod] + public void Directory_Get_VSTeamPool() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamPool.json"); + + ps.Invoke().Returns(obj); + + var target = new Directory("Agent Pools", "Pool", ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(12, actual.Length); + ps.Received().AddCommand("Sort-Object"); + ps.Received().AddCommand("Get-VSTeamPool"); + ps.DidNotReceive().AddParameter("ProjectName"); + } + + [TestMethod] + public void Directory_Has_ProjectName() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamPool.json"); + + ps.Invoke().Returns(obj); + + var target = new Directory(null, "Agent Pools", "Pool", ps, "MyProject"); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(12, actual.Length); + ps.Received().AddCommand("Sort-Object"); + ps.Received().AddCommand("Get-VSTeamPool"); + ps.Received().AddParameter("ProjectName", "MyProject"); + } + + [TestMethod] + public void Directory_Get_VSTeam() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + + // Act + var target = new Directory("Teams", "Team", ps); + + // Assert + Assert.AreEqual("Get-VSTeam", target.Command); + } + } +} diff --git a/Tests/library/Provider/EnvironmentTests.cs b/Tests/library/Provider/EnvironmentTests.cs new file mode 100644 index 000000000..4fcbdbe92 --- /dev/null +++ b/Tests/library/Provider/EnvironmentTests.cs @@ -0,0 +1,46 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class EnvironmentTests + { + [TestMethod] + public void Environment_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamRelease-id178-expandEnvironments.json", false); + var envs = obj[0].GetValue("environments"); + + // Act + var target = new Environment((PSObject)envs[0], 178, "projectName", ps); + + // Assert + Assert.AreEqual(2149, target.Id, "Id"); + Assert.AreEqual(178, target.ReleaseId, "ReleaseId"); + Assert.AreEqual("succeeded", target.Status, "Status"); + Assert.AreEqual(2149, target.EnvironmentId, "EnvironmentId"); + } + + [TestMethod] + public void Environment_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamRelease-id178-expandEnvironments.json", false); + var envs = obj[0].GetValue("environments"); + var target = new Environment((PSObject)envs[0], 178, "projectName", ps); + + // Act + var children = target.GetChildItem(); + + // Assert + Assert.AreEqual(1, children.Length); + } + } +} diff --git a/Tests/library/Provider/ExtensionTests.cs b/Tests/library/Provider/ExtensionTests.cs new file mode 100644 index 000000000..0ef2db018 --- /dev/null +++ b/Tests/library/Provider/ExtensionTests.cs @@ -0,0 +1,32 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ExtensionTests + { + [TestMethod] + public void Extension_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamExtension.json"); + + // Act + var actual = new Extension(obj[0]); + + // Assert + Assert.AreEqual("20200807.2", actual.Version, "Version"); + Assert.AreEqual("CloudTest", actual.PublisherName, "PublisherName"); + Assert.AreEqual("asg-cloudtest", actual.PublisherId, "PublisherId"); + Assert.AreEqual("asg-cloudtest-attachments", actual.ExtensionId, "ExtensionId"); + + Assert.IsNotNull(actual.InstallState, "InstallState"); + Assert.AreEqual("none", actual.InstallState.Flags, "InstallState.Flags"); + Assert.IsNotNull(actual.InstallState.InternalObject, "InstallState.InternalObject"); + Assert.AreEqual("8/10/2020 8:31:07 PM", actual.InstallState.LastUpdated.ToString(), "InstallState.LastUpdated"); + Assert.AreEqual("Flags: none, Last Updated: 8/10/2020 8:31:07 PM", actual.InstallState.ToString(), "InstallState.ToString()"); + } + } +} diff --git a/Tests/library/Provider/FeedTests.cs b/Tests/library/Provider/FeedTests.cs new file mode 100644 index 000000000..ffb2ee3e1 --- /dev/null +++ b/Tests/library/Provider/FeedTests.cs @@ -0,0 +1,40 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class FeedTests + { + [TestMethod] + public void Feed_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamFeed.json"); + + // Act + var actual = new Feed(obj[0]); + + // Assert + Assert.AreEqual("ber", actual.Name, "Name"); + Assert.AreEqual(null, actual.Description, "Description"); + Assert.AreEqual(true, actual.UpstreamEnabled, "UpstreamEnaabled"); + Assert.AreEqual("00000000-0000-0000-0000-000000000001", actual.Id, "Id"); + Assert.AreEqual("https://feeds.dev.azure.com/Test/_apis/Packaging/Feeds/00000000-0000-0000-0000-000000000000", actual.Url, "Url"); + + Assert.IsNotNull(actual.UpstreamSources, "UpstreamSources"); + Assert.AreEqual(4, actual.UpstreamSources.Count, "UpstreamSources.Count"); + + Assert.AreEqual("npmjs", actual.UpstreamSources[0].Name, "Name"); + Assert.AreEqual("ok", actual.UpstreamSources[0].Status, "Status"); + Assert.AreEqual("npm", actual.UpstreamSources[0].Protocol, "Protocol"); + Assert.IsNotNull(actual.UpstreamSources[0].InternalObject, "InternalObject"); + Assert.AreEqual("00000000-0000-0000-0000-000000000010", actual.UpstreamSources[0].ID); + Assert.AreEqual("public", actual.UpstreamSources[0].UpstreamSourceType, "UpstreamSourceType"); + Assert.AreEqual("https://registry.npmjs.org/", actual.UpstreamSources[0].Location, "Location"); + Assert.AreEqual("https://registry.npmjs.org/", actual.UpstreamSources[0].DisplayLocation, "DisplayLocation"); + } + } +} diff --git a/Tests/library/Provider/GitCommitRefTests.cs b/Tests/library/Provider/GitCommitRefTests.cs new file mode 100644 index 000000000..d928d5f06 --- /dev/null +++ b/Tests/library/Provider/GitCommitRefTests.cs @@ -0,0 +1,36 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class GitCommitRefTests + { + [TestMethod] + public void GitCommitRefTests_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamGitCommit.json"); + + // Act + var target = new GitCommitRef(obj[0], "Project Name"); + + // Assert + Assert.AreEqual(0, target.Adds, "Adds"); + Assert.AreEqual(3, target.Edits, "Edits"); + Assert.AreEqual(0, target.Deletes, "Deletes"); + Assert.AreEqual("Clean up.", target.Comment, "Comment"); + Assert.AreEqual("6843b66ef58214061b996508ae37a8bbd67a12c2", target.CommitId, "CommitId"); + Assert.AreEqual("https://dev.azure.com/Test/PeopleTracker/_git/Bakeoff/commit/6843b66ef58214061b996508ae37a8bbd67a12c2", target.RemoteUrl, "RemoteUrl"); + Assert.AreEqual("https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/git/repositories/00000000-0000-0000-0000-000000000000/commits/6843b66ef58214061b996508ae37a8bbd67a12c2", target.Url, "Url"); + + + Assert.IsNotNull(target.Author, "Author"); + Assert.IsNotNull(target.Committer, "Committer"); + Assert.AreEqual("Donovan Brown", target.Committer.Name, "Committer.Name"); + Assert.AreEqual("Test@Test.com", target.Committer.Email, "Committer.Email"); + Assert.AreEqual("8/8/2019 8:58:58 PM", target.Committer.Date.ToString(), "Committer.Date"); + } + } +} diff --git a/Tests/library/Provider/GitRefTests.cs b/Tests/library/Provider/GitRefTests.cs new file mode 100644 index 000000000..1ab65c3d3 --- /dev/null +++ b/Tests/library/Provider/GitRefTests.cs @@ -0,0 +1,24 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class GitRefTests + { + [TestMethod] + public void GitRef_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamGitRef.json"); + + // Act + var actual = new GitRef(obj[0], "TestProject"); + + // Assert + Assert.IsNotNull(actual.Creator, "Creator"); + Assert.AreEqual("refs/heads/master", actual.RefName, "RefName"); + } + } +} diff --git a/Tests/library/Provider/GitRepositoryTests.cs b/Tests/library/Provider/GitRepositoryTests.cs new file mode 100644 index 000000000..66cce1e24 --- /dev/null +++ b/Tests/library/Provider/GitRepositoryTests.cs @@ -0,0 +1,54 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class GitRepositoryTests + { + [TestMethod] + public void GitRepository_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamGitRepository.json"); + + // Act + var actual = new GitRepository(obj[0], null, ps); + + // Assert + Assert.IsNotNull(actual.Project, "Project"); + Assert.AreEqual(1939413, actual.Size, "Size"); + Assert.AreEqual("Bakeoff", actual.Name, "Name"); + Assert.AreEqual("Repository", actual.ResourceType, "ResourceType"); + Assert.AreEqual("PeopleTracker", actual.ProjectName, "ProjectName"); + Assert.AreEqual("00000000-0000-0000-0000-000000000001", actual.Id, "Id"); + Assert.AreEqual("refs/heads/master", actual.DefaultBranch, "DefaultBranch"); + Assert.AreEqual("https://dev.azure.com/Test/0/_apis/git/repositories/0", actual.Url, "Url"); + Assert.AreEqual("00000000-0000-0000-0000-000000000001", actual.RepositoryID, "RepositoryID"); + Assert.AreEqual("git@ssh.dev.azure.com:v3/Test/PeopleTracker/Bakeoff", actual.SSHUrl, "SSHUrl"); + Assert.AreEqual("https://Test@dev.azure.com/Test/PeopleTracker/_git/Bakeoff", actual.RemoteUrl, "RemoteUrl"); + } + + [TestMethod] + public void GitRepository_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var gitRefs = BaseTests.LoadJson("Get-VSTeamGitRef.json"); + var obj = BaseTests.LoadJson("Get-VSTeamGitRepository.json"); + var target = new GitRepository(obj[0], "Project Name", ps); + + ps.Invoke().Returns(gitRefs); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(1, actual.Length); + ps.Received().AddCommand("Get-VSTeamGitRef"); + } + } +} diff --git a/Tests/library/Provider/GroupTests.cs b/Tests/library/Provider/GroupTests.cs new file mode 100644 index 000000000..bb403e41c --- /dev/null +++ b/Tests/library/Provider/GroupTests.cs @@ -0,0 +1,45 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class GroupTests + { + [TestMethod] + public void Group_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamGroup.json"); + + // Act + var target = new Group(obj[0]); + + // Assert + Assert.AreEqual("vsts", target.Origin, "Origin"); + Assert.AreEqual(null, target.MailAddress, "MailAddress"); + Assert.IsNotNull(target.InternalObject, "InternalObject"); + Assert.AreEqual("Test", target.ProjectName, "ProjectName"); + Assert.AreEqual("group", target.SubjectKind, "SubjectKind"); + Assert.AreEqual("redacted", target.Descriptor, "Descriptor"); + Assert.AreEqual("redacted", target.ContainerDescriptor, "ContainerDescriptor"); + Assert.AreEqual("00000000-0000-0000-0000-000000000000", target.OriginId, "OriginId"); + Assert.AreEqual("Project Collection Build Administrators", target.DisplayName, "DisplayName"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Groups/redacted", target.Url, "Url"); + Assert.AreEqual("[Test]\\Project Collection Build Administrators", target.PrincipalName, "PrincipalName"); + Assert.AreEqual("vstfs:///Framework/IdentityDomain/00000000-0000-0000-0000-000000000000", target.Domain, "Domain"); + Assert.AreEqual("Members of this group should include accounts for people who should be able to administer the build resources.", target.Description, "Description"); + + + + + Assert.IsNotNull(target.Links, "Links"); + Assert.IsNotNull(target.Links.InternalObject, "Links.InternalObject"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Groups/redacted", target.Links.Self, "Links.Self"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/redacted", target.Links.Memberships, "Links.Memberships"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/redacted", target.Links.MembershipState, "Links.MembershipState"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/redacted", target.Links.StorageKey, "Links.StorageKey"); + } + } +} diff --git a/Tests/library/Provider/JobRequestTests.cs b/Tests/library/Provider/JobRequestTests.cs new file mode 100644 index 000000000..2b00d7599 --- /dev/null +++ b/Tests/library/Provider/JobRequestTests.cs @@ -0,0 +1,62 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class JobRequestTests + { + [TestMethod] + public void JobRequest_Constructor_Completed() + { + // Arrange + var jobRequests = BaseTests.LoadJson("Get-VSTeamJobRequest-PoolId1-AgentID111.json"); + + // Act + var target = new JobRequest(jobRequests[0]); + + // Assert + Assert.AreEqual("3123", target.Id, "ID"); + Assert.IsNotNull(target.Demands, "Demands"); + Assert.AreEqual("Release", target.Type, "Type"); + Assert.AreEqual("failed", target.Result, "Result"); + Assert.AreEqual(null, target.ProjectName, "ProjectName"); + Assert.IsNotNull(target.InternalObject, "InternalObject"); + Assert.AreEqual("PTracker-CD", target.Pipeline, "Pipeline"); + Assert.AreEqual("------", target.DisplayMode, "DisplayMode"); + Assert.AreEqual(TimeSpan.Parse("00:10:58"), target.Duration, "Duration"); + Assert.AreEqual("11/14/2019 12:56:12 AM", target.QueueTime.ToString(), "QueueTime"); + Assert.AreEqual("11/14/2019 12:56:15 AM", target.StartTime.ToString(), "StartTime"); + Assert.AreEqual("11/14/2019 1:07:13 AM", target.FinishTime.ToString(), "FinishTime"); + Assert.AreEqual("11/14/2019 12:56:12 AM", target.AssignedTime.ToString(), "AssignedTime"); + } + + [TestMethod] + public void JobRequest_Constructor_Running() + { + // Arrange + var jobRequests = BaseTests.LoadJson("Get-VSTeamJobRequest-PoolId1-AgentID111.json"); + + // Act + var target = new JobRequest(jobRequests[2]); + + // Assert + Assert.AreEqual("running", target.Result, "Result"); + } + + [TestMethod] + public void JobRequest_Constructor_Queued() + { + // Arrange + var jobRequests = BaseTests.LoadJson("Get-VSTeamJobRequest-PoolId1-AgentID111.json"); + + // Act + var target = new JobRequest(jobRequests[1]); + + // Assert + Assert.AreEqual("queued", target.Result, "Result"); + } + } +} diff --git a/Tests/library/Provider/LinkTests.cs b/Tests/library/Provider/LinkTests.cs new file mode 100644 index 000000000..aa8df328b --- /dev/null +++ b/Tests/library/Provider/LinkTests.cs @@ -0,0 +1,20 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class LinkTests + { + [TestMethod] + public void Link_Constructor() + { + // Arrange + + // Act + + // Assert + } + } +} diff --git a/Tests/library/Provider/PSObjectExtensionMethodsTests.cs b/Tests/library/Provider/PSObjectExtensionMethodsTests.cs new file mode 100644 index 000000000..bee0986c6 --- /dev/null +++ b/Tests/library/Provider/PSObjectExtensionMethodsTests.cs @@ -0,0 +1,105 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class PSObjectExtensionMethodsTests + { + [TestMethod] + public void GetValue_String_To_Nullable_DateTime() + { + // Arrange + var target = PSObject.AsPSObject(new { finishTime = "2019-06-04T13:32:30.17Z" }); + var expected = DateTime.Parse("2019-06-04T13:32:30.17Z"); + + // Act + var actual = target.GetValue("finishTime"); + + // Assert + Assert.AreEqual(expected, actual); + } + + [TestMethod] + public void GetValue_Int32_To_Long() + { + // Arrange + var target = PSObject.AsPSObject(new { revision = 8 }); + + // Act + var actual = target.GetValue("revision"); + + // Assert + Assert.AreEqual(8, actual); + } + + [TestMethod] + public void GetValue_Missing_Nested_Property_As_String() + { + // Arrange + var target = PSObject.AsPSObject(new { revision = PSObject.AsPSObject(new { value = 0 }) }); + + // Act + var actual = target.GetValue("revision.test"); + + // Assert + Assert.AreEqual(null, actual); + } + + [TestMethod] + public void GetValue_Missing_Property_As_String() + { + // Arrange + var target = PSObject.AsPSObject(new { revision = PSObject.AsPSObject(new { value = 0 }) }); + + // Act + var actual = target.GetValue("test"); + + // Assert + Assert.AreEqual(null, actual); + } + + [TestMethod] + public void GetValue_Null_Property_As_String() + { + // Arrange + var target = PSObject.AsPSObject(new { test = (string)null }); + + // Act + var actual = target.GetValue("test"); + + // Assert + Assert.AreEqual(null, actual); + } + + [TestMethod] + public void GetValue_Nested_Property_As_Long() + { + // Arrange + var target = PSObject.AsPSObject(new { revision = PSObject.AsPSObject(new { value = 1 }) }); + + // Act + var actual = target.GetValue("revision.value"); + + // Assert + Assert.AreEqual(1, actual); + } + + [TestMethod] + public void GetValue_Long_Property_As_String() + { + // Arrange + var target = PSObject.AsPSObject(new { value = 1 }); + + // Act + var actual = target.GetValue("value"); + + // Assert + Assert.AreEqual("1", actual); + } + } +} diff --git a/Tests/library/Provider/PermissionsTests.cs b/Tests/library/Provider/PermissionsTests.cs new file mode 100644 index 000000000..a8fbeb4eb --- /dev/null +++ b/Tests/library/Provider/PermissionsTests.cs @@ -0,0 +1,27 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class PermissionsTests + { + [TestMethod] + public void Permissions_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var target = new Permissions("Permissions", ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(2, actual.Length); + Assert.AreEqual("Groups", ((Directory)actual[0]).Name); + Assert.AreEqual("Users", ((Directory)actual[1]).Name); + } + } +} diff --git a/Tests/library/Provider/ProcessTests.cs b/Tests/library/Provider/ProcessTests.cs new file mode 100644 index 000000000..a42ebfbfd --- /dev/null +++ b/Tests/library/Provider/ProcessTests.cs @@ -0,0 +1,32 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ProcessTests + { + [TestMethod] + public void Process_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamProcess.json"); + + // Act + var target = new Process(obj[0]); + + // Assert + Assert.AreEqual("Scrum", target.Name, "Name"); + Assert.AreEqual("system", target.Type, "Type"); + Assert.AreEqual(true, target.IsEnabled, "IsEnabled"); + Assert.AreEqual(false, target.IsDefault, "IsDefault"); + Assert.AreEqual("Scrum", target.ToString(), "ToString()"); + Assert.AreEqual("Scrum", target.ProcessTemplate, "ProcessTemplate"); + Assert.AreEqual("6b724908-ef14-45cf-84f8-768b5384da45", target.Id, "Id"); + Assert.AreEqual("6b724908-ef14-45cf-84f8-768b5384da45", target.TypeId, "TypeId"); + Assert.AreEqual("00000000-0000-0000-0000-000000000000", target.ParentProcessTypeId, "ParentProcessTypeId"); + Assert.AreEqual("This template is for teams who follow the Scrum framework.", target.Description, "Description"); + } + } +} diff --git a/Tests/library/Provider/ProjectTests.cs b/Tests/library/Provider/ProjectTests.cs new file mode 100644 index 000000000..2ad238e95 --- /dev/null +++ b/Tests/library/Provider/ProjectTests.cs @@ -0,0 +1,56 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ProjectTests + { + [TestMethod] + public void Project_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamProject.json"); + + // Act + var target = new Project(obj[0], ps); + + // Assert + Assert.AreEqual(159, target.Revision, "Revision"); + Assert.AreEqual("Voting-App", target.Name, "Name"); + Assert.AreEqual("wellFormed", target.State, "State"); + Assert.IsNotNull(target.InternalObject, "InternalObject"); + Assert.AreEqual("private", target.Visibility, "Visibility"); + Assert.AreEqual("Voting-App", target.ToString(), "ToString()"); + Assert.AreEqual("Vote App", target.Description, "Description"); + Assert.AreEqual("Voting-App", target.ProjectName, "ProjectName"); + Assert.AreEqual("00000000-0000-0000-0000-000000000001", target.Id, "Id"); + Assert.AreEqual("https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000001", target.Url, "Url"); + } + + [TestMethod] + public void Project_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamProject.json"); + var target = new Project(obj[0], ps); + + // Act + var actual = target.GetChildItem(); + + // Assert + Assert.AreEqual(7, actual.Length); + Assert.AreEqual("Build Definitions", ((Directory)actual[0]).Name); + Assert.AreEqual("Builds", ((Directory)actual[1]).Name); + Assert.AreEqual("Queues", ((Directory)actual[2]).Name); + Assert.AreEqual("Release Definitions", ((Directory)actual[3]).Name); + Assert.AreEqual("Releases", ((Releases)actual[4]).Name); + Assert.AreEqual("Repositories", ((Directory)actual[5]).Name); + Assert.AreEqual("Teams", ((Directory)actual[6]).Name); + } + } +} diff --git a/Tests/library/Provider/QueueTests.cs b/Tests/library/Provider/QueueTests.cs new file mode 100644 index 000000000..dd4204bc3 --- /dev/null +++ b/Tests/library/Provider/QueueTests.cs @@ -0,0 +1,26 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class QueueTests + { + [TestMethod] + public void Queue_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamQueue.json"); + + // Act + var target = new Queue(obj[0], "Project Name", ps); + + // Assert + Assert.IsNotNull(target.Pool, "Pool"); + Assert.AreEqual("81", target.Id, "ID"); + Assert.AreEqual("DefaultPool", target.PoolName, "PoolName"); + } + } +} diff --git a/Tests/library/Provider/ReleaseDefinitionTests.cs b/Tests/library/Provider/ReleaseDefinitionTests.cs new file mode 100644 index 000000000..554b29365 --- /dev/null +++ b/Tests/library/Provider/ReleaseDefinitionTests.cs @@ -0,0 +1,90 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ReleaseDefinitionTests + { + [TestMethod] + public void ReleaseDefinition_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamReleaseDefinition-ReleaseId40.json", false); + + // Act + var actual = new ReleaseDefinition(obj[0], "Project Name"); + + // Assert + Assert.IsNotNull(actual.Tags, "Tags"); + Assert.IsNotNull(actual.Triggers, "Triggers"); + Assert.IsNotNull(actual.Variables, "Variables"); + Assert.IsNotNull(actual.Environments, "Environments"); + Assert.IsNotNull(actual.VariableGroups, "VariableGroups"); + + Assert.IsNotNull(actual.Artifacts, "Artifacts"); + Assert.IsNotNull(actual.CreatedBy, "CreatedBy"); + Assert.IsNotNull(actual.ModifiedBy, "ModifiedBy"); + Assert.IsNotNull(actual.Properties, "Properties"); + + + Assert.IsFalse(actual.IsDeleted, "IsDeleted"); + + Assert.IsNotNull(actual.Links, "Links"); + Assert.IsNotNull(actual.Links.InternalObject, "Links.InternalObject"); + Assert.AreEqual("https://dev.azure.com/fabrikam/00000000-0000-0000-0000-000000000000/_release?definitionId=40", actual.Links.Web, "Links.Web"); + + Assert.AreEqual("40", actual.Id, "Id"); + Assert.AreEqual("\\", actual.Path, "Path"); + Assert.AreEqual(1, actual.Revision, "Revision"); + Assert.AreEqual("Fabrikam-web", actual.Name, "Name"); + Assert.AreEqual(null, actual.Description, "Description"); + Assert.AreEqual("", actual.ReleaseNameFormat, "ReleaseNameFormat"); + Assert.AreEqual("Chuck Reinhart", actual.CreatedByUser, "CreatedByUser"); + Assert.AreEqual("ReleaseDefinition", actual.ResourceType, "ResourceType"); + Assert.AreEqual("12/11/2018 4:48:42 AM", actual.CreatedOn.ToString(), "CreatedOn"); + Assert.AreEqual("12/11/2018 4:48:42 AM", actual.ModifiedOn.ToString(), "ModifiedOn"); + Assert.AreEqual("https://vsrm.dev.azure.com/fabrikam/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/40", actual.Url, "Url"); + } + + [TestMethod] + public void ReleaseDefinition_Constructor_NoEnvs() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamReleaseDefinition.json"); + + // Act + var actual = new ReleaseDefinition(obj[0], "Project Name"); + + // Assert + Assert.IsNull(actual.Tags, "Tags"); + Assert.IsNull(actual.Triggers, "Triggers"); + Assert.IsNull(actual.Variables, "Variables"); + Assert.IsNull(actual.Environments, "Environments"); + Assert.IsNull(actual.VariableGroups, "VariableGroups"); + + Assert.IsNotNull(actual.Artifacts, "Artifacts"); + Assert.IsNotNull(actual.CreatedBy, "CreatedBy"); + Assert.IsNotNull(actual.ModifiedBy, "ModifiedBy"); + Assert.IsNotNull(actual.Properties, "Properties"); + + Assert.IsTrue(actual.IsDeleted, "IsDeleted"); + + Assert.IsNotNull(actual.Links, "Links"); + Assert.IsNotNull(actual.Links.InternalObject, "Links.InternalObject"); + Assert.AreEqual("https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_release?definitionId=2", actual.Links.Web, "Links.Web"); + + Assert.AreEqual("2", actual.Id, "Id"); + Assert.AreEqual("\\", actual.Path, "Path"); + Assert.AreEqual(118, actual.Revision, "Revision"); + Assert.AreEqual("PTracker-CD", actual.Name, "Name"); + Assert.AreEqual(null, actual.Description, "Description"); + Assert.AreEqual("Donovan Brown", actual.CreatedByUser, "CreatedByUser"); + Assert.AreEqual("3/24/2019 4:46:08 PM", actual.CreatedOn.ToString(), "CreatedOn"); + Assert.AreEqual("Release-$(rev:r)", actual.ReleaseNameFormat, "ReleaseNameFormat"); + Assert.AreEqual("9/16/2019 2:32:37 PM", actual.ModifiedOn.ToString(), "ModifiedOn"); + Assert.AreEqual("https://vsrm.dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/Release/definitions/2", actual.Url, "Url"); + } + } +} diff --git a/Tests/library/Provider/ReleaseTests.cs b/Tests/library/Provider/ReleaseTests.cs new file mode 100644 index 000000000..d0c68ca96 --- /dev/null +++ b/Tests/library/Provider/ReleaseTests.cs @@ -0,0 +1,90 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ReleaseTests + { + [TestMethod] + public void Release_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamRelease.json"); + + // Act + var target = new Release(obj[0], ps, "Project Name"); + + // Assert + Assert.AreEqual(259, target.Id, "Id"); + Assert.AreEqual("active", target.Status, "Status"); + Assert.AreEqual(259, target.ReleaseId, "ReleaseId"); + Assert.IsNotNull(target.Environments, "Environments"); + Assert.AreEqual("2", target.DefinitionId, "DefinitionId"); + Assert.AreEqual(0, target.Environments.Count, "Environments.Count"); + Assert.AreEqual("PTracker-CD", target.DefinitionName, "DefinitionName"); + Assert.AreEqual("00000000-0000-0000-0000-000000000000", target.ProjectId, "ProjectId"); + + Assert.IsNotNull(target.Variables, "Variables"); + Assert.IsNotNull(target.ReleaseDefinition, "ReleaseDefinition"); + + Assert.AreEqual("Test@Test.com", target.ModifiedBy.UniqueName, "ModifiedBy.UniqueName"); + Assert.AreEqual("Donovan Brown", target.CreatedBy.DisplayName, "CreatedBy.DisplayName"); + Assert.AreEqual("11/14/2019 12:56:09 AM", target.CreatedOn.ToString(), "CreatedOn.ToString()"); + + Assert.AreEqual("Donovan Brown", target.CreatedByUser, "CreatedByUser"); + Assert.AreEqual("Donovan Brown", target.ModifiedByUser, "ModifiedByUser"); + } + + [TestMethod] + public void Release_Constructor_Expand_Environments() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamRelease-id178-expandEnvironments.json", false); + + // Act + var target = new Release(obj[0], ps, "Project Name"); + + // Assert + Assert.AreEqual(178, target.Id, "Id"); + Assert.AreEqual("active", target.Status, "Status"); + Assert.AreEqual("Release-132", target.Name, "Name"); + Assert.IsNotNull(target.Environments, "Environments"); + Assert.AreEqual(19, target.Environments.Count, "Environments.Count"); + Assert.AreEqual("PTracker-CD", target.DefinitionName, "DefinitionName"); + + Assert.IsNotNull(target.Variables, "Variables"); + Assert.IsNotNull(target.ReleaseDefinition, "ReleaseDefinition"); + + Assert.AreEqual("test@test.com", target.ModifiedBy.UniqueName, "ModifiedBy.UniqueName"); + Assert.AreEqual("Donovan Brown", target.CreatedBy.DisplayName, "CreatedBy.DisplayName"); + Assert.AreEqual("7/13/2019 3:49:31 PM", target.CreatedOn.ToString(), "CreatedOn.ToString()"); + } + + [TestMethod] + public void Release_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamRelease-id178-expandEnvironments.json", false); + var target = new Release(obj[0], ps, "Project Name"); + var envs = obj[0].GetValue("environments"); + var environments = new Collection(envs.Select(e => PSObject.AsPSObject(e)).ToList()); + ps.Invoke().Returns(environments); + + // Act + var children = target.GetChildItem(); + + // Assert + Assert.AreEqual(19, children.Length); + } + } +} diff --git a/Tests/library/Provider/ReleasesTests.cs b/Tests/library/Provider/ReleasesTests.cs new file mode 100644 index 000000000..e944e2fb4 --- /dev/null +++ b/Tests/library/Provider/ReleasesTests.cs @@ -0,0 +1,44 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Management.Automation; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class ReleasesTests + { + [TestMethod] + public void Releases_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + + // Act + var target = new Releases(ps, "Project Name"); + + // Assert + Assert.AreEqual("vsteam_lib.Provider.Release", target.TypeName, "TypeName"); + } + + [TestMethod] + public void Releases_GetChildItem() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var target = new Releases(ps, "Project Name"); + var obj = BaseTests.LoadJson("Get-VSTeamRelease.json"); + var releases = new Collection(obj.Select(o => PSObject.AsPSObject(o)).ToList()); + ps.Invoke().Returns(releases); + + // Act + var children = target.GetChildItem(); + + // Assert + Assert.AreEqual(2, children.Length, "Length"); + } + } +} diff --git a/Tests/library/Provider/SecurityNamespaceTests.cs b/Tests/library/Provider/SecurityNamespaceTests.cs new file mode 100644 index 000000000..1ffaba6b5 --- /dev/null +++ b/Tests/library/Provider/SecurityNamespaceTests.cs @@ -0,0 +1,44 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class SecurityNamespaceTests + { + [TestMethod] + public void SecurityNamespaceTests_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamSecurityNamespace.json"); + + // Act + var target = new SecurityNamespace(obj[0]); + + // Assert + Assert.AreEqual("Analytics", target.Name, "Name"); + Assert.IsNull(target.ExtensionType, "ExtensionType"); + Assert.AreEqual(false, target.IsRemotable, "IsRemotable"); + Assert.AreEqual(30, target.SystemBitMask, "SystemBitMask"); + Assert.AreEqual(-1, target.ElementLength, "ElementLength"); + Assert.AreEqual(1, target.ReadPermission, "ReadPermission"); + Assert.AreEqual("/", target.SeparatorValue, "SeparatorValue"); + Assert.AreEqual("1", target.StructureValue, "StructureValue"); + Assert.AreEqual(2, target.WritePermission, "WritePermission"); + Assert.AreEqual("Analytics", target.DisplayName, "DisplayName"); + Assert.AreEqual(false, target.UseTokenTranslator, "UseTokenTranslator"); + Assert.AreEqual("Default", target.DataspaceCategory, "DataspaceCategory"); + + Assert.AreEqual("Analytics", target.ToString(), "ToString()"); + + Assert.IsNotNull(target.Actions, "Actions"); + Assert.AreEqual(5, target.Actions.Count, "Actions.Count"); + Assert.AreEqual(1, target.Actions[0].Bit, "Actions[0].Bit"); + Assert.AreEqual("Read", target.Actions[0].Name, "Actions[0].Name"); + Assert.AreEqual(Guid.Empty, target.Actions[0].NamespaceId, "Actions[0].NamespaceId"); + Assert.AreEqual("View analytics", target.Actions[0].DisplayName, "Actions[0].DisplayName"); + } + } +} diff --git a/Tests/library/Provider/TeamTests.cs b/Tests/library/Provider/TeamTests.cs new file mode 100644 index 000000000..a0ac8022c --- /dev/null +++ b/Tests/library/Provider/TeamTests.cs @@ -0,0 +1,23 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class TeamTests + { + [TestMethod] + public void Team_Constructor() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeam.json"); + + // Act + var actual = new Team(obj[0], "ProjectName"); + + // Assert + Assert.AreEqual("The default project team.", actual.Description, "Description"); + } + } +} diff --git a/Tests/library/Provider/UserEntitlementTests.cs b/Tests/library/Provider/UserEntitlementTests.cs new file mode 100644 index 000000000..14076bcd2 --- /dev/null +++ b/Tests/library/Provider/UserEntitlementTests.cs @@ -0,0 +1,49 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; +using System.Management.Automation; +using vsteam_lib.Provider; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class UserEntitlementTests + { + [TestMethod] + public void UserEntitlementTests_Constructor() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamUserEntitlement.json", false); + var members = obj[0].GetValue("members"); + + // Act + var target = new UserEntitlement((PSObject)members[0]); + + // Assert + Assert.AreEqual("mlastName@test.com", target.Email, "Email"); + Assert.AreEqual("Math lastName", target.UserName, "UserName"); + Assert.AreEqual("Math lastName", target.ToString(), "ToString()"); + Assert.AreEqual("Math lastName", target.DisplayName, "DisplayName"); + Assert.AreEqual("mlastName@test.com", target.UniqueName, "UniqueName"); + Assert.AreEqual("Early Adopter", target.AccessLevelName, "AccessLevelName"); + Assert.AreEqual("9/9/2020 6:43:29 AM", target.LastAccessedDate.ToString(), "LastAccessedDate"); + } + + [TestMethod] + public void UserEntitlementTests_Constructor_ById() + { + // Arrange + var ps = BaseTests.PrepPowerShell(); + var obj = BaseTests.LoadJson("Get-VSTeamUserEntitlement-Id.json", false); + + // Act + var target = new UserEntitlement(obj[0]); + + // Assert + Assert.AreEqual("test@test.com", target.Email, "Email"); + Assert.AreEqual("Donovan Brown", target.UserName, "UserName"); + Assert.AreEqual("Early Adopter", target.AccessLevelName, "AccessLevelName"); + } + } +} diff --git a/Tests/library/Provider/UserTests.cs b/Tests/library/Provider/UserTests.cs new file mode 100644 index 000000000..450dc1240 --- /dev/null +++ b/Tests/library/Provider/UserTests.cs @@ -0,0 +1,75 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test.Provider +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class UserTests + { + [TestMethod] + public void User_Constructor_Without_MetaType() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamUser.json"); + + // Act + var target = new User(obj[0]); + + // Assert + Assert.AreEqual("vsts", target.Origin, "Origin"); + Assert.AreEqual(null, target.MetaType, "MetaTaype"); + Assert.AreEqual("AgentPool", target.Domain, "Domain"); + Assert.AreEqual("", target.MailAddress, "MailAddress"); + Assert.AreEqual(null, target.ProjectName, "ProjectName"); + Assert.IsNotNull(target.InternalObject, "InternalObject"); + Assert.AreEqual("user", target.SubjectKind, "SubjectKind"); + Assert.AreEqual("redacted", target.Descriptor, "Descriptor"); + Assert.AreEqual("Agent Pool Service (10)", target.DisplayName, "DisplayName"); + Assert.AreEqual("00000000-0000-0000-0000-000000000001", target.OriginId, "OriginId"); + Assert.AreEqual("00000000-0000-0000-0000-000000000011", target.PrincipalName, "PrincipalName"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Users/redacted", target.Url, "Url"); + + Assert.IsNotNull(target.Links, "Links"); + Assert.IsNotNull(target.Links.InternalObject, "Links.InternalObject"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Users/redacted", target.Links.Self, "Links.Self"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/redacted", target.Links.Memberships, "Links.Memberships"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/redacted", target.Links.MembershipState, "Links.MembershipState"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/redacted", target.Links.StorageKey, "Links.StorageKey"); + Assert.AreEqual("https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/redacted", target.Links.Avatar, "Links.Avatar"); + } + + [TestMethod] + public void User_Constructor_With_MetaType() + { + // Arrange + var obj = BaseTests.LoadJson("Get-VSTeamUser.json"); + + // Act + var target = new User(obj[3]); + + // Assert + Assert.AreEqual("aad", target.Origin, "Origin"); + Assert.AreEqual("member", target.MetaType, "MetaType"); + Assert.AreEqual(null, target.ProjectName, "ProjectName"); + Assert.IsNotNull(target.InternalObject, "InternalObject"); + Assert.AreEqual("user", target.SubjectKind, "SubjectKind"); + Assert.AreEqual("Redacted", target.Descriptor, "Descriptor"); + Assert.AreEqual("Donovan Brown", target.DisplayName, "DisplayName"); + Assert.AreEqual("Redacted", target.MemberDescriptor, "MemberDescriptor"); + Assert.AreEqual("test@microsoft.com", target.MailAddress, "MailAddress"); + Assert.AreEqual("test@microsoft.com", target.PrincipalName, "PrincipalName"); + Assert.AreEqual("00000000-0000-0000-0000-000000000088", target.Domain, "Domain"); + Assert.AreEqual("00000000-0000-0000-0000-000000000008", target.OriginId, "OriginId"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Users/Redacted", target.Url, "Url"); + + Assert.IsNotNull(target.Links, "Links"); + Assert.IsNotNull(target.Links.InternalObject, "Links.InternalObject"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Users/Redacted", target.Links.Self, "Links.Self"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/Memberships/Redacted", target.Links.Memberships, "Links.Memberships"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/MembershipStates/Redacted", target.Links.MembershipState, "Links.MembershipState"); + Assert.AreEqual("https://vssps.dev.azure.com/Test/_apis/Graph/StorageKeys/Redacted", target.Links.StorageKey, "Links.StorageKey"); + Assert.AreEqual("https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/Redacted", target.Links.Avatar, "Links.Avatar"); + } + } +} diff --git a/Tests/library/VersionsTests.cs b/Tests/library/VersionsTests.cs new file mode 100644 index 000000000..e42b6c0d3 --- /dev/null +++ b/Tests/library/VersionsTests.cs @@ -0,0 +1,42 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Diagnostics.CodeAnalysis; + +namespace vsteam_lib.Test +{ + [TestClass] + [ExcludeFromCodeCoverage] + public class VersionsTests + { + [TestMethod] + [DataTestMethod] + [DataRow("BuildV1", APIs.Build)] + [DataRow("ReleaseV1", APIs.Release)] + [DataRow("CoreV1", APIs.Core)] + [DataRow("GitV1", APIs.Git)] + [DataRow("DistributedTaskV1", APIs.DistributedTask)] + [DataRow("DistributedTaskReleasedV1", APIs.DistributedTaskReleased)] + [DataRow("VariableGroupsV1", APIs.VariableGroups)] + [DataRow("TfvcV1", APIs.Tfvc)] + [DataRow("PackagingV1", APIs.Packaging)] + [DataRow("MemberEntitlementManagementV1", APIs.MemberEntitlementManagement)] + [DataRow("ExtensionsManagementV1", APIs.ExtensionsManagement)] + [DataRow("ServiceEndpointsV1", APIs.ServiceEndpoints)] + [DataRow("GraphV1", APIs.Graph)] + [DataRow("TaskGroupsV1", APIs.TaskGroups)] + [DataRow("PolicyV1", APIs.Policy)] + [DataRow("HierarchyQuery", APIs.HierarchyQuery)] + [DataRow("ProcessesV1", APIs.Processes)] + [DataRow("TFS2017", APIs.Version)] + public void Versions_ChangeServiceVersions(string expected, APIs version) + { + // Arrange + Versions.SetApiVersion(version, expected); + + // Act + var actual = Versions.GetApiVersion(version); + + // Assert + Assert.AreEqual(expected, actual); + } + } +} diff --git a/Tests/library/vsteam-lib.Test.csproj b/Tests/library/vsteam-lib.Test.csproj new file mode 100644 index 000000000..3ea39570a --- /dev/null +++ b/Tests/library/vsteam-lib.Test.csproj @@ -0,0 +1,370 @@ + + + + netcoreapp3.1 + vsteam_lib.Test + + false + + Debug;Release;VS;LibOnly + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ..\..\packages\ships\CodeOwls.PowerShell.Paths.dll + + + ..\..\packages\ships\CodeOwls.PowerShell.Provider.dll + + + ..\..\packages\ships\Microsoft.PowerShell.SHiPS.dll + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + + + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a8e592e9c..b4f0bc10b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,44 +16,28 @@ stages: displayName: Build Stage jobs: - - job: macOS_Linux_Phase - displayName: 'Build' - strategy: - matrix: - macOS: - OS: 'macOS' - vmImageName: 'macOS-latest' - Linux: - OS: 'Linux' - vmImageName: 'ubuntu-16.04' - maxParallel: 2 - pool: - vmImage: $(vmImageName) - steps: - - template: build/unitTests.yml - parameters: - os: '$(OS)' - - - job: Windows_Phase - displayName: Build Windows + - job: Linux_Phase + displayName: Build Linux pool: - vmImage: 'windows-latest' + vmImage: 'ubuntu-16.04' steps: - - template: build/unitTests.yml + - template: .build/unitTests.yml parameters: - os: 'Windows' - buildHelp: 'true' + os: 'Linux' + buildHelp: 'false' - task: PowerShell@2 displayName: 'Install PSScriptAnalyzer' inputs: + pwsh: true targetType: 'inline' script: 'Install-Module -Name PSScriptAnalyzer -Repository PSGallery -Force -Scope CurrentUser -Verbose' - task: PowerShell@2 displayName: 'Run Static Code Analysis' inputs: + pwsh: true targetType: 'inline' script: | # Has to happen in this task for it to take effect @@ -71,26 +55,16 @@ stages: Write-Host "##vso[task.complete result=Failed;]Static Code Analysis with error count = $count" } - - task: CredScan@2 - displayName: 'Run CredScan' - inputs: - toolMajorVersion: 'V2' - suppressionsFile: '$(Build.SourcesDirectory)/build/credscan-supression.json' - - - task: SdtReport@1 - displayName: 'Create Security Analysis Report' - inputs: - AllTools: false - CredScan: true - - - task: PublishSecurityAnalysisLogs@2 - displayName: 'Publish Security Analysis Logs' + - job: macOS_Phase + displayName: Build macOS + pool: + vmImage: 'macOS-latest' - - task: PostAnalysis@1 - displayName: 'Post Analysis' - inputs: - AllTools: false - CredScan: true + steps: + - template: .build/unitTests.yml + parameters: + os: 'macOS' + buildHelp: 'true' - task: CopyFiles@2 displayName: 'Copy Module to Artifacts Folder' @@ -98,7 +72,7 @@ stages: Contents: | README.md .gitignore - dist\** + dist/** TargetFolder: '$(build.artifactstagingdirectory)/VSTeam' flattenFolders: false condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], false)) @@ -114,8 +88,16 @@ stages: displayName: 'Copy Integration Tests Artifacts Folder' inputs: Contents: | - dist\*.psd1 - integration\** + Tests/SampleFiles/** + Tests/integration/tests/** + TargetFolder: '$(build.artifactstagingdirectory)/Tests' + condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], false)) + + - task: CopyFiles@2 + displayName: 'Copy psd1 to Integration Tests Artifacts Folder' + inputs: + Contents: | + dist/*.psd1 TargetFolder: '$(build.artifactstagingdirectory)/Tests' condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], false)) @@ -126,6 +108,29 @@ stages: artifact: 'test' condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], false)) + - job: Windows_Phase + displayName: Build Windows + pool: + vmImage: 'windows-latest' + + steps: + - template: .build/unitTests.yml + parameters: + os: 'Windows' + buildHelp: 'false' + + - task: CredScan@2 + displayName: 'Run CredScan' + inputs: + toolMajorVersion: 'V2' + suppressionsFile: '$(Build.SourcesDirectory)/.build/credscan-supression.json' + + - task: PostAnalysis@1 + displayName: 'Post Analysis' + inputs: + AllTools: false + CredScan: true + - stage: Package displayName: Package Management dependsOn: Build @@ -140,6 +145,10 @@ stages: runOnce: deploy: steps: + - download: current + displayName: 'Download module' + artifact: module + - task: NuGetToolInstaller@0 displayName: 'Install NuGet 5.2.0' inputs: @@ -148,6 +157,7 @@ stages: - task: PowerShell@2 displayName: 'Install Module Dependencies' inputs: + pwsh: true targetType: 'inline' script: | # Load the psd1 file so you can read the required modules and install them @@ -155,11 +165,12 @@ stages: # Install each module $manifest.RequiredModules | ForEach-Object { Install-Module -Name $_ -Repository PSGallery -Force -Scope CurrentUser -Verbose } - workingDirectory: '$(Pipeline.Workspace)/Module' + workingDirectory: '$(Pipeline.Workspace)/module' - task: PowerShell@2 displayName: 'Compute Version Number' inputs: + pwsh: true targetType: 'inline' script: | # Load the psd1 file so you can read the version @@ -168,11 +179,12 @@ stages: Write-Host "Package Version Number: $($manifest.ModuleVersion).$(Build.BuildId)" Write-Host "##vso[task.setvariable variable=PACKAGE_VERSION;isOutput=false]$($manifest.ModuleVersion).$(Build.BuildId)" - workingDirectory: '$(Pipeline.Workspace)/Module' + workingDirectory: '$(Pipeline.Workspace)/module' - task: PowerShell@2 displayName: 'Create NuSpec from PSD1' inputs: + pwsh: true targetType: 'inline' script: | Install-Module -Name Trackyon.Nuget -Scope CurrentUser -Force -Verbose @@ -180,14 +192,14 @@ stages: Write-Host "Convert psd1 into a NuSpec" ConvertTo-NuSpec -Path ./$(Folder)/VSTeam.psd1 -Verbose - workingDirectory: '$(Pipeline.Workspace)/Module' + workingDirectory: '$(Pipeline.Workspace)/module' - task: NuGetCommand@2 displayName: 'Pack Module' inputs: command: pack - packagesToPack: '$(Pipeline.Workspace)/Module/$(Folder)/VSTeam.nuspec' - packDestination: '$(Pipeline.Workspace)/Module/$(Folder)' + packagesToPack: '$(Pipeline.Workspace)/module/$(Folder)/VSTeam.nuspec' + packDestination: '$(Pipeline.Workspace)/module/$(Folder)' versioningScheme: byEnvVar versionEnvVar: 'PACKAGE_VERSION' @@ -195,7 +207,7 @@ stages: displayName: 'Push Module' inputs: command: push - packagesToPush: '$(Pipeline.Workspace)/Module/$(Folder)/*.nupkg' + packagesToPush: '$(Pipeline.Workspace)/module/$(Folder)/*.nupkg' publishVstsFeed: 'vsteam' allowPackageConflicts: true @@ -204,7 +216,7 @@ stages: dependsOn: Package jobs: - - template: build/integrationTests.yml + - template: .build/integrationTests.yml parameters: displayName: 'Linux TFS 2018' os: 'Linux' @@ -215,7 +227,7 @@ stages: apiVersion: 'TFS2018' account: 'http://winbldbox3.centralus.cloudapp.azure.com:8080/tfs/defaultcollection' - - template: build/integrationTests.yml + - template: .build/integrationTests.yml parameters: displayName: 'Windows AzD' os: 'Windows' @@ -224,7 +236,7 @@ stages: apiVersion: 'VSTS' account: 'tooltester' - - template: build/integrationTests.yml + - template: .build/integrationTests.yml parameters: displayName: 'macOS TFS 2017' os: 'macOS' @@ -249,6 +261,9 @@ stages: runOnce: deploy: steps: + - download: current + artifact: module + - task: NuGetToolInstaller@0 displayName: 'Install NuGet 5.2.0' inputs: @@ -257,6 +272,7 @@ stages: - task: PowerShell@2 displayName: 'Install Module Dependencies' inputs: + pwsh: true targetType: 'inline' script: | # Load the psd1 file so you can read the required modules and install them @@ -264,11 +280,12 @@ stages: # Install each module $manifest.RequiredModules | ForEach-Object { Install-Module -Name $_ -Repository PSGallery -F -Scope CurrentUser } - workingDirectory: '$(Pipeline.Workspace)/Module' + workingDirectory: '$(Pipeline.Workspace)/module' - task: PowerShell@2 displayName: 'Create NuSpec from PSD1' inputs: + pwsh: true targetType: 'inline' script: | Install-Module -Name Trackyon.Nuget -Scope CurrentUser -Force -Verbose @@ -278,19 +295,19 @@ stages: $manifest = Import-PowerShellDataFile ./$(Folder)/VSTeam.psd1 Write-Host "##vso[task.setvariable variable=PACKAGE_VERSION;isOutput=false]$($manifest.ModuleVersion)" - workingDirectory: '$(Pipeline.Workspace)/Module' + workingDirectory: '$(Pipeline.Workspace)/module' - task: NuGetCommand@2 displayName: 'Pack Module' inputs: command: pack - packagesToPack: '$(Pipeline.Workspace)/Module/$(Folder)/VSTeam.nuspec' - packDestination: '$(Pipeline.Workspace)/Module/$(Folder)' + packagesToPack: '$(Pipeline.Workspace)/module/$(Folder)/VSTeam.nuspec' + packDestination: '$(Pipeline.Workspace)/module/$(Folder)' - task: PublishPipelineArtifact@1 displayName: 'Publish nupkg Artifact' inputs: - targetPath: '$(Pipeline.Workspace)/Module/$(Folder)' + targetPath: '$(Pipeline.Workspace)/module/$(Folder)' artifact: 'Package' publishLocation: 'pipeline' @@ -298,7 +315,7 @@ stages: displayName: 'Push Module' inputs: command: push - packagesToPush: '$(Pipeline.Workspace)/Module/$(Folder)/*.nupkg' + packagesToPush: '$(Pipeline.Workspace)/module/$(Folder)/*.nupkg' nuGetFeedType: external publishFeedCredentials: 'PowerShell Gallery' @@ -312,4 +329,4 @@ stages: addChangeLog: true compareWith: 'lastFullRelease' assets: | - $(Pipeline.Workspace)/Module/$(Folder)/*.nupkg + $(Pipeline.Workspace)/module/$(Folder)/*.nupkg diff --git a/build/CredScanTask.md b/build/CredScanTask.md deleted file mode 100644 index 41038eef9..000000000 --- a/build/CredScanTask.md +++ /dev/null @@ -1,71 +0,0 @@ -# Credential Scanner (CredScan) in the Build - -This repository uses the so called [CredScan created by Microsoft](https://secdevtools.azurewebsites.net/helpcredscan.html#collapseOne) to prevent passwords being added to the master branch. - -To not even commit credentials to the repository you can download and install a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=VSIDEDevOpsMSFT.ContinuousDeliveryToolsforVisualStudio&ssr=false#overview). Unfortunately, no VS Code extension is available yet. - -## Unit tests - -When writing unit tests fake passwords have to be used sometimes. -To prevent CredScan to mix up fake passwords with real ones, a suppression file is used. - -There are several passwords defined, that can be used: - -If you write a unit test, which needs a fake password please include this in the suppression file for CredScan. - -**Note**: This only applies for unit tests and documentation, but not for the module itself. - -## How suppressions work - -The following documentation is taken from [the official CredScan](https://secdevtools.azurewebsites.net/helpcredscan.html) page. - -### Suppress all occurrences of a given secret within the specified path - -The hash key of the secret from the CredScan output file is required as shown in the sample below - -```json - { - "tool": "Credential Scanner", - "suppressions": [ - { - "hash": "CLgYxl2FcQE8XZgha9/UbKLTkJkUh3Vakkxh2CAdhtY=", - "_justification": "Secret used by MSDN sample, it is fake." - } - ] - } -``` - -**Warning:** The hash key is generated by a portion of the matching value or file content. Any source code revision could change the hash key and disable the suppression rule. - -### To suppress all secrets in a specified file (or to suppress the secrets file itself) - -The file expression could be a file name or any postfix portion of the full file path/name. Wildcards are not supported. - -#### Example - -File to be suppressed: [InputPath]\src\JS\lib\angular.js -Valid Suppression Rules: - -* [InputPath]\src\JS\lib\angular.js -- suppress the file in the specified path -* \src\JS\lib\angular.js -* \JS\lib\angular.js -* \lib\angular.js -* angular.js -- suppress any file with the same name - -```json - { - "tool": "Credential Scanner", - "suppressions": [ - { - "file": "\\files\\AdditonalSearcher.xml", - "_justification": "Additional CredScan searcher specific to my team" - }, - { - "file": "\\files\\unittest.pfx", - "_justification": "Legitimate UT certificate file with private key" - } - ] - } -``` - -**Warning:** All future secrets added to the file will also get suppressed automatically. diff --git a/docs/Add-VSTeam.md b/docs/Add-VSTeam.md deleted file mode 100644 index ba0104488..000000000 --- a/docs/Add-VSTeam.md +++ /dev/null @@ -1,71 +0,0 @@ - - - -# Add-VSTeam - -## SYNOPSIS - -Adds a team to a team project. - -## SYNTAX - -## DESCRIPTION - -Adds a team to a team project. - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -Description - -The description of the team. - -```yaml -Type: String -Position: 1 -``` - -### -Name - -The name of the team - -```yaml -Type: String -Aliases: TeamName -Required: True -Position: 1 -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeam](Get-VSTeam.md) - -[Remove-VSTeam](Remove-VSTeam.md) - -[Show-VSTeam](Show-VSTeam.md) - -[Update-VSTeam](pda-VSTeam.md) - diff --git a/docs/Add-VSTeamAccessControlEntry.md b/docs/Add-VSTeamAccessControlEntry.md deleted file mode 100644 index 0205fe0de..000000000 --- a/docs/Add-VSTeamAccessControlEntry.md +++ /dev/null @@ -1,187 +0,0 @@ - - - -# Add-VSTeamAccessControlEntry - -## SYNOPSIS - -Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. - -Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. - -## SYNTAX - -## DESCRIPTION - -Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. - -Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. - -## EXAMPLES - -## PARAMETERS - -### -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) -``` - -### -SecurityNamespaceName - -Security Namespace Name. Valid names are: - -AzD: -- Analytics (58450c49-b02d-465a-ab12-59ae512d6531) -- AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) -- ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) -- ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) -- Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) -- WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) -- DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) -- WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) -- GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) -- VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) -- EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) -- WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) -- ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) -- ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) -- Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) -- Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) -- Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) -- Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) -- Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) -- AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) -- Library (b7e84409-6553-448a-bbb2-af228e07cbeb) -- Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) -- Project (52d39943-cb85-4d7f-8fa8-c6baac873819) -- EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) -- CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) -- TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) -- ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) -- Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) -- MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) -- Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) -- Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) -- Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) -- Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) -- ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) -- Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) -- WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) -- StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) -- Server (1f4179b3-6bac-4d01-b421-71ea09171400) -- TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) -- SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) -- BuildAdministration (302acaca-b667-436d-a946-87133492041c) -- Location (2725d2bc-7520-4af4-b0e3-8d876494731f) -- Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) -- UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) -- WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) -- WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) -- VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) -- Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) -- CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) -- WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) -- Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) -- BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) -- DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) -- Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) -- Security (9a82c708-bfbe-4f31-984c-e860c2196781) -- IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) -- ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) -- Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) -- DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) -- VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) - -VSSPS: -- EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) -- EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) -- Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) -- Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) -- Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) -- SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) -- Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) -- CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) -- StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) -- GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) -- Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) -- SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) -- RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) -- Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) -- WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) -- DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) -- Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) -- IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) -- ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) - - -```yaml -Type: String -Required: True -``` - -### -SecurityNamespace - -Security namespace identifier. - -```yaml -Type: VSTeamSecurityNamespace -Required: True -``` - -### -SecurityNamespaceId - -Security namespace identifier. - -```yaml -Type: String -Required: True -``` - -### -Token - -The security Token - -```yaml -Type: String -Required: True -``` - -### -AllowMask - -Bitmask for Allow Permissions - -```yaml -Type: Int -Required: True -``` - -### -DenyMask - -Bitmask for Deny Permissions - -```yaml -Type: Int -Required: True -``` - -## INPUTS - -## OUTPUTS - -### VSTeamAccessControlEntry - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamArea.md b/docs/Add-VSTeamArea.md deleted file mode 100644 index 8551d1943..000000000 --- a/docs/Add-VSTeamArea.md +++ /dev/null @@ -1,83 +0,0 @@ - - - -# Add-VSTeamArea - -## SYNOPSIS - -Adds a new area to the project - -## SYNTAX - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamArea -ProjectName Demo -Name "NewArea" -Path "MyArea/Path" -``` - -This command adds a new area named NewArea to the Demo project under the area path MyArea/Path. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamArea -ProjectName Demo -Name "NewArea" -``` - -This command adds a new area named NewArea to the Demo project. - -## DESCRIPTION - -Adds a new area to the project - -## 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) -``` - -### -Name - -Name of the new area. - -```yaml -Type: string -``` - -### -Path - -Path of the existing area under where the new one will be created. - -```yaml -Type: string -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This function is a wrapper of the base function Add-VSTeamClassificationNode. - -## RELATED LINKS - -[Add-VSTeamClassificationNode](Add-VSTeamClassificationNode.md) - -[Add-VSTeamIteration](Add-VSTeamIteration.md) - diff --git a/docs/Add-VSTeamAzureRMServiceEndpoint.md b/docs/Add-VSTeamAzureRMServiceEndpoint.md deleted file mode 100644 index 47cfcd0da..000000000 --- a/docs/Add-VSTeamAzureRMServiceEndpoint.md +++ /dev/null @@ -1,115 +0,0 @@ - - - -# Add-VSTeamAzureRMServiceEndpoint - -## SYNOPSIS - -Adds a new Azure Resource Manager service endpoint. - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new connection between TFS/AzD and Azure using the Azure Resource Manager connection type. - -## EXAMPLES - -## 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) -``` - -### -SubscriptionName - -The name of the Azure Subscription. - -```yaml -Type: String -Aliases: displayName -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -SubscriptionId - -The id of the Azure subscription to use. - -```yaml -Type: String -Required: True -Position: 2 -Accept pipeline input: true (ByPropertyName) -``` - -### -SubscriptionTenantId - -The id of the Azure tenant to use. - -```yaml -Type: String -Required: True -Position: 3 -Accept pipeline input: true (ByPropertyName) -``` - -### -ServicePrincipalId - -The ID of the Azure Service Principal to use with this service endpoint. - -```yaml -Type: String -Parameter Sets: Manual -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -ServicePrincipalKey - -The key of the Azure Service Principal to use with this service endpoint. - -```yaml -Type: String -Parameter Sets: Manual -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -EndpointName - -The name displayed on the services page. -In AzD this is the Connection Name. - -```yaml -Type: String -Position: 4 -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - diff --git a/docs/Add-VSTeamBuild.md b/docs/Add-VSTeamBuild.md deleted file mode 100644 index 300f07b00..000000000 --- a/docs/Add-VSTeamBuild.md +++ /dev/null @@ -1,157 +0,0 @@ - - - -# Add-VSTeamBuild - -## SYNOPSIS - -Queues a new build. - -## SYNTAX - -## DESCRIPTION - -Add-VSTeamBuild will queue a new build. - -You can override the queue in the build definition by using the QueueName parameter. You can override the default source branch by using the SourceBranch parameter. You can also set specific build parameters by using the BuildParameters parameter. - -To have the BuildDefinition and QueueNames tab complete you must set a default project by calling Set-VSTeamDefaultProject before you call Add-VSTeamBuild. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted -``` - -This example sets the default project so you can tab complete the BuildDefinition parameter. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -SourceBranch refs/heads/develop - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted -``` - -This example queues the build for the 'develop' branch, overriding the default branch in the build definition. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamBuild -BuildDefinition Demo-CI -BuildParameters @{msg="hello world!"; 'system.debug'='true'} - -Build Definition Build Number Status Result ----------------- ------------ ------ ------ -Demo-CI Demo-CI-45 notStarted -``` - -This example queues the build and sets the system.debug variable to true and msg to 'hello world!'. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -BuildDefinitionName - -The name of the build definition to use to queue to build. - -```yaml -Type: String -Parameter Sets: ByName -Aliases: BuildDefinition -Accept pipeline input: true (ByPropertyName) -``` - -### -QueueName - -The name of the queue to use for this build. - -```yaml -Type: String -Accept pipeline input: true (ByPropertyName) -``` - -### -BuildDefinitionId - -The Id of the build definition to use to queue to build. - -```yaml -Type: Int32 -Parameter Sets: ByID -Aliases: Id -Accept pipeline input: true (ByPropertyName) -``` - -### -SourceBranch - -Which source branch to use for this build. Overrides default branch in build definition. - -```yaml -Type: String -``` - -### -BuildParameters - -A hashtable with build parameters. - -```yaml -Type: System.Collection.Hashtable -``` - -## INPUTS - -### System.String - -ProjectName - -BuildDefinitionName - -QueueName - -SourceBranch - -### System.Int32 - -BuildDefinitionId - -### System.Collections.Hashtable - -Build Parameters - -## OUTPUTS - -### Team.Build - -## NOTES - -BuildDefinition and QueueName are dynamic parameters and use the default project value to query their validate set. - -If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamBuild you will have to type in the names. - -## RELATED LINKS - diff --git a/docs/Add-VSTeamBuildDefinition.md b/docs/Add-VSTeamBuildDefinition.md deleted file mode 100644 index 9e6cc2d11..000000000 --- a/docs/Add-VSTeamBuildDefinition.md +++ /dev/null @@ -1,75 +0,0 @@ - - - -# Add-VSTeamBuildDefinition - -## SYNOPSIS - -Creates a new build definition from a JSON file. - -## SYNTAX - -## DESCRIPTION - -Reads a JSON file off disk and uses that file to create a new build definition in the provided project. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamBuildDefinition -ProjectName Demo -InFile build.json -``` - -This command reads build.json and creates a new build definition from it -on the demo team project. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -InFile - -Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. - -```yaml -Type: String -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the -project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have -to pass the ProjectName with each call. - -## RELATED LINKS - diff --git a/docs/Add-VSTeamBuildTag.md b/docs/Add-VSTeamBuildTag.md deleted file mode 100644 index af31e3a28..000000000 --- a/docs/Add-VSTeamBuildTag.md +++ /dev/null @@ -1,109 +0,0 @@ - - - -# Add-VSTeamBuildTag - -## SYNOPSIS - -Adds a tag to a build. - -## SYNTAX - -## DESCRIPTION - -Adds a tag to a build. - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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 - -Specifies one or more builds by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build, type Get-VSTeamBuild. - -```yaml -Type: Int32[] -Aliases: BuildID -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Tags - -One or more tags. To specify multiple, use commas to separate. - -```yaml -Type: String[] -Required: True -Position: 1 -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamClassificationNode.md b/docs/Add-VSTeamClassificationNode.md deleted file mode 100644 index fdcbe6fbf..000000000 --- a/docs/Add-VSTeamClassificationNode.md +++ /dev/null @@ -1,108 +0,0 @@ - - - -# Add-VSTeamClassificationNode - -## SYNOPSIS - -Adds either a new iteration or area to the project - -## SYNTAX - -## DESCRIPTION - -Adds either a new iteration or area to the project - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamClassificationNode -ProjectName Demo -Name "NewIteration" -StructureGroup "iteration" -Path "MyIteration/Path" -``` - -This command adds a new iteration named NewIteration to the Demo project under the iteration path MyIteration/Path. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamClassificationNode -ProjectName "Demo" -FinishDate (Get-Date "31.01.2020") -StartDate (Get-Date "01.01.2020") -Name "NewIteration" -StructureGroup "iterations" -``` - -This command adds a new iteration named NewIteration to the Demo project with the start date 01.01.2020 and finish date 31.01.2020. - -## 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) -``` - -### -Name - -Name of the new classification node. - -```yaml -Type: string -``` - -### -StructureGroup - -Structure group of the classification node. - -```yaml -Type: string -Accepted values: iterations, areas -``` - -### -Path - -Path of the classification node. - -```yaml -Type: string -``` - -### -StartDate - -Start date of the classification node. - -```yaml -Type: datetime -``` - -### -FinishDate - -Finish date of the classification node. - -```yaml -Type: datetime -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This function is the base function for Add-VSTeamArea and Add-VSTeamIteration. - -## RELATED LINKS - -[Add-VSTeamArea](Add-VSTeamArea.md) - -[Add-VSTeamIteration](Add-VSTeamIteration.md) - diff --git a/docs/Add-VSTeamExtension.md b/docs/Add-VSTeamExtension.md deleted file mode 100644 index 9d9aa12c0..000000000 --- a/docs/Add-VSTeamExtension.md +++ /dev/null @@ -1,62 +0,0 @@ - - - -# Add-VSTeamExtension - -## SYNOPSIS - -Install the specified extension into the account / project collection. - -## SYNTAX - -## DESCRIPTION - -Install the specified extension into the account / project collection. - -## EXAMPLES - -## PARAMETERS - -### -PublisherId - -The id of the publisher. - -```yaml -Type: String -Required: True -``` - -### -ExtensionId - -The id of the extension. - -```yaml -Type: String -Required: True -``` - -### -Version - -The version of the extension. Example: "0.1.35". - -```yaml -Type: String -Required: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamExtension](Add-VSTeamExtension.md) - -[Get-VSTeamExtension](Get-VSTeamExtension.md) - -[Remove-VSTeamExtension](Remove-VSTeamExtension.md) - -[Update-VSTeamExtension](Update-VSTeamExtension.md) - diff --git a/docs/Add-VSTeamFeed.md b/docs/Add-VSTeamFeed.md deleted file mode 100644 index f98f65197..000000000 --- a/docs/Add-VSTeamFeed.md +++ /dev/null @@ -1,68 +0,0 @@ - - - -# Add-VSTeamFeed - -## SYNOPSIS - -Adds a new feed to package management. - -## SYNTAX - -## DESCRIPTION - -Adds a new feed to package management. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamFeed -Name test -Description 'Test Description' -``` - -This command adds a new package feed to the account. - -## PARAMETERS - -### -Name - -Name of the feed - -```yaml -Type: string -Accept pipeline input: true (ByPropertyName) -``` - -### -Description - -Description of the feed - -```yaml -Type: string -``` - -### -EnableUpstreamSources - -Enables npm and nuget upstream sources for the feed - -```yaml -Type: SwitchParameter -``` - -### -showDeletedPackageVersions - -The feed will show deleted version in the feed - -```yaml -Type: SwitchParameter -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamGitRepository.md b/docs/Add-VSTeamGitRepository.md deleted file mode 100644 index e64f2ee11..000000000 --- a/docs/Add-VSTeamGitRepository.md +++ /dev/null @@ -1,61 +0,0 @@ - - - -# Add-VSTeamGitRepository - -## SYNOPSIS - -Adds a Git repository to your Azure DevOps or Team Foundation Server account. - -## SYNTAX - -## DESCRIPTION - -Add-VSTeamGitRepository adds a Git repository to your Azure DevOps or Team Foundation Server account. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamGitRepository -ProjectName Demo -Name Temp -``` - -This command adds a new repository named Temp to the Demo project. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -Name - -Specifies the name of the repository. - -```yaml -Type: System.String -Aliases: RepositoryID -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamGitRepositoryPermission.md b/docs/Add-VSTeamGitRepositoryPermission.md deleted file mode 100644 index 515f1c935..000000000 --- a/docs/Add-VSTeamGitRepositoryPermission.md +++ /dev/null @@ -1,101 +0,0 @@ - - - -# Add-VSTeamGitRepositoryPermission - -## SYNOPSIS - -Add permissions to a git repository, all repositories in a project, or a specific branch - -## SYNTAX - -## DESCRIPTION - -Add permissions to a git repository, all repositories in a project, or a specific branch - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -RepositoryId - -```yaml -Type: String -Required: True -``` - -### -RepositoryName - -```yaml -Type: String -Required: True -``` - -### -BranchName - -```yaml -Type: String -Required: True -``` - -### -Descriptor - -```yaml -Type: String -Required: True -``` - -### -User - -```yaml -Type: VSTeamUser -Required: True -``` - -### -Group - -```yaml -Type: VSTeamGroup -Required: True -``` - -### -Allow - -```yaml -Type: VSTeamGitRepositoryPermissions -Required: True -``` - -### -Deny - -```yaml -Type: VSTeamGitRepositoryPermissions -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamIteration.md b/docs/Add-VSTeamIteration.md deleted file mode 100644 index 4506ef9cb..000000000 --- a/docs/Add-VSTeamIteration.md +++ /dev/null @@ -1,99 +0,0 @@ - - - -# Add-VSTeamIteration - -## SYNOPSIS - -Adds a new iteration to the project - -## SYNTAX - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamIteration -ProjectName Demo -Name "NewIteration" -Path "MyIteration/Path" -``` - -This command adds a new iteration named NewIteration to the Demo project under the iteration path MyIteration/Path. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamIteration -ProjectName "Demo" -FinishDate (Get-Date "31.01.2020") -StartDate (Get-Date "01.01.2020") -Name "NewIteration" -``` - -This command adds a new iteration named NewIteration to the Demo project with the start date 01.01.2020 and finish date 31.01.2020. - -## DESCRIPTION - -Adds a new iteration to the project - -## 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) -``` - -### -Name - -Name of the new iteration. - -```yaml -Type: string -``` - -### -Path - -Path of the existing iteration under where the new one will be created. - -```yaml -Type: string -``` - -### -StartDate - -Start date of the iteration. - -```yaml -Type: datetime -``` - -### -FinishDate - -Finish date of the iteration. - -```yaml -Type: datetime -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This function is a wrapper of the base function Add-VSTeamClassificationNode. - -## RELATED LINKS - -[Add-VSTeamArea](Add-VSTeamArea.md) - -[Add-VSTeamClassificationNode](Add-VSTeamClassificationNode.md) - diff --git a/docs/Add-VSTeamKubernetesEndpoint.md b/docs/Add-VSTeamKubernetesEndpoint.md deleted file mode 100644 index 32ad7256d..000000000 --- a/docs/Add-VSTeamKubernetesEndpoint.md +++ /dev/null @@ -1,120 +0,0 @@ - - - -# Add-VSTeamKubernetesEndpoint - -## SYNOPSIS - -Adds connections to Kubernetes clusters - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new connection between TFS/AzD and a Kubernetes cluster using kubeconfig json. - -This is only used when using the Kubernetes tasks. - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -Kubeconfig - -kubeconfig as JSON string - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -KubernetesUrl - -URL of Kubernetes cluster - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -EndpointName - -The name displayed on the services page. -In AzD this is the Connection Name. - -```yaml -Type: String -Position: 3 -``` - -### -ClientCertificateData - -Client certificate from Kubeconfig - -```yaml -Type: String -Required: True -``` - -### -ClientKeyData - -Client private key from Kubeconfig - -```yaml -Type: String -Parameter Sets: Plain -Required: True -``` - -### -AcceptUntrustedCerts - -Accept untrusted certificates for cluster - -```yaml -Type: Switch -``` - -### -GeneratePfx - -Generate pfx file - -```yaml -Type: Switch -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - diff --git a/docs/Add-VSTeamMembership.md b/docs/Add-VSTeamMembership.md deleted file mode 100644 index 567a3b556..000000000 --- a/docs/Add-VSTeamMembership.md +++ /dev/null @@ -1,69 +0,0 @@ - - - -# Add-VSTeamMembership - -## SYNOPSIS - -Adds a membership to a container. - -## SYNTAX - -## DESCRIPTION - -Adds a membership to a container. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> $user = Get-VSTeamUser | ? DisplayName -eq 'Test User' -PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' -PS C:\> Add-VSTeamMembership -MemberDescriptor $user.Descriptor -ContainerDescriptor $group.Descriptor -``` - -Adds Test User to the Endpoint Administrators group. - -## PARAMETERS - -### -MemberDescriptor - -A member descriptor retrieved by Get-VsTeamUser - -```yaml -Type: String -Required: True -Position: 0 -``` - - -### -ContainerDescriptor - -A container descriptor retrieved by Get-VsTeamGroup - -```yaml -Type: String -Required: True -Position: 1 -``` - - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VsTeamUser](Get-VsTeamUser.md) - -[Get-VsTeamGroup](Get-VsTeamGroup.md) - -[Get-VsTeamMembership](Get-VsTeamMembership.md) - -[Remove-VsTeamMembership](Remove-VsTeamMembership.md) - -[Test-VsTeamMembership](Test-VsTeamMembership.md) - diff --git a/docs/Add-VSTeamNuGetEndpoint.md b/docs/Add-VSTeamNuGetEndpoint.md deleted file mode 100644 index 88ecd2b42..000000000 --- a/docs/Add-VSTeamNuGetEndpoint.md +++ /dev/null @@ -1,153 +0,0 @@ - - - -# Add-VSTeamNuGetEndpoint - -## SYNOPSIS - -Adds a new NuGet service endpoint. - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new connection between TFS/AzD and a NuGet server using the NuGet connection type. - -This is only used when using the NuGet tasks. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> $apikey = Read-Host -Prompt 'ApiKey' -AsSecureString -ApiKey: ************************************ -PS C:\> Add-NuGetEndpoint -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -SecureApiKey $apikey -``` - -This will add a project name MyProject with no description using the Scrum process -template and Git source control. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -NuGetUrl - -URL of the NuGet server. - -```yaml -Type: String -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -PersonalAccessToken - -Authentication Token generated by NuGet. - -```yaml -Type: String -Parameter Sets: ClearToken -Required: True -Position: Named -Accept pipeline input: true (ByPropertyName) -``` - -### -ApiKey - -Authentication ApiKey generated by NuGet. - -```yaml -Type: String -Parameter Sets: ClearApiKey -Required: True -Position: Named -Accept pipeline input: true (ByPropertyName) -``` - -### -Username - -Username to use with basic authentication. - -```yaml -Type: String -Parameter Sets: SecurePassword -Position: Named -``` - -### -EndpointName - -The name displayed on the services page. -In AzD this is the Connection Name. - -```yaml -Type: String -Position: Named -``` - -### -SecureApiKey - -A secured string to capture your sensitive information. - -This will allow you to provide your information without displaying it in plain text. - -```yaml -Type: SecureString -Parameter Sets: SecureApiKey -Required: True -``` - -### -SecurePersonalAccessToken - -A secured string to capture your sensitive information. - -You must provide on the command line. You will not be prompted for this value. - -You can use $p = Read-Host -AsSecureString to capture to pass in as parameter. - -```yaml -Type: SecureString -Parameter Sets: SecureToken -Required: True -``` - -### -SecurePassword - -A secured string to capture your sensitive information. - -```yaml -Type: SecureString -Parameter Sets: SecurePassword -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - diff --git a/docs/Add-VSTeamPolicy.md b/docs/Add-VSTeamPolicy.md deleted file mode 100644 index 3237e1b66..000000000 --- a/docs/Add-VSTeamPolicy.md +++ /dev/null @@ -1,93 +0,0 @@ - - - -# Add-VSTeamPolicy - -## SYNOPSIS - -Adds a new policy to the specified project. - -## SYNTAX - -## DESCRIPTION - -Adds a new policy to the specified project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamPolicy -ProjectName Demo -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} -``` - -This command adds a new policy to the Demo project's repository specified. The policy added requires a minimum number of reviewers and applies to the master branch. Specifying `-blocking` will block pushes to master directly. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -type - -Specifies the id of the type of policy to be created. - -```yaml -Type: Guid -Required: True -``` - -### -enabled - -Enables the policy - -```yaml -Type: Switch -``` - -### -blocking - -Determines if the policy will block pushes to the branch if the policy is not adhered to. - -```yaml -Type: Switch -``` - -### -settings - -The settings for the policy. - -Each policy type has it's own settings that will need to be set. - -```yaml -Type: Hashtable -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamPolicy](Get-VSTeamPolicy.md) - -[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md) - diff --git a/docs/Add-VSTeamProfile.md b/docs/Add-VSTeamProfile.md deleted file mode 100644 index 936131373..000000000 --- a/docs/Add-VSTeamProfile.md +++ /dev/null @@ -1,147 +0,0 @@ - - - -# Add-VSTeamProfile - -## SYNOPSIS - -Stores your account name and personal access token as a profile for use with -the Add-TeamAccount function in this module. - -## SYNTAX - -## DESCRIPTION - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProfile -``` - -You will be prompted for the account name and personal access token. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProfile -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Version TFS2018 -``` - -Allows you to provide all the information on the command line. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProfile -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication -``` - -On Windows, allows you use to use Windows authentication against a local TFS server. - -## PARAMETERS - -### -Account - -The Azure DevOps (AzD) account name to use. -DO NOT enter the entire URL. - -Just the portion after dev.azure.com. For example in the -following url mydemos is the account name. - -or -The full Team Foundation Server (TFS) url including the collection. - - -```yaml -Type: String -Parameter Sets: Secure, Plain, Windows -Required: True -Position: 1 -``` - -### -PAT - -A secured string to capture your personal access token. - -This will allow you to provide your personal access token -without displaying it in plain text. - -To use pat simply omit it from the Add-VSTeamProfile command. - -```yaml -Type: SecureString -Parameter Sets: Secure -Required: True -``` - -### -PersonalAccessToken - -The personal access token from AzD/TFS to use to access this account. - -```yaml -Type: String -Parameter Sets: Plain -Required: True -Position: 2 -``` - -### -UseWindowsAuthentication - -Allows the use of the current user's Windows credentials to authenticate against a local TFS. - -```yaml -Type: SwitchParameter -Parameter Sets: Windows -``` - -### -UseBearerToken - -Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - -```yaml -Type: SwitchParameter -Parameter Sets: Secure, Plain -``` - -### -Name - -Optional name for the profile. If this parameter is not provided the account will also serve as the name. - -```yaml -Type: String -Required: True -Position: 3 -``` - -### -Version - -Specifies the version to use. The acceptable values for this parameter are: - -- TFS2017 -- TFS2018 -- AzD2019 -- VSTS -- AzD - -If you are on AzD it will default to Azd otherwise it will default to TFS2017 - -```yaml -Type: String -Parameter Sets: Secure, Plain, Windows -Required: True -Position: 3 -Default value: TFS2017 for TFS and AzD for AzD -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - diff --git a/docs/Add-VSTeamProject.md b/docs/Add-VSTeamProject.md deleted file mode 100644 index 72e31afb4..000000000 --- a/docs/Add-VSTeamProject.md +++ /dev/null @@ -1,89 +0,0 @@ - - - -# Add-VSTeamProject - -## SYNOPSIS - -Adds a Team Project to your account. - -## SYNTAX - -## DESCRIPTION - -This will create a new Team Project in your Team Foundation Server or Team Services account. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProject 'MyProject' -``` - -This will add a project name MyProject with no description using the Scrum process -template and Git source control. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamProject 'MyProject' -TFVC -ProcessTemplate Agile -``` - -This will add a project name MyProject with no description using the Agile process -template and TFVC source control. - -## PARAMETERS - -### -ProjectName - -The name of the project to create. - -```yaml -Type: String -Aliases: Name -Required: True -Position: 0 -``` - -### -ProcessTemplate - -The name of the process template to use for the project. - -You can tab complete from a list of available projects. - -```yaml -Type: String -Default value: Scrum -``` - -### -Description - -The description of the team project. - -```yaml -Type: String -``` - -### -TFVC - -Switches the source control from Git to TFVC. - -```yaml -Type: SwitchParameter -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Remove-VSTeamProject](Remove-VSTeamProject.md) - -[Get-VSTeamProcess](Get-VSTeamProcess.md) - diff --git a/docs/Add-VSTeamProjectPermission.md b/docs/Add-VSTeamProjectPermission.md deleted file mode 100644 index 5118180da..000000000 --- a/docs/Add-VSTeamProjectPermission.md +++ /dev/null @@ -1,80 +0,0 @@ - - - -# Add-VSTeamProjectPermission - -## SYNOPSIS - -Add Permissions on Project Level - -## SYNTAX - -## DESCRIPTION - -Add Permissions on Project Level - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -Descriptor - -```yaml -Type: String -Required: True -``` - -### -User - -```yaml -Type: VSTeamUser -Required: True -``` - -### -Group - -```yaml -Type: VSTeamGroup -Required: True -``` - -### -Allow - -```yaml -Type: VSTeamProjectPermissions -Required: True -``` - -### -Deny - -```yaml -Type: VSTeamProjectPermissions -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamPullRequest.md b/docs/Add-VSTeamPullRequest.md deleted file mode 100644 index 01d19f975..000000000 --- a/docs/Add-VSTeamPullRequest.md +++ /dev/null @@ -1,151 +0,0 @@ - - - -# Add-VSTeamPullRequest - -## SYNOPSIS - -Create a new Pull Request - -## SYNTAX - -## DESCRIPTION - -Create a new Pull Request - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Add-VSTeamPullRequest -ProjectName project -RepositoryId $r.RepositoryId -SourceRefName "refs/heads/mybranch" -TargetRefName "refs/heads/master" -Title "My PR" -Description "My Description" -Draft -``` - -Create a new pull request as a draft - -## 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) -``` - -### -RepositoryId - -Specifies the ID of the repository - -```yaml -Type: Guid -Required: True -Aliases: Id -Accept pipeline input: true (ByPropertyName) -``` - -### -SourceRefName - -A source reference, like a branch or commit -Needs to be in ref format like refs/heads/MyBranch - -```yaml -Type: String -Required: True -``` - -### -TargetRefName - -A target reference, like a branch or commit -Needs to be in ref format like refs/heads/MyBranch - -```yaml -Type: String -Required: True -``` - -### -Title - -The title of the pull request - -```yaml -Type: String -Required: True -``` - -### -Description - -The description of the pull request - -```yaml -Type: String -Required: True -``` - -### -Draft - -Mark the new pull request as a draft - -```yaml -Type: Switch -``` - -### -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -### Team.PullRequest - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamRelease.md b/docs/Add-VSTeamRelease.md deleted file mode 100644 index 010bb9df0..000000000 --- a/docs/Add-VSTeamRelease.md +++ /dev/null @@ -1,170 +0,0 @@ - - - -# Add-VSTeamRelease - -## SYNOPSIS - -Queues a new release - -## SYNTAX - -## DESCRIPTION - -Add-VSTeamRelease will queue a new release. - -The environments will deploy according to how the release definition is configured in the Triggers tab. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild | ft id,name - -id name --- ---- -44 Demo-CI-44 - -PS C:\> Get-VSTeamReleaseDefinition -Expand artifacts | ft id,name,@{l='Alias';e={$_.artifacts[0].alias}} - -id name Alias --- ---- ----- - 1 Demo-CD Demo-CI - -PS C:\> Add-VSTeamRelease -DefinitionId 1 -Description Test -ArtifactAlias Demo-CI -BuildId 44 -``` - -This example shows how to find the Build ID, Artifact Alias, and Release definition ID required to start a release. If you call Set-VSTeamDefaultProject you can use Example 2 which is much easier. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamRelease -DefinitionName Demo-CD -Description Test -BuildNumber Demo-CI-44 -``` - -This command starts a new release using the Demo-CD release definition and the build with build number Demo-CI-44. - -You must set a default project to tab complete DefinitionName and BuildNumber. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -DefinitionId - -The id of the release definition to use. - -```yaml -Type: Int32 -Parameter Sets: ById -Required: True -``` - -### -Description - -The description to use on the release. - -```yaml -Type: String -Required: True -``` - -### -ArtifactAlias - -The alias of the artifact to use with this release. - -```yaml -Type: String -Parameter Sets: ById -Required: True -``` - -### -Name - -The name of this release. - -```yaml -Type: String -``` - -### -BuildId - -The id of the build to use with this release. - -```yaml -Type: String -Parameter Sets: ById -Required: True -``` - -### -DefinitionName - -The name of the release definition to use. - -```yaml -Type: String -Parameter Sets: ByName -Accept pipeline input: true (ByPropertyName) -``` - -### -SourceBranch - -The branch of the artifact - -```yaml -Type: String -``` - -### -BuildNumber - -The number of the build to use. - -```yaml -Type: String -Parameter Sets: ByName -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -## RELATED LINKS - diff --git a/docs/Add-VSTeamReleaseDefinition.md b/docs/Add-VSTeamReleaseDefinition.md deleted file mode 100644 index 3219ada5c..000000000 --- a/docs/Add-VSTeamReleaseDefinition.md +++ /dev/null @@ -1,71 +0,0 @@ - - - -# Add-VSTeamReleaseDefinition - -## SYNOPSIS - -Creates a new release definition from a JSON file. - -## SYNTAX - -## DESCRIPTION - -Reads a JSON file off disk and uses that file to create a new release definition in the provided project. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamReleaseDefinition -ProjectName demo -inFile release.json -``` - -This command reads release.json and creates a new release definition from it on the demo team project. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -InFile - -Path and file name to the JSON file that contains the definition to be created. If the path is omitted, the default is the current location. - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## RELATED LINKS - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - diff --git a/docs/Add-VSTeamServiceEndpoint.md b/docs/Add-VSTeamServiceEndpoint.md deleted file mode 100644 index a7af1f7c0..000000000 --- a/docs/Add-VSTeamServiceEndpoint.md +++ /dev/null @@ -1,79 +0,0 @@ - - - -# Add-VSTeamServiceEndpoint - -## SYNOPSIS - -Adds a generic service connection - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new generic connection between TFS/AzD and a third party service (see AzD for available connections). - -## EXAMPLES - -## 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) -``` - -### -Object - -Hashtable of Payload for REST call - -```yaml -Type: Hashtable -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -EndpointName - -The name displayed on the services page. In AzD this is the Connection Name. - -```yaml -Type: String -Position: 2 -``` - -### -EndpointType - -Type of endpoint (eg. `kubernetes`, `sonarqube`). See AzD service page for supported endpoints. - -```yaml -Type: String -Position: 3 -``` - -## INPUTS - -## OUTPUTS - -### Team.ServiceEndpoint - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - diff --git a/docs/Add-VSTeamServiceFabricEndpoint.md b/docs/Add-VSTeamServiceFabricEndpoint.md deleted file mode 100644 index de25605bd..000000000 --- a/docs/Add-VSTeamServiceFabricEndpoint.md +++ /dev/null @@ -1,175 +0,0 @@ - - - -# Add-VSTeamServiceFabricEndpoint - -## SYNOPSIS - -Adds a new Service Fabric service endpoint. - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new Service Fabric service endpoint to an existing project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "NoAuthTest" -url "tcp://10.0.0.1:19000" -useWindowsSecurity $false -``` - -Adds a Service Fabric Endpoint for a non-secure cluster - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "AzureAdAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -username "someUser@someplace.com" -password $password -``` - -Adds a Service Fabric Endpoint for an Azure AD secured cluster. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force -PS C:\> $pathToPFX = "C:\someFolder\theCertificateFile.pfx" -PS C:\> $base64Cert = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes($pathToPFX)) -PS C:\> Add-VSTeamServiceFabricEndpoint -ProjectName "SomeProjectName" -endpointName "CertificateAuthTest" -url "tcp://10.0.0.1:19000" -serverCertThumbprint "SOMECERTTHUMBPRINT" -certificate $base64Cert -certificatePassword $password -``` - -Adds a Service Fabric Endpoint for a certificate secured cluster. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -url - -The url of the Service Fabric management endpoint. - -```yaml -Type: String -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -useWindowsSecurity - -If windows integrated authentication should be enabled. If set to false, all authentication is disabled. - -```yaml -Type: Boolean -Position: 2 -Accept pipeline input: true (ByPropertyName) -``` - -### -clusterSpn - -Specify the cluster service principal name, for use with windows integrated authentication. - -```yaml -Type: String -Accept pipeline input: true (ByPropertyName) -``` - -### -serverCertThumbprint - -The server certificate thumbprint, used for communicating with the Service Fabric cluster. - -```yaml -Type: String -Parameter Sets: AzureAd, Certificate -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -username - -The Azure AD Username, used for communicating with the Service Fabric cluster. - -```yaml -Type: String -Parameter Sets: AzureAd -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -password - -The Password for the Azure AD User, used for communicating with the Service Fabric cluster. - -```yaml -Type: SecureString -Parameter Sets: AzureAd -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -certificate - -The certificate used for communicating with the Service Fabric cluster. - -```yaml -Type: String -Parameter Sets: Certificate -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -certificatePassword - -The Password for the certificate used for communicating with the Service Fabric cluster. - -```yaml -Type: SecureString -Parameter Sets: Certificate -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -endpointName - -The name displayed on the services page. In AzD this is the Connection Name. - -```yaml -Type: String -Aliases: displayName -Position: 3 -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.ServiceEndpoint - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - diff --git a/docs/Add-VSTeamSonarQubeEndpoint.md b/docs/Add-VSTeamSonarQubeEndpoint.md deleted file mode 100644 index 111a5ca7b..000000000 --- a/docs/Add-VSTeamSonarQubeEndpoint.md +++ /dev/null @@ -1,100 +0,0 @@ - - - -# Add-VSTeamSonarQubeEndpoint - -## SYNOPSIS - -Adds a new SonarQube service endpoint. - -## SYNTAX - -## DESCRIPTION - -The cmdlet adds a new connection between TFS/AzD and a SonarQube server using the SonarQube connection type. - -This is only used when using the SonarQube tasks. - -Using SonarQube with the Maven tasks uses a Generic Connection type. - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -SonarQubeUrl - -URL of the sonarqube server. - -```yaml -Type: String -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -PersonalAccessToken - -Authentication Token generated by SonarQube. - -```yaml -Type: String -Parameter Sets: Plain -Required: True -Position: 2 -Accept pipeline input: true (ByPropertyName) -``` - -### -EndpointName - -The name displayed on the services page. -In AzD this is the Connection Name. - -```yaml -Type: String -Position: 3 -``` - -### -SecurePersonalAccessToken - -A secured string to capture your personal access token. - -This will allow you to provide your personal access token without displaying it in plain text. - -To use pat simply omit it from the Set-VSTeamAccount command. - -```yaml -Type: SecureString -Parameter Sets: Secure -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - diff --git a/docs/Add-VSTeamTaskGroup.md b/docs/Add-VSTeamTaskGroup.md deleted file mode 100644 index 02367a7a7..000000000 --- a/docs/Add-VSTeamTaskGroup.md +++ /dev/null @@ -1,125 +0,0 @@ - - - -# Add-VSTeamTaskGroup - -## SYNOPSIS - -Adds a task group. - -## SYNTAX - -## DESCRIPTION - -Adds a task group. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```powershell - -$taskGroup = Get-VSTeamTaskGroup -Name "taskGroupName" -ProjectName "sourceProjectName" - -# Set the ID and revision to null, so AzD is happy. -$taskGroup.id = $null -$taskGroup.revision = $null - -$taskGroupJson = ConvertTo-Json -InputObject $taskGroup -Depth 10 - -Add-VSTeamTaskGroup -Body $taskGroupJson -ProjectName "destinationProjectName" -``` - -This example is useful for when one wants to copy an existing task group in one project into another project. - -## PARAMETERS - -### -ProjectName - -### -ProjectName - -Specifies the team project for which this function operates. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so -you do not have to pass the ProjectName with each call. - -```yaml -Type: String -Position: 0 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -WhatIf - -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InFile - -The path to the json file that represents the task group - -```yaml -Type: String -Parameter Sets: ByFile -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Body - -The json that represents the task group as a string - -```yaml -Type: String -Parameter Sets: ByBody -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorTask, -InformationAction, -InformationTask, -OutTask, -OutBuffer, -PipelineTask, -Verbose, -WarningAction, and -WarningTask. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Update-VSTeamTaskGroup](Update-VSTeamTaskGroup.md) - -[Get-VSTeamTaskGroup](Get-VSTeamTaskGroup.md) - -[Remove-VSTeamTaskGroup](Remove-VSTeamTaskGroup.md) - diff --git a/docs/Add-VSTeamUserEntitlement.md b/docs/Add-VSTeamUserEntitlement.md deleted file mode 100644 index 9288d501e..000000000 --- a/docs/Add-VSTeamUserEntitlement.md +++ /dev/null @@ -1,112 +0,0 @@ - - - -# Add-VSTeamUserEntitlement - -## SYNOPSIS - -Add a user, assign license and extensions and make them a member of a project group in an account. - -## SYNTAX - -## DESCRIPTION - -Add a user, assign license and extensions and make them a member of a project group in an account. - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -License - -Type of Account License. The acceptable values for this parameter are: - -- Advanced -- EarlyAdopter -- Express -- None -- Professional -- StakeHolder - -```yaml -Type: String -Required: True -Default value: EarlyAdopter -``` - -### -Group - -The acceptable values for this parameter are: - -- Custom -- ProjectAdministrator -- ProjectContributor -- ProjectReader -- ProjectStakeholder - -```yaml -Type: String -Required: True -Default value: ProjectContributor -``` - -### -LicensingSource - -Licensing Source (e.g. Account. MSDN etc.). The acceptable values for this parameter are: - -- account -- auto -- msdn -- none -- profile -- trial - -```yaml -Type: String -Default value: account -``` - -### -MSDNLicenseType - -Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.). The acceptable values for this parameter are: - -- eligible -- enterprise -- none -- platforms -- premium -- professional -- testProfessional -- ultimate - -```yaml -Type: String -Default value: none -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamVariableGroup.md b/docs/Add-VSTeamVariableGroup.md deleted file mode 100644 index a557d8941..000000000 --- a/docs/Add-VSTeamVariableGroup.md +++ /dev/null @@ -1,227 +0,0 @@ - - - -# Add-VSTeamVariableGroup - -## SYNOPSIS - -Adds a variable group. - -## SYNTAX - -## DESCRIPTION - -Adds a variable group. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "Vsts" - Variables = @{ - key1 = @{ - value = "value1" - } - key2 = @{ - value = "value2" - isSecret = $true - } - } -} - -Add-VSTeamVariableGroup @methodParameters -``` - -### -------------------------- EXAMPLE 2 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "AzureKeyVault" - Variables = @{ - name_of_existing_secret = @{ - enabled = $true - contentType = "" - value = "" - isSecret = $true - } - } - ProviderData = @{ - serviceEndpointId = "AzureRMServiceEndpointGuid" - vault = "name_of_existing_key_vault" - } -} - -Add-VSTeamVariableGroup @methodParameters -``` - -### -------------------------- EXAMPLE 3 -------------------------- - -```powershell -# Copy variable group varGroupName from project sourceProjectName to project targetProjectName. If varGroupName already exists, we'll update it; else, we'll add it. - -$Name = "varGroupName" -$FromProject = "sourceProjectName" -$ToProject = "targetProjectName" - -$FromVariableGroupObject = Get-VSTeamVariableGroup -Name $Name -ProjectName $FromProject -$body = ConvertTo-Json -InputObject $FromVariableGroupObject -Depth 100 -Compress -$toVariableGroupObject = Get-VSTeamVariableGroup -Name $Name -ProjectName $ToProject -if ($toVariableGroupObject) { - Update-VSTeamVariableGroup -Body $body -ProjectName $ToProject -Id $toVariableGroupObject.id -} -else { - Add-VSTeamVariableGroup -Body $body -ProjectName $ToProject -} - -``` - -## 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) -``` - -### -Description - -The variable group description - -```yaml -Type: String -Parameter Sets: ByHashtable -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Name - -The variable group name - -```yaml -Type: String -Parameter Sets: ByHashtable -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -ProviderData - -The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. - -```yaml -Type: Hashtable -Parameter Sets: ByHashtable -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Type - -The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. - -```yaml -Type: String -Parameter Sets: ByHashtable -Aliases: -Accepted values: Vsts, AzureKeyVault - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Variables - -The variable group variables. - -```yaml -Type: Hashtable -Parameter Sets: ByHashtable -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Body - -The json that represents the variable group as a string - -```yaml -Type: String -Parameter Sets: ByBody -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String - -System.Collections.Hashtable - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) - -[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) - -[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) - diff --git a/docs/Add-VSTeamWorkItem.md b/docs/Add-VSTeamWorkItem.md deleted file mode 100644 index b236ffb42..000000000 --- a/docs/Add-VSTeamWorkItem.md +++ /dev/null @@ -1,158 +0,0 @@ - - - -# Add-VSTeamWorkItem - -## SYNOPSIS - -Adds a work item to your project. - -## SYNTAX - -## DESCRIPTION - -Add-VSTeamWorkItem will add a new work item to your project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task - -ID Title Status --- ----- ------ -6 New Work Item To Do -``` - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" - -ID Title Status --- ----- ------ -6 New Work Item To Do -``` - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> $additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"} -PS C:\> Add-VSTeamWorkItem -Title "New Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields - -ID Title Status --- ----- ------ -6 New Work Item To Do -``` - -## 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) -``` - -### -Title - -The title of the work item - -```yaml -Type: String -Required: True -``` - -### -Description - -The Description of the work item - -```yaml -Type: String -Required: False -``` - -### -IterationPath - -The IterationPath of the work item - -```yaml -Type: String -Required: False -``` - -### -AssignedTo - -The email address of the user this work item will be assigned to. - -```yaml -Type: String -Required: False -``` - -### -WorkItemType - -The type of work item to add. - -You can tab complete from a list of available work item types. - -You must use Set-VSTeamDefaultProject to set a default project to enable the tab completion. - -```yaml -Type: String -Required: True -``` - -### -ParentId - -The Id of the parent work item that this work item will be related to. - -```yaml -Type: Int -Required: False -``` - -### -AdditionalFields - -Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'. - -```yaml -Type: Hashtable -Required: False -``` - -## INPUTS - -### System.String - -ProjectName - -WorkItemType - -## OUTPUTS - -## NOTES - -WorkItemType is a dynamic parameter and use the default -project value to query their validate set. - -If you do not set the default project by called Set-VSTeamDefaultProject before -calling Add-VSTeamWorkItem you will have to type in the names. - -Any of the basic work item parameters defined in this method, will cause an exception if also added to the parameter AdditionalFields, since it is redundant. Either only use the parameter OR define them in the AdditionalFields parameter. - -## RELATED LINKS - diff --git a/docs/Add-VSTeamWorkItemAreaPermission.md b/docs/Add-VSTeamWorkItemAreaPermission.md deleted file mode 100644 index 6f72f75f9..000000000 --- a/docs/Add-VSTeamWorkItemAreaPermission.md +++ /dev/null @@ -1,94 +0,0 @@ - - - -# Add-VSTeamWorkItemAreaPermission - -## SYNOPSIS - -Add Permissions to a Work Item Area - -## SYNTAX - -## DESCRIPTION - -Add Permissions to a Work Item Area - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -AreaID - -```yaml -Type: Int32 -Required: True -``` - -### -AreaPath - -```yaml -Type: String -Required: True -``` - -### -Descriptor - -```yaml -Type: String -Required: True -``` - -### -User - -```yaml -Type: VSTeamUser -Required: True -``` - -### -Group - -```yaml -Type: VSTeamGroup -Required: True -``` - -### -Allow - -```yaml -Type: VSTeamWorkItemAreaPermissions -Required: True -``` - -### -Deny - -```yaml -Type: VSTeamWorkItemAreaPermissions -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Add-VSTeamWorkItemIterationPermission.md b/docs/Add-VSTeamWorkItemIterationPermission.md deleted file mode 100644 index 2cf53e853..000000000 --- a/docs/Add-VSTeamWorkItemIterationPermission.md +++ /dev/null @@ -1,94 +0,0 @@ - - - -# Add-VSTeamWorkItemIterationPermission - -## SYNOPSIS - -Add Permissions to an Iteration - -## SYNTAX - -## DESCRIPTION - -Add Permissions to an Iteration - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -IterationID - -```yaml -Type: Int32 -Required: True -``` - -### -IterationPath - -```yaml -Type: String -Required: True -``` - -### -Descriptor - -```yaml -Type: String -Required: True -``` - -### -User - -```yaml -Type: VSTeamUser -Required: True -``` - -### -Group - -```yaml -Type: VSTeamGroup -Required: True -``` - -### -Allow - -```yaml -Type: VSTeamWorkItemIterationPermissions -Required: True -``` - -### -Deny - -```yaml -Type: VSTeamWorkItemIterationPermissions -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Clear-VSTeamDefaultAPITimeout.md b/docs/Clear-VSTeamDefaultAPITimeout.md deleted file mode 100644 index ce1d3ac09..000000000 --- a/docs/Clear-VSTeamDefaultAPITimeout.md +++ /dev/null @@ -1,47 +0,0 @@ - - - -# Clear-VSTeamDefaultAPITimeout - -## SYNOPSIS - -Clears the value stored in the default timeout parameter value. - -## SYNTAX - -## DESCRIPTION - -Clears the value stored in the default timeout parameter value. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Clear-VSTeamDefaultAPITimeout -``` - -This will clear the default timeout parameter value. - -## PARAMETERS - -### -Level - -On Windows allows you to clear your default timeout at the Process, User or Machine levels. - -```yaml -Type: String -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamDefaultAPITimeout](Set-VSTeamDefaultAPITimeout.md) - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - diff --git a/docs/Clear-VSTeamDefaultProject.md b/docs/Clear-VSTeamDefaultProject.md deleted file mode 100644 index cd87fc4e1..000000000 --- a/docs/Clear-VSTeamDefaultProject.md +++ /dev/null @@ -1,47 +0,0 @@ - - - -# Clear-VSTeamDefaultProject - -## SYNOPSIS - -Clears the value stored in the default project parameter value. - -## SYNTAX - -## DESCRIPTION - -Clears the value stored in the default project parameter value. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Clear-VSTeamDefaultProject -``` - -This will clear the default project parameter value. You will now have to provide a project for any functions that require a project. - -## PARAMETERS - -### -Level - -On Windows allows you to clear your default project at the Process, User or Machine levels. - -```yaml -Type: String -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - diff --git a/docs/Disable-VSTeamAgent.md b/docs/Disable-VSTeamAgent.md deleted file mode 100644 index 8a0535b79..000000000 --- a/docs/Disable-VSTeamAgent.md +++ /dev/null @@ -1,50 +0,0 @@ - - - -# Disable-VSTeamAgent - -## SYNOPSIS - -Disables an agent in a pool. - -## SYNTAX - -## DESCRIPTION - -Disables an agent in a pool. - -## EXAMPLES - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: int -Required: True -Accept pipeline input: true (ByValue) -``` - -### -Id - -Id of the agent to disable. - -```yaml -Type: int[] -Aliases: AgentID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Enable-VSTeamAgent.md b/docs/Enable-VSTeamAgent.md deleted file mode 100644 index 79e0800de..000000000 --- a/docs/Enable-VSTeamAgent.md +++ /dev/null @@ -1,50 +0,0 @@ - - - -# Enable-VSTeamAgent - -## SYNOPSIS - -Enables an agent in a pool. - -## SYNTAX - -## DESCRIPTION - -Enables an agent in a pool. - -## EXAMPLES - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: int -Required: True -Accept pipeline input: true (ByValue) -``` - -### -Id - -Id of the agent to enable. - -```yaml -Type: int[] -Aliases: AgentID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeam.md b/docs/Get-VSTeam.md deleted file mode 100644 index 254f20b77..000000000 --- a/docs/Get-VSTeam.md +++ /dev/null @@ -1,81 +0,0 @@ - - - -# Get-VSTeam - -## SYNOPSIS - -Returns a team. - -## SYNTAX - -## DESCRIPTION - -Returns a team. - -## EXAMPLES - -## 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) -``` - -### -Skip - -The number of items to skip. - -```yaml -Type: Int32 -Parameter Sets: List -``` - -### -TeamId - -The id of the team to retrieve. - -```yaml -Type: String[] -Parameter Sets: ByID -``` - -### -Top - -Specifies the maximum number to return. - -```yaml -Type: Int32 -Parameter Sets: List -``` - -### -Name - -The name of the team to retrieve. - -```yaml -Type: String[] -Parameter Sets: ByName -``` - -## INPUTS - -## OUTPUTS - -### Team.Team - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamAPIVersion.md b/docs/Get-VSTeamAPIVersion.md deleted file mode 100644 index a8a9ae55e..000000000 --- a/docs/Get-VSTeamAPIVersion.md +++ /dev/null @@ -1,64 +0,0 @@ - - - -# 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 deleted file mode 100644 index cb3fe4746..000000000 --- a/docs/Get-VSTeamAccessControlList.md +++ /dev/null @@ -1,89 +0,0 @@ - - - -# Get-VSTeamAccessControlList - -## SYNOPSIS - -Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. - -## SYNTAX - -## DESCRIPTION - -Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList -``` - -## PARAMETERS - -### -SecurityNamespace - -Security namespace identifier. - -```yaml -Type: VSTeamSecurityNamespace -Required: True -``` - -### -SecurityNamespaceId - -Security namespace identifier. - -```yaml -Type: String -Required: True -``` - -### -Token - -Security token - -```yaml -Type: String -Required: True -``` - -### -Descriptors - -An optional filter string containing a list of identity descriptors whose ACEs should be retrieved. If this is not set entire ACLs will be returned. - -```yaml -Type: String -Required: True -``` - -### -IncludeExtendedInfo - -If set, populate the extended information properties for the access control entries contained in the returned lists. - -```yaml -Type: Switch -Required: True -``` - -### -Recurse - -If true and this is a hierarchical namespace, return child ACLs of the specified token. - -```yaml -Type: Switch -Required: True -``` - -## INPUTS - -## OUTPUTS - -### VSTeamAccessControlList - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamAgent.md b/docs/Get-VSTeamAgent.md deleted file mode 100644 index a297ed556..000000000 --- a/docs/Get-VSTeamAgent.md +++ /dev/null @@ -1,57 +0,0 @@ - - - -# Get-VSTeamAgent - -## SYNOPSIS - -Returns the agents in a pool. - -## SYNTAX - -## DESCRIPTION - -Returns the agents in a pool. - -## EXAMPLES - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByValue) -``` - -### -Id - -Id of the agent to return. - -```yaml -Type: String -Parameter Sets: ByID -Aliases: AgentID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -To read system capabilities that contain dots you have to use the PSObject Properties property. - -(Get-VSTeamAgent 1 91).systemCapabilities.PSObject.Properties['Agent.OS'].Value - -## RELATED LINKS - diff --git a/docs/Get-VSTeamApproval.md b/docs/Get-VSTeamApproval.md deleted file mode 100644 index 3299fabd0..000000000 --- a/docs/Get-VSTeamApproval.md +++ /dev/null @@ -1,126 +0,0 @@ - - - -# Get-VSTeamApproval - -## SYNOPSIS - -Gets a list of approvals for all releases for a team project. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamApproval function gets the approvals for all releases for a team project. - -With just a project name, this function gets all of the pending approvals for that team project. - -When using with AzD "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter is not empty. - -When using with TFS "IncludeMyGroupApprovals" will be added to the request when Assigned To Filter, Release Id Filter are not empty and Status Filter equals Pending. - -The Team.Approval type has three custom table formats: - -- Pending: ID, Status, Release Name, Environment, Type, Approver Name, Release Definitions -- Approved: Release Name, Environment, Is Automated, Approval Type, Approver Name, Release Definitions, Comments -- Rejected: Release Name, Environment, Approval Type, Approver Name, Release Definition, Comments - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo -``` - -This command gets a list of all pending approvals. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo -StatusFilter Approved | Format-Table -View Approved -``` - -This command gets a list of all approved approvals using a custom table format. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo -AssignedToFilter Administrator -StatusFilter Rejected | FT -View Rejected -``` - -This command gets a list of all approvals rejected by Administrator using a custom table format. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -StatusFilter - -By default the function returns Pending approvals. - -Using this filter you can return Approved, ReAssigned or Rejected approvals. - -There is a custom table view for each status. - -```yaml -Type: String -``` - -### -ReleaseIdsFilter - -Only approvals for the release ids provided will be returned. - -```yaml -Type: Int32[] -Aliases: ReleaseIdFilter -``` - -### -AssignedToFilter - -Approvals are filtered to only those assigned to this user. - -```yaml -Type: String -``` - -## INPUTS - -## OUTPUTS - -### Team.BuildDefinition - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe build definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -[Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) - diff --git a/docs/Get-VSTeamArea.md b/docs/Get-VSTeamArea.md deleted file mode 100644 index 9b1c6f45c..000000000 --- a/docs/Get-VSTeamArea.md +++ /dev/null @@ -1,73 +0,0 @@ - - - -# Get-VSTeamArea - -## SYNOPSIS - -Gets the area node for a given area path. - -## SYNTAX - -## DESCRIPTION - -Gets the area node for a given area path. - -## 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) -``` - -### -Depth - -Depth of children to fetch. - -```yaml -Type: int32 -``` - -### -Path - -Path of the classification node. - -```yaml -Type: string -``` - -### -Ids - -Integer classification nodes ids. - -```yaml -Type: int32[] -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This is a wrapper function for Get-VSTeamClassificationNode - -## RELATED LINKS - -[Get-VSTeamClassificationNode](Get-VSTeamClassificationNode.md) - -[Get-VSTeamIteration](Get-VSTeamIteration.md) - diff --git a/docs/Get-VSTeamBuild.md b/docs/Get-VSTeamBuild.md deleted file mode 100644 index fa01de31b..000000000 --- a/docs/Get-VSTeamBuild.md +++ /dev/null @@ -1,239 +0,0 @@ - - - -# Get-VSTeamBuild - -## SYNOPSIS - -Gets the builds for a team project. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamBuild function gets the builds for a team project. - -With just a project name, this function gets all of the builds for that team project. - -You can also specify a particular build by ID. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo | Format-List * -``` - -This command gets a list of all builds in the demo project. - -The pipeline operator (|) passes the data to the Format-List cmdlet, which -displays all available properties (*) of the build objects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -top 5 -resultFilter failed -``` - -This command gets a list of 5 failed builds in the demo project. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> 1203,1204 | Get-VSTeamBuild -ProjectName demo -``` - -This command gets builds with IDs 1203 and 1204 by using the pipeline. - -### -------------------------- EXAMPLE 4 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203,1204 -``` - -This command gets builds with IDs 1203 and 1204 by using the ID parameter. - -### -------------------------- EXAMPLE 5 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -ProjectName demo -ID 1203 -Raw -``` - -This command returns the raw object returned from the server. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -Top - -Specifies the maximum number to return. - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 0 -``` - -### -ResultFilter - -Specifies the result of the builds to return Succeeded, PartiallySucceeded, Failed, or Canceled. - -```yaml -Type: String -Parameter Sets: List -``` - -### -ReasonFilter - -Specifies the reason the build was created of the builds to return Manual, IndividualCI, BatchedCI, Schedule, UserCreated, ValidateShelveSet, CheckInShelveSet, Triggered, or All. - -```yaml -Type: String -Parameter Sets: List -``` - -### -StatusFilter - -Specifies the status of the builds to return InProgress, Completed, Cancelling, Postponed, NotStarted, or All. - -```yaml -Type: String -Parameter Sets: List -``` - -### -Queues - -A comma-delimited list of queue IDs that specifies the builds to return. - -```yaml -Type: Int32[] -Parameter Sets: List -``` - -### -Definitions - -A comma-delimited list of build definition IDs that specifies the builds to return. - -```yaml -Type: Int32[] -Parameter Sets: List -``` - -### -BuildNumber - -Returns the build with this build number. - -You can also use * for a starts with search. -For example: 2015* -Will return all build numbers that start with 2015. - -```yaml -Type: String -Parameter Sets: List -``` - -### -Type - -The type of builds to retrieve. - -```yaml -Type: String -Parameter Sets: List -``` - -### -MaxBuildsPerDefinition - -The maximum number of builds to retrieve for each definition. - -This is only valid when definitions is also specified. - -```yaml -Type: Int32 -Parameter Sets: List -``` - -### -Properties - -A comma-delimited list of extended properties to retrieve. - -```yaml -Type: String[] -Parameter Sets: List -``` - -### -Id - -Specifies one or more builds by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build, type Get-VSTeamBuild. - -```yaml -Type: Int32[] -Aliases: BuildID -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -JSON - -Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDJson -``` - -### -Raw - -Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDRaw -``` - -## INPUTS - -## OUTPUTS - -### Team.Build - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe build IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuild](Add-VSTeamBuild.md) - -[Remove-VSTeamBuild](Remove-VSTeamBuild.md) - diff --git a/docs/Get-VSTeamBuildArtifact.md b/docs/Get-VSTeamBuildArtifact.md deleted file mode 100644 index 19e6b2d20..000000000 --- a/docs/Get-VSTeamBuildArtifact.md +++ /dev/null @@ -1,56 +0,0 @@ - - - -# Get-VSTeamBuildArtifact - -## SYNOPSIS - -Returns the artifacts of a build. - -## SYNTAX - -## DESCRIPTION - -Returns the artifacts of a build. - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamBuildDefinition.md b/docs/Get-VSTeamBuildDefinition.md deleted file mode 100644 index c05a42f17..000000000 --- a/docs/Get-VSTeamBuildDefinition.md +++ /dev/null @@ -1,157 +0,0 @@ - - - -# Get-VSTeamBuildDefinition - -## SYNOPSIS - -Gets the build definitions for a team project. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamBuildDefinition function gets the build definitions for a team project. - -The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - -With just a project name, this function gets all of the build definitions for that team project. - -You can also specify a particular build definition by ID. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo | Format-List * -``` - -This command gets a list of all build definitions in the demo project. - -The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the build definition objects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Json -``` - -This command returns the raw object returned from the server formatted as a JSON string. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo -id 2 -Raw -``` - -This command returns the raw object returned from the server. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -Filter - -Filters to definitions whose names equal this value. Append a * to filter to definitions whose names start with this value. -For example: MS* - -```yaml -Type: String -Parameter Sets: List -``` - -### -Type - -The type of the build definitions to retrieve. The acceptable values for this parameter are: - -- build -- xaml -- All - -```yaml -Type: String -Parameter Sets: List -Default value: All -``` - -### -Id - -Specifies one or more build definitions by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build definition, type Get-VSTeamBuildDefinition. - -```yaml -Type: Int32[] -Parameter Sets: ByID -Aliases: BuildDefinitionID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Revision - -Specifies the specific revision number of the definition to retrieve. - -```yaml -Type: Int32 -Parameter Sets: ByID -Default value: -1 -``` - -### -JSON - -Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDJson -``` - -### -Raw - -Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDRaw -``` - -## INPUTS - -## OUTPUTS - -### Team.BuildDefinition - -## NOTES - -You can pipe build definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -[Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) - diff --git a/docs/Get-VSTeamBuildLog.md b/docs/Get-VSTeamBuildLog.md deleted file mode 100644 index 12803d43b..000000000 --- a/docs/Get-VSTeamBuildLog.md +++ /dev/null @@ -1,78 +0,0 @@ - - - -# Get-VSTeamBuildLog - -## SYNOPSIS - -Displays the logs for the build. - -## SYNTAX - -## DESCRIPTION - -Displays the logs for the build. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild -Top 1 | Get-VSTeamBuildLog -``` - -This command displays the logs of the first build. - -The pipeline operator (|) passes the build id to the Get-VSTeamBuildLog cmdlet, which -displays the logs. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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 - -Specifies one or more builds by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build, type Get-VSTeamBuild. - -```yaml -Type: Int32[] -Aliases: BuildID -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Index - -Each task stores its logs in an array. If you know the index of a specific task you can return just its logs. If you do not provide a value all the logs are displayed. - -```yaml -Type: Int32 -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamBuildTag.md b/docs/Get-VSTeamBuildTag.md deleted file mode 100644 index eba4df34b..000000000 --- a/docs/Get-VSTeamBuildTag.md +++ /dev/null @@ -1,56 +0,0 @@ - - - -# Get-VSTeamBuildTag - -## SYNOPSIS - -Returns all the tags of a build. - -## SYNTAX - -## DESCRIPTION - -Returns all the tags of a build. - -## EXAMPLES - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamBuildTimeline.md b/docs/Get-VSTeamBuildTimeline.md deleted file mode 100644 index 1551cc5cd..000000000 --- a/docs/Get-VSTeamBuildTimeline.md +++ /dev/null @@ -1,140 +0,0 @@ - - - -# Get-VSTeamBuildTimeline - -## SYNOPSIS - -Get the timelines for builds - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamBuildTimeline function gets the timelines for a build. - -With just a project name and the build id, this function gets all the timelines of a build for that team project. - -You can also specify a particular timeline by ID to get . - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 | Format-List * -``` - -This command gets a list of all timelines of thr build with Id 1 in the demo project. - -The pipeline operator (|) passes the data to the Format-List cmdlet, which -displays all available properties (*) of the timeline objects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 -Id 595dac0c-0f1a-4bfd-a35f-e5a838ac71d7 -ChangeId 2 -PlanId 356de525-47a9-4251-80c6-d3849a9d6382 -``` - -This command gets the timelines with ID 1 and timeline id 595dac0c-0f1a-4bfd-a35f-e5a838ac71d7. It is filtered with the change ID and plan ID. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildTimeline -ProjectName demo -BuildId 1 -ID @(1,2) -``` - -This command gets timelines with IDs 1 and 2 by using the ID parameter. - -## 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) -``` - -### -BuildId - -Build id where you get the time line from - -```yaml -Type: int[] -Parameter Sets: ByID -``` - -### -Id - -Returns the timelines with the given timeline id. - -```yaml -Type: Guid -Aliases: TimelineId -Parameter Sets: ByID -``` - -### -ChangeId - -Returns the timelines with the given change id. - -```yaml -Type: Int32 -Parameter Sets: ByID -``` - -### -PlanId - -Returns the timelines with the given plan id. - -```yaml -Type: Guid -Parameter Sets: ByID -``` - -### -Id - -Specifies one or more builds by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build, type Get-VSTeamBuild. - -```yaml -Type: Int32[] -Aliases: BuildID -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -## INPUTS - -## OUTPUTS - -### Team.Build - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe build IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Get-VSTeamBuild](Get-VSTeamBuild.md) diff --git a/docs/Get-VSTeamClassificationNode.md b/docs/Get-VSTeamClassificationNode.md deleted file mode 100644 index 0f89069d6..000000000 --- a/docs/Get-VSTeamClassificationNode.md +++ /dev/null @@ -1,81 +0,0 @@ - - - -# Get-VSTeamClassificationNode - -## SYNOPSIS - -Gets the classification node for a given node path. - -## SYNTAX - -## DESCRIPTION - -Gets the classification node for a given node path. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -StructureGroup - -Structure group of the classification node, area or iteration. - -```yaml -Type: string -``` - -### -Depth - -Depth of children to fetch. - -```yaml -Type: int32 -``` - -### -Path - -Path of the classification node. - -```yaml -Type: string -``` - -### -Ids - -Integer classification nodes ids. - -```yaml -Type: int32[] -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This function is the base function for Get-VSTeamArea and Get-VSTeamIteration. - -## RELATED LINKS - -[Get-VSTeamArea](Get-VSTeamArea.md) - -[Get-VSTeamIteration](Get-VSTeamIteration.md) - diff --git a/docs/Get-VSTeamCloudSubscription.md b/docs/Get-VSTeamCloudSubscription.md deleted file mode 100644 index 9b2107949..000000000 --- a/docs/Get-VSTeamCloudSubscription.md +++ /dev/null @@ -1,43 +0,0 @@ - - - -# Get-VSTeamCloudSubscription - -## SYNOPSIS - -Gets the Azure subscriptions associated with the Team Services account. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamCloudSubscription function gets the Azure subscriptions associated with the Team Services account. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamCloudSubscription -``` - -This command gets a list of all Azure subscriptions associated with the Team Services account. - -## PARAMETERS - -## INPUTS - -### None - -## OUTPUTS - -### Team.AzureSubscription - -## NOTES - -This function currently is not supported in TFS. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - diff --git a/docs/Get-VSTeamDescriptor.md b/docs/Get-VSTeamDescriptor.md deleted file mode 100644 index 5dd7ce05e..000000000 --- a/docs/Get-VSTeamDescriptor.md +++ /dev/null @@ -1,37 +0,0 @@ - - - -# Get-VSTeamDescriptor - -## SYNOPSIS - -Resolve a storage key to a descriptor. - -## SYNTAX - -## DESCRIPTION - -Resolve a storage key to a descriptor. - -## EXAMPLES - -## PARAMETERS - -### -StorageKey - -Storage key of the subject (user, group, scope, etc.) to resolve - -```yaml -Type: String -Required: True -Parameter Sets: ByStorageKey -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamExtension.md b/docs/Get-VSTeamExtension.md deleted file mode 100644 index 19ad614e5..000000000 --- a/docs/Get-VSTeamExtension.md +++ /dev/null @@ -1,82 +0,0 @@ - - - -# Get-VSTeamExtension - -## SYNOPSIS - -Get the installed extensions in the specified Azure DevOps or Team Foundation Server project. - -## SYNTAX - -## DESCRIPTION - -Get the installed extensions in the specified Azure DevOps or Team Foundation Server project. - -## EXAMPLES - -## PARAMETERS - -### -PublisherId - -The id of the publisher. - -```yaml -Type: String -Required: True -Parameter Sets: GetById -``` - -### -ExtensionId - -The id of the extension. - -```yaml -Type: String -Required: True -Parameter Sets: GetById -``` - -### -IncludeInstallationIssues - -If true (the default), include installed extensions with issues. - -```yaml -Type: Switch -Parameter Sets: List -``` - -### -IncludeDisabledExtensions - -If true (the default), include disabled extensions in the results. - -```yaml -Type: Switch -Parameter Sets: List -``` - -### -IncludeErrors - -If true, include installed extensions with errors. - -```yaml -Type: Switch -Parameter Sets: List -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamExtension](Add-VSTeamExtension.md) - -[Get-VSTeamExtension](Get-VSTeamExtension.md) - -[Remove-VSTeamExtension](Remove-VSTeamExtension.md) - -[Update-VSTeamExtension](Update-VSTeamExtension.md) - diff --git a/docs/Get-VSTeamFeed.md b/docs/Get-VSTeamFeed.md deleted file mode 100644 index b5e691cde..000000000 --- a/docs/Get-VSTeamFeed.md +++ /dev/null @@ -1,45 +0,0 @@ - - - -# Get-VSTeamFeed - -## SYNOPSIS - -Returns a list of package feeds for the account. - -## SYNTAX - -## DESCRIPTION - -Get-VSTeamFeed gets all the feeds for the account - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamFeed -``` - -This command returns all the package feeds for the account. - -## PARAMETERS - -### -FeedId - -Specifies the ID of the feed. - -```yaml -Type: Guid -Aliases: ID -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamGitCommit.md b/docs/Get-VSTeamGitCommit.md deleted file mode 100644 index 592227059..000000000 --- a/docs/Get-VSTeamGitCommit.md +++ /dev/null @@ -1,253 +0,0 @@ - - - -# Get-VSTeamGitCommit - -## SYNOPSIS - -Retrieve git commits for a project - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamGitCommit function gets the commits for a git repository. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamGitCommit -ProjectName demo -RepositoryId 118C262F-0D4C-4B76-BD9B-7DD8CA12F196 -``` - -This command gets a list of all commits in the demo project for a specific repository. - -## 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) -``` - -### -RepositoryId - -The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - -```yaml -Type: Guid -Required: True -Accept pipeline input: true (ByPropertyName) -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath, ByIds -``` - -### -FromDate - -If provided, only include history entries created after this date (string) - -```yaml -Type: DateTime -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -ToDate - -If provided, only include history entries created before this date (string) - -```yaml -Type: DateTime -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -ItemVersionVersionType - -Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - -- branch -- commit -- tag - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -ItemVersionVersion - -Version string identifier (name of tag/branch, SHA1 of commit) - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -ItemVersionVersionOptions - -Version options - Specify additional modifiers to version (e.g Previous). The acceptable values for this parameter are: - -- firstParent -- none -- previousChange - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -CompareVersionVersionType - -Version type (branch, tag, or commit). Determines how Id is interpreted. The acceptable values for this parameter are: - -- branch -- commit -- tag - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -CompareVersionVersion - -Version string identifier (name of tag/branch, SHA1 of commit). The acceptable values for this parameter are: - -- firstParent -- none -- previousChange - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -CompareVersionVersionOptions - -Version options - Specify additional modifiers to version (e.g Previous) - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -FromCommitId - -If provided, a lower bound for filtering commits alphabetically - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -ToCommitId - -If provided, an upper bound for filtering commits alphabetically - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -Author - -Alias or display name of the author - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -Ids - -If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. - -```yaml -Type: String -Parameter Sets: ByIds -``` - -### -ItemPath - -Path of item to search under - -```yaml -Type: String -Parameter Sets: All, ItemPath -``` - -### -ExcludeDeletes - -Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. - -```yaml -Type: Switch -Parameter Sets: All, ItemPath -``` - -### -Top - -Maximum number of entries to retrieve - -```yaml -Type: Int32 -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -Skip - -Number of entries to skip - -```yaml -Type: Int32 -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -### -HistoryMode - -What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. The acceptable values for this parameter are: - -- firstParent -- fullHistory -- fullHistorySimplifyMerges -- simplifiedHistory - -```yaml -Type: String -Parameter Sets: ItemPath -``` - -### -User - -Alias or display name of the committer - -```yaml -Type: String -Parameter Sets: All, ItemVersion, CompareVersion, ItemPath -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets commits. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe a repository ID to this function. - -## RELATED LINKS - diff --git a/docs/Get-VSTeamGitRef.md b/docs/Get-VSTeamGitRef.md deleted file mode 100644 index 028f9ab9d..000000000 --- a/docs/Get-VSTeamGitRef.md +++ /dev/null @@ -1,93 +0,0 @@ - - - -# Get-VSTeamGitRef - -## SYNOPSIS - -Queries the provided repository for its refs and returns them. - -## SYNTAX - -## DESCRIPTION - -Get-VSTeamGitRef gets all the refs for the provided repository. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamGitRef -ProjectName Demo -``` - -This command returns all the Git refs for the Demo team project. - -## 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) -``` - -### -RepositoryId - -Specifies the ID of the repository. - -```yaml -Type: Guid -Aliases: ID -Accept pipeline input: true (ByPropertyName) -``` - -### -Filter - -A filter to apply to the refs (starts with). - -```yaml -Type: string -``` - -### -FilterContains - -A filter to apply to the refs (contains). (Azure DevOps Service and Azure DevOps Server 2019+ only) - -```yaml -Type: string -``` - -### -Top - -Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuationToken is, top will default to 100. (Azure DevOps Service and Azure DevOps Server 2019+ only) - -```yaml -Type: int -``` - -### -ContinuationToken - -The continuation token used for pagination. (Azure DevOps Service and Azure DevOps Server 2019+ only) - -```yaml -Type: string -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamGitRepository.md b/docs/Get-VSTeamGitRepository.md deleted file mode 100644 index 04f7a908b..000000000 --- a/docs/Get-VSTeamGitRepository.md +++ /dev/null @@ -1,96 +0,0 @@ - - - -# Get-VSTeamGitRepository - -## SYNOPSIS - -Get all the repositories in your Azure DevOps or Team Foundation Server account, or a specific project. - -## SYNTAX - -## DESCRIPTION - -Get-VSTeamGitRepository gets all the repositories in your Azure DevOps or Team Foundation Server account, or a specific project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamGitRepository -``` - -This command returns all the Git repositories for your TFS or Team Services account. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamGitRepository -ProjectName Demo -``` - -This command returns all the Git repositories for the Demo team project. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> git clone (Get-VSTeamGitRepository | select -ExpandProperty remoteUrl) -``` - -This command gets the remote URL and passes it to git clone command. - -## 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 - -Specifies one or more repositories by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a repository, type Get-VSTeamGitRepository. - -```yaml -Type: Guid[] -Parameter Sets: ByID -Aliases: RepositoryID -Accept pipeline input: true (ByPropertyName) -``` - -### -Name - -Specifies one or more repositories by name. - -To specify multiple names, use commas to separate the names. - -To find the name of a repository, type Get-VSTeamGitRepository. - -```yaml -Type: String[] -Parameter Sets: ByName -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamGitStat.md b/docs/Get-VSTeamGitStat.md deleted file mode 100644 index af10cfca1..000000000 --- a/docs/Get-VSTeamGitStat.md +++ /dev/null @@ -1,122 +0,0 @@ - - - -# Get-VSTeamGitStat - -## SYNOPSIS - -Retrieves statistics about branches within a repository. - -## SYNTAX - -## DESCRIPTION - -Retrieves statistics about branches within a repository. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -``` - -This command returns all the Git stats for the entire repository - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop -``` - -This command returns all the Git stats for a specific branch - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamGitStat -ProjectName Demo -RepositoryId 011E421A-2A54-4491-B370-9256AD8A1BDD -BranchName develop -VersionType branch -Version 67cae2b029dff7eb3dc062b49403aaedca5bad8d -``` - -This command returns all the Git stats for a specific commit - -## 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) -``` - -### -RepositoryId - -Specifies the ID of the repository. - -```yaml -Type: Guid -Aliases: ID -Required: true -Accept pipeline input: true (ByPropertyName) -``` - -### -BranchName - -Name of the branch. - -```yaml -Type: String -Required: true -``` - -### -VersionOptions - -Version options - Specify additional modifiers to version (e.g Previous). Valid options for this parameter are: - -- firstParent -- none -- previousChange - -```yaml -Type: String -Parameter Sets: ByVersion -``` - -### -Version - -Version string identifier (name of tag/branch, SHA1 of commit) - -```yaml -Type: String -Parameter Sets: ByVersion -``` - -### -VersionType - -Version type (branch, tag, or commit). Determines how Id is interpreted. Valid options for this parameter are: - -- branch -- commit -- tag - -```yaml -Type: String -Parameter Sets: ByVersion -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamGroup.md b/docs/Get-VSTeamGroup.md deleted file mode 100644 index 16b175d04..000000000 --- a/docs/Get-VSTeamGroup.md +++ /dev/null @@ -1,85 +0,0 @@ - - - -# Get-VSTeamGroup - -## SYNOPSIS - -Returns a Group or List of Groups. - -## SYNTAX - -## DESCRIPTION - -Returns a Group or List of Groups. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' -``` - -Assigns Endpoint Administrators group to $group variable. - -## 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) -``` - -### -SubjectTypes - -A comma separated list of user subject subtypes to reduce the retrieved results. -Valid subject types: - -- vssgp (Azure DevOps Group) -- aadgp (Azure Active Directory Group) - -```yaml -Type: String[] -Required: False -Parameter Sets: List, ListByProjectName -``` - -### -ScopeDescriptor - -Specify a non-default scope (collection, project) to search for groups. - -```yaml -Type: String -Required: False -Parameter Sets: List -``` - -### -Descriptor - -The descriptor of the desired graph group. - -```yaml -Type: String -Required: False -Parameter Sets: ByGroupDescriptor -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamInfo.md b/docs/Get-VSTeamInfo.md deleted file mode 100644 index 8ca5b9b91..000000000 --- a/docs/Get-VSTeamInfo.md +++ /dev/null @@ -1,37 +0,0 @@ - - - -# Get-VSTeamInfo - -## SYNOPSIS - -Displays your current account and default project. - -## SYNTAX - -## DESCRIPTION - -Displays your current account and default project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamInfo -``` - -This will display your current account and default project - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - diff --git a/docs/Get-VSTeamIteration.md b/docs/Get-VSTeamIteration.md deleted file mode 100644 index 8d9c2e199..000000000 --- a/docs/Get-VSTeamIteration.md +++ /dev/null @@ -1,73 +0,0 @@ - - - -# Get-VSTeamIteration - -## SYNOPSIS - -Gets the iteration node for a given iteration path. - -## SYNTAX - -## DESCRIPTION - -Gets the iteration node for a given iteration path. - -## 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) -``` - -### -Depth - -Depth of children to fetch. - -```yaml -Type: int32 -``` - -### -Path - -Path of the classification node. - -```yaml -Type: string -``` - -### -Ids - -Integer classification nodes ids. - -```yaml -Type: int32[] -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This is a wrapper function for Get-VSTeamClassificationNode - -## RELATED LINKS - -[Get-VSTeamClassificationNode](Get-VSTeamClassificationNode.md) - -[Get-VSTeamIteration](Get-VSTeamIteration.md) - diff --git a/docs/Get-VSTeamJobRequest.md b/docs/Get-VSTeamJobRequest.md deleted file mode 100644 index fc1b4f756..000000000 --- a/docs/Get-VSTeamJobRequest.md +++ /dev/null @@ -1,67 +0,0 @@ - - - -# Get-VSTeamJobRequest - -## SYNOPSIS - -Returns all the job requests of an agent. - -## SYNTAX - -## DESCRIPTION - -Returns all the job requests of an agent. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamJobRequest 1 111 -``` - -This will display all the job request of agent with id 111 under the pool with id 1. - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -AgentId - -Id of the agent to return. - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByValue) -``` - -### -CompletedRequestCount - -The number of requests to return. - -```yaml -Type: Int32 -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamMember.md b/docs/Get-VSTeamMember.md deleted file mode 100644 index ba726863a..000000000 --- a/docs/Get-VSTeamMember.md +++ /dev/null @@ -1,73 +0,0 @@ - - - -# Get-VSTeamMember - -## SYNOPSIS - -Returns a team member. - -## SYNTAX - -## DESCRIPTION - -Returns a team member. - -## EXAMPLES - -## 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) -``` - -### -Skip - -The number of items to skip. - -```yaml -Type: Int32 -``` - -### -TeamId - -The id of the team to search. - -```yaml -Type: String -Aliases: name -Required: True -Position: 2 -Accept pipeline input: true (ByPropertyName) -``` - -### -Top - -Specifies the maximum number to return. - -```yaml -Type: Int32 -``` - -## INPUTS - -## OUTPUTS - -### Team.Team - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamMembership.md b/docs/Get-VSTeamMembership.md deleted file mode 100644 index d76f36ae2..000000000 --- a/docs/Get-VSTeamMembership.md +++ /dev/null @@ -1,75 +0,0 @@ - - - -# Get-VSTeamMembership - -## SYNOPSIS - -Gets a memberships for a container or member. - -## SYNTAX - -## DESCRIPTION - -Gets a memberships for a container or member. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -(Get-VSTeamMembership -MemberDescriptor $user.ID).value | % { Get-VSTeamGroup -Descriptor $_.containerDescriptor } -``` - -Get all the groups for a user - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -(Get-VSTeamMembership -ContainerDescriptor $group.id).value | % {Get-VSTeamUser -Descriptor $_.memberDescriptor } -``` - -Get all the members for a group - -## PARAMETERS - -### -ContainerDescriptor - -A container descriptor retrieved by Get-VsTeamGroup - -```yaml -Type: String -Required: True -Parameter Sets: ByContainerId -Position: 0 -``` - -### -MemberDescriptor - -A member descriptor retrieved by Get-VsTeamUser - -```yaml -Type: String -Required: True -Parameter Sets: ByMemberId -Position: 0 -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VsTeamUser](Get-VsTeamUser.md) - -[Get-VsTeamGroup](Get-VsTeamGroup.md) - -[Add-VsTeamMembership](Add-VsTeamMembership.md) - -[Remove-VsTeamMembership](Remove-VsTeamMembership.md) - -[Test-VsTeamMembership](Test-VsTeamMembership.md) - diff --git a/docs/Get-VSTeamOption.md b/docs/Get-VSTeamOption.md deleted file mode 100644 index bffddc428..000000000 --- a/docs/Get-VSTeamOption.md +++ /dev/null @@ -1,108 +0,0 @@ - - - -# Get-VSTeamOption - -## SYNOPSIS - -Returns all the versions of supported APIs of your TFS or AzD. - -## SYNTAX - -## DESCRIPTION - -Returns all the versions of supported APIs of your TFS or AzD. - -There are two table formats defined for the Team.Option type, Default and Versions. - -Default view contains Name, Area, Max Version and URI Template. - -Version view contains Name, Area, Min Version, Max Version, Released Version and Resource Version. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamOption -``` - -This will display all the versions of supported APIs for your account using the 'Default' table format. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamOption | Format-Table -View Versions -``` - -This will display all the versions of supported APIs for your account using the 'Versions' custom table format. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -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 - -Returns options for that sub domain APIs. Some examples include: - -- vsaex = Member Entitlement Management -- feeds = Artifacts -- vsrm = Release Management -- vssps = Graph -- extmgmt = Extensions - -```yaml -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 - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - diff --git a/docs/Get-VSTeamPermissionInheritance.md b/docs/Get-VSTeamPermissionInheritance.md deleted file mode 100644 index 4d539f965..000000000 --- a/docs/Get-VSTeamPermissionInheritance.md +++ /dev/null @@ -1,88 +0,0 @@ - - - -# Get-VSTeamPermissionInheritance - -## SYNOPSIS - -Returns true or false. - -## SYNTAX - -## DESCRIPTION - -Returns true or false. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition -``` - -This command returns true or false. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition | Get-VSTeamPermissionInheritance -ResourceType BuildDefinition -``` - -This command returns true or false for every build definition returned from Get-VSTeamBuildDefinition. - -## 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) -``` - -### -Name - -Specifies the name of the resource. - -```yaml -Type: String -Accept pipeline input: true (ByPropertyName) -Required: True -``` - -### -ResourceType - -Specifies the type of resource. The acceptable values for this parameter are: - -- Repository -- BuildDefinition -- ReleaseDefinition - -```yaml -Type: String -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamPolicy](Add-VSTeamPolicy.md) - -[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -[Get-VSTeamPermissionInheritanceType](Get-VSTeamPermissionInheritanceType.md) - diff --git a/docs/Get-VSTeamPolicy.md b/docs/Get-VSTeamPolicy.md deleted file mode 100644 index 48df2eef0..000000000 --- a/docs/Get-VSTeamPolicy.md +++ /dev/null @@ -1,77 +0,0 @@ - - - -# Get-VSTeamPolicy - -## SYNOPSIS - -Get the code policies in the specified Azure DevOps or Team Foundation Server project. - -## SYNTAX - -## DESCRIPTION - -Get the code policies in the specified Azure DevOps or Team Foundation Server project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPolicy -ProjectName Demo -``` - -This command returns all the policies for the Demo project in your TFS or Team Services account. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPolicy -ProjectName Demo -Id 1 -``` - -This command gets the policy with an id of 1 within the Demo project. - -## 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 - -Specifies one code policy by id. - -The id is an integer. Unique within each project. - -```yaml -Type: Int -Parameter Sets: ByID -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamPolicy](Add-VSTeamPolicy.md) - -[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md) - diff --git a/docs/Get-VSTeamPolicyType.md b/docs/Get-VSTeamPolicyType.md deleted file mode 100644 index 01912346e..000000000 --- a/docs/Get-VSTeamPolicyType.md +++ /dev/null @@ -1,74 +0,0 @@ - - - -# Get-VSTeamPolicyType - -## SYNOPSIS - -Get the policy types in the specified Azure DevOps or Team Foundation Server project. - -## SYNTAX - -## DESCRIPTION - -Get the policy types in the specified Azure DevOps or Team Foundation Server project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPolicyType -ProjectName Demo -``` - -This command returns all the policy types for the Demo project. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPolicyType -ProjectName Demo -Id 73da726a-8ff9-44d7-8caa-cbb581eac991 -``` - -This command gets the policy type by the specified id within the Demo project. - -## 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 - -Specifies one policy type by id. - -```yaml -Type: Guid[] -Parameter Sets: ByID -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamPolicy](Add-VSTeamPolicy.md) - -[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -[Get-VSTeamPolicy](Get-VSTeamPolicy.md) - diff --git a/docs/Get-VSTeamPool.md b/docs/Get-VSTeamPool.md deleted file mode 100644 index 2929aea46..000000000 --- a/docs/Get-VSTeamPool.md +++ /dev/null @@ -1,43 +0,0 @@ - - - -# Get-VSTeamPool - -## SYNOPSIS - -Returns the agent pools. - -## SYNTAX - -## DESCRIPTION - -Returns the agent pools. - -## EXAMPLES - -## PARAMETERS - -### -Id - -Id of the pool to return. - -```yaml -Type: int -Parameter Sets: ByID -Aliases: PoolID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamProcess.md b/docs/Get-VSTeamProcess.md deleted file mode 100644 index 2f1a26182..000000000 --- a/docs/Get-VSTeamProcess.md +++ /dev/null @@ -1,106 +0,0 @@ - - - -# Get-VSTeamProcess - -## SYNOPSIS - -Returns a list of process templates in the Team Services or Team Foundation Server account. - -## SYNTAX - -## DESCRIPTION - -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. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProcess -``` - -This will return all the Process Templates - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProcess | Format-Wide -``` - -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 - -### -Name - -Specifies the process template name for which this function operates. - -You can tab complete from a list of available process templates. - -```yaml -Type: String -Required: true -Position: 0 -Accept pipeline input: true (ByPropertyName) -``` - -### -Top - -Specifies the maximum number to return. -If -Skip is specified and -Top is omitted the next 100 will be returned. -If neither Skip nor -Top is specified, all process templates will be returned. - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 100 -``` - -### -Skip - -Defines the number of Process Templates to skip. -If -Top is specified and -Skip is omitted none will be skipped. -If neither Skip nor -Top is specified, all process templates will be returned. - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 0 -``` - -### -Id - -The id of the Process Template to return. - -```yaml -Type: String -Parameter Sets: ByID -Aliases: ProcessID -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Add-VSTeamProject](Add-VSTeamProject.md) - diff --git a/docs/Get-VSTeamProfile.md b/docs/Get-VSTeamProfile.md deleted file mode 100644 index 50b532ff7..000000000 --- a/docs/Get-VSTeamProfile.md +++ /dev/null @@ -1,57 +0,0 @@ - - - -# Get-VSTeamProfile - -## SYNOPSIS - -Returns the saved profiles. - -## SYNTAX - -## DESCRIPTION - -Returns the saved profiles. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProfile -``` - -Return the list of saved profiles - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProfile -Name mydemos -``` - -Will return details of the profile provided - -## PARAMETERS - -### -Name - -Optional name for the profile. - -```yaml -Type: String -Parameter Sets: All -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Add-VSTeamProfile](Add-VSTeamProfile.md) - diff --git a/docs/Get-VSTeamProject.md b/docs/Get-VSTeamProject.md deleted file mode 100644 index 871c33f10..000000000 --- a/docs/Get-VSTeamProject.md +++ /dev/null @@ -1,124 +0,0 @@ - - - -# Get-VSTeamProject - -## SYNOPSIS - -Returns a list of projects in the Team Services or Team Foundation Server account. - -## SYNTAX - -## DESCRIPTION - -The list of projects returned can be controlled by using the stateFilter, top and skip parameters. - -You can also get a single project by name or id. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProject -``` - -This will return all the WellFormed team projects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProject -top 5 | Format-Wide -``` - -This will return the top five WellFormed team projects only showing their name - -## 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) -``` - -### -StateFilter - -Returns team projects in a specific team project state. The acceptable values for this parameter are: - -- WellFormed -- CreatePending -- Deleting -- New -- All - -```yaml -Type: String -Parameter Sets: List -Default value: WellFormed -``` - -### -Top - -Specifies the maximum number to return. - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 100 -``` - -### -Skip - -Defines the number of team projects to skip. The default value is 0 - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 0 -``` - -### -Id - -The id of the project to return. - -```yaml -Type: String -Parameter Sets: ByID -Aliases: ProjectID -``` - -### -IncludeCapabilities - -Will return additional information about the project. - -```yaml -Type: SwitchParameter -Parameter Sets: ByID -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Add-VSTeamProject](Add-VSTeamProject.md) - -[Remove-VSTeamProject](Remove-VSTeamProject.md) - diff --git a/docs/Get-VSTeamPullRequest.md b/docs/Get-VSTeamPullRequest.md deleted file mode 100644 index ac951e56c..000000000 --- a/docs/Get-VSTeamPullRequest.md +++ /dev/null @@ -1,191 +0,0 @@ - - - -# Get-VSTeamPullRequest - -## SYNOPSIS - -Returns one or more open pull requests from your team, project, or Id. - -## SYNTAX - -## DESCRIPTION - -Returns one or more open pull requests from your team, project, or Id. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPullRequest -``` - -This command returns all the open pull requests for your TFS or Team Services account. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPullRequest -ProjectName Demo -``` - -This command returns all the open pull requests for the Demo team project. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPullRequest -ProjectName Demo -All -``` - -This command returns all pull requests for the Demo team project. - -### -------------------------- EXAMPLE 4 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPullRequest -ProjectName Demo -TargetBranchRef "refs/heads/mybranch" -``` - -This command returns all open pull requests for a specific branch - -### -------------------------- EXAMPLE 5 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPullRequest -Id 123 -``` - -This command gets the pull request with an Id of 123. - -### -------------------------- EXAMPLE 6 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamPullRequest -Id 123 -RepositoryId "93BBA613-2729-4158-9217-751E952AB4AF" -IncludeCommits -``` - -This command gets the pull request with an Id of 123 and includes the commits that are part of the pull request. - -## 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 -Required: false -Position: 0 -Accept pipeline input: true (ByPropertyName) -``` - -### -Id - -Specifies the pull request by ID. - -```yaml -Type: String -Aliases: PullRequestId -Accept pipeline input: true (ByPropertyName) -Parameter Sets: ById, IncludeCommits -``` - -### -RepositoryId - -The repository ID of the pull request's target branch. - -```yaml -Type: Guid -Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll, ById, IncludeCommits -``` - -### -SourceRepositoryId - -If set, search for pull requests whose source branch is in this repository. - -```yaml -Type: Guid -Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll -``` - -### -SourceBranchRef - -If set, search for pull requests from this branch. - -```yaml -Type: String -Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll -``` - -### -TargetBranchRef - -If set, search for pull requests into this branch. - -```yaml -Type: String -Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll -``` - -### -Status - -If set, search for pull requests that are in this state. Defaults to Active if unset. Valid values for this parameter are: - -- abandoned -- active -- all -- completed -- notSet - -```yaml -Type: String -Parameter Sets: SearchCriteriaWithStatus -``` - -### -All - -```yaml -Type: Switch -Parameter Sets: SearchCriteriaWithAll -``` - -### -Top - -The number of pull requests to retrieve. - -```yaml -Type: Int32 -Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll -``` - -### -Skip - -The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. - -```yaml -Type: Int32 -Parameter Sets: SearchCriteriaWithStatus, SearchCriteriaWithAll -``` - -### -IncludeCommits - -If set, includes the commits that are part of the pull request. Requires the RepositoryId to be set. - -```yaml -Type: Switch -Parameter Sets: IncludeCommits -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Show-VSTeamPullRequest](Show-VSTeamPullRequest.md) -[Add-VSTeamPullRequest](Add-VSTeamPullRequest.md) -[Update-VSTeamPullRequest](Update-VSTeamPullRequest.md) - diff --git a/docs/Get-VSTeamQueue.md b/docs/Get-VSTeamQueue.md deleted file mode 100644 index f4eee4816..000000000 --- a/docs/Get-VSTeamQueue.md +++ /dev/null @@ -1,73 +0,0 @@ - - - -# Get-VSTeamQueue - -## SYNOPSIS - -Gets a agent queue. - -## SYNTAX - -## DESCRIPTION - -Gets a agent queue. - -## EXAMPLES - -## 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) -``` - -### -QueueName - -Name of the queue to return. - -```yaml -Type: String -Parameter Sets: List -``` - -### -ActionFilter - -None, Manage or Use. - -```yaml -Type: String -Parameter Sets: List -``` - -### -Id - -Id of the queue to return. - -```yaml -Type: String -Parameter Sets: ByID -Aliases: QueueID -``` - -## INPUTS - -## OUTPUTS - -### Team.Queue - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamRelease.md b/docs/Get-VSTeamRelease.md deleted file mode 100644 index 02f6b7e73..000000000 --- a/docs/Get-VSTeamRelease.md +++ /dev/null @@ -1,202 +0,0 @@ - - - -# Get-VSTeamRelease - -## SYNOPSIS - -Gets the releases for a team project. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamRelease function gets the releases for a team project. - -The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - -With just a project name, this function gets all of the releases for that team project. - -You can also specify a particular release definition by ID. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamRelease -ProjectName demo | Format-List * -``` - -This command gets a list of all releases in the demo project. - -The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Raw -``` - -This command returns the raw object returned from the server. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamRelease -ProjectName demo -Id 10 -Json -``` - -This command returns the raw object returned from the server formated as JSON. - -## 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) -``` - -### -Expand - -Specifies which property should be expanded in the list of Release (environments, artifacts, none). - -```yaml -Type: String -Parameter Sets: List -``` - -### -StatusFilter - -Draft, Active or Abandoned. - -```yaml -Type: String -Parameter Sets: List -``` - -### -DefinitionId - -Id of the release definition - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 0 -``` - -### -Top - -Specifies the maximum number to return. - -```yaml -Type: Int32 -Parameter Sets: List -Default value: 0 -``` - -### -CreatedBy - -```yaml -Type: String -Parameter Sets: List -``` - -### -MinCreatedTime - -```yaml -Type: DateTime -Parameter Sets: List -``` - -### -MaxCreatedTime - -```yaml -Type: DateTime -Parameter Sets: List -``` - -### -QueryOrder - -```yaml -Type: String -Parameter Sets: List -``` - -### -ContinuationToken - -```yaml -Type: String -Parameter Sets: List -``` - -### -Id - -Specifies one or more releases by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a release definition, type Get-VSTeamRelease. - -```yaml -Type: Int32[] -Parameter Sets: ByID, ByIDJson, ByIDRaw -Aliases: ReleaseID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -JSON - -Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDJson -``` - -### -Raw - -Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDRaw -``` - -## INPUTS - -## OUTPUTS - -### Team.Release - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe release definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamRelease](Add-VSTeamRelease.md) - -[Remove-VSTeamRelease](Remove-VSTeamRelease.md) - diff --git a/docs/Get-VSTeamReleaseDefinition.md b/docs/Get-VSTeamReleaseDefinition.md deleted file mode 100644 index 03c741d36..000000000 --- a/docs/Get-VSTeamReleaseDefinition.md +++ /dev/null @@ -1,131 +0,0 @@ - - - -# Get-VSTeamReleaseDefinition - -## SYNOPSIS - -Gets the release definitions for a team project. - -## SYNTAX - -## DESCRIPTION - -The Get-VSTeamReleaseDefinition function gets the release definitions for a team project. - -The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - -With just a project name, this function gets all of the release definitions for that team project. - -You can also specify a particular release definition by ID. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Format-List * -``` - -This command gets a list of all release definitions in the demo project. - -The pipeline operator (|) passes the data to the Format-List cmdlet, which displays all available properties (*) of the release definition objects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Json -``` - -This command returns the raw object returned from the server formatted as a JSON string. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamReleaseDefinition -ProjectName Demo -id 2 -Raw -``` - -This command returns the raw object returned from the server. - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -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) -``` - -### -Expand - -Specifies which property should be expanded in the list of Release Definition (environments, artifacts, none). - -```yaml -Type: String -Parameter Sets: List -``` - -### -Id - -Specifies one or more release definitions by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a release definition, type Get-VSTeamReleaseDefinition. - -```yaml -Type: Int32[] -Parameter Sets: ByID -Aliases: ReleaseDefinitionID -Accept pipeline input: true (ByPropertyName) -``` - -### -JSON - -Converts the raw response into JSON and displays in the console. This is required when you need to use the object to send back. Without this switch the JSON produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDJson -``` - -### -Raw - -Returns the raw response. This is required when you need to use the object to send back. Without this switch the object produced from the returned object will not match the expected shape of the JSON for sending back to server. - -```yaml -Type: Switch -Required: True -Parameter Sets: ByIDRaw -``` - -## INPUTS - -### Int[] - -## OUTPUTS - -### Team.ReleaseDefinition - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamReleaseDefinition](Add-VSTeamReleaseDefinition.md) - -[Remove-VSTeamReleaseDefinition](Remove-VSTeamReleaseDefinition.md) - diff --git a/docs/Get-VSTeamResourceArea.md b/docs/Get-VSTeamResourceArea.md deleted file mode 100644 index 7a0d2d149..000000000 --- a/docs/Get-VSTeamResourceArea.md +++ /dev/null @@ -1,39 +0,0 @@ - - - -# Get-VSTeamResourceArea - -## SYNOPSIS - -List all the areas supported by this instance of TFS/VSTS. - -## SYNTAX - -## DESCRIPTION - -List all the areas supported by this instance of TFS/VSTS. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamResourceArea -``` - -This will display all the areas of supported APIs for your account. - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Add-VSTeamOption](Add-VSTeamOption.md) - diff --git a/docs/Get-VSTeamSecurityNamespace.md b/docs/Get-VSTeamSecurityNamespace.md deleted file mode 100644 index e7cf9d280..000000000 --- a/docs/Get-VSTeamSecurityNamespace.md +++ /dev/null @@ -1,59 +0,0 @@ - - - -# Get-VSTeamSecurityNamespace - -## SYNOPSIS - -List all security namespaces or just the specified namespace. - -## SYNTAX - -## DESCRIPTION - -List all security namespaces or just the specified namespace. - -## EXAMPLES - -## PARAMETERS - -### -Id - -Security namespace identifier. - -```yaml -Type: String -Required: False -Parameter Sets: ByNamespaceId -``` - -### -Name - -Security namespace name. - -```yaml -Type: String -Required: False -Parameter Sets: ByNamespaceName -``` - -### -LocalOnly - -If true, retrieve only local security namespaces. - -```yaml -Type: Switch -Required: False -Parameter Sets: List -``` - -## INPUTS - -## OUTPUTS - -### VSTeamSecurityNamespace - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamServiceEndpoint.md b/docs/Get-VSTeamServiceEndpoint.md deleted file mode 100644 index 4d5238a1c..000000000 --- a/docs/Get-VSTeamServiceEndpoint.md +++ /dev/null @@ -1,58 +0,0 @@ - - - -# Get-VSTeamServiceEndpoint - -## SYNOPSIS - -Gets a service endpoint. - -## SYNTAX - -## DESCRIPTION - -Gets a service endpoint. - -## EXAMPLES - -## 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 - -Id of the service endpoint - -```yaml -Type: String -Parameter Sets: ByID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamServiceEndpointType.md b/docs/Get-VSTeamServiceEndpointType.md deleted file mode 100644 index 863f34383..000000000 --- a/docs/Get-VSTeamServiceEndpointType.md +++ /dev/null @@ -1,51 +0,0 @@ - - - -# Get-VSTeamServiceEndpointType - -## SYNOPSIS - -Get service endpoint types. - -## SYNTAX - -## DESCRIPTION - -Get service endpoint types. - -## EXAMPLES - -## PARAMETERS - -### -Type - -Name of service endpoint type to return. - -```yaml -Type: String -Parameter Sets: ByType -Accept pipeline input: true (ByPropertyName) -``` - -### -Scheme - -Scheme of service endpoint - -```yaml -Type: String -Parameter Sets: ByType -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamTaskGroup.md b/docs/Get-VSTeamTaskGroup.md deleted file mode 100644 index 4d70e0dca..000000000 --- a/docs/Get-VSTeamTaskGroup.md +++ /dev/null @@ -1,126 +0,0 @@ - - - -# Get-VSTeamTaskGroup - -## SYNOPSIS - -Gets a task group - -## SYNTAX - -## DESCRIPTION - -Gets a task group - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" -} - -Get-VSTeamTaskGroup @methodParameters -``` - -Get all the task groups for the some_project_name project. Here we are splatting the parameter, but it may also be directly specified. See a non-splatting example below. - -### -------------------------- EXAMPLE 2 -------------------------- - -```powershell -Get-VSTeamTaskGroup -ProjectName "some_project_name" -Id "Task_group_id" -``` - -Get a task group when the ID is already known. - -### -------------------------- EXAMPLE 3 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" - Name = "Task_group_name" -} - -Get-VSTeamTaskGroup @methodParameters -``` - -Get a task group by name, when the ID is not known. Here we are splatting the parameters, but they may also be directly specified. Getting by ID is preferred, as it's more efficient; but getting by name is, of course, handy. - -## PARAMETERS - -### -ProjectName - -### -ProjectName - -Specifies the team project for which this function operates. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so -you do not have to pass the ProjectName with each call. - -```yaml -Type: String -Position: 0 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Id - -ID of the existing task group - -```yaml -Type: String -Parameter Sets: ByID -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Name - -Name of the existing task group - -```yaml -Type: String -Parameter Sets: ByName -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorTask, -InformationAction, -InformationTask, -OutTask, -OutBuffer, -PipelineTask, -Verbose, -WarningAction, and -WarningTask. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Add-VSTeamTaskGroup](Add-VSTeamTaskGroup.md) - -[Update-VSTeamTaskGroup](Update-VSTeamTaskGroup.md) - -[Remove-VSTeamTaskGroup](Remove-VSTeamTaskGroup.md) diff --git a/docs/Get-VSTeamTfvcBranch.md b/docs/Get-VSTeamTfvcBranch.md deleted file mode 100644 index 503830def..000000000 --- a/docs/Get-VSTeamTfvcBranch.md +++ /dev/null @@ -1,102 +0,0 @@ - - - -# Get-VSTeamTfvcBranch - -## SYNOPSIS - -Gets a branch for a given path from TFVC source control. - -## SYNTAX - -## DESCRIPTION - -Get-VSTeamTfvcBranch gets a branch for a given path from TFVC source control. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -``` - -This command returns the branch object for the path $/MyProject/MyBranch - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeChildren -``` - -This command returns the branch object for the path $/MyProject/MyBranch and its child branches. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeParent -``` - -This command returns the branch object for the path $/MyProject/MyBranch and its parent. - -### -------------------------- EXAMPLE 4 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamTfvcBranch -Path $/MyProject/MyBranch -IncludeDeleted -``` - -This command returns the branch object for the path $/MyProject/MyBranch, even if it's marked as deleted. - -### -------------------------- EXAMPLE 5 -------------------------- - -```PowerShell -PS C:\> '$/MyProject/MyBranch','$/AnotherProject/AnotherBranch' | Get-VSTeamTfvcBranch -``` - -This command returns the branch objects for the paths $/MyProject/MyBranch and $/AnotherProject/AnotherBranch by using the pipeline. - -## PARAMETERS - -### -Path - -Full path to the branch. - -```yaml -Type: String[] -Accept pipeline input: true -``` - -### -IncludeChildren - -Return child branches, if there are any. - -```yaml -Type: SwitchParameter -``` - -### -IncludeParent - -Return the parent branch, if there is one. - -```yaml -Type: SwitchParameter -``` - -### -IncludeDeleted - -Return branches marked as deleted. - -```yaml -Type: SwitchParameter -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -You can pipe paths to this function. - -## RELATED LINKS - diff --git a/docs/Get-VSTeamTfvcRootBranch.md b/docs/Get-VSTeamTfvcRootBranch.md deleted file mode 100644 index ccfa156f9..000000000 --- a/docs/Get-VSTeamTfvcRootBranch.md +++ /dev/null @@ -1,67 +0,0 @@ - - - -# Get-VSTeamTfvcRootBranch - -## SYNOPSIS - -Gets root branches for all projects with TFVC source control. - -## SYNTAX - -## DESCRIPTION - -Get-VSTeamTfvcRootBranch gets root branches for all projects with TFVC source control. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamTfvcRootBranch -``` - -This command returns root branches for all projects. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamTfvcRootBranch -IncludeChildren -``` - -This command returns root branches for all projects and their respective child branches. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamTfvcRootBranch -IncludeDeleted -``` - -This command returns root branches for all projects, also those marked as deleted. - -## PARAMETERS - -### -IncludeChildren - -Return the child branches for each root branch. - -```yaml -Type: SwitchParameter -``` - -### -IncludeDeleted - -Return deleted branches. - -```yaml -Type: SwitchParameter -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamUser.md b/docs/Get-VSTeamUser.md deleted file mode 100644 index 30c42bb24..000000000 --- a/docs/Get-VSTeamUser.md +++ /dev/null @@ -1,54 +0,0 @@ - - - -# Get-VSTeamUser - -## SYNOPSIS - -Returns a list of users for the account. - -## SYNTAX - -## DESCRIPTION - -Returns a list of users for the account. - -## EXAMPLES - -## PARAMETERS - -### -SubjectTypes - -A comma separated list of user subject subtypes to reduce the retrieved results. -Valid subject types: - -- vss (Azure DevOps User) -- aad (Azure Active Directory User) -- svc (Azure DevOps Service Identity) -- imp (Imported Identity) -- msa (Microsoft Account) - -```yaml -Type: String[] -Required: False -Parameter Sets: List -``` - -### -Descriptor - -The descriptor of the desired graph user. - -```yaml -Type: String -Required: False -Parameter Sets: ByUserDescriptor -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamUserEntitlement.md b/docs/Get-VSTeamUserEntitlement.md deleted file mode 100644 index e90649013..000000000 --- a/docs/Get-VSTeamUserEntitlement.md +++ /dev/null @@ -1,69 +0,0 @@ - - - -# Get-VSTeamUserEntitlement - -## SYNOPSIS - -Get User Entitlement for a user. - -## SYNTAX - -## DESCRIPTION - -Get User Entitlement for a user. - -## EXAMPLES - -## PARAMETERS - -### -Skip - -The number of items to skip. - -```yaml -Type: Int32 -Parameter Sets: List -``` - -### -UserId - -The id of the user to retrieve. - -```yaml -Type: String[] -Parameter Sets: ByID -``` - -### -Top - -Specifies the maximum number to return. - -```yaml -Type: Int32 -Parameter Sets: List -``` - -### -Select - -Comma (",") separated list of properties to select in the result entitlements. The acceptable values for this parameter are: - -- Projects -- Extensions -- GroupRules - -```yaml -Type: String -Parameter Sets: List -Required: True -Default value: None -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Get-VSTeamVariableGroup.md b/docs/Get-VSTeamVariableGroup.md deleted file mode 100644 index 4e4fb00d9..000000000 --- a/docs/Get-VSTeamVariableGroup.md +++ /dev/null @@ -1,114 +0,0 @@ - - - -# Get-VSTeamVariableGroup - -## SYNOPSIS - -Gets a variable group - -## SYNTAX - -## DESCRIPTION - -Gets a variable group - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" -} - -Get-VSTeamVariableGroup @methodParameters -``` - -### -------------------------- EXAMPLE 2 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" - Id = "variable_group_id" -} - -Get-VSTeamVariableGroup @methodParameters -``` - -### -------------------------- EXAMPLE 3 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" - Name = "variable_group_name" -} - -Get-VSTeamVariableGroup @methodParameters -``` - -## PARAMETERS - -### -ProjectName - -### -ProjectName - -Specifies the team project for which this function operates. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so -you do not have to pass the ProjectName with each call. - -```yaml -Type: String -Position: 0 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Id - -ID of the existing variable group - -### -Name - -Name of the existing variable group - -```yaml -Type: String -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) - -[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) - -[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) - diff --git a/docs/Get-VSTeamWiql.md b/docs/Get-VSTeamWiql.md deleted file mode 100644 index 25a052207..000000000 --- a/docs/Get-VSTeamWiql.md +++ /dev/null @@ -1,95 +0,0 @@ - - - -# Get-VSTeamWiqlItem - -## SYNOPSIS - -Returns work items from the given WIQL query or a saved query by ID from your projects team. - -## SYNTAX - -## DESCRIPTION - -Returns work items from the given WIQL query or a saved query by ID from your projects team. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" -Expand -``` - -This command gets work items via a WIQL query and expands the return work items with only the selected fields System.Id, System.Title and System.State. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamWiql -Query "Select [System.Id], [System.Title], [System.State] From WorkItems" -Team "MyProject Team" -Project "MyProject" -``` - -This command gets work items via a WIQL query and returns the WIQL query result with only work item IDs. - -## PARAMETERS - -### -Id - -The id query to return work items for. This is the ID of any saved query within a team in a project - -```yaml -Type: Int32 -Parameter Sets: ByID -Required: True -``` - -### -Query - -The WIQL query. For the syntax check [the official documentation](https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops). - -```yaml -Type: String -Parameter Sets: ByQuery -Required: True -``` - -### -Top - -The max number of results to return. - -```yaml -Type: String -Required: False -Default value: 100 -``` - -### -TimePrecision - -Whether or not to use time precision. - -```yaml -Type: Switch -``` - -### -Expand - -The expand the work items with the selected attributes in the WIQL query. - -```yaml -Type: Switch -``` - -## INPUTS - -### System.String - -ProjectName - -## OUTPUTS - -## NOTES - -If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWiql you will have to type in the names. - -## RELATED LINKS - diff --git a/docs/Get-VSTeamWorkItem.md b/docs/Get-VSTeamWorkItem.md deleted file mode 100644 index d211bedaf..000000000 --- a/docs/Get-VSTeamWorkItem.md +++ /dev/null @@ -1,98 +0,0 @@ - - - -# Get-VSTeamWorkItem - -## SYNOPSIS - -Returns one or more a work items from your project. - -## SYNTAX - -## DESCRIPTION - -Returns one or more a work items from your project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamWorkItem -Id 47,48 -``` - -This command gets work items with IDs 47 and 48 by using the IDs parameter. - -## PARAMETERS - -### -Id - -The id of one or more work items. - -```yaml -Type: Int32[] -Parameter Sets: List -Required: True -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -ErrorPolicy - -The flag to control error policy in a bulk get work items request. The acceptable values for this parameter are: - -- Fail -- Omit - -```yaml -Type: String -Parameter Sets: List -Required: True -Default value: omit -``` - -### -Fields - -Comma-separated list of requested fields. - -```yaml -Type: String[] -``` - -### -Expand - -Comma-separated list of requested fields. The acceptable values for this parameter are: - -- None -- Relations -- Fields -- Links -- All - -```yaml -Type: String -``` - -### -AsOf - -```yaml -Type: DateTime -``` - -## INPUTS - -### System.String - -ProjectName - -WorkItemType - -## OUTPUTS - -## NOTES - -WorkItemType is a dynamic parameter and use the default project value to query their validate set. - -If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. - -## RELATED LINKS - diff --git a/docs/Get-VSTeamWorkItemType.md b/docs/Get-VSTeamWorkItemType.md deleted file mode 100644 index 9adc3fd62..000000000 --- a/docs/Get-VSTeamWorkItemType.md +++ /dev/null @@ -1,70 +0,0 @@ - - - -# Get-VSTeamWorkItemType - -## SYNOPSIS - -Gets a list of all Work Item Types or a single work item type. - -## SYNTAX - -## Description - -Gets a list of all Work Item Types or a single work item type. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS R:\repos\vsteam> Get-WorkItemType -ProjectName test -WorkItemType 'Code Review Response' -``` - -This command gets a single work item type. - -## 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) -``` - -### -WorkItemType - -The type of work item to retrieve. - -```yaml -Type: String -Parameter Sets: ByType -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -The JSON returned has empty named items i.e. -"": "To Do" -This causes issues with the ConvertFrom-Json CmdLet. Therefore, all "": are replaced with "_end": - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - diff --git a/docs/Invoke-VSTeamRequest.md b/docs/Invoke-VSTeamRequest.md deleted file mode 100644 index d96b0352e..000000000 --- a/docs/Invoke-VSTeamRequest.md +++ /dev/null @@ -1,195 +0,0 @@ - - - -# Invoke-VSTeamRequest - -## SYNOPSIS - -Allows you to call any TFS/AzD REST API. All the Auth and Route Structure is taken care of for you. Just provide the parts of the API call you need. If you need to send a non-standard URL use the -Url parameter. If the -Url is used the Url is not changed but the header and UserAgent are added for you. - -## SYNTAX - -## DESCRIPTION - -Invoke-VSTeamRequest allows you to call a TFS/AzD REST API much easier than using Invoke-WebRequest directly. The shape of the URI and authentication is all handled for you. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Invoke-VSTeamRequest -resource projectHistory -version '4.1-preview' -Verbose -``` - -This command will return the project history. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> ivr -area release -resource releases -version '4.1-preview' -subDomain vsrm -Verbose -``` - -This command will return the releases for a project. - -## 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) -``` - -### -ContentType - -Specifies the content type of the request. - -If this parameter is omitted and the request method is POST, the content type will be set to application/json. - -Otherwise, the content type is not specified in the call. - -```yaml -Type: String -Default value: application/json -``` - -### -Method - -Specifies the method used for the request. The acceptable values for this parameter are: - -- Get -- Post -- Patch -- Delete -- Options -- Put -- Default -- Trace -- Head -- Merge - -```yaml -Type: String -Default value: Get -``` - -### -Body - -Specifies the body of the request. The body is the content of the request that follows the headers. - -You can pipe a body value to Invoke-VSTeamRequest. - -The Body parameter can be used to specify a list of query parameters or specify the content of the response. - -When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. - -```yaml -Type: Object -Accept pipeline input: true (ByValue) -``` - -### -InFile - -Path and file name to the file that contains the contents of the request. If the path is omitted, the default is the current location. - -```yaml -Type: String -``` - -### -OutFile - -Specifies the output file for which this function saves the response body. Enter a path and file name. If you omit the path, the default is the current location. - -```yaml -Type: String -``` - -### -Area - -The area to find the resource. You can tab complete this value. It can be filtered by passing -subDomain first. - -```yaml -Type: String -``` - -### -Resource - -The name of the feature you want to manipulate. You can tab complete this value if you pass -Area before this parameter. - -```yaml -Type: String -``` - -### -Id - -The unique value of the item you want to work with. - -```yaml -Type: String -``` - -### -Version - -The version of the API you wish to target. - -```yaml -Type: String -``` - -### -SubDomain - -The SubDomain before .dev.azure.com. For example, to target Release Management you must use the SubDomain vsrm. - -```yaml -Type: String -``` - -### -JSON - -Converts the PowerShell object into JSON and displays in the console. - -```yaml -Type: Switch -``` - -### -AdditionalHeaders - -Adds additional headers to the request - -```yaml -Type: Hashtable -``` - -### -UseProjectId - -Converts the project name to project id before building the URI for the REST API call. - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeam.md b/docs/Remove-VSTeam.md deleted file mode 100644 index 2fc68f000..000000000 --- a/docs/Remove-VSTeam.md +++ /dev/null @@ -1,93 +0,0 @@ - - - -# Remove-VSTeam - -## SYNOPSIS - -Removes a team from a project. - -## SYNTAX - -## DESCRIPTION - -Removes a team from a project. - -## EXAMPLES - -## 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) -``` - -### -TeamId - -The id of the team to remove. - -```yaml -Type: String -Aliases: name -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamAccessControlEntry.md b/docs/Remove-VSTeamAccessControlEntry.md deleted file mode 100644 index f01b2b264..000000000 --- a/docs/Remove-VSTeamAccessControlEntry.md +++ /dev/null @@ -1,204 +0,0 @@ - - - - -# Remove-VSTeamAccessControlEntry - -## SYNOPSIS - -Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. - -## SYNTAX - -## DESCRIPTION - -Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. - -## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -``` - -This will remove the specified descriptor from the specified repository, using the security namespace id, while confirming for the remove action. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -confirm:$false -``` - -This will remove the specified descriptor from the specified repository, using the security namespace id, with no confirmation for the remove action. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -token "repov2/$projectid/$repoid" -descriptor @("descriptor1","descriptor2") -``` - -This will remove multiple descriptors from the specified repository, using the security namespace id, while confirming for the remove action. - -### -------------------------- EXAMPLE 4 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -``` - -This will remove the specified descriptor from the specified repository, using a security namespace object, while confirming for the remove action. - -### -------------------------- EXAMPLE 5 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0xMzk4ODc2NjMwLTEwMTQ0ODQ4MTMtMzE5MDA4NTI4Ny0xNDU4NTkwODY1LTEtMzE1MjE3NTkwMy03NjE1NjY3OTMtMjgwMTUwMjI2Ny0zMjU5Mjg5MTIy") -confirm:$false -``` - -This will remove the specified descriptor from the specified repository, using a security namespace object, with no confirmation for the remove action. - -### -------------------------- EXAMPLE 6 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamAccessControlEntry -securityNamespace [VSTeamSecurityNamespace]$securityNamespace -token "repov2/$projectid/$repoid" -descriptor @("descriptor1","descriptor2") -``` - -This will remove multiple descriptors from the specified repository, using a security namespace object, while confirming for the remove action. - -## PARAMETERS - -### -SecurityNamespace - -VSTeamSecurityNamespace object. - -```yaml -Type: VSTeamSecurityNamespace -Required: True -``` - -### -SecurityNamespaceId - -Security namespace identifier. - -Valid IDs are: - -AzD: -- Analytics (58450c49-b02d-465a-ab12-59ae512d6531) -- AnalyticsViews (d34d3680-dfe5-4cc6-a949-7d9c68f73cba) -- ReleaseManagement (7c7d32f7-0e86-4cd6-892e-b35dbba870bd) -- ReleaseManagement2 (c788c23e-1b46-4162-8f5e-d7585343b5de) -- Identity (5a27515b-ccd7-42c9-84f1-54c998f03866) -- WorkItemTrackingAdministration (445d2788-c5fb-4132-bbef-09c4045ad93f) -- DistributedTask (101eae8c-1709-47f9-b228-0e476c35b3ba) -- WorkItemQueryFolders (71356614-aad7-4757-8f2c-0fb3bff6f680) -- GitRepositories (2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87) -- VersionControlItems2 (3c15a8b7-af1a-45c2-aa97-2cb97078332e) -- EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) -- WorkItemTrackingProvision (5a6cd233-6615-414d-9393-48dbb252bd23) -- ServiceEndpoints (49b48001-ca20-4adc-8111-5b60c903a50c) -- ServiceHooks (cb594ebe-87dd-4fc9-ac2c-6a10a4c92046) -- Chat (bc295513-b1a2-4663-8d1a-7017fd760d18) -- Collection (3e65f728-f8bc-4ecd-8764-7e378b19bfa7) -- Proxy (cb4d56d2-e84b-457e-8845-81320a133fbb) -- Plan (bed337f8-e5f3-4fb9-80da-81e17d06e7a8) -- Process (2dab47f9-bd70-49ed-9bd5-8eb051e59c02) -- AccountAdminSecurity (11238e09-49f2-40c7-94d0-8f0307204ce4) -- Library (b7e84409-6553-448a-bbb2-af228e07cbeb) -- Environment (83d4c2e6-e57d-4d6e-892b-b87222b7ad20) -- Project (52d39943-cb85-4d7f-8fa8-c6baac873819) -- EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) -- CSS (83e28ad4-2d72-4ceb-97b0-c7726d5502c3) -- TeamLabSecurity (9e4894c3-ff9a-4eac-8a85-ce11cafdc6f1) -- ProjectAnalysisLanguageMetrics (fc5b7b85-5d6b-41eb-8534-e128cb10eb67) -- Tagging (bb50f182-8e5e-40b8-bc21-e8752a1e7ae2) -- MetaTask (f6a4de49-dbe2-4704-86dc-f8ec1a294436) -- Iteration (bf7bfa03-b2b7-47db-8113-fa2e002cc5b1) -- Favorites (fa557b48-b5bf-458a-bb2b-1b680426fe8b) -- Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) -- Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) -- ViewActivityPaneSecurity (dc02bf3d-cd48-46c3-8a41-345094ecc94b) -- Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) -- WorkItemTracking (73e71c45-d483-40d5-bdba-62fd076f7f87) -- StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) -- Server (1f4179b3-6bac-4d01-b421-71ea09171400) -- TestManagement (e06e1c24-e93d-4e4a-908a-7d951187b483) -- SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) -- BuildAdministration (302acaca-b667-436d-a946-87133492041c) -- Location (2725d2bc-7520-4af4-b0e3-8d876494731f) -- Boards (251e12d9-bea3-43a8-bfdb-901b98c0125e) -- UtilizationPermissions (83abde3a-4593-424e-b45f-9898af99034d) -- WorkItemsHub (c0e7a722-1cad-4ae6-b340-a8467501e7ce) -- WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) -- VersionControlPrivileges (66312704-deb5-43f9-b51c-ab4ff5e351c3) -- Workspaces (93bafc04-9075-403a-9367-b7164eac6b5c) -- CrossProjectWidgetView (093cbb02-722b-4ad6-9f88-bc452043fa63) -- WorkItemTrackingConfiguration (35e35e8e-686d-4b01-aff6-c369d6e36ce0) -- Discussion Threads (0d140cae-8ac1-4f48-b6d1-c93ce0301a12) -- BoardsExternalIntegration (5ab15bc8-4ea1-d0f3-8344-cab8fe976877) -- DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) -- Social (81c27cc8-7a9f-48ee-b63f-df1e1d0412dd) -- Security (9a82c708-bfbe-4f31-984c-e860c2196781) -- IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) -- ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) -- Build (33344d9c-fc72-4d6f-aba5-fa317101a7e9) -- DashboardsPrivileges (8adf73b7-389a-4276-b638-fe1653f7efc7) -- VersionControlItems (a39371cf-0841-4c16-bbd3-276e341bc052) - -VSSPS: -- EventSubscriber (2bf24a2b-70ba-43d3-ad97-3d9e1f75622f) (VSSPS) -- EventSubscription (58b176e7-3411-457a-89d0-c6d0ccb3c52b) (VSSPS) -- Registry (4ae0db5d-8437-4ee8-a18b-1f6fb38bd34c) (VSSPS) -- Graph (c2ee56c9-e8fa-4cdd-9d48-2c44f697a58e) (VSSPS) -- Invitation (ea0b4d1e-577a-4797-97b5-2f5755e548d5) (VSSPS) -- SystemGraph (b24dfdf1-285a-4ea6-a55b-32549a68121d) (VSSPS) -- Job (2a887f97-db68-4b7c-9ae3-5cebd7add999) (VSSPS) -- CommerceCollectionSecurity (307be2d3-12ed-45c2-aacf-6598760efca7) (VSSPS) -- StrongBox (4a9e8381-289a-4dfd-8460-69028eaa93b3) (VSSPS) -- GroupLicensing (c6a4fd35-b508-49eb-8ea7-7189df5f3698) (VSSPS) -- Server (1f4179b3-6bac-4d01-b421-71ea09171400) (VSSPS) -- SettingEntries (6ec4592e-048c-434e-8e6c-8671753a8418) (VSSPS) -- RemotableTemplateTest (ccdcb71c-4780-4a42-9bb4-8bce07a7628f) (VSSPS) -- Location (2725d2bc-7520-4af4-b0e3-8d876494731f) (VSSPS) -- WebPlatform (0582eb05-c896-449a-b933-aa3d99e121d6) (VSSPS) -- DataProvider (7ffa7cf4-317c-4fea-8f1d-cfda50cfa956) (VSSPS) -- Security (9a82c708-bfbe-4f31-984c-e860c2196781) (VSSPS) -- IdentityPicker (a60e0d84-c2f8-48e4-9c0c-f32da48d5fd1) (VSSPS) -- ServicingOrchestration (84cc1aa4-15bc-423d-90d9-f97c450fc729) (VSSPS) - -```yaml -Type: String -Required: True -``` - -### -Token - -The security Token - -Valid token formats are: - -- Git Repository (repov2/$projectID/$repositoryID) -- Build Definition ($projectID/$buildDefinitionID) -- Release Definition ($projectID/$releaseDefinitionID, $projectID/Path/to/Release/$releaseDefinitionID) - -```yaml -Type: String -Required: True -``` - -### -Descriptor - -An array of descriptors of users/groups to be removed - -```yaml -Type: System.Array -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -This function outputs a non-terminating error if the ACE removal from the ACL returns $False. This can be due to the wrong descriptor being provided, or the descriptor already not being on the ACL. - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamAccessControlList.md b/docs/Remove-VSTeamAccessControlList.md deleted file mode 100644 index 618328047..000000000 --- a/docs/Remove-VSTeamAccessControlList.md +++ /dev/null @@ -1,65 +0,0 @@ - - - -# Remove-VSTeamAccessControlList - -## SYNOPSIS - -Remove access control lists under the specified security namespace. - -## SYNTAX - -## DESCRIPTION - -Remove access control lists under the specified security namespace. - -## EXAMPLES - -## PARAMETERS - -### -SecurityNamespace - -Security namespace identifier. - -```yaml -Type: VSTeamSecurityNamespace -Required: True -``` - -### -SecurityNamespaceId - -Security namespace identifier. - -```yaml -Type: String -Required: True -``` - -### -Tokens - -One or more comma-separated security tokens - -```yaml -Type: String -Required: True -``` - -### -Recurse - -If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens. - -```yaml -Type: Switch -Required: True -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamAccount.md b/docs/Remove-VSTeamAccount.md deleted file mode 100644 index 9935e2957..000000000 --- a/docs/Remove-VSTeamAccount.md +++ /dev/null @@ -1,59 +0,0 @@ - - - -# Remove-VSTeamAccount - -## SYNOPSIS - -Clears your default project, account name and personal access token. - -## SYNTAX - -## DESCRIPTION - -Clears the environment variables that hold your default project, account, bearer token and personal access token. You have to run Set-VSTeamAccount again before calling any other functions. - -To remove from the Machine level you must be running PowerShell as administrator. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamAccount -``` - -This will clear your account name and personal access token. - -## PARAMETERS - -### -Level - -On Windows allows you to clear your account information at the Process, User or Machine levels. - -```yaml -Type: String -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - diff --git a/docs/Remove-VSTeamAgent.md b/docs/Remove-VSTeamAgent.md deleted file mode 100644 index 200da853d..000000000 --- a/docs/Remove-VSTeamAgent.md +++ /dev/null @@ -1,62 +0,0 @@ - - - -# Remove-VSTeamAgent - -## SYNOPSIS - -Removes an agent from a pool. - -## SYNTAX - -## DESCRIPTION - -Removes an agent from a pool. - -## EXAMPLES - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: int -Required: True -Accept pipeline input: true (ByValue) -``` - -### -Id - -Id of the agent to remove. - -```yaml -Type: int[] -Aliases: AgentID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamArea.md b/docs/Remove-VSTeamArea.md deleted file mode 100644 index b718e5af1..000000000 --- a/docs/Remove-VSTeamArea.md +++ /dev/null @@ -1,97 +0,0 @@ - - - -# Remove-VSTeamArea - -## SYNOPSIS - -Removes an existing area from the project - - -## SYNTAX - -## DESCRIPTION - -Removes an existing area from the project - - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamArea -ProjectName Demo -Path "\MyIteration\Path" -``` - -This command removes an existing area with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root area, since no reclassification id has been given. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamArea -ProjectName "Demo" -Path "\MyIteration\Path" -ReClassifyId 19 -``` - -This command removes an existing area with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the area with the id 19. - -## 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) -``` - -### -Path - -Path of the area node. - -```yaml -Type: string -``` - -### -ReClassifyId - -Id of an area where work items should be reassigned to if they are currently assigned to the area being deleted. - -```yaml -Type: int -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This function is a wrapper of the base function Remove-VSTeamClassificationNode.md. - -## RELATED LINKS - -[Remove-VSTeamClassificationNode](Remove-VSTeamClassificationNode.md) - -[Remove-VSTeamIteration](Remove-VSTeamIteration.md) - diff --git a/docs/Remove-VSTeamBuild.md b/docs/Remove-VSTeamBuild.md deleted file mode 100644 index fba9d923b..000000000 --- a/docs/Remove-VSTeamBuild.md +++ /dev/null @@ -1,79 +0,0 @@ - - - -# Remove-VSTeamBuild - -## SYNOPSIS - -Deletes the build. - -## SYNTAX - -## DESCRIPTION - -Deletes the build. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild | Remove-VSTeamBuild -Force -``` - -This command will delete all builds that are not marked retain indefinitely. - -## 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 - -Specifies one or more builds by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build, type Get-VSTeamBuild. - -```yaml -Type: Int32[] -Aliases: BuildID -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamBuildDefinition.md b/docs/Remove-VSTeamBuildDefinition.md deleted file mode 100644 index 4d5c84e08..000000000 --- a/docs/Remove-VSTeamBuildDefinition.md +++ /dev/null @@ -1,99 +0,0 @@ - - - -# Remove-VSTeamBuildDefinition - -## SYNOPSIS - -Removes the build definitions for a team project. - -## SYNTAX - -## DESCRIPTION - -The Remove-VSTeamBuildDefinition function removes the build definitions for a team project. - -The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition -ProjectName Demo | Remove-VSTeamBuildDefinition -``` - -This command gets a list of all build definitions in the demo project. - -The pipeline operator (|) passes the data to the Remove-VSTeamBuildDefinition function, which removes each build definition object. - -## 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 - -Specifies one or more build definitions by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build definition, type Get-VSTeamBuildDefinition. - -```yaml -Type: Int32[] -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -### None - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe build definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -[Get-VSTeamBuildDefinition](Get-VSTeamBuildDefinition.md) - diff --git a/docs/Remove-VSTeamBuildTag.md b/docs/Remove-VSTeamBuildTag.md deleted file mode 100644 index f26d0d858..000000000 --- a/docs/Remove-VSTeamBuildTag.md +++ /dev/null @@ -1,107 +0,0 @@ - - - -# Remove-VSTeamBuildTag - -## SYNOPSIS - -Removes the tag from a build. - -## SYNTAX - -## DESCRIPTION - -Removes the tag from a build. - -## EXAMPLES - -## 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 - -Specifies one or more builds by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a build, type Get-VSTeamBuild. - -```yaml -Type: Int32[] -Aliases: BuildID -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Tags - -One or more tags. To specify multiple, use commas to separate. - -```yaml -Type: String[] -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamClassificationNode.md b/docs/Remove-VSTeamClassificationNode.md deleted file mode 100644 index d5e922f26..000000000 --- a/docs/Remove-VSTeamClassificationNode.md +++ /dev/null @@ -1,106 +0,0 @@ - - - -# Remove-VSTeamClassificationNode - -## SYNOPSIS - - -Removes either an existing iteration or area from the project - -## SYNTAX - -## DESCRIPTION - - -Removes either an existing iteration or area from the project - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamClassificationNode -ProjectName Demo -StructureGroup "iterations" -Path "\MyIteration\Path" -``` - -This command removes an existing iteration with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root iteration, since no reclassification id has been given. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamClassificationNode -ProjectName "Demo" -StructureGroup "areas" -Path "\MyIteration\Path" -ReClassifyId 19 -``` - -This command removes an existing area with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the area with the id 19. - -## 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) -``` - -### -StructureGroup - -Structure group of the classification node. - -```yaml -Type: string -Accepted values: iterations, areas -``` - -### -Path - -Path of the classification node. - -```yaml -Type: string -``` - -### -ReClassifyId - -Id of a classification node where work items should be reassigned to if they are currently assigned to the node being deleted. - -```yaml -Type: int -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This function is the base function for Remove-VSTeamArea and Remove-VSTeamIteration. - -## RELATED LINKS - -[Remove-VSTeamArea](Remove-VSTeamArea.md) - -[Remove-VSTeamIteration](Remove-VSTeamIteration.md) - diff --git a/docs/Remove-VSTeamExtension.md b/docs/Remove-VSTeamExtension.md deleted file mode 100644 index 8a8a29af0..000000000 --- a/docs/Remove-VSTeamExtension.md +++ /dev/null @@ -1,65 +0,0 @@ - - - -# Remove-VSTeamExtension - -## SYNOPSIS - -Uninstall the specified extension from the account / project collection. - -## SYNTAX - -## DESCRIPTION - -Uninstall the specified extension from the account / project collection. - -## EXAMPLES - -## PARAMETERS - -### -PublisherId - -The id of the publisher. - -```yaml -Type: String -Required: True -``` - -### -ExtensionId - -The id of the extension. - -```yaml -Type: String -Required: True -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamExtension](Add-VSTeamExtension.md) - -[Get-VSTeamExtension](Get-VSTeamExtension.md) - -[Remove-VSTeamExtension](Remove-VSTeamExtension.md) - -[Update-VSTeamExtension](Update-VSTeamExtension.md) - diff --git a/docs/Remove-VSTeamFeed.md b/docs/Remove-VSTeamFeed.md deleted file mode 100644 index 086dd8bfd..000000000 --- a/docs/Remove-VSTeamFeed.md +++ /dev/null @@ -1,45 +0,0 @@ - - - -# Remove-VSTeamFeed - -## SYNOPSIS - -Removes a package feed from the account. - -## SYNTAX - -## DESCRIPTION - -Removes a package feed from the account. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' -``` - -This command remove the package feed from the account. - -## PARAMETERS - -### -FeedId - -Specifies the ID of the feed. - -```yaml -Type: Guid -Aliases: ID -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamGitRepository.md b/docs/Remove-VSTeamGitRepository.md deleted file mode 100644 index 648bab054..000000000 --- a/docs/Remove-VSTeamGitRepository.md +++ /dev/null @@ -1,61 +0,0 @@ - - - -# Remove-VSTeamGitRepository - -## SYNOPSIS - -Removes the Git repository from your Azure DevOps or Team Foundation Server account. - -## SYNTAX - -## DESCRIPTION - -Remove-VSTeamGitRepository removes the Git repository from your Azure DevOps or Team Foundation Server account. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamGitRepository -Id 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -``` - -This command removes all the Git repositories for your TFS or Team Services account. - -## PARAMETERS - -### -Id - -Specifies one or more repositories by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a repository, type Get-Repository. - -```yaml -Type: Guid[] -Aliases: RepositoryID -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamIteration.md b/docs/Remove-VSTeamIteration.md deleted file mode 100644 index 49b5c2c92..000000000 --- a/docs/Remove-VSTeamIteration.md +++ /dev/null @@ -1,97 +0,0 @@ - - - -# Remove-VSTeamIteration - -## SYNOPSIS - - -Removes an existing iteration from the project - -## SYNTAX - -## DESCRIPTION - - -Removes an existing iteration from the project - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamIteration -ProjectName Demo -Path "\MyIteration\Path" -``` - -This command removes an existing iteration with the path MyIteration/Path to the Demo project. Any work items that are assigned to that path get reassigned to the root iteration, since no reclassification id has been given. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamIteration -ProjectName "Demo" -Path "\MyIteration\Path" -ReClassifyId 19 -``` - -This command removes an existing iteration with the path \MyIteration\Path to the Demo project. Any work items that are assigned to that path get reassigned to the iteration with the id 19. - -## 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) -``` - -### -Path - -Path of the iteration node. - -```yaml -Type: string -``` - -### -ReClassifyId - -Id of an iteration where work items should be reassigned to if they are currently assigned to the iteration being deleted. - -```yaml -Type: int -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -### System.Object - -## NOTES - -This function is a wrapper of the base function Remove-VSTeamClassificationNode.md. - -## RELATED LINKS - -[Remove-VSTeamArea](Add-VSTeamArea.md) - -[Remove-VSTeamClassificationNode](Add-VSTeamClassificationNode.md) - diff --git a/docs/Remove-VSTeamMembership.md b/docs/Remove-VSTeamMembership.md deleted file mode 100644 index fc9a9fd3e..000000000 --- a/docs/Remove-VSTeamMembership.md +++ /dev/null @@ -1,69 +0,0 @@ - - - -# Remove-VSTeamMembership - -## SYNOPSIS - -Removes a membership to a container. - -## SYNTAX - -## DESCRIPTION - -Removes a membership to a container. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> $user = Get-VSTeamUser | ? DisplayName -eq 'Test User' -PS C:\> $group = Get-VSTeamGroup | ? DisplayName -eq 'Endpoint Administrators' -PS C:\> Remove-VSTeamMembership -MemberDescriptor $user.Descriptor -ContainerDescriptor $group.Descriptor -``` - -Removes Test User from the Endpoint Administrators group. - -## PARAMETERS - -### -MemberDescriptor - -A member descriptor retrieved by Get-VsTeamUser - -```yaml -Type: String -Required: True -Position: 0 -``` - - -### -ContainerDescriptor - -A container descriptor retrieved by Get-VsTeamGroup - -```yaml -Type: String -Required: True -Position: 1 -``` - - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VsTeamUser](Get-VsTeamUser.md) - -[Get-VsTeamGroup](Get-VsTeamGroup.md) - -[Add-VsTeamMembership](Add-VsTeamMembership.md) - -[Get-VsTeamMembership](Get-VsTeamMembership.md) - -[Test-VsTeamMembership](Test-VsTeamMembership.md) - diff --git a/docs/Remove-VSTeamPolicy.md b/docs/Remove-VSTeamPolicy.md deleted file mode 100644 index c51fc3165..000000000 --- a/docs/Remove-VSTeamPolicy.md +++ /dev/null @@ -1,81 +0,0 @@ - - - -# Remove-VSTeamPolicy - -## SYNOPSIS - -Removes the specified policy from the specified project. - -## SYNTAX - -## DESCRIPTION - -Remove-VSTeamPolicy removes the policy from the specified project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamPolicy -ProjectName Demo -Id 1 -``` - -This command removes the policy with ID of 1 from the Demo project. - -## 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 - -Specifies one or more policies by ID. - -To find the ID of a policy see [Get-VSTeamPolicy](Get-VSTeamPolicy.md) - -```yaml -Type: Int[] -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamPolicy](Add-VSTeamPolicy.md) - -[Get-VSTeamPolicy](Get-VSTeamPolicy.md) - -[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md) - diff --git a/docs/Remove-VSTeamProfile.md b/docs/Remove-VSTeamProfile.md deleted file mode 100644 index 9536ac859..000000000 --- a/docs/Remove-VSTeamProfile.md +++ /dev/null @@ -1,58 +0,0 @@ - - - -# Remove-VSTeamProfile - -## SYNOPSIS - -Removes the profile. - -## SYNTAX - -## DESCRIPTION - -Removes the profile. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProfile | Remove-VSTeamProfile -Force -``` - -This will remove all the profiles on your system. - -## PARAMETERS - -### -Name - -Name of profile to remove. - -```yaml -Type: String -Required: True -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamProfile](Add-VSTeamProfile.md) - diff --git a/docs/Remove-VSTeamProject.md b/docs/Remove-VSTeamProject.md deleted file mode 100644 index 9b1536231..000000000 --- a/docs/Remove-VSTeamProject.md +++ /dev/null @@ -1,85 +0,0 @@ - - - -# Remove-VSTeamProject - -## SYNOPSIS - -Deletes the Team Project from your Team Services account. - -## SYNTAX - -## DESCRIPTION - -This will permanently delete your Team Project from your Team Services account. - -This function takes a DynamicParam for ProjectName that can be read from the Pipeline by Property Name - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamProject 'MyProject' -``` - -You will be prompted for confirmation and the project will be deleted. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamProject 'MyProject' -Force -``` - -You will NOT be prompted for confirmation and the project will be deleted. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProject | Remove-VSTeamProject -Force -``` - -This will remove all projects - -## 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) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Add-VSTeamProject](Add-VSTeamProject.md) - diff --git a/docs/Remove-VSTeamRelease.md b/docs/Remove-VSTeamRelease.md deleted file mode 100644 index 453ced42d..000000000 --- a/docs/Remove-VSTeamRelease.md +++ /dev/null @@ -1,99 +0,0 @@ - - - -# Remove-VSTeamRelease - -## SYNOPSIS - -Removes the releases for a team project. - -## SYNTAX - -## DESCRIPTION - -The Remove-VSTeamRelease function removes the releases for a team project. - -The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamRelease -ProjectName demo | Remove-VSTeamRelease -``` - -This command gets a list of all releases in the demo project. - -The pipeline operator (|) passes the data to the Remove-VSTeamRelease function, which removes each release definition object. - -## 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 - -Specifies one or more releases by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a release definition, type Get-VSTeamRelease. - -```yaml -Type: Int32[] -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -### None - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe release definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamRelease](Add-VSTeamRelease.md) - -[Get-VSTeamRelease](Get-VSTeamRelease.md) - diff --git a/docs/Remove-VSTeamReleaseDefinition.md b/docs/Remove-VSTeamReleaseDefinition.md deleted file mode 100644 index 5c5448bfd..000000000 --- a/docs/Remove-VSTeamReleaseDefinition.md +++ /dev/null @@ -1,99 +0,0 @@ - - - -# Remove-VSTeamReleaseDefinition - -## SYNOPSIS - -Removes the release definitions for a team project. - -## SYNTAX - -## DESCRIPTION - -The Remove-VSTeamReleaseDefinition function removes the release definitions for a team project. - -The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamReleaseDefinition -ProjectName demo | Remove-VSTeamReleaseDefinition -``` - -This command gets a list of all release definitions in the demo project. - -The pipeline operator (|) passes the data to the Remove-VSTeamReleaseDefinition function, which removes each release definition object. - -## 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 - -Specifies one or more release definitions by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a release definition, type Get-VSTeamReleaseDefinition. - -```yaml -Type: Int32[] -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -### None - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe release definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamReleaseDefinition](Add-VSTeamReleaseDefinition.md) - -[Get-VSTeamReleaseDefinition](Get-VSTeamReleaseDefinition.md) - diff --git a/docs/Remove-VSTeamServiceEndpoint.md b/docs/Remove-VSTeamServiceEndpoint.md deleted file mode 100644 index 1d8eb91f0..000000000 --- a/docs/Remove-VSTeamServiceEndpoint.md +++ /dev/null @@ -1,65 +0,0 @@ - - - -# Remove-VSTeamServiceEndpoint - -## SYNOPSIS - -Removes a service endpoint. - -## SYNTAX - -## DESCRIPTION - -Removes a service endpoint. - -## EXAMPLES - -## 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 - -Id of the service endpoint - -```yaml -Type: String[] -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamTaskGroup.md b/docs/Remove-VSTeamTaskGroup.md deleted file mode 100644 index 041cfe034..000000000 --- a/docs/Remove-VSTeamTaskGroup.md +++ /dev/null @@ -1,139 +0,0 @@ - - - -# Remove-VSTeamTaskGroup - -## SYNOPSIS - -Removes a task group - -## SYNTAX - -## DESCRIPTION - -Removes a task group - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```powershell - -$projectName = "some_project_name" -$taskGroup = Get-VSTeamTaskGroup -Name "taskName" -ProjectName $projectName - -$methodParameters = @{ - Id = $taskGroup.id - ProjectName = $projectName - Force = $true -} - -Remove-VSTeamTaskGroup @methodParameters -``` - -## PARAMETERS - -### -Confirm - -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Force - -Does not prompt - -```yaml -Type: SwitchParameter -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ProjectName - -### -ProjectName - -Specifies the team project for which this function operates. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so -you do not have to pass the ProjectName with each call. - -```yaml -Type: String -Position: 0 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -WhatIf - -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Id - -ID of the existing task group - -```yaml -Type: String -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorTask, -InformationAction, -InformationTask, -OutTask, -OutBuffer, -PipelineTask, -Verbose, -WarningAction, and -WarningTask. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String[] - -System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Add-VSTeamTaskGroup](Add-VSTeamTaskGroup.md) - -[Get-VSTeamTaskGroup](Get-VSTeamTaskGroup.md) - -[Update-VSTeamTaskGroup](Update-VSTeamTaskGroup.md) - diff --git a/docs/Remove-VSTeamUserEntitlement.md b/docs/Remove-VSTeamUserEntitlement.md deleted file mode 100644 index a67e2711f..000000000 --- a/docs/Remove-VSTeamUserEntitlement.md +++ /dev/null @@ -1,98 +0,0 @@ - - - -# Remove-VSTeamUserEntitlement - -## SYNOPSIS - -Delete a user from the account. - -The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. - -## SYNTAX - -## DESCRIPTION - -Delete a user from the account. - -The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. - -## EXAMPLES - -## PARAMETERS - -### -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -UserId - -The id of the user to remove. - -```yaml -Type: String -Parameter Sets: ByID -Aliases: name -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Email - -The email of the user to remove. - -```yaml -Type: String -Parameter Sets: ByEmail -Aliases: name -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -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 - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Remove-VSTeamVariableGroup.md b/docs/Remove-VSTeamVariableGroup.md deleted file mode 100644 index 0240967c5..000000000 --- a/docs/Remove-VSTeamVariableGroup.md +++ /dev/null @@ -1,142 +0,0 @@ - - - -# Remove-VSTeamVariableGroup - -## SYNOPSIS - -Removes a variable group - -## SYNTAX - -## DESCRIPTION - -Removes a variable group - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "Vsts" - Variables = @{ - key1 = @{ - value = "value1" - isSecret = $true - } - } -} - -$newVariableGroup = Add-VSTeamVariableGroup @methodParameters - -$methodParameters = @{ - Id = $newVariableGroup.id - ProjectName = "some_project_name" - Force = $true -} - -Remove-VSTeamVariableGroup @methodParameters -``` - -## PARAMETERS - -### -ProjectName - -Specifies the team project for which this function operates. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so -you do not have to pass the ProjectName with each call. - -```yaml -Type: String -Position: 0 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 -``` - -### -Id - -ID of the existing variable group - -```yaml -Type: String -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String[] - -System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) - -[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) - -[Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) - diff --git a/docs/Remove-VSTeamWorkItem.md b/docs/Remove-VSTeamWorkItem.md deleted file mode 100644 index f318f9718..000000000 --- a/docs/Remove-VSTeamWorkItem.md +++ /dev/null @@ -1,115 +0,0 @@ - - - -# Remove-VSTeamWorkItem - -## SYNOPSIS - -Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - -## SYNTAX - -## DESCRIPTION - -Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamWorkItem -Id 47,48 -Force -``` - -This command deletes work items with IDs 47 and 48 by using the IDs parameter. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamWorkItem -Id 47 -``` - -This command deletes the work item with ID 47 by using the ID parameter. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Remove-VSTeamWorkItem -Id 47 -Destroy -Force -``` - -This command deletes work item with IDs 47 **permanently** by using the Destroy parameter. - -## PARAMETERS - -### -Id - -The id of one or more work items. - -```yaml -Type: Int32[] -Parameter Sets: List -Required: True -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Destroy - -Optional parameter, if set to true, the work item is deleted permanently. **Please note: the destroy action is PERMANENT and cannot be undone.** - -```yaml -Type: Switch -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -## NOTES - -If you do not set the default project by called Set-VSTeamDefaultProject before calling Get-VSTeamWorkItem you will have to type in the names. - -## RELATED LINKS - diff --git a/docs/Set-VSTeamAPIVersion.md b/docs/Set-VSTeamAPIVersion.md deleted file mode 100644 index 9de444e14..000000000 --- a/docs/Set-VSTeamAPIVersion.md +++ /dev/null @@ -1,111 +0,0 @@ - - - -# Set-VSTeamAPIVersion - -## SYNOPSIS - -Sets the API versions to support either TFS2017, TFS2018, AzD2019 or AzD. - -## SYNTAX - -## DESCRIPTION - -Set-VSTeamAPIVersion sets the versions of APIs used. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAPIVersion AzD -``` - -This command sets the API versions to support AzD. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAPIVersion -Service Release -Version '5.0' -``` - -This command sets the version of the Release calls to 5.0. - -## PARAMETERS - -### -Target - -Specifies the version to use. The acceptable values for this parameter are: - -- TFS2017 -- TFS2017U1 -- TFS2017U2 -- TFS2017U3 -- TFS2018 -- TFS2018U1 -- TFS2018U2 -- TFS2018U3 -- AzD2019 -- AzD2019U1 -- VSTS -- AzD - -```yaml -Type: String -Required: True -Position: 0 -Parameter Sets: Target -Default value: TFS2017 -``` - -### -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 -``` - -### -Version - -Specifies the version to use. - -```yaml -Type: String -Required: True -Parameter Sets: Service -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Set-VSTeamAccount.md b/docs/Set-VSTeamAccount.md deleted file mode 100644 index d738c2c62..000000000 --- a/docs/Set-VSTeamAccount.md +++ /dev/null @@ -1,226 +0,0 @@ - - - -# Set-VSTeamAccount - -## SYNOPSIS - -Stores your account name and personal access token for use with the other -functions in this module. - -## SYNTAX - -## DESCRIPTION - -On Windows you have to option to store the information at the process, user or machine (you must be running PowerShell as administrator to store at the machine level) level. - -On Linux and Mac you can only store at the process level. - -Calling Set-VSTeamAccount will clear any default project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -``` - -You will be prompted for the account name and personal access token. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrthisisnotreal4uhlh5vgbmgap3mziwnga -``` - -Allows you to provide all the information on the command line. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Account http://localtfs:8080/tfs/DefaultCollection -UseWindowsAuthentication -``` - -On Windows, allows you use to use Windows authentication against a local TFS server. - -### -------------------------- EXAMPLE 4 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Profile demonstrations -``` - -Will add the account from the profile provided. - -### -------------------------- EXAMPLE 5 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Profile demonstrations -Drive demo | Invoke-Expression -PS C:\> Set-Location demo: -PS demo:\> Get-ChildItem -``` - -Will add the account from the profile provided and mount a drive named demo that you can navigate like a file system. If you do not pipe to Invoke-Expression you can simply copy and paste the output and execute it. - -### -------------------------- EXAMPLE 6 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Profile demonstrations -Level Machine -``` - -Will add the account from the profile provided and store the information at the Machine level. Now any new PowerShell sessions will auto load this account. - -Note: You must run PowerShell as an Administrator to store at the Machine level. - -### -------------------------- EXAMPLE 7 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -``` - -Will add the account and use the OAuth Token provided by AzD when you check the *Allow scripts to access OAuth token* checkbox on the phase. Using this method removes the need to create a Personal Access Token. Note -Token is just an alias for -PersonalAccessToken. The token is scoped to only allow access to the account running the build or release. To access other accounts you will have to use a personal access token. - -## PARAMETERS - -### -Account - -The Azure DevOps (AzD) account name to use. -DO NOT enter the entire URL. - -Just the portion after dev.azure.com. For example in the -following url mydemos is the account name. - -or -The full Team Foundation Server (TFS) url including the collection. - - -```yaml -Type: String -Parameter Sets: Secure, Plain, Windows -Required: True -Position: 1 -``` - -### -SecurePersonalAccessToken - -A secured string to capture your personal access token. - -This will allow you to provide your personal access token without displaying it in plain text. - -To use pat simply omit it from the Set-VSTeamAccount command. - -```yaml -Type: SecureString -Aliases: PAT -Parameter Sets: Secure -Required: True -``` - -### -Level - -On Windows allows you to store your account information at the Process, User or Machine levels. -When saved at the User or Machine level your account information will be in any future PowerShell processes. - -To store at the Machine level you must be running PowerShell as an Administrator. - -```yaml -Type: String -Parameter Sets: Secure, Plain, Windows -``` - -### -PersonalAccessToken - -The personal access token from AzD/TFS to use to access this account. - -```yaml -Type: String -Parameter Sets: Plain -Aliases: Token -Required: True -Position: 2 -``` - -### -UseWindowsAuthentication - -Allows the use of the current user's Windows credentials to authenticate against a local Team Foundation Server or Azure DevOps Server. This cannot be used to connect to Azure DevOps Services. - -```yaml -Type: SwitchParameter -Parameter Sets: Windows -``` - -### -UseBearerToken - -Switches the authorization from Basic to Bearer. You still use the PAT for PersonalAccessToken parameters to store the token. - -```yaml -Type: SwitchParameter -Parameter Sets: Secure, Plain -``` - -### -Profile - -The profile name stored using Add-VSTeamProfile function. You can tab complete through existing profile names. - -```yaml -Type: String -Parameter Sets: Profile -Required: True -``` - -### -Version - -Specifies the version to use. The acceptable values for this parameter are: - -- TFS2017 -- TFS2018 -- AzD2019 -- VSTS -- AzD - -If you are on AzD it will default to Azd otherwise it will default to TFS2017 - -```yaml -Type: String -Parameter Sets: Secure, Plain, Windows -Required: True -Position: 3 -Default value: TFS2017 for TFS and AzD for AzD -``` - -### -Drive - -The name of the drive you want to mount to this account. The command you need to run will be presented. Simply copy and paste the command to mount the drive. To use the drive run Set-Location [driveName]: - -```yaml -Type: String -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Add-VSTeamProfile](Add-VSTeamProfile.md) - -[Clear-VSTeamDefaultProject](Clear-VSTeamDefaultProject.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - diff --git a/docs/Set-VSTeamAlias.md b/docs/Set-VSTeamAlias.md deleted file mode 100644 index ae026453e..000000000 --- a/docs/Set-VSTeamAlias.md +++ /dev/null @@ -1,43 +0,0 @@ - - - -# Set-VSTeamAlias - -## SYNOPSIS - -In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - -## SYNTAX - -## DESCRIPTION - -In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - -## EXAMPLES - -## PARAMETERS - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Set-VSTeamApproval.md b/docs/Set-VSTeamApproval.md deleted file mode 100644 index 78f7fd846..000000000 --- a/docs/Set-VSTeamApproval.md +++ /dev/null @@ -1,112 +0,0 @@ - - - -# Set-VSTeamApproval - -## SYNOPSIS - -Sets the status of approval to Approved, Rejected, Pending, or ReAssigned. - -## SYNTAX - -## DESCRIPTION - -Set-VSTeamApproval sets the status of approval to Approved, Rejected, Pending, or ReAssigned. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamApproval | Set-VSTeamApproval -``` - -This command sets all pending approvals to approved. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamApproval -Id 1 -Status Rejected -``` - -This command rejects approval with Id of 1. - -## 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 - -Specifies the approval IDs of the approvals to set. - -```yaml -Type: Int32[] -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Status - -Specifies the status to set for the approval. The acceptable values for this parameter are: - -- Approved -- Rejected -- Pending -- ReAssigned - -```yaml -Type: String -Required: True -Default value: Approved -``` - -### -Approver - -Specifies the user to whom the approval has been re-assigned to Alias of the user chuckreinhart@outlook.com, for example. - -```yaml -Type: String -``` - -### -Comment - -Specifies the comment to be stored with this approval. - -```yaml -Type: String -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Set-VSTeamDefaultAPITimeout.md b/docs/Set-VSTeamDefaultAPITimeout.md deleted file mode 100644 index 354153315..000000000 --- a/docs/Set-VSTeamDefaultAPITimeout.md +++ /dev/null @@ -1,71 +0,0 @@ - - - -# Set-VSTeamDefaultAPITimeout - -## SYNOPSIS - -Sets the default timeout to be used with other calls in the module. - -## SYNTAX - -## DESCRIPTION - -By setting a default timeout you can adjust the value for your needs - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultAPITimeout 30 -``` - -This command sets 30 seconds as the default timeout. - -## PARAMETERS - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -TimeoutSec - -Specifies the timeout for all function calls. - -```yaml -Type: Int -Required: True -Accept pipeline input: False -``` - -### -Level - -On Windows allows you to store your default timeout at the Process, User or Machine levels. - -When saved at the User or Machine level your default timeout will be in any future PowerShell processes. - -```yaml -Type: String -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Set-VSTeamDefaultProject.md b/docs/Set-VSTeamDefaultProject.md deleted file mode 100644 index 00a9fe1f8..000000000 --- a/docs/Set-VSTeamDefaultProject.md +++ /dev/null @@ -1,81 +0,0 @@ - - - -# Set-VSTeamDefaultProject - -## SYNOPSIS - -Sets the default project to be used with other calls in the module. - -## SYNTAX - -## DESCRIPTION - -The majority of the functions in this module require a project name. - -By setting a default project you can omit that parameter from your function calls and this default will be used instead. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -``` - -This command sets Demo as the default project. - -You can now call other functions that require a project name without passing the project. - -## PARAMETERS - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -Project - -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 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Level - -On Windows allows you to store your default project at the Process, User or Machine levels. - -When saved at the User or Machine level your default project will be in any future PowerShell processes. - -```yaml -Type: String -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -Setting a default project also enables tab completion of dynamic parameters when you call Add-VSTeamBuild. - -## RELATED LINKS - diff --git a/docs/Set-VSTeamEnvironmentStatus.md b/docs/Set-VSTeamEnvironmentStatus.md deleted file mode 100644 index 3086e1f7c..000000000 --- a/docs/Set-VSTeamEnvironmentStatus.md +++ /dev/null @@ -1,120 +0,0 @@ - - - -# Set-VSTeamEnvironmentStatus - -## SYNOPSIS - -Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - -## SYNTAX - -## DESCRIPTION - -Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamEnvironmentStatus -ReleaseId 54 -Id 5 -status inProgress -``` - -This command will set the status of environment with id 5 of release 54 to inProgress. You can use this call to redeploy an environment. - -## 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) -``` - -### -EnvironmentId - -Specifies one or more environments by ID you wish to deploy. - -The Environment Ids are unique for each environment and in each release. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of an environment type Get-VSTeamRelease -expand environments. - -```yaml -Type: Int32[] -Aliases: Id -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -ReleaseId - -Specifies the release by ID. - -```yaml -Type: Int32 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Status - -The status to set for the environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - -```yaml -Type: String -``` - -### -Comment - -The comment to set for the status change. - -```yaml -Type: String -``` - -### -ScheduledDeploymentTime - -The date and time to schedule when setting the status to scheduled. - -```yaml -Type: DateTime -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets releases. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -## RELATED LINKS - diff --git a/docs/Set-VSTeamPermissionInheritance.md b/docs/Set-VSTeamPermissionInheritance.md deleted file mode 100644 index f3f7b6362..000000000 --- a/docs/Set-VSTeamPermissionInheritance.md +++ /dev/null @@ -1,109 +0,0 @@ - - - -# Set-VSTeamPermissionInheritance - -## SYNOPSIS - -Sets the permission inheritance to true or false. - -## SYNTAX - -## DESCRIPTION - -Sets the permission inheritance to true or false. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamPermissionInheritance -ProjectName Demo -Name Demo-CI -ResourceType BuildDefinition -NewState $true -Force -``` - -This command sets the permission inheritance to true. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuildDefinition | Set-VSTeamPermissionInheritance -ResourceType BuildDefinition -NewState $true -Force -``` - -ThisThis command sets the permission inheritance to true for every build definition returned from Get-VSTeamBuildDefinition. - -## 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) -``` - -### -Name - -Specifies the name of the resource. - -```yaml -Type: String -Accept pipeline input: true (ByPropertyName) -Required: True -``` - -### -ResourceType - -Specifies the type of resource. The acceptable values for this parameter are: - -- Repository -- BuildDefinition -- ReleaseDefinition - -```yaml -Type: String -Required: True -``` - -### -NewState - -The new state to set - -```yaml -Type: Boolean -Required: True -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamPolicy](Add-VSTeamPolicy.md) - -[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -[Set-VSTeamPermissionInheritanceType](Set-VSTeamPermissionInheritanceType.md) - diff --git a/docs/Set-VSTeamReleaseStatus.md b/docs/Set-VSTeamReleaseStatus.md deleted file mode 100644 index cfc05a98c..000000000 --- a/docs/Set-VSTeamReleaseStatus.md +++ /dev/null @@ -1,85 +0,0 @@ - - - -# Set-VSTeamReleaseStatus - -## SYNOPSIS - -Sets the status of a release to Active or Abandoned. - -## SYNTAX - -## DESCRIPTION - -Sets the status of a release to Active or Abandoned. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamReleaseStatus -Id 5 -status Abandoned -``` - -This command will set the status of release with id 5 to Abandoned. - -## 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 - -Specifies one or more releases by ID. - -To specify multiple IDs, use commas to separate the IDs. - -To find the ID of a release type Get-VSTeamRelease. - -```yaml -Type: Int32[] -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Status - -The status to set for the release Active or Abandoned. - -```yaml -Type: String -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Show-VSTeam.md b/docs/Show-VSTeam.md deleted file mode 100644 index 76cfe9df3..000000000 --- a/docs/Show-VSTeam.md +++ /dev/null @@ -1,37 +0,0 @@ - - - -# Show-VSTeam - -## SYNOPSIS - -Opens TFS or AzD site in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens TFS or AzD site in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeam -``` - -This will open a browser to the TFS or AzD site - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - diff --git a/docs/Show-VSTeamApproval.md b/docs/Show-VSTeamApproval.md deleted file mode 100644 index a71308711..000000000 --- a/docs/Show-VSTeamApproval.md +++ /dev/null @@ -1,81 +0,0 @@ - - - -# Show-VSTeamApproval - -## SYNOPSIS - -Opens the release associated with the waiting approval in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the release associated with the waiting approval in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamApproval -ProjectName Demo | Show-VSTeamApproval -``` - -This command opens a web browser showing the release requiring approval. - -## 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) -``` - -### -ReleaseDefinitionId - -Only approvals for the release id provided will be returned. - -```yaml -Type: Int32 -Aliases: Id -Required: True -Position: 1 -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -## INPUTS - -## OUTPUTS - -### Team.BuildDefinition - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -You can pipe build definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -[Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) - diff --git a/docs/Show-VSTeamBuild.md b/docs/Show-VSTeamBuild.md deleted file mode 100644 index e797f54a3..000000000 --- a/docs/Show-VSTeamBuild.md +++ /dev/null @@ -1,59 +0,0 @@ - - - -# Show-VSTeamBuild - -## SYNOPSIS - -Opens the build summary in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the build summary in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamBuild -ProjectName Demo -Id 3 -``` - -This command will open a web browser with the summary of build 3. - -## PARAMETERS - -### -Id - -Specifies build by ID. - -```yaml -Type: Int32 -Parameter Sets: ByID -Aliases: BuildID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.Build - -## NOTES - -You can pipe the build ID to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuild](Add-VSTeamBuild.md) - -[Remove-VSTeamBuild](Remove-VSTeamBuild.md) - diff --git a/docs/Show-VSTeamBuildDefinition.md b/docs/Show-VSTeamBuildDefinition.md deleted file mode 100644 index 236f76e4a..000000000 --- a/docs/Show-VSTeamBuildDefinition.md +++ /dev/null @@ -1,108 +0,0 @@ - - - -# Show-VSTeamBuildDefinition - -## SYNOPSIS - -Opens the build definition in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the build definition in the default browser. - -The project name is a Dynamic Parameter which may not be displayed in the syntax above but is mandatory. - -With just a project name, this function shows all of the build definitions for that team project. - -You can also specify a particular build definition by ID. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamBuildDefinition -ProjectName Demo -``` - -This command will open a web browser with All Definitions for this project showing. - -## 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) -``` - -### -Type - -The type of the build definitions to retrieve. The acceptable values for this parameter are: - -- Mine -- All -- Queued -- XAML - -If not specified, all types will be returned. - -```yaml -Type: String -Parameter Sets: List -Default value: All -``` - -### -Path - -The folder of the build definitions to retrieve. - -```yaml -Type: String -Parameter Sets: List -Default value: \ -``` - -### -Id - -Specifies build definition by ID. - -```yaml -Type: Int32 -Parameter Sets: ByID -Aliases: BuildDefinitionID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.BuildDefinition - -## NOTES - -You can pipe build definition IDs to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -[Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) - diff --git a/docs/Show-VSTeamFeed.md b/docs/Show-VSTeamFeed.md deleted file mode 100644 index f0ada0c09..000000000 --- a/docs/Show-VSTeamFeed.md +++ /dev/null @@ -1,53 +0,0 @@ - - - -# Show-VSTeamFeed - -## SYNOPSIS - -Opens the feed in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the feed in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamFeed -Name Demo -``` - -This command will open a web browser with this feed showing. - -## PARAMETERS - -### -Id - -Specifies feed by ID or Name. - -```yaml -Type: Int32 -Parameter Sets: -Aliases: Name -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.Feed - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Add-VSTeamFeed](Add-VSTeamFeed.md) - diff --git a/docs/Show-VSTeamGitRepository.md b/docs/Show-VSTeamGitRepository.md deleted file mode 100644 index 534e3ae0a..000000000 --- a/docs/Show-VSTeamGitRepository.md +++ /dev/null @@ -1,61 +0,0 @@ - - - -# Show-VSTeamGitRepository - -## SYNOPSIS - -Opens the Git repository in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the Git repository in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamGitRepository -ProjectName Demo -``` - -This command opens the Git repository in a browser. - -## 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) -``` - -### -RemoteUrl - -The RemoteUrl of the Git repository to open. - -```yaml -Type: String -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Show-VSTeamProject.md b/docs/Show-VSTeamProject.md deleted file mode 100644 index 5d890ef8a..000000000 --- a/docs/Show-VSTeamProject.md +++ /dev/null @@ -1,69 +0,0 @@ - - - -# Show-VSTeamProject - -## SYNOPSIS - -Opens the project in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the project in default browser. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamProject TestProject -``` - -This will open a browser to the TestProject site - -## 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 project to return. - -```yaml -Type: String -Parameter Sets: ByID -Aliases: ProjectID -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Add-VSTeamProject](Add-VSTeamProject.md) - -[Remove-VSTeamProject](Remove-VSTeamProject.md) - diff --git a/docs/Show-VSTeamPullRequest.md b/docs/Show-VSTeamPullRequest.md deleted file mode 100644 index 7f21f8bf8..000000000 --- a/docs/Show-VSTeamPullRequest.md +++ /dev/null @@ -1,60 +0,0 @@ - - - -# Show-VSTeamPullRequest - -## SYNOPSIS - -Opens the pull request in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the pull request in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamPullRequest 3 -``` - -This command will open a web browser with the pull request id of 3. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamPullRequest -Id 3 -``` - -This command will open a web browser with the pull request id of 3. - -## PARAMETERS - -### -PullRequestId - -Specifies pull request by ID. - -```yaml -Type: Int32 -Aliases: PullRequestId -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.Release - -## NOTES - -You can pipe the pull request ID to this function. - -## RELATED LINKS - -[Get-VSTeamPullRequest](Get-VSTeamPullRequest.md) - diff --git a/docs/Show-VSTeamRelease.md b/docs/Show-VSTeamRelease.md deleted file mode 100644 index 28ed507fa..000000000 --- a/docs/Show-VSTeamRelease.md +++ /dev/null @@ -1,59 +0,0 @@ - - - -# Show-VSTeamRelease - -## SYNOPSIS - -Opens the release summary in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the release summary in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamRelease -ProjectName Demo -Id 3 -``` - -This command will open a web browser with the summary of release 3. - -## PARAMETERS - -### -Id - -Specifies release by ID. - -```yaml -Type: Int32 -Parameter Sets: ByID -Aliases: ReleaseID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.Release - -## NOTES - -You can pipe the release ID to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamRelease](Add-VSTeamRelease.md) - -[Remove-VSTeamRelease](Remove-VSTeamRelease.md) - diff --git a/docs/Show-VSTeamReleaseDefinition.md b/docs/Show-VSTeamReleaseDefinition.md deleted file mode 100644 index ace66c307..000000000 --- a/docs/Show-VSTeamReleaseDefinition.md +++ /dev/null @@ -1,75 +0,0 @@ - - - -# Show-VSTeamReleaseDefinition - -## SYNOPSIS - -Opens the release definitions for a team project in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the release definitions for a team project in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamReleaseDefinition -ProjectName Demo -``` - -This command will open a web browser with All Release Definitions for this project showing. - -## 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 - -Specifies release definition by ID. - -```yaml -Type: Int32 -Parameter Sets: ByID -Aliases: ReleaseDefinitionID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.ReleaseDefinition - -## NOTES - -You can pipe the release definition ID to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamReleaseDefinition](Add-VSTeamReleaseDefinition.md) - -[Remove-VSTeamReleaseDefinition](Remove-VSTeamReleaseDefinition.md) - diff --git a/docs/Show-VSTeamWorkItem.md b/docs/Show-VSTeamWorkItem.md deleted file mode 100644 index c6a067fb4..000000000 --- a/docs/Show-VSTeamWorkItem.md +++ /dev/null @@ -1,59 +0,0 @@ - - - -# Show-VSTeamWorkItem - -## SYNOPSIS - -Opens the work item in the default browser. - -## SYNTAX - -## DESCRIPTION - -Opens the work item in the default browser. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Show-VSTeamWorkItem -ProjectName Demo -Id 3 -``` - -This command will open a web browser with the summary of work item 3. - -## PARAMETERS - -### -Id - -Specifies work item by ID. - -```yaml -Type: Int32 -Parameter Sets: ByID -Aliases: WorkItemID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### Team.WorkItem - -## NOTES - -You can pipe the WorkItem ID to this function. - -## RELATED LINKS - -[Set-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -[Add-VSTeamWorkItem](Add-VSTeamWorkItem.md) - -[Get-VSTeamWorkItem](Get-VSTeamWorkItem.md) - diff --git a/docs/Stop-VSTeamBuild.md b/docs/Stop-VSTeamBuild.md deleted file mode 100644 index 284008a2a..000000000 --- a/docs/Stop-VSTeamBuild.md +++ /dev/null @@ -1,108 +0,0 @@ - - - -# 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 deleted file mode 100644 index 9f1084a37..000000000 --- a/docs/Team.md +++ /dev/null @@ -1,639 +0,0 @@ ---- -Module Name: Team -Module Guid: 22fe5207-1749-4832-9648-e939fe074b7f -Help Version: 1.0.0.0 -Locale: en-US ---- - -# VSTeam Module - -## Description - -Welcome to VSTeam. VSTeam is a [PowerShell module](https://www.powershellgallery.com/packages/VSTeam/) that wraps the [REST API provided by Team Foundation Server and Azure DevOps](https://cda.ms/ys). This allows you to access the power of TFS and AzD from [PowerShell on Windows, MacOS and Linux](https://github.com/PowerShell/PowerShell). - -## VSTeam Functions - -### [Add-VSTeam](Add-VSTeam.md) - -Adds a team to a team project. - -### [Add-VSTeamAccessControlEntry](Add-VSTeamAccessControlEntry.md) - -Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. - -Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. - -### [Add-VSTeamArea](Add-VSTeamArea.md) - -Adds a new area to the project - -### [Add-VSTeamAzureRMServiceEndpoint](Add-VSTeamAzureRMServiceEndpoint.md) - -Adds a new Azure Resource Manager service endpoint. - -### [Add-VSTeamBuild](Add-VSTeamBuild.md) - -Queues a new build. - -### [Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -Creates a new build definition from a JSON file. - -### [Add-VSTeamBuildTag](Add-VSTeamBuildTag.md) - -Adds a tag to a build. - -### [Add-VSTeamClassificationNode](Add-VSTeamClassificationNode.md) - -Adds either a new iteration or area to the project - -### [Add-VSTeamExtension](Add-VSTeamExtension.md) - -Install the specified extension into the account / project collection. - -### [Add-VSTeamFeed](Add-VSTeamFeed.md) - -Adds a new feed to package management. - -### [Add-VSTeamGitRepository](Add-VSTeamGitRepository.md) - -Adds a Git repository to your Azure DevOps or Team Foundation Server account. - -### [Add-VSTeamGitRepositoryPermission](Add-VSTeamGitRepositoryPermission.md) - -Add permissions to a git repository, all repositories in a project, or a specific branch - -### [Add-VSTeamIteration](Add-VSTeamIteration.md) - -Adds a new iteration to the project - -### [Add-VSTeamKubernetesEndpoint](Add-VSTeamKubernetesEndpoint.md) - -Adds connections to Kubernetes clusters - -### [Add-VSTeamMembership](Add-VSTeamMembership.md) - -Adds a membership to a container. - -### [Add-VSTeamNuGetEndpoint](Add-VSTeamNuGetEndpoint.md) - -Adds a new NuGet service endpoint. - -### [Add-VSTeamPolicy](Add-VSTeamPolicy.md) - -Adds a new policy to the specified project. - -### [Add-VSTeamProfile](Add-VSTeamProfile.md) - -Stores your account name and personal access token as a profile for use with -the Add-TeamAccount function in this module. - -### [Add-VSTeamProject](Add-VSTeamProject.md) - -Adds a Team Project to your account. - -### [Add-VSTeamProjectPermission](Add-VSTeamProjectPermission.md) - -Add Permissions on Project Level - -### [Add-VSTeamPullRequest](Add-VSTeamPullRequest.md) - -Create a new Pull Request - -### [Add-VSTeamRelease](Add-VSTeamRelease.md) - -Queues a new release - -### [Add-VSTeamReleaseDefinition](Add-VSTeamReleaseDefinition.md) - -Creates a new release definition from a JSON file. - -### [Add-VSTeamServiceEndpoint](Add-VSTeamServiceEndpoint.md) - -Adds a generic service connection - -### [Add-VSTeamServiceFabricEndpoint](Add-VSTeamServiceFabricEndpoint.md) - -Adds a new Service Fabric service endpoint. - -### [Add-VSTeamSonarQubeEndpoint](Add-VSTeamSonarQubeEndpoint.md) - -Adds a new SonarQube service endpoint. - -### [Add-VSTeamTaskGroup](Add-VSTeamTaskGroup.md) - -Adds a task group. - -### [Add-VSTeamUserEntitlement](Add-VSTeamUserEntitlement.md) - -Add a user, assign license and extensions and make them a member of a project group in an account. - -### [Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) - -Adds a variable group. - -### [Add-VSTeamWorkItem](Add-VSTeamWorkItem.md) - -Adds a work item to your project. - -### [Add-VSTeamWorkItemAreaPermission](Add-VSTeamWorkItemAreaPermission.md) - -Add Permissions to a Work Item Area - -### [Add-VSTeamWorkItemIterationPermission](Add-VSTeamWorkItemIterationPermission.md) - -Add Permissions to an Iteration - -### [Clear-VSTeamDefaultAPITimeout](Clear-VSTeamDefaultAPITimeout.md) - -Clears the value stored in the default timeout parameter value. - -### [Clear-VSTeamDefaultProject](Clear-VSTeamDefaultProject.md) - -Clears the value stored in the default project parameter value. - -### [Disable-VSTeamAgent](Disable-VSTeamAgent.md) - -Disables an agent in a pool. - -### [Enable-VSTeamAgent](Enable-VSTeamAgent.md) - -Enables an agent in a pool. - -### [Get-VSTeam](Get-VSTeam.md) - -Returns a team. - -### [Get-VSTeamAccessControlList](Get-VSTeamAccessControlList.md) - -Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. - -### [Get-VSTeamAgent](Get-VSTeamAgent.md) - -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. - -### [Get-VSTeamArea](Get-VSTeamArea.md) - -Gets the area node for a given area path. - -### [Get-VSTeamBuild](Get-VSTeamBuild.md) - -Gets the builds for a team project. - -### [Get-VSTeamBuildArtifact](Get-VSTeamBuildArtifact.md) - -Returns the artifacts of a build. - -### [Get-VSTeamBuildDefinition](Get-VSTeamBuildDefinition.md) - -Gets the build definitions for a team project. - -### [Get-VSTeamBuildLog](Get-VSTeamBuildLog.md) - -Displays the logs for the build. - -### [Get-VSTeamBuildTag](Get-VSTeamBuildTag.md) - -Returns all the tags of a build. - -### [Get-VSTeamBuildTimeline](Get-VSTeamBuildTimeline.md) - -Get the timelines for builds - -### [Get-VSTeamClassificationNode](Get-VSTeamClassificationNode.md) - -Gets the classification node for a given node path. - -### [Get-VSTeamCloudSubscription](Get-VSTeamCloudSubscription.md) - -Gets the Azure subscriptions associated with the Team Services account. - -### [Get-VSTeamDescriptor](Get-VSTeamDescriptor.md) - -Resolve a storage key to a descriptor. - -### [Get-VSTeamExtension](Get-VSTeamExtension.md) - -Get the installed extensions in the specified Azure DevOps or Team Foundation Server project. - -### [Get-VSTeamFeed](Get-VSTeamFeed.md) - -Returns a list of package feeds for the account. - -### [Get-VSTeamGitCommit](Get-VSTeamGitCommit.md) - -Retrieve git commits for a project - -### [Get-VSTeamGitRef](Get-VSTeamGitRef.md) - -Queries the provided repository for its refs and returns them. - -### [Get-VSTeamGitRepository](Get-VSTeamGitRepository.md) - -Get all the repositories in your Azure DevOps or Team Foundation Server account, or a specific project. - -### [Get-VSTeamGitStat](Get-VSTeamGitStat.md) - -Retrieves statistics about branches within a repository. - -### [Get-VSTeamGroup](Get-VSTeamGroup.md) - -Returns a Group or List of Groups. - -### [Get-VSTeamInfo](Get-VSTeamInfo.md) - -Displays your current account and default project. - -### [Get-VSTeamIteration](Get-VSTeamIteration.md) - -Gets the iteration node for a given iteration path. - -### [Get-VSTeamJobRequest](Get-VSTeamJobRequest.md) - -Returns all the job requests of an agent. - -### [Get-VSTeamMember](Get-VSTeamMember.md) - -Returns a team member. - -### [Get-VSTeamMembership](Get-VSTeamMembership.md) - -Gets a memberships for a container or member. - -### [Get-VSTeamOption](Get-VSTeamOption.md) - -Returns all the versions of supported APIs of your TFS or AzD. - -### [Get-VSTeamPermissionInheritance](Get-VSTeamPermissionInheritance.md) - -Returns true or false. - -### [Get-VSTeamPolicy](Get-VSTeamPolicy.md) - -Get the code policies in the specified Azure DevOps or Team Foundation Server project. - -### [Get-VSTeamPolicyType](Get-VSTeamPolicyType.md) - -Get the policy types in the specified Azure DevOps or Team Foundation Server project. - -### [Get-VSTeamPool](Get-VSTeamPool.md) - -Returns the agent pools. - -### [Get-VSTeamProcess](Get-VSTeamProcess.md) - -Returns a list of process templates in the Team Services or Team Foundation Server account. - -### [Get-VSTeamProfile](Get-VSTeamProfile.md) - -Returns the saved profiles. - -### [Get-VSTeamProject](Get-VSTeamProject.md) - -Returns a list of projects in the Team Services or Team Foundation Server account. - -### [Get-VSTeamPullRequest](Get-VSTeamPullRequest.md) - -Returns one or more open pull requests from your team, project, or Id. - -### [Get-VSTeamQueue](Get-VSTeamQueue.md) - -Gets a agent queue. - -### [Get-VSTeamRelease](Get-VSTeamRelease.md) - -Gets the releases for a team project. - -### [Get-VSTeamReleaseDefinition](Get-VSTeamReleaseDefinition.md) - -Gets the release definitions for a team project. - -### [Get-VSTeamResourceArea](Get-VSTeamResourceArea.md) - -List all the areas supported by this instance of TFS/VSTS. - -### [Get-VSTeamSecurityNamespace](Get-VSTeamSecurityNamespace.md) - -List all security namespaces or just the specified namespace. - -### [Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -Gets a service endpoint. - -### [Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -Get service endpoint types. - -### [Get-VSTeamTaskGroup](Get-VSTeamTaskGroup.md) - -Gets a task group - -### [Get-VSTeamTfvcBranch](Get-VSTeamTfvcBranch.md) - -Gets a branch for a given path from TFVC source control. - -### [Get-VSTeamTfvcRootBranch](Get-VSTeamTfvcRootBranch.md) - -Gets root branches for all projects with TFVC source control. - -### [Get-VSTeamUser](Get-VSTeamUser.md) - -Returns a list of users for the account. - -### [Get-VSTeamUserEntitlement](Get-VSTeamUserEntitlement.md) - -Get User Entitlement for a user. - -### [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) - -Gets a variable group - -### [Get-VSTeamWiql](Get-VSTeamWiql.md) - -Returns work items from the given WIQL query or a saved query by ID from your projects team. - -### [Get-VSTeamWorkItem](Get-VSTeamWorkItem.md) - -Returns one or more a work items from your project. - -### [Get-VSTeamWorkItemType](Get-VSTeamWorkItemType.md) - -Gets a list of all Work Item Types or a single work item type. - -### [Invoke-VSTeamRequest](Invoke-VSTeamRequest.md) - -Allows you to call any TFS/AzD REST API. All the Auth and Route Structure is taken care of for you. Just provide the parts of the API call you need. If you need to send a non-standard URL use the -Url parameter. If the -Url is used the Url is not changed but the header and UserAgent are added for you. - -### [Remove-VSTeam](Remove-VSTeam.md) - -Removes a team from a project. - -### [Remove-VSTeamAccessControlEntry](Remove-VSTeamAccessControlEntry.md) - -Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. - -### [Remove-VSTeamAccessControlList](Remove-VSTeamAccessControlList.md) - -Remove access control lists under the specified security namespace. - -### [Remove-VSTeamAccount](Remove-VSTeamAccount.md) - -Clears your default project, account name and personal access token. - -### [Remove-VSTeamAgent](Remove-VSTeamAgent.md) - -Removes an agent from a pool. - -### [Remove-VSTeamArea](Remove-VSTeamArea.md) - -Removes an existing area from the project - - -### [Remove-VSTeamBuild](Remove-VSTeamBuild.md) - -Deletes the build. - -### [Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) - -Removes the build definitions for a team project. - -### [Remove-VSTeamBuildTag](Remove-VSTeamBuildTag.md) - -Removes the tag from a build. - -### [Remove-VSTeamClassificationNode](Remove-VSTeamClassificationNode.md) - - -Removes either an existing iteration or area from the project - -### [Remove-VSTeamExtension](Remove-VSTeamExtension.md) - -Uninstall the specified extension from the account / project collection. - -### [Remove-VSTeamFeed](Remove-VSTeamFeed.md) - -Removes a package feed from the account. - -### [Remove-VSTeamGitRepository](Remove-VSTeamGitRepository.md) - -Removes the Git repository from your Azure DevOps or Team Foundation Server account. - -### [Remove-VSTeamIteration](Remove-VSTeamIteration.md) - - -Removes an existing iteration from the project - -### [Remove-VSTeamMembership](Remove-VSTeamMembership.md) - -Removes a membership to a container. - -### [Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -Removes the specified policy from the specified project. - -### [Remove-VSTeamProfile](Remove-VSTeamProfile.md) - -Removes the profile. - -### [Remove-VSTeamProject](Remove-VSTeamProject.md) - -Deletes the Team Project from your Team Services account. - -### [Remove-VSTeamRelease](Remove-VSTeamRelease.md) - -Removes the releases for a team project. - -### [Remove-VSTeamReleaseDefinition](Remove-VSTeamReleaseDefinition.md) - -Removes the release definitions for a team project. - -### [Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - -Removes a service endpoint. - -### [Remove-VSTeamTaskGroup](Remove-VSTeamTaskGroup.md) - -Removes a task group - -### [Remove-VSTeamUserEntitlement](Remove-VSTeamUserEntitlement.md) - -Delete a user from the account. - -The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. - -### [Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) - -Removes a variable group - -### [Remove-VSTeamWorkItem](Remove-VSTeamWorkItem.md) - -Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - -### [Set-VSTeamAccount](Set-VSTeamAccount.md) - -Stores your account name and personal access token for use with the other -functions in this module. - -### [Set-VSTeamAlias](Set-VSTeamAlias.md) - -In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - -### [Set-VSTeamAPIVersion](Set-VSTeamAPIVersion.md) - -Sets the API versions to support either TFS2017, TFS2018, AzD2019 or AzD. - -### [Set-VSTeamApproval](Set-VSTeamApproval.md) - -Sets the status of approval to Approved, Rejected, Pending, or ReAssigned. - -### [Set-VSTeamDefaultAPITimeout](Set-VSTeamDefaultAPITimeout.md) - -Sets the default timeout to be used with other calls in the module. - -### [Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -Sets the default project to be used with other calls in the module. - -### [Set-VSTeamEnvironmentStatus](Set-VSTeamEnvironmentStatus.md) - -Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - -### [Set-VSTeamPermissionInheritance](Set-VSTeamPermissionInheritance.md) - -Sets the permission inheritance to true or false. - -### [Set-VSTeamReleaseStatus](Set-VSTeamReleaseStatus.md) - -Sets the status of a release to Active or Abandoned. - -### [Show-VSTeam](Show-VSTeam.md) - -Opens TFS or AzD site in the default browser. - -### [Show-VSTeamApproval](Show-VSTeamApproval.md) - -Opens the release associated with the waiting approval in the default browser. - -### [Show-VSTeamBuild](Show-VSTeamBuild.md) - -Opens the build summary in the default browser. - -### [Show-VSTeamBuildDefinition](Show-VSTeamBuildDefinition.md) - -Opens the build definition in the default browser. - -### [Show-VSTeamFeed](Show-VSTeamFeed.md) - -Opens the feed in the default browser. - -### [Show-VSTeamGitRepository](Show-VSTeamGitRepository.md) - -Opens the Git repository in the default browser. - -### [Show-VSTeamProject](Show-VSTeamProject.md) - -Opens the project in the default browser. - -### [Show-VSTeamPullRequest](Show-VSTeamPullRequest.md) - -Opens the pull request in the default browser. - -### [Show-VSTeamRelease](Show-VSTeamRelease.md) - -Opens the release summary in the default browser. - -### [Show-VSTeamReleaseDefinition](Show-VSTeamReleaseDefinition.md) - -Opens the release definitions for a team project in the default browser. - -### [Show-VSTeamWorkItem](Show-VSTeamWorkItem.md) - -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. - -### [Test-VSTeamYamlPipeline](Test-VSTeamYamlPipeline.md) - -Tests the commited YAML pipeline files to check for inconsitencies. Now, you can try out a YAML pipeline without committing it to a repo or running it. Given an existing pipeline and an optional new YAML payload, this function will give you back the full YAML pipeline. - -### [Update-VSTeam](Update-VSTeam.md) - -Updates the team name, description or both. - -### [Update-VSTeamAgent](Update-VSTeamAgent.md) - -Instructs the agent to download and install the lastest version of the agent on self-hosted agents. - -### [Update-VSTeamBuild](Update-VSTeamBuild.md) - -Allows you to set the keep forever flag and build number. - -### [Update-VSTeamBuildDefinition](Update-VSTeamBuildDefinition.md) - -Updates a build definition for a team project. - -### [Update-VSTeamExtension](Update-VSTeamExtension.md) - -Update an installed extension. Typically this API is used to enable or disable an extension. - -### [Update-VSTeamPolicy](Update-VSTeamPolicy.md) - -Updates an existing policy in the specified project. - -### [Update-VSTeamProfile](Update-VSTeamProfile.md) - -Allows you to update the Personal Access Token for your profile. - -### [Update-VSTeamProject](Update-VSTeamProject.md) - -Updates the project name, description or both. - -### [Update-VSTeamPullRequest](Update-VSTeamPullRequest.md) - -Update a pull request - -### [Update-VSTeamRelease](Update-VSTeamRelease.md) - -Allows you to update release variables for future stages to read. - -### [Update-VSTeamReleaseDefinition](Update-VSTeamReleaseDefinition.md) - -Updates a build definition for a team project. - -### [Update-VSTeamServiceEndpoint](Update-VSTeamServiceEndpoint.md) - -Updates an existing service connection - -### [Update-VSTeamTaskGroup](Update-VSTeamTaskGroup.md) - -Updates an existing task group - -### [Update-VSTeamUserEntitlement](Update-VSTeamUserEntitlement.md) - -Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. - -### [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) - -Updates an existing variable group - -### [Update-VSTeamWorkItem](Update-VSTeamWorkItem.md) - -Update a work item in your project. - - - - diff --git a/docs/Test-VSTeamMembership.md b/docs/Test-VSTeamMembership.md deleted file mode 100644 index ead26c43f..000000000 --- a/docs/Test-VSTeamMembership.md +++ /dev/null @@ -1,61 +0,0 @@ - - - -# Test-VSTeamMembership - -## SYNOPSIS - -Tests the membership in a container. - -## SYNTAX - -## DESCRIPTION - -Tests the membership in a container. - -## EXAMPLES - -## PARAMETERS - -### -MemberDescriptor - -A member descriptor retrieved by Get-VsTeamUser - -```yaml -Type: String -Required: True -Position: 0 -``` - - -### -ContainerDescriptor - -A container descriptor retrieved by Get-VsTeamGroup - -```yaml -Type: String -Required: True -Position: 1 -``` - - -## INPUTS - -## OUTPUTS - -### System.Boolean - -## NOTES - -## RELATED LINKS - -[Get-VsTeamUser](Get-VsTeamUser.md) - -[Get-VsTeamGroup](Get-VsTeamGroup.md) - -[Add-VsTeamMembership](Add-VsTeamMembership.md) - -[Get-VsTeamMembership](Get-VsTeamMembership.md) - -[Remove-VsTeamMembership](Remove-VsTeamMembership.md) - diff --git a/docs/Test-VSTeamYamlPipeline.md b/docs/Test-VSTeamYamlPipeline.md deleted file mode 100644 index 2b39dbf6c..000000000 --- a/docs/Test-VSTeamYamlPipeline.md +++ /dev/null @@ -1,106 +0,0 @@ - - - -# Test-VSTeamYamlPipeline - -## SYNOPSIS - -Tests the commited YAML pipeline files to check for inconsitencies. Now, you can try out a YAML pipeline without committing it to a repo or running it. Given an existing pipeline and an optional new YAML payload, this function will give you back the full YAML pipeline. - -## SYNTAX - -## DESCRIPTION - -Tests the commited YAML pipeline files to check for inconsitencies. Now, you can try out a YAML pipeline without committing it to a repo or running it. Given an existing pipeline and an optional new YAML payload, this function will give you back the full YAML pipeline. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -FilePath './azure-pipelines.yml' - -Name Id url state ----- -- --- ----- - -1 https://dev.azure.com/devsdb/3428bdd7-9fed-4c30-a6c9-fcb52f084ab9/_apis/pipelines/24/runs/-1 unknown -``` - -This example checks the YAML pipeline with ID 24 and the file './azure-pipelines.yml' for consistency on Azure DevOps to see if the changes still work. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> $yamlOverride = [string](Get-Content -raw $FilePath) -PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -YamlOverride $yamlOverride -``` - -This example checks the YAML pipeline with ID 24 and the content of a yaml file in the variable $yamlOverride for consistency on Azure DevOps to see if the changes still work. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> $yamlOverride = [string](Get-Content -raw $FilePath) -PS C:\> Test-VSTeamYamlPipeline -Project DemoProject -PipelineId 24 -``` - -This example checks the YAML pipeline with ID 24 for consistency on Azure DevOps to see if the existing YAML of the pipeline works. - -## 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) -``` - -### -PipelineId - -Id of the YAML pipeline to be checked - -```yaml -Type: Int32 -Position: 1 -``` - -### -FilePath - -Path to the file that should be checked - -```yaml -Type: String -``` - -## INPUTS - -### System.String - -FilePath - -### System.Int32 - -PipelineId - -## OUTPUTS - -### Team.YamlPipelineResult - -## NOTES - -If you do not set the default project by called Set-VSTeamDefaultProject before calling Add-VSTeamBuild you will have to type in the names. - -Currently the API that is used by this cmdlet is only supporting YAML pipelines without template references. This will be supported soon. see the issue in GitHub: [https://github.com/microsoft/azure-pipelines-yaml/issues/34#issuecomment-591092498](https://github.com/microsoft/azure-pipelines-yaml/issues/34#issuecomment-591092498) - -## RELATED LINKS - -[Get-VSTeamBuildDefinition](Get-VSTeamBuildDefinition.md) - diff --git a/docs/Update-VSTeam.md b/docs/Update-VSTeam.md deleted file mode 100644 index 1ccb48005..000000000 --- a/docs/Update-VSTeam.md +++ /dev/null @@ -1,120 +0,0 @@ - - - -# Update-VSTeam - -## SYNOPSIS - -Updates the team name, description or both. - -## SYNTAX - -## DESCRIPTION - -Updates the team name, description or both. - -## EXAMPLES - -## 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) -``` - -### -Description - -The new description of the team - -```yaml -Type: String -Position: 2 -``` - -### -Name - -The name of the team to update - -```yaml -Type: String -Aliases: Id, TeamToUpdate, TeamId, TeamName -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -NewTeamName - -The new name of the team - -```yaml -Type: String -``` - -### -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -Description - -Name - -NewTeamName - -## OUTPUTS - -### Team.Team - -## NOTES - -## RELATED LINKS - diff --git a/docs/Update-VSTeamAgent.md b/docs/Update-VSTeamAgent.md deleted file mode 100644 index 09102087e..000000000 --- a/docs/Update-VSTeamAgent.md +++ /dev/null @@ -1,89 +0,0 @@ - - - -# Update-VSTeamAgent - -## SYNOPSIS - -Instructs the agent to download and install the lastest version of the agent on self-hosted agents. - -## SYNTAX - -## DESCRIPTION - -Instructs the agent to download and install the lastest version of the agent on self-hosted agents. - -## EXAMPLES - -## PARAMETERS - -### -PoolId - -Id of the pool. - -```yaml -Type: int -Required: True -Accept pipeline input: true (ByValue) -``` - -### -Id - -Id of the agent to Update. - -```yaml -Type: int[] -Aliases: AgentID -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/docs/Update-VSTeamBuild.md b/docs/Update-VSTeamBuild.md deleted file mode 100644 index 498f866e8..000000000 --- a/docs/Update-VSTeamBuild.md +++ /dev/null @@ -1,121 +0,0 @@ - - - -# Update-VSTeamBuild - -## SYNOPSIS - -Allows you to set the keep forever flag and build number. - -## SYNTAX - -## DESCRIPTION - -Allows you to set the keep forever flag and build number. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamBuild | Update-VSTeamBuild -KeepForever $false -``` - -Sets the keep forever property of every build to false. - -## 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) -``` - -### -BuildNumber - -The value you want to set as the build number. - -```yaml -Type: String -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Id - -The id of the build. - -```yaml -Type: Int32 -Aliases: BuildID -Required: True -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -KeepForever - -$True or $False to set the keep forever property of the build. - -```yaml -Type: Boolean -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -### Team.Build - -## NOTES - -## RELATED LINKS - diff --git a/docs/Update-VSTeamBuildDefinition.md b/docs/Update-VSTeamBuildDefinition.md deleted file mode 100644 index dad6bb20e..000000000 --- a/docs/Update-VSTeamBuildDefinition.md +++ /dev/null @@ -1,107 +0,0 @@ - - - -# Update-VSTeamBuildDefinition - -## SYNOPSIS - -Updates a build definition for a team project. - -## SYNTAX - -## DESCRIPTION - -Reads a JSON file off disk or string and uses that file to update an existing build definition in the provided project. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Update-VSTeamBuildDefinition -ProjectName Demo -Id 123 -InFile build.json -``` - -This command reads build.json and updates existing build definition with -id 123 from it on the demo team project. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> $b = Get-VSTeamBuildDefinition -ProjectName Demo -Id 23 -Raw -PS C:\> $b.variables.subscriptionId.value = 'Some New Value' -PS C:\> $body = $b | ConvertTo-Json -Depth 100 -PS C:\> Update-VSTeamBuildDefinition -ProjectName Demo -Id 23 -BuildDefinition $body -``` - -## 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 - -Specifies the build definition to update by ID. - -To find the ID of a build definition, type Get-VSTeamBuildDefinition. - -```yaml -Type: Int32 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -InFile - -Path and file name to the JSON file that contains the definition to be updated. If the path is omitted, the default is the current location. - -```yaml -Type: String -Required: True -Parameter Sets: File -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -BuildDefinition - -JSON string of build definition. - -```yaml -Type: String -Required: True -Parameter Sets: JSON -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -## INPUTS - -## OUTPUTS - -### None - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -## RELATED LINKS - diff --git a/docs/Update-VSTeamExtension.md b/docs/Update-VSTeamExtension.md deleted file mode 100644 index 5a37906ce..000000000 --- a/docs/Update-VSTeamExtension.md +++ /dev/null @@ -1,77 +0,0 @@ - - - -# Update-VSTeamExtension - -## SYNOPSIS - -Update an installed extension. Typically this API is used to enable or disable an extension. - -## SYNTAX - -## DESCRIPTION - -Update an installed extension. Typically this API is used to enable or disable an extension. - -## EXAMPLES - -## PARAMETERS - -### -PublisherId - -The id of the publisher. - -```yaml -Type: String -Required: True -``` - -### -ExtensionId - -The id of the extension. - -```yaml -Type: String -Required: True -``` - -### -ExtensionState - -The state of an installed extension. Example: "disabled". The acceptable values for this parameter are: - -- none -- disabled - -```yaml -Type: String -Required: True -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Add-VSTeamExtension](Add-VSTeamExtension.md) - -[Get-VSTeamExtension](Get-VSTeamExtension.md) - -[Remove-VSTeamExtension](Remove-VSTeamExtension.md) - -[Update-VSTeamExtension](Update-VSTeamExtension.md) - diff --git a/docs/Update-VSTeamPolicy.md b/docs/Update-VSTeamPolicy.md deleted file mode 100644 index 9b1f5fc90..000000000 --- a/docs/Update-VSTeamPolicy.md +++ /dev/null @@ -1,101 +0,0 @@ - - - -# Update-VSTeamPolicy - -## SYNOPSIS - -Updates an existing policy in the specified project. - -## SYNTAX - -## DESCRIPTION - -Updates an existing policy in the specified project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Update-VSTeamPolicy -ProjectName Demo -id 1 -type 687c53f8-1a82-4e89-9a86-13d51bc4a8d5 -enabled -blocking -settings @{MinimumApproverCount = 1;Scope=@(@{repositoryId=b87c5af8-1a82-4e59-9a86-13d5cbc4a8d5; matchKind="Exact"; refName="refs/heads/master"})} -``` - -This command updates an existing policy in the Demo project. - -## 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 - -Specifies the policy to update. - -```yaml -Type: Int -``` - -### -type - -Specifies the id of the type of policy to be update. This must match the original policy, it cannot be changed via this call. - -```yaml -Type: Guid -Required: True -``` - -### -enabled - -Enables the policy - -```yaml -Type: Switch -``` - -### -blocking - -Determines if the policy will block pushes to the branch if the policy is not adhered to. - -```yaml -Type: Switch -``` - -### -settings - -The settings for the policy. - -Each policy type has it's own settings that will need to be set. - -```yaml -Type: Hashtable -Required: True -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamPolicy](Get-VSTeamPolicy.md) - -[Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -[Get-VSTeamPolicyType](Get-VSTeamPolicyType.md) - diff --git a/docs/Update-VSTeamProfile.md b/docs/Update-VSTeamProfile.md deleted file mode 100644 index 306a93b69..000000000 --- a/docs/Update-VSTeamProfile.md +++ /dev/null @@ -1,101 +0,0 @@ - - - -# Update-VSTeamProfile - -## SYNOPSIS - -Allows you to update the Personal Access Token for your profile. - -## SYNTAX - -## DESCRIPTION - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Update-VSTeamProfile -Name ProfileName -``` - -You will be prompted for the account name and personal access token. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Update-VSTeamProfile -Name mydemos -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -``` - -Allows you to provide all the information on the command line. - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Get-VSTeamProfile | Where-Object version -eq vsts | Select-Object -skip 1 | Update-VSTeamProfile -PersonalAccessToken 7a8ilh6db4aforlrnrqmdrxdztkjvcc4uhlh5vgbteserp3mziwnga -Force -``` - -This will update all but the first AzD profile - -## PARAMETERS - -### -PAT - -A secured string to capture your personal access token. - -This will allow you to provide your personal access token -without displaying it in plain text. - -To use pat simply omit it from the Update-VSTeamProfile command. - -```yaml -Type: SecureString -Parameter Sets: Secure -Required: True -``` - -### -PersonalAccessToken - -The personal access token from AzD/TFS to use to access this account. - -```yaml -Type: String -Parameter Sets: Plain -Required: True -Position: 2 -``` - -### -Name - -Name of the profile to be updated - -```yaml -Type: String -Required: True -Position: 3 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Update-VSTeamAccount](Set-VSTeamAccount.md) - -[Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - diff --git a/docs/Update-VSTeamProject.md b/docs/Update-VSTeamProject.md deleted file mode 100644 index 65b3e0627..000000000 --- a/docs/Update-VSTeamProject.md +++ /dev/null @@ -1,94 +0,0 @@ - - - -# Update-VSTeamProject - -## SYNOPSIS - -Updates the project name, description or both. - -## SYNTAX - -## DESCRIPTION - -Updates the project name, description or both. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Update-VSTeamProject -Name Demo -NewName aspDemo -``` - -This command changes the name of your project from Demo to aspDemo. - -## 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) -``` - -### -NewName - -The new name for the project. - -```yaml -Type: String -``` - -### -NewDescription - -The new description for the project. - -```yaml -Type: String -``` - -### -Id - -The id of the project to update. - -```yaml -Type: String -Parameter Sets: (ByID) -Aliases: ProjectId -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/docs/Update-VSTeamPullRequest.md b/docs/Update-VSTeamPullRequest.md deleted file mode 100644 index eb869af82..000000000 --- a/docs/Update-VSTeamPullRequest.md +++ /dev/null @@ -1,160 +0,0 @@ - - - -# Update-VSTeamPullRequest - -## SYNOPSIS - -Update a pull request - -## SYNTAX - -## DESCRIPTION - -Update a pull request - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Draft -``` - -Set the pull request to be a draft - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamGitRepository -ProjectName project -Name demorepo -PS C:\> Update-VSTeamPullRequest -RepositoryId $r.RepositoryId -Status abandoned -``` - -Abandon a pull request - -## PARAMETERS - -### -RepositoryId - -The id of the repository - -```yaml -Type: Guid -Required: True -Aliases: Id -Accept pipeline input: true (ByPropertyName) -Parameter Sets: Draft, Publish, Status, EnableAutoComplete, DisableAutoComplete -``` - -### -PullRequestId - -The id of the pull request - -```yaml -Type: Int32 -Required: True -Parameter Sets: Draft, Publish, Status, EnableAutoComplete, DisableAutoComplete -``` - -### -Status - -The status to set the pull request to. Valid values for this are: - -- abandoned -- active -- completed -- notSet - -```yaml -Type: String -Parameter Sets: Status -``` - -### -EnableAutoComplete - -Set the pull requests auto complete status - -```yaml -Type: Switch -Parameter Sets: EnableAutoComplete -``` - -### -AutoCompleteIdentity - -The identity that enabled autocomplete. This is mandatory if -AutoComplete is set to $true - -```yaml -Type: VSTeamUser -Parameter Sets: EnableAutoComplete -``` - -### -DisableAutoComplete - -Unset the pull requests auto complete status - -```yaml -Type: Switch -Parameter Sets: DisableAutoComplete -``` - -### -Draft - -Set the pull request as a draft - -```yaml -Type: Switch -Parameter Sets: Draft -``` - -### -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -### Team.PullRequest - -## NOTES - -## RELATED LINKS - diff --git a/docs/Update-VSTeamRelease.md b/docs/Update-VSTeamRelease.md deleted file mode 100644 index ac732bb78..000000000 --- a/docs/Update-VSTeamRelease.md +++ /dev/null @@ -1,125 +0,0 @@ - - - -# Update-VSTeamRelease - -## SYNOPSIS - -Allows you to update release variables for future stages to read. - -## SYNTAX - -## DESCRIPTION - -Allows you to update release variables for future stages to read. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamRelease -ProjectName project -Id 76 -Raw -PS C:\> $r.variables.temp.value='temp' -PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r -``` - -Changes the variable temp on the release. This can be done in one stage and read in another stage. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamAccount -Account mydemos -Token $(System.AccessToken) -UseBearerToken -PS C:\> $r = Get-VSTeamRelease -ProjectName project -Id 76 -Raw -PS C:\> $r.variables | Add-Member NoteProperty temp([PSCustomObject]@{value='test'}) -PS C:\> Update-VSTeamRelease -ProjectName project -Id 76 -release $r -``` - -Adds a variable temp to the release with a value of test. - -## 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 release to update - -```yaml -Type: Int32 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -Release - -The updated release to save in AzD - -```yaml -Type: PSCustomObject -Required: True -``` - -### -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -### Team.Release - -## NOTES - -## RELATED LINKS - diff --git a/docs/Update-VSTeamReleaseDefinition.md b/docs/Update-VSTeamReleaseDefinition.md deleted file mode 100644 index abb83a208..000000000 --- a/docs/Update-VSTeamReleaseDefinition.md +++ /dev/null @@ -1,136 +0,0 @@ - - - -# Update-VSTeamReleaseDefinition - -## SYNOPSIS - -Updates a build definition for a team project. - -## SYNTAX - -## DESCRIPTION - -Reads a JSON file off disk or from string and uses that file to update an existing release definition in the provided project. - -You must call Set-VSTeamAccount before calling this function. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Update-VSTeamReleaseDefinition -ProjectName Demo -Id 123 -InFile release.json -``` - -This command reads release.json and updates existing release definition with -id 123 from it on the demo team project. - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> $b = Get-VSTeamReleaseDefinition -ProjectName Demo -Id 23 -Raw -PS C:\> $b.variables.subscriptionId.value = 'Some New Value' -PS C:\> $body = $b | ConvertTo-Json -Depth 100 -PS C:\> Update-VSTeamReleaseDefinition -ProjectName Demo -ReleaseDefinition $body -``` - -This commands update the variables of the release definition. - -## 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) -``` - -### -InFile - -Path and file name to the JSON file that contains the definition to be updated. If the path is omitted, the default is the current location. - -```yaml -Type: String -Required: true -Parameter Sets: File -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -ReleaseDefinition - -JSON string of release definition. - -```yaml -Type: String -Required: true -Parameter Sets: JSON -Position: 1 -Accept pipeline input: true (ByPropertyName) -``` - -### -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 -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -### -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 - -## OUTPUTS - -### None - -## NOTES - -This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so you do not have to pass the ProjectName with each call. - -## RELATED LINKS - diff --git a/docs/Update-VSTeamServiceEndpoint.md b/docs/Update-VSTeamServiceEndpoint.md deleted file mode 100644 index f0be7d288..000000000 --- a/docs/Update-VSTeamServiceEndpoint.md +++ /dev/null @@ -1,92 +0,0 @@ - - - -# Update-VSTeamServiceEndpoint - -## SYNOPSIS - -Updates an existing service connection - -## SYNTAX - -## DESCRIPTION - -Updates an existing service connection - -## EXAMPLES - -## 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 - -UUID of existing services endpoint from AzD - -```yaml -Type: String -Position: 1 -``` - -### -Object - -Hashtable of payload for REST call - -```yaml -Type: Hashtable -Required: true -Accept pipeline input: true (ByPropertyName) -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -### Team.ServiceEndpoint - -## NOTES - -## RELATED LINKS - -[Add-VSTeamServiceEndpoint](Add-VSTeamServiceEndpoint.md) - -[Add-VSTeamServiceFabricEndpoint](Add-VSTeamServiceFabricEndpoint.md) - -[Add-VSTeamSonarQubeEndpoint](Add-VSTeamSonarQubeEndpoint.md) - -[Add-VSTeamKubernetesEndpoint](Add-VSTeamKubernetesEndpoint.md) - -[Add-VSTeamAzureRMServiceEndpoint](Add-VSTeamAzureRMServiceEndpoint.md) - -[Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -[Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -[Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - diff --git a/docs/Update-VSTeamTaskGroup.md b/docs/Update-VSTeamTaskGroup.md deleted file mode 100644 index af061c3f1..000000000 --- a/docs/Update-VSTeamTaskGroup.md +++ /dev/null @@ -1,169 +0,0 @@ - - - -# Update-VSTeamTaskGroup - -## SYNOPSIS - -Updates an existing task group - -## SYNTAX - -## DESCRIPTION - -Updates an existing task group - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```powershell - -$projectName = "projectName" - -$taskGroup = Get-VSTeamTaskGroup -Name "taskGroupName" -ProjectName $projectName - -# Make some change, e.g. -$taskGroup.description = "new description" - -$taskGroupJson = ConvertTo-Json -InputObject $taskGroup -Depth 10 - -Update-VSTeamTaskGroup -ProjectName $projectName -Id $taskGroup.id -Body $taskGroupJson -``` - -## PARAMETERS - -### -Confirm - -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Force - -Does not prompt - -```yaml -Type: SwitchParameter -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ProjectName - -### -ProjectName - -Specifies the team project for which this function operates. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so -you do not have to pass the ProjectName with each call. - -```yaml -Type: String -Position: 0 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -WhatIf - -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Id - -ID of the existing task group - -```yaml -Type: String -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -InFile - -The path to the json file that represents the task group - -```yaml -Type: String -Parameter Sets: ByFile -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Body - -The json that represents the task group as a string - -```yaml -Type: String -Parameter Sets: ByBody -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorTask, -InformationAction, -InformationTask, -OutTask, -OutBuffer, -PipelineTask, -Verbose, -WarningAction, and -WarningTask. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Add-VSTeamTaskGroup](Add-VSTeamTaskGroup.md) - -[Get-VSTeamTaskGroup](Get-VSTeamTaskGroup.md) - -[Remove-VSTeamTaskGroup](Remove-VSTeamTaskGroup.md) - diff --git a/docs/Update-VSTeamUserEntitlement.md b/docs/Update-VSTeamUserEntitlement.md deleted file mode 100644 index 18e18ef06..000000000 --- a/docs/Update-VSTeamUserEntitlement.md +++ /dev/null @@ -1,77 +0,0 @@ - - - -# Update-VSTeamUserEntitlement - -## SYNOPSIS - -Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. - -## SYNTAX - -## DESCRIPTION - -Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. - -## EXAMPLES - -## PARAMETERS - -### -Id - -The id of the user to be updated. - -```yaml -Type: String -Parameter Sets: ById -Required: True -``` - -### -Email - -The email address of the user to update. For organizations with over 100 users this can be very slow and resource intensive. - -```yaml -Type: String -Parameter Sets: ByEmail -Required: True -``` - -### -License - -Type of Account License you want to change to. The acceptable values for this parameter are: - -- Advanced -- EarlyAdopter -- Express -- None -- Professional -- StakeHolder - -```yaml -Type: String -Required: True -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Get-VSTeamUserEntitlement](Get-VSTeamUserEntitlement.md) - diff --git a/docs/Update-VSTeamVariableGroup.md b/docs/Update-VSTeamVariableGroup.md deleted file mode 100644 index bd21279cb..000000000 --- a/docs/Update-VSTeamVariableGroup.md +++ /dev/null @@ -1,283 +0,0 @@ - - - -# Update-VSTeamVariableGroup - -## SYNOPSIS - -Updates an existing variable group - -## SYNTAX - -## DESCRIPTION - -Updates an existing variable group - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```powershell - -$methodParameters = @{ - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "Vsts" - Variables = @{ - key1 = @{ - value = "value1" - isSecret = $true - } - } -} - -$newVariableGroup = Add-VSTeamVariableGroup @methodParameters - -$methodParameters = @{ - id = $newVariableGroup.id - ProjectName = "some_project_name" - Name = "new_variable_group" - Description = "Describe the Variable Group" - Type = "AzureKeyVault" - Variables = @{ - name_of_existing_secret = @{ - enabled = $true - contentType = "" - value = "" - isSecret = $true - } - } - ProviderData = @{ - serviceEndpointId = "AzureRMServiceEndpointGuid" - vault = "name_of_existing_key_vault" - } -} - -Update-VSTeamVariableGroup @methodParameters -``` - -### -------------------------- EXAMPLE 2 -------------------------- - -```powershell -# Copy variable group varGroupName from project sourceProjectName to project targetProjectName. If varGroupName already exists, we'll update it; else, we'll add it. - -$Name = "varGroupName" -$FromProject = "sourceProjectName" -$ToProject = "targetProjectName" - -$FromVariableGroupObject = Get-VSTeamVariableGroup -Name $Name -ProjectName $FromProject -$body = ConvertTo-Json -InputObject $FromVariableGroupObject -Depth 100 -Compress -$toVariableGroupObject = Get-VSTeamVariableGroup -Name $Name -ProjectName $ToProject -if ($toVariableGroupObject) { - Update-VSTeamVariableGroup -Body $body -ProjectName $ToProject -Id $toVariableGroupObject.id -} -else { - Add-VSTeamVariableGroup -Body $body -ProjectName $ToProject -} - -``` - -## PARAMETERS - -### -Confirm - -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Force - -Does not prompt - -```yaml -Type: SwitchParameter -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ProjectName - -### -ProjectName - -Specifies the team project for which this function operates. - -You can tab complete from a list of available projects. - -You can use Set-VSTeamDefaultProject to set a default project so -you do not have to pass the ProjectName with each call. - -```yaml -Type: String -Position: 0 -Required: True -Accept pipeline input: true (ByPropertyName) -``` - -### -WhatIf - -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Id - -ID of the existing variable group - -```yaml -Type: String -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Description - -The variable group description - -```yaml -Type: String -Parameter Sets: ByHashtable -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Name - -The variable group name - -```yaml -Type: String -Parameter Sets: ByHashtable -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -ProviderData - -The variable group ProviderData. This parameter is not available in TFS2017. This should be $null for Vsts types. - -```yaml -Type: Hashtable -Parameter Sets: ByHashtable -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Type - -The variable group type. This parameter is not available in TFS2017; all variable groups are type Vsts in this case. - -```yaml -Type: String -Parameter Sets: ByHashtable -Aliases: -Accepted values: Vsts, AzureKeyVault - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Variables - -The variable group variables. - -```yaml -Type: Hashtable -Parameter Sets: ByHashtable -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Body - -The json that represents the task group as a string - -```yaml -Type: String -Parameter Sets: ByBody -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### CommonParameters - -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String - -System.Collections.Hashtable - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - -[Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) - -[Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) - -[Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) - diff --git a/docs/Update-VSTeamWorkItem.md b/docs/Update-VSTeamWorkItem.md deleted file mode 100644 index 8bee49818..000000000 --- a/docs/Update-VSTeamWorkItem.md +++ /dev/null @@ -1,143 +0,0 @@ - - - -# Update-VSTeamWorkItem - -## SYNOPSIS - -Update a work item in your project. - -## SYNTAX - -## DESCRIPTION - -Update-VSTeamWorkItem will update a new work item in your project. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Update-VSTeamWorkItem -WorkItemId 1 -Title "Updated Work Item" - -ID Title Status --- ----- ------ -6 Updated Work Item To Do -``` - -### -------------------------- EXAMPLE 2 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" - -ID Title Status --- ----- ------ -6 Updated Work Item To Do -``` - -### -------------------------- EXAMPLE 3 -------------------------- - -```PowerShell -PS C:\> Set-VSTeamDefaultProject Demo -PS C:\> $additionalFields = @{"System.Tags"= "TestTag"; "System.AreaPath" = "Project\\MyPath"} -PS C:\> Update-VSTeamWorkItem -Title "Updated Work Item" -WorkItemType Task -Description "This is a description" -AdditionalFields $additionalFields - -ID Title Status --- ----- ------ -6 Updated Work Item To Do -``` - -## PARAMETERS - -### -Id - -The id of the work item. - -```yaml -Type: Int32 -Parameter Sets: ByID -Required: True -Accept pipeline input: true (ByPropertyName, ByValue) -``` - -### -Title - -The title of the work item - -```yaml -Type: String -Required: False -``` - -### -Description - -The Description of the work item - -```yaml -Type: String -Required: False -``` - -### -IterationPath - -The IterationPath of the work item - -```yaml -Type: String -Required: False -``` - -### -AssignedTo - -The email address of the user this work item will be assigned to. - -```yaml -Type: String -Required: False -``` - -### -AdditionalFields - -Hashtable which contains a key value pair of any field that should be filled with values. Key is the internal name of the field and the value is the content of the field being filled. E.g. the internal name for the area path is 'System.AreaPath'. - -```yaml -Type: Hashtable -Required: False -``` - -### -Force - -Forces the function without confirmation - -```yaml -Type: SwitchParameter -Required: false -Position: Named -Accept pipeline input: false -Parameter Sets: (All) -``` - -## INPUTS - -### System.String - -ProjectName - -WorkItemType - -## OUTPUTS - -## NOTES - -WorkItemType is a dynamic parameter and use the default -project value to query their validate set. - -If you do not set the default project by called Set-VSTeamDefaultProject before -calling Update-VSTeamWorkItem you will have to type in the names. - -Any of the basic work item parameters defined in this method, will cause an exception if also added to the parameter AdditionalFields, since it is redundant. Either only use the parameter OR define them in the AdditionalFields parameter. - -## RELATED LINKS - diff --git a/docs/readme.md b/docs/readme.md deleted file mode 100644 index 4a0c1c309..000000000 --- a/docs/readme.md +++ /dev/null @@ -1,644 +0,0 @@ -# VSTeam Help - -Welcome to VSTeam. VSTeam is a [PowerShell module](https://www.powershellgallery.com/packages/VSTeam/) that wraps the [REST API provided by Team Foundation Server and Azure DevOps](https://cda.ms/ys). This allows you to access the power of TFS and AzD from [PowerShell on Windows, MacOS and Linux](https://github.com/PowerShell/PowerShell). - -## About files - -[VSTeam](../en-US/about_vsteam.help.txt) - -Learn about the goals of VSTeam. - -[Profiles](../en-US/about_vsteam_profiles.help.txt) - -Profiles allow you to store your account information for easy switching of accounts. - -[Provider](../en-US/about_vsteam_provider.help.txt) - -The provider allows you to navigate your TFS or AzD as a file system. - -## VSTeam Functions - -### [Add-VSTeam](Add-VSTeam.md) - -Adds a team to a team project. - -### [Add-VSTeamAccessControlEntry](Add-VSTeamAccessControlEntry.md) - -Add or update ACEs in the ACL for the provided token. The request contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. - -Note: This is a low-level function. You should really use a high level function (Add-VSTeam*Permission / Set-VSTeam*Permission / Get-VSTeam*Permission) unless you know what you are doing. - -### [Add-VSTeamArea](Add-VSTeamArea.md) - -Adds a new area to the project - -### [Add-VSTeamAzureRMServiceEndpoint](Add-VSTeamAzureRMServiceEndpoint.md) - -Adds a new Azure Resource Manager service endpoint. - -### [Add-VSTeamBuild](Add-VSTeamBuild.md) - -Queues a new build. - -### [Add-VSTeamBuildDefinition](Add-VSTeamBuildDefinition.md) - -Creates a new build definition from a JSON file. - -### [Add-VSTeamBuildTag](Add-VSTeamBuildTag.md) - -Adds a tag to a build. - -### [Add-VSTeamClassificationNode](Add-VSTeamClassificationNode.md) - -Adds either a new iteration or area to the project - -### [Add-VSTeamExtension](Add-VSTeamExtension.md) - -Install the specified extension into the account / project collection. - -### [Add-VSTeamFeed](Add-VSTeamFeed.md) - -Adds a new feed to package management. - -### [Add-VSTeamGitRepository](Add-VSTeamGitRepository.md) - -Adds a Git repository to your Azure DevOps or Team Foundation Server account. - -### [Add-VSTeamGitRepositoryPermission](Add-VSTeamGitRepositoryPermission.md) - -Add permissions to a git repository, all repositories in a project, or a specific branch - -### [Add-VSTeamIteration](Add-VSTeamIteration.md) - -Adds a new iteration to the project - -### [Add-VSTeamKubernetesEndpoint](Add-VSTeamKubernetesEndpoint.md) - -Adds connections to Kubernetes clusters - -### [Add-VSTeamMembership](Add-VSTeamMembership.md) - -Adds a membership to a container. - -### [Add-VSTeamNuGetEndpoint](Add-VSTeamNuGetEndpoint.md) - -Adds a new NuGet service endpoint. - -### [Add-VSTeamPolicy](Add-VSTeamPolicy.md) - -Adds a new policy to the specified project. - -### [Add-VSTeamProfile](Add-VSTeamProfile.md) - -Stores your account name and personal access token as a profile for use with -the Add-TeamAccount function in this module. - -### [Add-VSTeamProject](Add-VSTeamProject.md) - -Adds a Team Project to your account. - -### [Add-VSTeamProjectPermission](Add-VSTeamProjectPermission.md) - -Add Permissions on Project Level - -### [Add-VSTeamPullRequest](Add-VSTeamPullRequest.md) - -Create a new Pull Request - -### [Add-VSTeamRelease](Add-VSTeamRelease.md) - -Queues a new release - -### [Add-VSTeamReleaseDefinition](Add-VSTeamReleaseDefinition.md) - -Creates a new release definition from a JSON file. - -### [Add-VSTeamServiceEndpoint](Add-VSTeamServiceEndpoint.md) - -Adds a generic service connection - -### [Add-VSTeamServiceFabricEndpoint](Add-VSTeamServiceFabricEndpoint.md) - -Adds a new Service Fabric service endpoint. - -### [Add-VSTeamSonarQubeEndpoint](Add-VSTeamSonarQubeEndpoint.md) - -Adds a new SonarQube service endpoint. - -### [Add-VSTeamTaskGroup](Add-VSTeamTaskGroup.md) - -Adds a task group. - -### [Add-VSTeamUserEntitlement](Add-VSTeamUserEntitlement.md) - -Add a user, assign license and extensions and make them a member of a project group in an account. - -### [Add-VSTeamVariableGroup](Add-VSTeamVariableGroup.md) - -Adds a variable group. - -### [Add-VSTeamWorkItem](Add-VSTeamWorkItem.md) - -Adds a work item to your project. - -### [Add-VSTeamWorkItemAreaPermission](Add-VSTeamWorkItemAreaPermission.md) - -Add Permissions to a Work Item Area - -### [Add-VSTeamWorkItemIterationPermission](Add-VSTeamWorkItemIterationPermission.md) - -Add Permissions to an Iteration - -### [Clear-VSTeamDefaultAPITimeout](Clear-VSTeamDefaultAPITimeout.md) - -Clears the value stored in the default timeout parameter value. - -### [Clear-VSTeamDefaultProject](Clear-VSTeamDefaultProject.md) - -Clears the value stored in the default project parameter value. - -### [Disable-VSTeamAgent](Disable-VSTeamAgent.md) - -Disables an agent in a pool. - -### [Enable-VSTeamAgent](Enable-VSTeamAgent.md) - -Enables an agent in a pool. - -### [Get-VSTeam](Get-VSTeam.md) - -Returns a team. - -### [Get-VSTeamAccessControlList](Get-VSTeamAccessControlList.md) - -Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. - -### [Get-VSTeamAgent](Get-VSTeamAgent.md) - -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. - -### [Get-VSTeamArea](Get-VSTeamArea.md) - -Gets the area node for a given area path. - -### [Get-VSTeamBuild](Get-VSTeamBuild.md) - -Gets the builds for a team project. - -### [Get-VSTeamBuildArtifact](Get-VSTeamBuildArtifact.md) - -Returns the artifacts of a build. - -### [Get-VSTeamBuildDefinition](Get-VSTeamBuildDefinition.md) - -Gets the build definitions for a team project. - -### [Get-VSTeamBuildLog](Get-VSTeamBuildLog.md) - -Displays the logs for the build. - -### [Get-VSTeamBuildTag](Get-VSTeamBuildTag.md) - -Returns all the tags of a build. - -### [Get-VSTeamBuildTimeline](Get-VSTeamBuildTimeline.md) - -Get the timelines for builds - -### [Get-VSTeamClassificationNode](Get-VSTeamClassificationNode.md) - -Gets the classification node for a given node path. - -### [Get-VSTeamCloudSubscription](Get-VSTeamCloudSubscription.md) - -Gets the Azure subscriptions associated with the Team Services account. - -### [Get-VSTeamDescriptor](Get-VSTeamDescriptor.md) - -Resolve a storage key to a descriptor. - -### [Get-VSTeamExtension](Get-VSTeamExtension.md) - -Get the installed extensions in the specified Azure DevOps or Team Foundation Server project. - -### [Get-VSTeamFeed](Get-VSTeamFeed.md) - -Returns a list of package feeds for the account. - -### [Get-VSTeamGitCommit](Get-VSTeamGitCommit.md) - -Retrieve git commits for a project - -### [Get-VSTeamGitRef](Get-VSTeamGitRef.md) - -Queries the provided repository for its refs and returns them. - -### [Get-VSTeamGitRepository](Get-VSTeamGitRepository.md) - -Get all the repositories in your Azure DevOps or Team Foundation Server account, or a specific project. - -### [Get-VSTeamGitStat](Get-VSTeamGitStat.md) - -Retrieves statistics about branches within a repository. - -### [Get-VSTeamGroup](Get-VSTeamGroup.md) - -Returns a Group or List of Groups. - -### [Get-VSTeamInfo](Get-VSTeamInfo.md) - -Displays your current account and default project. - -### [Get-VSTeamIteration](Get-VSTeamIteration.md) - -Gets the iteration node for a given iteration path. - -### [Get-VSTeamJobRequest](Get-VSTeamJobRequest.md) - -Returns all the job requests of an agent. - -### [Get-VSTeamMember](Get-VSTeamMember.md) - -Returns a team member. - -### [Get-VSTeamMembership](Get-VSTeamMembership.md) - -Gets a memberships for a container or member. - -### [Get-VSTeamOption](Get-VSTeamOption.md) - -Returns all the versions of supported APIs of your TFS or AzD. - -### [Get-VSTeamPermissionInheritance](Get-VSTeamPermissionInheritance.md) - -Returns true or false. - -### [Get-VSTeamPolicy](Get-VSTeamPolicy.md) - -Get the code policies in the specified Azure DevOps or Team Foundation Server project. - -### [Get-VSTeamPolicyType](Get-VSTeamPolicyType.md) - -Get the policy types in the specified Azure DevOps or Team Foundation Server project. - -### [Get-VSTeamPool](Get-VSTeamPool.md) - -Returns the agent pools. - -### [Get-VSTeamProcess](Get-VSTeamProcess.md) - -Returns a list of process templates in the Team Services or Team Foundation Server account. - -### [Get-VSTeamProfile](Get-VSTeamProfile.md) - -Returns the saved profiles. - -### [Get-VSTeamProject](Get-VSTeamProject.md) - -Returns a list of projects in the Team Services or Team Foundation Server account. - -### [Get-VSTeamPullRequest](Get-VSTeamPullRequest.md) - -Returns one or more open pull requests from your team, project, or Id. - -### [Get-VSTeamQueue](Get-VSTeamQueue.md) - -Gets a agent queue. - -### [Get-VSTeamRelease](Get-VSTeamRelease.md) - -Gets the releases for a team project. - -### [Get-VSTeamReleaseDefinition](Get-VSTeamReleaseDefinition.md) - -Gets the release definitions for a team project. - -### [Get-VSTeamResourceArea](Get-VSTeamResourceArea.md) - -List all the areas supported by this instance of TFS/VSTS. - -### [Get-VSTeamSecurityNamespace](Get-VSTeamSecurityNamespace.md) - -List all security namespaces or just the specified namespace. - -### [Get-VSTeamServiceEndpoint](Get-VSTeamServiceEndpoint.md) - -Gets a service endpoint. - -### [Get-VSTeamServiceEndpointType](Get-VSTeamServiceEndpointType.md) - -Get service endpoint types. - -### [Get-VSTeamTaskGroup](Get-VSTeamTaskGroup.md) - -Gets a task group - -### [Get-VSTeamTfvcBranch](Get-VSTeamTfvcBranch.md) - -Gets a branch for a given path from TFVC source control. - -### [Get-VSTeamTfvcRootBranch](Get-VSTeamTfvcRootBranch.md) - -Gets root branches for all projects with TFVC source control. - -### [Get-VSTeamUser](Get-VSTeamUser.md) - -Returns a list of users for the account. - -### [Get-VSTeamUserEntitlement](Get-VSTeamUserEntitlement.md) - -Get User Entitlement for a user. - -### [Get-VSTeamVariableGroup](Get-VSTeamVariableGroup.md) - -Gets a variable group - -### [Get-VSTeamWiql](Get-VSTeamWiql.md) - -Returns work items from the given WIQL query or a saved query by ID from your projects team. - -### [Get-VSTeamWorkItem](Get-VSTeamWorkItem.md) - -Returns one or more a work items from your project. - -### [Get-VSTeamWorkItemType](Get-VSTeamWorkItemType.md) - -Gets a list of all Work Item Types or a single work item type. - -### [Invoke-VSTeamRequest](Invoke-VSTeamRequest.md) - -Allows you to call any TFS/AzD REST API. All the Auth and Route Structure is taken care of for you. Just provide the parts of the API call you need. If you need to send a non-standard URL use the -Url parameter. If the -Url is used the Url is not changed but the header and UserAgent are added for you. - -### [Remove-VSTeam](Remove-VSTeam.md) - -Removes a team from a project. - -### [Remove-VSTeamAccessControlEntry](Remove-VSTeamAccessControlEntry.md) - -Removes specified ACEs in the ACL for the provided token. The request URI contains the namespace ID, the target token, and a single or list of descriptors that should be removed. Only supports removing AzD based users/groups. - -### [Remove-VSTeamAccessControlList](Remove-VSTeamAccessControlList.md) - -Remove access control lists under the specified security namespace. - -### [Remove-VSTeamAccount](Remove-VSTeamAccount.md) - -Clears your default project, account name and personal access token. - -### [Remove-VSTeamAgent](Remove-VSTeamAgent.md) - -Removes an agent from a pool. - -### [Remove-VSTeamArea](Remove-VSTeamArea.md) - -Removes an existing area from the project - - -### [Remove-VSTeamBuild](Remove-VSTeamBuild.md) - -Deletes the build. - -### [Remove-VSTeamBuildDefinition](Remove-VSTeamBuildDefinition.md) - -Removes the build definitions for a team project. - -### [Remove-VSTeamBuildTag](Remove-VSTeamBuildTag.md) - -Removes the tag from a build. - -### [Remove-VSTeamClassificationNode](Remove-VSTeamClassificationNode.md) - - -Removes either an existing iteration or area from the project - -### [Remove-VSTeamExtension](Remove-VSTeamExtension.md) - -Uninstall the specified extension from the account / project collection. - -### [Remove-VSTeamFeed](Remove-VSTeamFeed.md) - -Removes a package feed from the account. - -### [Remove-VSTeamGitRepository](Remove-VSTeamGitRepository.md) - -Removes the Git repository from your Azure DevOps or Team Foundation Server account. - -### [Remove-VSTeamIteration](Remove-VSTeamIteration.md) - - -Removes an existing iteration from the project - -### [Remove-VSTeamMembership](Remove-VSTeamMembership.md) - -Removes a membership to a container. - -### [Remove-VSTeamPolicy](Remove-VSTeamPolicy.md) - -Removes the specified policy from the specified project. - -### [Remove-VSTeamProfile](Remove-VSTeamProfile.md) - -Removes the profile. - -### [Remove-VSTeamProject](Remove-VSTeamProject.md) - -Deletes the Team Project from your Team Services account. - -### [Remove-VSTeamRelease](Remove-VSTeamRelease.md) - -Removes the releases for a team project. - -### [Remove-VSTeamReleaseDefinition](Remove-VSTeamReleaseDefinition.md) - -Removes the release definitions for a team project. - -### [Remove-VSTeamServiceEndpoint](Remove-VSTeamServiceEndpoint.md) - -Removes a service endpoint. - -### [Remove-VSTeamTaskGroup](Remove-VSTeamTaskGroup.md) - -Removes a task group - -### [Remove-VSTeamUserEntitlement](Remove-VSTeamUserEntitlement.md) - -Delete a user from the account. - -The delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships. The user would continue to have access to the account if she is member of an AAD group, that is added directly to the account. - -### [Remove-VSTeamVariableGroup](Remove-VSTeamVariableGroup.md) - -Removes a variable group - -### [Remove-VSTeamWorkItem](Remove-VSTeamWorkItem.md) - -Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. - -### [Set-VSTeamAccount](Set-VSTeamAccount.md) - -Stores your account name and personal access token for use with the other -functions in this module. - -### [Set-VSTeamAlias](Set-VSTeamAlias.md) - -In version 6.0 the default aliases were removed to prevent conflicts with other modules. If you want to use the original aliases you can run this function to restore them. - -### [Set-VSTeamAPIVersion](Set-VSTeamAPIVersion.md) - -Sets the API versions to support either TFS2017, TFS2018, AzD2019 or AzD. - -### [Set-VSTeamApproval](Set-VSTeamApproval.md) - -Sets the status of approval to Approved, Rejected, Pending, or ReAssigned. - -### [Set-VSTeamDefaultAPITimeout](Set-VSTeamDefaultAPITimeout.md) - -Sets the default timeout to be used with other calls in the module. - -### [Set-VSTeamDefaultProject](Set-VSTeamDefaultProject.md) - -Sets the default project to be used with other calls in the module. - -### [Set-VSTeamEnvironmentStatus](Set-VSTeamEnvironmentStatus.md) - -Sets the status of a environment to canceled, inProgress, notStarted, partiallySucceeded, queued, rejected, scheduled, succeeded or undefined. - -### [Set-VSTeamPermissionInheritance](Set-VSTeamPermissionInheritance.md) - -Sets the permission inheritance to true or false. - -### [Set-VSTeamReleaseStatus](Set-VSTeamReleaseStatus.md) - -Sets the status of a release to Active or Abandoned. - -### [Show-VSTeam](Show-VSTeam.md) - -Opens TFS or AzD site in the default browser. - -### [Show-VSTeamApproval](Show-VSTeamApproval.md) - -Opens the release associated with the waiting approval in the default browser. - -### [Show-VSTeamBuild](Show-VSTeamBuild.md) - -Opens the build summary in the default browser. - -### [Show-VSTeamBuildDefinition](Show-VSTeamBuildDefinition.md) - -Opens the build definition in the default browser. - -### [Show-VSTeamFeed](Show-VSTeamFeed.md) - -Opens the feed in the default browser. - -### [Show-VSTeamGitRepository](Show-VSTeamGitRepository.md) - -Opens the Git repository in the default browser. - -### [Show-VSTeamProject](Show-VSTeamProject.md) - -Opens the project in the default browser. - -### [Show-VSTeamPullRequest](Show-VSTeamPullRequest.md) - -Opens the pull request in the default browser. - -### [Show-VSTeamRelease](Show-VSTeamRelease.md) - -Opens the release summary in the default browser. - -### [Show-VSTeamReleaseDefinition](Show-VSTeamReleaseDefinition.md) - -Opens the release definitions for a team project in the default browser. - -### [Show-VSTeamWorkItem](Show-VSTeamWorkItem.md) - -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. - -### [Test-VSTeamYamlPipeline](Test-VSTeamYamlPipeline.md) - -Tests the commited YAML pipeline files to check for inconsitencies. Now, you can try out a YAML pipeline without committing it to a repo or running it. Given an existing pipeline and an optional new YAML payload, this function will give you back the full YAML pipeline. - -### [Update-VSTeam](Update-VSTeam.md) - -Updates the team name, description or both. - -### [Update-VSTeamAgent](Update-VSTeamAgent.md) - -Instructs the agent to download and install the lastest version of the agent on self-hosted agents. - -### [Update-VSTeamBuild](Update-VSTeamBuild.md) - -Allows you to set the keep forever flag and build number. - -### [Update-VSTeamBuildDefinition](Update-VSTeamBuildDefinition.md) - -Updates a build definition for a team project. - -### [Update-VSTeamExtension](Update-VSTeamExtension.md) - -Update an installed extension. Typically this API is used to enable or disable an extension. - -### [Update-VSTeamPolicy](Update-VSTeamPolicy.md) - -Updates an existing policy in the specified project. - -### [Update-VSTeamProfile](Update-VSTeamProfile.md) - -Allows you to update the Personal Access Token for your profile. - -### [Update-VSTeamProject](Update-VSTeamProject.md) - -Updates the project name, description or both. - -### [Update-VSTeamPullRequest](Update-VSTeamPullRequest.md) - -Update a pull request - -### [Update-VSTeamRelease](Update-VSTeamRelease.md) - -Allows you to update release variables for future stages to read. - -### [Update-VSTeamReleaseDefinition](Update-VSTeamReleaseDefinition.md) - -Updates a build definition for a team project. - -### [Update-VSTeamServiceEndpoint](Update-VSTeamServiceEndpoint.md) - -Updates an existing service connection - -### [Update-VSTeamTaskGroup](Update-VSTeamTaskGroup.md) - -Updates an existing task group - -### [Update-VSTeamUserEntitlement](Update-VSTeamUserEntitlement.md) - -Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. - -### [Update-VSTeamVariableGroup](Update-VSTeamVariableGroup.md) - -Updates an existing variable group - -### [Update-VSTeamWorkItem](Update-VSTeamWorkItem.md) - -Update a work item in your project. - - - - diff --git a/integration/test/020_.psDrive.Tests.ps1 b/integration/test/020_.psDrive.Tests.ps1 deleted file mode 100644 index eb5406f77..000000000 --- a/integration/test/020_.psDrive.Tests.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -Describe "PS Drive Full exercise" { - BeforeAll { - . "$PSScriptRoot/testprep.ps1" - - Set-TestPrep - $target = Set-Project - - $originalLocation = Get-Location - } - - 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 under project' { - Set-Location $target.Name - $projectChildren = Get-ChildItem - Start-Sleep -Seconds 2 - $projectChildren | Should -Not -Be $null - } - - # Have to do some more research - # It 'Should list Teams' { - # Start-Sleep -Seconds 2 - # Set-Location 'Teams' - # Start-Sleep -Seconds 2 - # $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 deleted file mode 100644 index eaf27ceb6..000000000 --- a/integration/test/030_VSTeamExtension.Tests.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -Describe "VSTeamExtension" { - BeforeAll { - . "$PSScriptRoot/testprep.ps1" - - Set-TestPrep - - Set-Project - } - - 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/testprep.ps1 b/integration/test/testprep.ps1 deleted file mode 100644 index a248e14b2..000000000 --- a/integration/test/testprep.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -function Set-TestPrep { - if ($null -eq $env:ACCT -or - $null -eq $env:API_VERSION -or - $null -eq $env:PAT -or - $null -eq $env:EMAIL) { - throw "You must set all environment variables that are needed first to run integration tests. Please see https://github.com/DarqueWarrior/vsteam/blob/master/.github/CONTRIBUTING.md#running-integration-tests for details." - } - - # Module must be loaded - if (-not (Get-Module VSTeam)) { - Write-Host "Importing module" - Import-Module "$PSScriptRoot\..\..\dist\VSTeam.psd1" - } - - Write-Host "Target = $($env:ACCT)" - Write-Host "Version = $($env:API_VERSION)" - - Set-VSTeamAccount -Account $env:ACCT -PersonalAccessToken $env:PAT -Version $env:API_VERSION -} - -$projectDescription = 'Project for VSTeam integration testing.' - -function Set-Project { - $projectName = 'TeamModuleIntegration-' + [guid]::NewGuid().toString().substring(0, 5) - - # This will search for a project with the description of our test projects - # if it finds one it will reuse that project instead of creating a new project. - # This makes debuging tests easier and faster. - $existingProject = $(Get-VSTeamProject | Where-Object Description -eq $projectDescription) - - if ($existingProject) { - Write-Host "Found existing project $($existingProject.Name)" - $projectName = $existingProject.Name - } - else { - Write-Host "Creating new project" - Add-VSTeamProject -Name $projectName -Description $projectDescription | Should -Not -Be $null - Start-Sleep -Seconds 5 - } - - $target = @{ - Name = $projectName - Description = $projectDescription - NewName = $projectName + [guid]::NewGuid().toString().substring(0, 5) + '1' - } - - Write-Host "Project Name: $($target.Name)" - Write-Host "Project Description: $($target.Description)" - Write-Host "Project NewName: $($target.NewName)" - - return $target -} - -function Get-ProjectName { - # Everytime you run the test a new "$newProjectName" is generated. - # This is fine if you are running all the tests but not if you just - # want to run these. So if the newProjectName can't be found in the - # target system change newProjectName to equal the name of the project - # found with the correct description. - return ($(Get-VSTeamProject | Where-Object Description -eq $projectDescription)).Name -} \ No newline at end of file diff --git a/packages/README.md b/packages/README.md new file mode 100644 index 000000000..821942596 --- /dev/null +++ b/packages/README.md @@ -0,0 +1,3 @@ +# Packages + +This folders holds packages that are required for building but are not available from a NuGet feed. diff --git a/packages/ships/CodeOwls.PowerShell.Paths.dll b/packages/ships/CodeOwls.PowerShell.Paths.dll new file mode 100644 index 000000000..ca1bba26e Binary files /dev/null and b/packages/ships/CodeOwls.PowerShell.Paths.dll differ diff --git a/packages/ships/CodeOwls.PowerShell.Provider.dll b/packages/ships/CodeOwls.PowerShell.Provider.dll new file mode 100644 index 000000000..f89d4c5b7 Binary files /dev/null and b/packages/ships/CodeOwls.PowerShell.Provider.dll differ diff --git a/packages/ships/Microsoft.PowerShell.SHiPS.dll b/packages/ships/Microsoft.PowerShell.SHiPS.dll new file mode 100644 index 000000000..858e11da7 Binary files /dev/null and b/packages/ships/Microsoft.PowerShell.SHiPS.dll differ diff --git a/tools/docker/Run-ContainerTests.ps1 b/tools/docker/Run-ContainerTests.ps1 index 775813cbb..abf0b4464 100644 --- a/tools/docker/Run-ContainerTests.ps1 +++ b/tools/docker/Run-ContainerTests.ps1 @@ -157,21 +157,20 @@ function Start-DockerVSTeamTests { # I delete from the container so that all the correct permissions # are granted to delete. When I tried this from outside the container # I did not have permissions to delete it. - if (Test-Path '#Container#_result.xml') { - Write-Verbose 'Deleting old results file #Container#_result.xml' - Remove-Item '#Container#_result.xml' + if (Test-Path './Tests/TestResults/#Container#_result.xml') { + Write-Verbose 'Deleting old results file ./Tests/TestResults/#Container#_result.xml' + Remove-Item './Tests/TestResults/#Container#_result.xml' } - .\Build-Module.ps1 -installDep + .\Build-Module.ps1 -installDep -skipLibBuild $null = Import-Module Pester $pesterArgs = [PesterConfiguration]::Default $pesterArgs.Run.Exit = $true - $pesterArgs.Run.Path = '.\unit' + $pesterArgs.Run.Path = './Tests/function' $pesterArgs.Run.PassThru = $false - $pesterArgs.Output.Verbosity = 'Detailed' $pesterArgs.TestResult.Enabled = $true - $pesterArgs.TestResult.OutputPath = '#Container#_result.xml' + $pesterArgs.TestResult.OutputPath = './Tests/TestResults/#Container#_result.xml' Invoke-Pester -Configuration $pesterArgs @@ -198,7 +197,7 @@ function Start-DockerVSTeamTests { docker run ` -dit ` - --name $Container ` + --name $Container ` --volume $Volume ` -w $DefaultWorkDir ` $Image ` @@ -290,6 +289,8 @@ $rootDir = (Resolve-Path -Path "$scriptPath\..\..\").ToString().trim('\') $containerFolder = "c:/vsteam" $containerFilePath = "$rootDir/tools/docker" +Write-Verbose "Root Dir: $rootDir" + $dockerRepository = "vsteam" $WindowsImage = "$dockerRepository/wcore1903" @@ -342,9 +343,9 @@ $null = Start-DockerVSTeamTests ` -Wait ` -FollowLogs:$ShowLogs -$linux = Find-Numbers -fileToRead "$rootDir/vsteam_Linux_ps7_tests_result.xml" -$winP5 = Find-Numbers -fileToRead "$rootDir/vsteam_wcore1903_ps5_tests_result.xml" -$winP7 = Find-Numbers -fileToRead "$rootDir/vsteam_wcore1903_ps7_tests_result.xml" +$linux = Find-Numbers -fileToRead "$rootDir/Tests/TestResults/vsteam_Linux_ps7_tests_result.xml" +$winP5 = Find-Numbers -fileToRead "$rootDir/Tests/TestResults/vsteam_wcore1903_ps5_tests_result.xml" +$winP7 = Find-Numbers -fileToRead "$rootDir/Tests/TestResults/vsteam_wcore1903_ps7_tests_result.xml" $totalPassed = $winP5.Passed + $linux.Passed + $winP7.Passed $totalFailed = $winP5.Failed + $linux.Failed + $winP7.Failed diff --git a/tools/docker/RunTestsLocally.md b/tools/docker/RunTestsLocally.md index 75e456c1e..a4decbfe3 100644 --- a/tools/docker/RunTestsLocally.md +++ b/tools/docker/RunTestsLocally.md @@ -27,7 +27,7 @@ Also be aware that we cannot know all prerequisites as there often many differen 1. Install Docker: [https://docs.docker.com/engine/install](https://docs.docker.com/engine/install) 2. Run [Run-ContainerTests.ps1](Run-ContainerTests.ps1) located under ./tools/docker - ```PowerShell + ```powershell #Example Run-ContainerTests.ps1 ``` diff --git a/tools/docker/linux/Dockerfile b/tools/docker/linux/Dockerfile index 1f0ed7e40..0dbcb43a0 100644 --- a/tools/docker/linux/Dockerfile +++ b/tools/docker/linux/Dockerfile @@ -4,6 +4,15 @@ ARG pesterMinVer=5.0.2 FROM mcr.microsoft.com/powershell:${fromTag} +RUN apt-get update +RUN apt-get install -y wget +RUN wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb +RUN dpkg -i packages-microsoft-prod.deb +RUN apt-get update +RUN apt-get install -y apt-transport-https +RUN apt-get update +RUN apt-get install -y dotnet-sdk-3.1 + SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';"] RUN pwsh ` diff --git a/tools/docker/wcore1903/Dockerfile b/tools/docker/wcore1903/Dockerfile index 364c53f5b..c7dc6edb9 100644 --- a/tools/docker/wcore1903/Dockerfile +++ b/tools/docker/wcore1903/Dockerfile @@ -1,5 +1,5 @@ # escape=` -ARG fromTag=7.0.1-windowsservercore-1903 +ARG fromTag=7.0.3-windowsservercore-1903 ARG pesterMinVer=5.0.2 FROM mcr.microsoft.com/powershell:${fromTag} @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] RUN powershell ` -NoLogo ` -Command " ` - `Write-host 'Installing nuget and PowerShellGet...'; ` + `Write-host 'Installing nuget, .net core SDK and PowerShellGet...'; ` Set-ExecutionPolicy Bypass -Scope Process -Force; ` [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; ` iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); ` - choco install nuget.commandline -y; ` + choco install nuget.commandline dotnetcore-sdk -y; ` Install-PackageProvider -Name NuGet -Force; ` Install-Module -Name PowerShellGet -Force; ` Update-Module -Name PowerShellGet; ` diff --git a/unit.runsettings b/unit.runsettings new file mode 100644 index 000000000..ebc9f4f0c --- /dev/null +++ b/unit.runsettings @@ -0,0 +1,8 @@ + + + + + .\Tests\TestResults + + + \ No newline at end of file diff --git a/unit/Invokepester.ps1 b/unit/Invokepester.ps1 deleted file mode 100644 index c780dc951..000000000 --- a/unit/Invokepester.ps1 +++ /dev/null @@ -1,60 +0,0 @@ -function Invoke-PesterJob { - [CmdletBinding(DefaultParameterSetName = 'LegacyOutputXml')] - param( - [Parameter(Position = 0)] - [Alias('Path', 'relative_path')] - [System.Object[]] - ${Script}, - - [Parameter(Position = 1)] - [Alias('Name')] - [string[]] - ${TestName}, - - [Parameter(Position = 2)] - [switch] - ${EnableExit}, - - [Parameter(ParameterSetName = 'LegacyOutputXml', Position = 3)] - [string] - ${OutputXml}, - - [Parameter(Position = 4)] - [Alias('Tags')] - [string[]] - ${Tag}, - - [string[]] - ${ExcludeTag}, - - [switch] - ${PassThru}, - - [System.Object[]] - ${CodeCoverage}, - - [switch] - ${Strict}, - - [Parameter(ParameterSetName = 'NewOutputSet', Mandatory = $true)] - [string] - ${OutputFile}, - - [Parameter(ParameterSetName = 'NewOutputSet', Mandatory = $true)] - [ValidateSet('LegacyNUnitXml', 'NUnitXml')] - [string] - ${OutputFormat}, - - [ValidateSet('None', 'Default', 'Passed', 'Failed', 'Pending', 'Skipped', 'Inconclusive', 'Describe', 'Context', 'Summary', 'Header', 'All', 'Fails')] - [string] - ${Show}, - - [switch] - ${Quiet} - ) - - $params = $PSBoundParameters - - Start-Job -ScriptBlock { Set-Location $using:pwd; Invoke-Pester @using:params } | - Receive-Job -Wait -AutoRemoveJob -} \ No newline at end of file diff --git a/unit/test/Add-VSTeam.Tests.ps1 b/unit/test/Add-VSTeam.Tests.ps1 deleted file mode 100644 index fbedc0605..000000000 --- a/unit/test/Add-VSTeam.Tests.ps1 +++ /dev/null @@ -1,58 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeam" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeam.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context "Add-VSTeam" { - BeforeAll { - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\get-vsteam.json" -Raw | ConvertFrom-Json - - Mock _callAPI { return $singleResult } - # These two lines will force a refresh of the project - # cache and return an empty list. - Mock _getProjects { return @() } - Mock _hasProjectCacheExpired { return $true } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - It 'with team name only should create a team' { - Add-VSTeam -ProjectName Test -TeamName "TestTeam" - - Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { - $NoProject -eq $true -and - $Area -eq 'projects' -and - $Resource -eq 'Test' -and - $Method -eq 'Post' -and - $ContentType -eq 'application/json' -and - $Body -eq '{ "name": "TestTeam", "description": "" }' - $Version -eq '1.0-unitTests' - } - } - - It 'with team name and description should create a team' { - Add-VSTeam -ProjectName Test -TeamName "TestTeam" -Description "Test Description" - - Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { - $NoProject -eq $true -and - $Area -eq 'projects' -and - $Resource -eq 'Test' -and - $Method -eq 'Post' -and - $ContentType -eq 'application/json' -and - $Body -eq '{ "name": "TestTeam", "description": "Test Description" }' - $Version -eq '1.0-unitTests' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamAccessControlEntry.Tests.ps1 b/unit/test/Add-VSTeamAccessControlEntry.Tests.ps1 deleted file mode 100644 index 679a6f3bb..000000000 --- a/unit/test/Add-VSTeamAccessControlEntry.Tests.ps1 +++ /dev/null @@ -1,117 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamAccessControlEntry' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamDefaultProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamAccessControlEntry' -Tag "Add" { - BeforeAll { - ## Arrange - # Load sample files you need for mocks below - $securityNamespace = Get-Content "$PSScriptRoot\sampleFiles\securityNamespace.json" -Raw | ConvertFrom-Json - $accessControlEntryResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlEntryResult.json" -Raw | ConvertFrom-Json - - # Some of the functions return VSTeam classes so turn the PSCustomeObject - # into the correct type. - $securityNamespaceObject = [VSTeamSecurityNamespace]::new($securityNamespace.value[0]) - - ## Arrange - Mock _getDefaultProject { return "Testing" } - - # Set the account to use for testing. A normal user would do this using the - # Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - # This is only called when you need to test that the function can handle an - # exception. To make sure this mock is called make sure the descriptor in - # the body of your call has the value of 'boom'. - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Body -like "*`"descriptor`": `"boom`",*" } - - Mock Invoke-RestMethod { return $accessControlEntryResult } - } - - It 'by SecurityNamespace (pipeline) should return ACEs' { - ## Act - $securityNamespaceObject | Add-VSTeamAccessControlEntry -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"xyz`",*" -and - $Body -like "*`"descriptor`": `"abc`",*" -and - $Body -like "*`"allow`": 12,*" -and - $Body -like "*`"deny`": 15,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by SecurityNamespaceId should return ACEs' { - ## Act - Add-VSTeamAccessControlEntry -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/5a27515b-ccd7-42c9-84f1-54c998f03866*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"xyz`",*" -and - $Body -like "*`"descriptor`": `"abc`",*" -and - $Body -like "*`"allow`": 12,*" -and - $Body -like "*`"deny`": 15,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by SecurityNamespace should return ACEs' { - ## Act - Add-VSTeamAccessControlEntry -SecurityNamespace $securityNamespaceObject -Descriptor abc -Token xyz -AllowMask 12 -DenyMask 15 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"xyz`",*" -and - $Body -like "*`"descriptor`": `"abc`",*" -and - $Body -like "*`"allow`": 12,*" -and - $Body -like "*`"deny`": 15,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by securityNamespaceId throws should throw' -Tag "Throws" { - ## Act / Assert - { Add-VSTeamAccessControlEntry -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Descriptor boom -Token xyz -AllowMask 12 -DenyMask 15 } | Should -Throw - } - - It 'by SecurityNamespace should throw' -Tag "Throws" { - ## Act / Assert - { Add-VSTeamAccessControlEntry -SecurityNamespace $securityNamespaceObject -Descriptor boom -Token xyz -AllowMask 12 -DenyMask 15 } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamArea.Tests.ps1 b/unit/test/Add-VSTeamArea.Tests.ps1 deleted file mode 100644 index 9d81c42f4..000000000 --- a/unit/test/Add-VSTeamArea.Tests.ps1 +++ /dev/null @@ -1,74 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamArea' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamClassificationNode" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Add-VSTeamArea' -Tag "Add" { - BeforeAll { - $classificationNodeResult = Get-Content "$PSScriptRoot\sampleFiles\classificationNodeResult.json" -Raw | ConvertFrom-Json - - Mock Invoke-RestMethod { return $classificationNodeResult } - } - - It 'area should return Nodes' { - ## Act - Add-VSTeamArea -ProjectName "Public Demo" -Name "MyClassificationNodeName" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - - It 'with Path "" should return Nodes' -TestCases @( - @{ Path = "SubPath" } - @{ Path = "Path/SubPath" } - ) { - param ($Path) - ## Act - Add-VSTeamArea -ProjectName "Public Demo" -Name "MyClassificationNodeName" -Path $Path - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas/$Path*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - - It 'with empty Path "" should return Nodes' -TestCases @( - @{Path = "" } - @{Path = $null } - ) { - param ($Path) - ## Act - Add-VSTeamArea -ProjectName "Public Demo" -Name "MyClassificationNodeName" -Path $Path - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas?*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamBuild.Tests.ps1 b/unit/test/Add-VSTeamBuild.Tests.ps1 deleted file mode 100644 index b38b2129d..000000000 --- a/unit/test/Add-VSTeamBuild.Tests.ps1 +++ /dev/null @@ -1,178 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamBuild' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/TeamQueueCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/BuildDefinitionCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamBuild' -Tag "Add" { - ## Arrange - BeforeAll { - $resultsVSTS = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\buildSingleResult.json" -Raw | ConvertFrom-Json - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } - } - - Context 'Services' -Tag "Services" { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - Mock Invoke-RestMethod { return $singleResult } - Mock Get-VSTeamBuildDefinition { return $resultsVSTS.value } - } - - It 'by name should add build' { - ## Act - Add-VSTeamBuild -ProjectName project -BuildDefinitionName 'aspdemo-CI' - - ## Assert - # Call to queue build. - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Body -like "*699*" -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" - } - } - - It 'by id should add build' { - ## Act - Add-VSTeamBuild -ProjectName project -BuildDefinitionId 2 - - ## Assert - # Call to queue build. - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Body -like "*2*" -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" - } - } - - It 'with source branch should add build' { - ## Act - Add-VSTeamBuild -ProjectName project -BuildDefinitionId 2 -SourceBranch 'refs/heads/dev' - - ## Assert - # Call to queue build. - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Body -like "*2*" -and - $Body -like "*refs/heads/dev*" -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" - } - } - - It 'with parameters should add build' { - ## Act - Add-VSTeamBuild -ProjectName project -BuildDefinitionId 2 -BuildParameters @{'system.debug' = 'true' } - - ## Assert - # Call to queue build. - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Body -like "*2*" -and - $Body -like "*true*" -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Server' -Tag "Server" { - BeforeAll { - ## Arrange - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - - Mock Invoke-RestMethod { - # Write-Host $args - return $singleResult - } - - Mock Get-VSTeamQueue { return [PSCustomObject]@{ - name = "MyQueue" - id = 3 - } - } - - Mock Get-VSTeamBuildDefinition { return @{ name = "MyBuildDef" } } - } - - It 'by id on TFS local Auth should add build' { - ## Act - Add-VSTeamBuild -projectName project -BuildDefinitionId 2 -QueueName MyQueue - - ## Assert - # Call to queue build. - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and - $Body -like "*2*" -and - $Body -like "*3*" - } - } - - It 'with parameters on TFS local Auth should add build' { - ## Act - Add-VSTeamBuild -projectName project -BuildDefinitionId 2 -QueueName MyQueue -BuildParameters @{'system.debug' = 'true' } - - ## Assert - # Call to queue build. - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and - $Body -like "*2*" -and - $Body -like "*3*" -and - $Body -like "*system.debug*" - } - } - - It 'with source branch on TFS local auth should add build' { - ## Act - Add-VSTeamBuild -projectName project -BuildDefinitionId 2 -QueueName MyQueue -SourceBranch refs/heads/dev - - ## Assert - # Call to queue build. - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" -and - $Body -like "*2*" -and - $Body -like "*3*" -and - $Body -like "*refs/heads/dev*" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Add-VSTeamBuildDefinition.Tests.ps1 deleted file mode 100644 index 0c78d1e5d..000000000 --- a/unit/test/Add-VSTeamBuildDefinition.Tests.ps1 +++ /dev/null @@ -1,64 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamBuildDefinition' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamBuildDefinition' { - ## Arrange - BeforeAll { - $resultsVSTS = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json - - Mock Invoke-RestMethod { return $resultsVSTS } - Mock _getProjects { return @() } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } - } - - Context 'Services' -Tag "Services" { - ## Arrange - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - it 'Should add build' { - ## Act - Add-VSTeamBuildDefinition -projectName project -inFile 'sampleFiles/builddef.json' - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $InFile -eq 'sampleFiles/builddef.json' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Server' -Tag "Server" { - ## Arrange - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - it 'Should add build' { - ## Act - Add-VSTeamBuildDefinition -projectName project -inFile 'sampleFiles/builddef.json' - - ## Assert - Assert-MockCalled Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $InFile -eq 'sampleFiles/builddef.json' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions?api-version=$(_getApiVersion Build)" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamBuildTag.Tests.ps1 b/unit/test/Add-VSTeamBuildTag.Tests.ps1 deleted file mode 100644 index b9f8735d0..000000000 --- a/unit/test/Add-VSTeamBuildTag.Tests.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamBuildTag' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamBuildTag' -Tag "Add" { - ## Arrange - BeforeAll { - $inputTags = "Test1", "Test2", "Test3" - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } - } - - Context 'Services' -Tag "Services" { - ## Arrange - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - } - - It 'should add tags to Build' { - ## Act - Add-VSTeamBuildTag -ProjectName project -id 2 -Tags $inputTags - - ## Assert - foreach ($inputTag in $inputTags) { - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Put' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" - } - } - } - } - - Context 'Server' -Tag "Server" { - ## Arrange - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - - Mock Invoke-RestMethod - } - - It 'should add tags to Build' { - ## Act - Add-VSTeamBuildTag -ProjectName project -id 2 -Tags $inputTags - - ## Assert - foreach ($inputTag in $inputTags) { - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Put' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" - } - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamClassificationNode.Tests.ps1 b/unit/test/Add-VSTeamClassificationNode.Tests.ps1 deleted file mode 100644 index 1cdcac93f..000000000 --- a/unit/test/Add-VSTeamClassificationNode.Tests.ps1 +++ /dev/null @@ -1,82 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamClassificationNode' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Add-VSTeamClassificationNode' { - ## Arrange - BeforeAll { - $classificationNodeResult = Get-Content "$PSScriptRoot\sampleFiles\classificationNodeResult.json" -Raw | ConvertFrom-Json - - Mock Invoke-RestMethod { return $classificationNodeResult } - } - - It 'with StructureGroup "" should return Nodes' -TestCases @( - @{StructureGroup = "areas" } - @{StructureGroup = "iterations" } - ) { - param ($StructureGroup) - ## Act - Add-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Name "MyClassificationNodeName" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - - It 'with StructureGroup "" by Path "" should return Nodes' -TestCases @( - @{StructureGroup = "areas"; Path = "SubPath" } - @{StructureGroup = "areas"; Path = "Path/SubPath" } - @{StructureGroup = "iterations"; Path = "SubPath" } - @{StructureGroup = "iterations"; Path = "Path/SubPath" } - ) { - param ($StructureGroup, $Path) - ## Act - Add-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Name "MyClassificationNodeName" -Path $Path - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup/$Path*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - - It 'with StructureGroup "" by empty Path "" should return Nodes' -TestCases @( - @{StructureGroup = "areas"; Path = "" } - @{StructureGroup = "areas"; Path = $null } - @{StructureGroup = "iterations"; Path = "" } - @{StructureGroup = "iterations"; Path = $null } - ) { - param ($StructureGroup, $Path) - ## Act - Add-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Name "MyClassificationNodeName" -Path $Path - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup?*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamExtension.Tests.ps1 b/unit/test/Add-VSTeamExtension.Tests.ps1 deleted file mode 100644 index 575bbbb84..000000000 --- a/unit/test/Add-VSTeamExtension.Tests.ps1 +++ /dev/null @@ -1,76 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamExtension' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamInstallState.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamExtension.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamExtension' { - ## Arrange - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ExtensionsManagement' } - - $singleResult = [PSCustomObject]@{ - extensionId = 'test' - extensionName = 'test' - publisherId = 'test' - publisherName = 'test' - version = '1.0.0' - registrationId = '12345678-9012-3456-7890-123456789012' - manifestVersion = 1 - baseUri = '' - fallbackBaseUri = '' - scopes = [PSCustomObject]@{ } - installState = [PSCustomObject]@{ - flags = 'none' - lastUpdated = '2018-10-09T11:26:47.187Z' - } - } - - $env:Team_TOKEN = '1234' - - Mock _callAPI { return $singleResult } - } - - AfterAll { - $env:TEAM_TOKEN = $null - } - - It 'Should add an extension without version' { - ## Act - Add-VSTeamExtension -PublisherId 'test' -ExtensionId 'test' - - ## Assert - Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Get' -and - $subDomain -eq 'extmgmt' -and - $version -eq $(_getApiVersion ExtensionsManagement) -and - $uri - $Url -like "*https://extmgmt.dev.azure.com/test/_apis/_apis/extensionmanagement/installedextensionsbyname/test/test*" - } - } - - It 'Should add an extension with version' { - ## Act - Add-VSTeamExtension -PublisherId 'test' -ExtensionId 'test' -Version '1.0.0' - - ## Assert - Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Get' -and - $subDomain -eq 'extmgmt' -and - $version -eq $(_getApiVersion ExtensionsManagement) - $Url -like "*https://extmgmt.dev.azure.com/test/_apis/_apis/extensionmanagement/installedextensionsbyname/test/test/1.0.0*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamFeed.Tests.ps1 b/unit/test/Add-VSTeamFeed.Tests.ps1 deleted file mode 100644 index 8550d76e1..000000000 --- a/unit/test/Add-VSTeamFeed.Tests.ps1 +++ /dev/null @@ -1,54 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamFeed' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamFeed' { - ## Arrange - BeforeAll { - $results = Get-Content "$PSScriptRoot\sampleFiles\feeds.json" -Raw | ConvertFrom-Json - Mock Invoke-RestMethod { return $results.value[0] } - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Packaging' } - } - - it 'with description should add feed' { - ## Act - Add-VSTeamFeed -Name 'module' -Description 'Test Module' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds?api-version=$(_getApiVersion Packaging)" -and - $Method -eq 'Post' -and - $ContentType -eq 'application/json' -and - $Body -like '*"name": *"module"*' - } - } - - it 'with upstream sources should add feed' { - ## Act - Add-VSTeamFeed -Name 'module' -EnableUpstreamSources -showDeletedPackageVersions - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds?api-version=$(_getApiVersion packaging)" -and - $Method -eq 'Post' -and - $ContentType -eq 'application/json' -and - $Body -like '*"upstreamEnabled":*true*' -and - $Body -like '*"hideDeletedPackageVersions":*false*' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamGitRepository.Tests.ps1 b/unit/test/Add-VSTeamGitRepository.Tests.ps1 deleted file mode 100644 index b07828cce..000000000 --- a/unit/test/Add-VSTeamGitRepository.Tests.ps1 +++ /dev/null @@ -1,91 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamGitRepository" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamGitRepository' { - ## Arrange - BeforeAll { - $singleResult = [PSCustomObject]@{ - id = '' - url = '' - sshUrl = '' - remoteUrl = '' - defaultBranch = '' - size = 0 - name = 'testRepo' - project = [PSCustomObject]@{ - name = 'Project' - id = 1 - description = '' - url = '' - state = '' - revision = '' - visibility = '' - } - } - - # These two lines will force a refresh of the project - # cache and return an empty list. - Mock _getProjects { return @() } - Mock _hasProjectCacheExpired { return $true } - - Mock Invoke-RestMethod { return $singleResult } - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } - } - - It 'by name should add Git repo' { - Add-VSTeamGitRepository -Name 'testRepo' -ProjectName 'test' - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Post" -and - $Uri -eq "https://dev.azure.com/test/test/_apis/git/repositories?api-version=1.0-gitUnitTests" -and - $Body -like "*testRepo*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamGitRepositoryPermission.Tests.ps1 b/unit/test/Add-VSTeamGitRepositoryPermission.Tests.ps1 deleted file mode 100644 index 036464e11..000000000 --- a/unit/test/Add-VSTeamGitRepositoryPermission.Tests.ps1 +++ /dev/null @@ -1,223 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamGitRepositoryPermission' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGroup.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUser.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepositoryPermissions.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamGitRepositoryPermission' { - ## Arrange - BeforeAll { - $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json - $userSingleResultObject = [VSTeamUser]::new($userSingleResult) - - $groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json - $groupSingleResultObject = [VSTeamGroup]::new($groupSingleResult) - - $projectResult = Get-Content "$PSScriptRoot\sampleFiles\projectResult.json" -Raw | ConvertFrom-Json - $projectResultObject = [VSTeamProject]::new($projectResult) - - $accessControlEntryResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlEntryResult.json" -Raw | ConvertFrom-Json - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $accessControlEntryResult - } -Verifiable - } - - It 'by ProjectUser should return ACEs' { - ## Act - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -User $userSingleResultObject -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by ProjectGroup should return ACEs' { - ## Act - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -Group $groupSingleResultObject -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by ProjectDescriptor should return ACEs' { - ## Act - # The S-1-9 number is on digit off from the calls above so the same mock can be used - # as above with the exactly 1 parameter. If you don't use different S-1-9 the count - # of calls will be off. - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-2551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-2551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by RepositoryUser should return ACEs' { - ## Act - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -RepositoryId "12345678-1234-1234-1234-123456789012" -User $userSingleResultObject -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789012`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by RepositoryGroup should return ACEs' { - ## Act - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -RepositoryId "12345678-1234-1234-1234-123456789012" -Group $groupSingleResultObject -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789012`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by RepositoryDescriptor should return ACEs' { - ## Act - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -RepositoryId "12345678-1234-1234-1234-123456789013" -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789013`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by RepositoryBranchUser should return ACEs' { - ## Act - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -RepositoryId "12345678-1234-1234-1234-123456789012" -BranchName "master" -User $userSingleResultObject -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789012/refs/heads/6d0061007300740065007200`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by RepositoryBranchGroup should return ACEs' { - ## Act - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -RepositoryId "12345678-1234-1234-1234-123456789012" -BranchName "master" -Group $groupSingleResultObject -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789012/refs/heads/6d0061007300740065007200`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by RepositoryBranchDescriptor should return ACEs' { - ## Act - Add-VSTeamGitRepositoryPermission -Project $projectResultObject -RepositoryId "12345678-1234-1234-1234-123456789015" -BranchName "master" -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([VSTeamGitRepositoryPermissions]'CreateRepository,RenameRepository,PullRequestBypassPolicy') -Deny ([VSTeamGitRepositoryPermissions]'EditPolicies,ForcePush') - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"repoV2/010d06f0-00d5-472a-bb47-58947c230876/12345678-1234-1234-1234-123456789015/refs/heads/6d0061007300740065007200`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 34048,*" -and - $Body -like "*`"deny`": 2056,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamIteration.Tests.ps1 b/unit/test/Add-VSTeamIteration.Tests.ps1 deleted file mode 100644 index 21d33aecf..000000000 --- a/unit/test/Add-VSTeamIteration.Tests.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamIteration' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamClassificationNode" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Add-VSTeamIteration' { - BeforeAll { - $classificationNodeResult = Get-Content "$PSScriptRoot\sampleFiles\classificationNodeResult.json" -Raw | ConvertFrom-Json - Mock Invoke-RestMethod { return $classificationNodeResult } - } - - It 'iteration should return Nodes' { - ## Act - Add-VSTeamIteration -ProjectName "Public Demo" -Name "MyClassificationNodeName" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - - It 'with Path "" should return Nodes' -TestCases @( - @{ Path = 'SubPath' } - @{ Path = 'Path/SubPath' } - ) { - param ($Path) - ## Act - Add-VSTeamIteration -ProjectName "Public Demo" -Name "MyClassificationNodeName" -Path $Path - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations/$Path*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - - It 'with empty Path "" should return Nodes' -TestCases @( - @{Path = "" } - @{Path = $null } - ) { - param ($Path) - ## Act - Add-VSTeamIteration -ProjectName "Public Demo" -Name "MyClassificationNodeName" -Path $Path - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations?*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like '*"name":*"MyClassificationNodeName"*' - } - } - } -} diff --git a/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 b/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 deleted file mode 100644 index 7b3026276..000000000 --- a/unit/test/Add-VSTeamKubernetesEndpoint.Tests.ps1 +++ /dev/null @@ -1,74 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamKubernetesEndpoint' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamKubernetesEndpoint' { - BeforeAll { - Mock _hasProjectCacheExpired { return $false } - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } - - Mock Write-Progress - Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } - - Mock Invoke-RestMethod { - if ($iTracking -gt 9) { - return [PSCustomObject]@{ - isReady = $true - operationStatus = [PSCustomObject]@{state = 'Ready' } - } - } - - return [PSCustomObject]@{ - isReady = $false - createdBy = [PSCustomObject]@{ } - authorization = [PSCustomObject]@{ } - data = [PSCustomObject]@{ } - operationStatus = [PSCustomObject]@{state = 'InProgress' } - } - } - } - - It 'not accepting untrusted certs and not generating a pfx should create a new Kubernetes Serviceendpoint' { - Add-VSTeamKubernetesEndpoint -projectName 'project' -endpointName 'KubTest' ` - -kubernetesUrl 'http://myK8s.local' -clientKeyData '00000000-0000-0000-0000-000000000000' ` - -kubeconfig '{name: "myConfig"}' -clientCertificateData 'someClientCertData' - - # On PowerShell 5 the JSON has two spaces but on PowerShell 6 it only has one so - # test for both. - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - ($Body -like '*"acceptUntrustedCerts": false*' -or $Body -like '*"acceptUntrustedCerts": false*') -and - ($Body -like '*"generatePfx": false*' -or $Body -like '*"generatePfx": false*') - } - } - - It 'accepting untrusted certs and generating a pfx should create a new Kubernetes Serviceendpoint' { - Add-VSTeamKubernetesEndpoint -projectName 'project' -endpointName 'KubTest' ` - -kubernetesUrl 'http://myK8s.local' -clientKeyData '00000000-0000-0000-0000-000000000000' ` - -kubeconfig '{name: "myConfig"}' -clientCertificateData 'someClientCertData' -acceptUntrustedCerts -generatePfx - - # On PowerShell 5 the JSON has two spaces but on PowerShell 6 it only has one so - # test for both. - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - ($Body -like '*"acceptUntrustedCerts": true*' -or $Body -like '*"acceptUntrustedCerts": true*') -and - ($Body -like '*"generatePfx": true*' -or $Body -like '*"generatePfx": true*') - } - } - } -} diff --git a/unit/test/Add-VSTeamMembership.Tests.ps1 b/unit/test/Add-VSTeamMembership.Tests.ps1 deleted file mode 100644 index d4c50036e..000000000 --- a/unit/test/Add-VSTeamMembership.Tests.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamMembership' { - ## Arrange - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/callMembershipAPI.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - # You have to set the version or the api-version will not be added when [VSTeamVersions]::Graph = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - Mock _supportsGraph - - $UserDescriptor = 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' - $GroupDescriptor = 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' - } - - Context 'Add-VSTeamMembership' { - It 'Should add membership' { - ## Act - $null = Add-VSTeamMembership -MemberDescriptor $UserDescriptor -ContainerDescriptor $GroupDescriptor - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Put" -and - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$UserDescriptor/$GroupDescriptor*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" - } - } - } -} diff --git a/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 b/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 deleted file mode 100644 index 6f3251b5d..000000000 --- a/unit/test/Add-VSTeamNuGetEndpoint.Tests.ps1 +++ /dev/null @@ -1,85 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamNuGetEndpoint' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamNuGetEndpoint' { - BeforeAll { - Mock _hasProjectCacheExpired { return $false } - - 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 'ServiceEndpoints' } - - Mock Write-Progress - Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } - Mock Invoke-RestMethod { - # This $i is in the module. Because we use InModuleScope - # we can see it - if ($iTracking -gt 9) { - return [PSCustomObject]@{ - isReady = $true - operationStatus = [PSCustomObject]@{state = 'Ready' } - } - } - - return [PSCustomObject]@{ - isReady = $false - createdBy = [PSCustomObject]@{ } - authorization = [PSCustomObject]@{ } - data = [PSCustomObject]@{ } - operationStatus = [PSCustomObject]@{state = 'InProgress' } - } - } - } - - It 'with ApiKey should create a new NuGet Serviceendpoint' { - Add-VSTeamNuGetEndpoint -ProjectName 'project' -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -ApiKey '00000000-0000-0000-0000-000000000000' - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/serviceendpoints?api-version=$(_getApiVersion DistributedTask)" -and - $Method -eq 'Post' -and - $ContentType -eq 'application/json' -and - $Body -like '*"nugetkey": *"00000000-0000-0000-0000-000000000000"*' -and - $Body -like '*"scheme": *"None"*' - } - } - - It 'with Username and Password should create a new NuGet Serviceendpoint' { - $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force - Add-VSTeamNuGetEndpoint -ProjectName 'project' -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -Username 'testUser' -SecurePassword $password - - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/serviceendpoints?api-version=$(_getApiVersion DistributedTask)" -and - $Method -eq 'Post' -and - $ContentType -eq 'application/json' -and - $Body -like '*"username": *"testUser"*' -and - $Body -like '*"password": *"00000000-0000-0000-0000-000000000000"*' -and - $Body -like '*"scheme": *"UsernamePassword"*' - } - } - - It 'with Token should create a new NuGet Serviceendpoint' { - Add-VSTeamNuGetEndpoint -ProjectName 'project' -EndpointName 'PowerShell Gallery' -NuGetUrl 'https://www.powershellgallery.com/api/v2/package' -PersonalAccessToken '00000000-0000-0000-0000-000000000000' - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/serviceendpoints?api-version=$(_getApiVersion DistributedTask)" -and - $Method -eq 'Post' -and - $ContentType -eq 'application/json' -and - $Body -like '*"apitoken":*"00000000-0000-0000-0000-000000000000"*' -and - $Body -like '*"scheme":*"Token"*' - } - } - } -} diff --git a/unit/test/Add-VSTeamPolicy.Tests.ps1 b/unit/test/Add-VSTeamPolicy.Tests.ps1 deleted file mode 100644 index 7060080cf..000000000 --- a/unit/test/Add-VSTeamPolicy.Tests.ps1 +++ /dev/null @@ -1,75 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPolicy' { - ## Arrange - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } - - Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } - } - - Context 'Add-VSTeamPolicy' { - It 'should add the policy' { - ## Act - Add-VSTeamPolicy -ProjectName Demo -type babcf51f-d853-43a2-9b05-4a64ca577be0 -enabled -blocking -settings @{ - MinimumApproverCount = 1 - scope = @( - @{ - refName = 'refs/heads/master' - matchKind = 'Exact' - repositoryId = '10000000-0000-0000-0000-0000000000001' - }) - } - - ## Assert - # With PowerShell core the order of the boty string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # '{"isBlocking":true,"isEnabled":true,"type":{"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"},"settings":{"scope":[{"repositoryId":"10000000-0000-0000-0000-0000000000001","matchKind":"Exact","refName":"refs/heads/master"}],"MinimumApproverCount":1}}' - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations?api-version=$(_getApiVersion Git)" -and - $Body -like '*"isBlocking":true*' -and - $Body -like '*"isEnabled":true*' -and - $Body -like '*"type":{"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"}*' -and - $Body -like '*"MinimumApproverCount":1*' -and - $Body -like '*"settings":*' -and - $Body -like '*"scope":*' -and - $Body -like '*"repositoryId":"10000000-0000-0000-0000-0000000000001"*' -and - $Body -like '*"matchKind":"Exact"*' -and - $Body -like '*"refName":"refs/heads/master"*' - } - } - - It 'should throw' { - ## Act / Assert - { Add-VSTeamPolicy -ProjectName boom -type babcf51f-d853-43a2-9b05-4a64ca577be0 -enabled -blocking -settings @{ - MinimumApproverCount = 1 - scope = @( - @{ - refName = 'refs/heads/master' - matchKind = 'Exact' - repositoryId = '10000000-0000-0000-0000-0000000000001' - }) - } - } | Should -Throw - } - } -} diff --git a/unit/test/Add-VSTeamProject.Tests.ps1 b/unit/test/Add-VSTeamProject.Tests.ps1 deleted file mode 100644 index 756ebb160..000000000 --- a/unit/test/Add-VSTeamProject.Tests.ps1 +++ /dev/null @@ -1,176 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProject' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$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" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProcessTemplateCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProcessValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProcess.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $singleResult = [PSCustomObject]@{ - name = 'Test' - description = '' - url = '' - id = '123-5464-dee43' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - - 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 [PSCustomObject]@{value = @( - [PSCustomObject]@{ - name = 'Agile' - Typeid = '00000000-0000-0000-0000-000000000001' - }, - [PSCustomObject]@{ - name = 'CMMI' - Typeid = '00000000-0000-0000-0000-000000000002' - }, - [PSCustomObject]@{ - name = 'Scrum' - Typeid = '00000000-0000-0000-0000-000000000003' - } - ) - } - } - } - - Context 'Add-VSTeamProject' { - BeforeAll { - Mock Write-Progress - - # Add Project - Mock Invoke-RestMethod { return @{status = 'inProgress'; id = '123-5464-dee43'; url = 'https://someplace.com' } } -ParameterFilter { - $Method -eq 'Post' -and - $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" - } - - # Track Progress - Mock Invoke-RestMethod { - # This $i is in the module. Because we use InModuleScope - # we can see it - if ($i -gt 9) { - return @{status = 'succeeded' } - } - - return @{status = 'inProgress' } - } -ParameterFilter { - $Uri -eq 'https://someplace.com' - } - - # Get-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 - - Should -Invoke Invoke-RestMethod -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" - } - Should -Invoke Invoke-RestMethod -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" -and - $Body -eq '{"name": "Test", "description": "", "capabilities": {"versioncontrol": { "sourceControlType": "Tfvc"}, "processTemplate":{"templateTypeId": "6b724908-ef14-45cf-84f8-768b5384da45"}}}' - } - } - } - - Context 'Add-VSTeamProject with Agile' { - BeforeAll { - 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)" } - } - - It 'Should create project with Agile' { - Add-VSTeamProject -ProjectName Test -processTemplate Agile - - Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" } - } - } - - Context 'Add-VSTeamProject with CMMI' { - BeforeAll { - 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 [PSCustomObject]@{ - name = 'CMMI' - id = 1 - Typeid = '00000000-0000-0000-0000-000000000002' - } - } - } - - It 'Should create project with CMMI' { - Add-VSTeamProject -ProjectName Test -processTemplate CMMI - - Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Method -eq 'Post' -and $Uri -eq "https://dev.azure.com/test/_apis/projects?api-version=$(_getApiVersion Core)" } - } - } - - Context 'Add-VSTeamProject throws error' { - BeforeAll { - 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 Write-Error - Mock _trackProjectProgress { throw 'Test error' } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - } - - It '_trackProjectProgress errors should throw' { - { Add-VSTeamProject -projectName Test -processTemplate CMMI } | Should -Throw - } - } -} diff --git a/unit/test/Add-VSTeamProjectPermission.Tests.ps1 b/unit/test/Add-VSTeamProjectPermission.Tests.ps1 deleted file mode 100644 index edbec83d6..000000000 --- a/unit/test/Add-VSTeamProjectPermission.Tests.ps1 +++ /dev/null @@ -1,134 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProjectPermission' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGroup.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUser.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectPermissions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json - $userSingleResultObject = [VSTeamUser]::new($userSingleResult) - - $groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json - $groupSingleResultObject = [VSTeamGroup]::new($groupSingleResult) - - $projectResult = [PSCustomObject]@{ - name = 'Test Project Public' - description = '' - url = '' - id = '010d06f0-00d5-472a-bb47-58947c230876' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - - $projectResultObject = [VSTeamProject]::new($projectResult) - - $accessControlEntryResult = - @" -{ - "count": 1, - "value": [ - { - "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1", - "allow": 8, - "deny": 0, - "extendedInfo": {} - } - ] -} -"@ | ConvertFrom-Json - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Add-VSTeamProjectPermission by ProjectUser' { - BeforeAll { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $accessControlEntryResult - } -Verifiable - } - - It 'by ProjectUser should return ACEs' { - Add-VSTeamProjectPermission -Project $projectResultObject -User $userSingleResultObject -Allow ([VSTeamProjectPermissions]'GENERIC_READ,GENERIC_WRITE,WORK_ITEM_DELETE,RENAME') -Deny ([VSTeamProjectPermissions]'CHANGE_PROCESS,VIEW_TEST_RESULTS') - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/52d39943-cb85-4d7f-8fa8-c6baac873819*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"`$PROJECT:vstfs:///Classification/TeamProject/010d06f0-00d5-472a-bb47-58947c230876`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and - $Body -like "*`"allow`": 73731,*" -and - $Body -like "*`"deny`": 8389120,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by ProjectGroup should return ACEs' { - Add-VSTeamProjectPermission -Project $projectResultObject -Group $groupSingleResultObject -Allow ([VSTeamProjectPermissions]'GENERIC_READ,GENERIC_WRITE,WORK_ITEM_DELETE,RENAME') -Deny ([VSTeamProjectPermissions]'CHANGE_PROCESS,VIEW_TEST_RESULTS') - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/52d39943-cb85-4d7f-8fa8-c6baac873819*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"`$PROJECT:vstfs:///Classification/TeamProject/010d06f0-00d5-472a-bb47-58947c230876`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 73731,*" -and - $Body -like "*`"deny`": 8389120,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by ProjectDescriptor should return ACEs' { - Add-VSTeamProjectPermission -Project $projectResultObject -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([VSTeamProjectPermissions]'GENERIC_READ,GENERIC_WRITE,WORK_ITEM_DELETE,RENAME') -Deny ([VSTeamProjectPermissions]'CHANGE_PROCESS,VIEW_TEST_RESULTS') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/52d39943-cb85-4d7f-8fa8-c6baac873819*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"`$PROJECT:vstfs:///Classification/TeamProject/010d06f0-00d5-472a-bb47-58947c230876`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 73731,*" -and - $Body -like "*`"deny`": 8389120,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamPullRequest.Tests.ps1 b/unit/test/Add-VSTeamPullRequest.Tests.ps1 deleted file mode 100644 index 6d1d7f337..000000000 --- a/unit/test/Add-VSTeamPullRequest.Tests.ps1 +++ /dev/null @@ -1,82 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPullRequest' { - ## Arrange - BeforeAll { - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-gitUnitTests' } -ParameterFilter { $Service -eq 'Git' } - - $result = Get-Content "$PSScriptRoot\sampleFiles\updatePullRequestResponse.json" -Raw | ConvertFrom-Json - } - - Context 'Add-VSTeamPullRequest' { - BeforeAll { - Mock Invoke-RestMethod { return $result } - } - - It 'Add-VSTeamPullRequest as Draft' { - ## Act - Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` - -Title "PR Title" -Description "PR Description" ` - -SourceRefName "refs/heads/test" -TargetRefName "refs/heads/master" ` - -Draft -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests*" -and - $Body -eq '{"sourceRefName": "refs/heads/test", "targetRefName": "refs/heads/master", "title": "PR Title", "description": "PR Description", "isDraft": true}' - } - } - - It 'Add-VSTeamPullRequest as Published' { - ## Act - Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` - -Title "PR Title" -Description "PR Description" ` - -SourceRefName "refs/heads/test" -TargetRefName "refs/heads/master" ` - -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests*" -and - $Body -eq '{"sourceRefName": "refs/heads/test", "targetRefName": "refs/heads/master", "title": "PR Title", "description": "PR Description", "isDraft": false}' - } - } - - It 'Add-VSTeamPullRequest with wrong -SourceRefName throws' { - ## Act / Assert - { - Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` - -Title "PR Title" -Description "PR Description" ` - -SourceRefName "garbage" -TargetRefName "refs/heads/master" ` - -Draft -Force - } | Should -Throw - } - - It 'Add-VSTeamPullRequest with wrong -TargetRefName throws' { - ## Act / Assert - { - Add-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -ProjectName "Sandbox" ` - -Title "PR Title" -Description "PR Description" ` - -SourceRefName "refs/heads/test" -TargetRefName "garbage" ` - -Draft -Force - } | Should -Throw - } - } -} diff --git a/unit/test/Add-VSTeamRelease.Tests.ps1 b/unit/test/Add-VSTeamRelease.Tests.ps1 deleted file mode 100644 index 36e75dd78..000000000 --- a/unit/test/Add-VSTeamRelease.Tests.ps1 +++ /dev/null @@ -1,147 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamRelease' { - ## Arrange - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/BuildCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ReleaseDefinitionCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamReleaseDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } - - Mock _getInstance { return 'https://dev.azure.com/test' } - - $singleResult = [PSCustomObject]@{ - environments = [PSCustomObject]@{ } - variables = [PSCustomObject]@{ - BrowserToUse = [PSCustomObject]@{ - value = "phantomjs" - } - } - _links = [PSCustomObject]@{ - self = [PSCustomObject]@{ } - web = [PSCustomObject]@{ } - } - } - - Mock _hasProjectCacheExpired { return $false } - } - - Context 'Add-VSTeamRelease' { - ## Arrange - BeforeAll { - $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'project' - - - Mock Get-VSTeamReleaseDefinition { - $def1 = New-Object -TypeName PSObject -Prop @{name = 'Test1'; id = 1; artifacts = @(@{alias = 'drop' }) } - $def2 = New-Object -TypeName PSObject -Prop @{name = 'Tests'; id = 2; artifacts = @(@{alias = 'drop' }) } - return @( - $def1, - $def2 - ) - } - - Mock Get-VSTeamBuild { - $bld1 = New-Object -TypeName PSObject -Prop @{name = "Bld1"; id = 1 } - - return @( - $bld1 - ) - } - - Mock Invoke-RestMethod { return $singleResult } - Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Body -like "*101*" } - - Mock _buildDynamicParam { - param( - [string] $ParameterName = 'QueueName', - [array] $arrSet, - [bool] $Mandatory = $false, - [string] $ParameterSetName - ) - - # Create the collection of attributes - $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - - # Create and set the parameters' attributes - $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute - $ParameterAttribute.Mandatory = $Mandatory - $ParameterAttribute.ValueFromPipelineByPropertyName = $true - - if ($ParameterSetName) { - $ParameterAttribute.ParameterSetName = $ParameterSetName - } - - # Add the attributes to the attributes collection - $AttributeCollection.Add($ParameterAttribute) - - if ($arrSet) { - # Generate and set the ValidateSet - $ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet) - - # Add the ValidateSet to the attributes collection - $AttributeCollection.Add($ValidateSetAttribute) - } - - # Create and return the dynamic parameter - return New-Object System.Management.Automation.RuntimeDefinedParameter($ParameterName, [string], $AttributeCollection) - } - } - - AfterAll { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'by name should add a release' { - ## Act - Add-VSTeamRelease -ProjectName project -BuildNumber 'Bld1' -DefinitionName 'Test1' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '*"definitionId": 1*' -and - $Body -like '*"description": ""*' -and - $Body -like '*"alias": "drop"*' -and - $Body -like '*"id": "1"*' -and - $Body -like '*"sourceBranch": ""*' -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)" - } - } - - It 'by Id should add a release' { - ## Act - Add-VSTeamRelease -ProjectName project -DefinitionId 1 -ArtifactAlias drop -BuildId 2 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '*"definitionId": 1*' -and - $Body -like '*"description": ""*' -and - $Body -like '*"alias": "drop"*' -and - $Body -like '*"id": "2"*' -and - $Body -like '*"sourceBranch": ""*' -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)" - } - } - - It 'should throw' { - ## Act / Assert - { Add-VSTeamRelease -ProjectName project -DefinitionId 101 -ArtifactAlias drop -BuildId 101 } | Should -Throw - } - } -} diff --git a/unit/test/Add-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Add-VSTeamReleaseDefinition.Tests.ps1 deleted file mode 100644 index bb7bcc888..000000000 --- a/unit/test/Add-VSTeamReleaseDefinition.Tests.ps1 +++ /dev/null @@ -1,80 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamReleaseDefinition' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } - - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ - queue = [PSCustomObject]@{ name = 'Default' } - _links = [PSCustomObject]@{ - self = [PSCustomObject]@{ } - web = [PSCustomObject]@{ } - } - retentionPolicy = [PSCustomObject]@{ } - lastRelease = [PSCustomObject]@{ } - artifacts = [PSCustomObject]@{ } - modifiedBy = [PSCustomObject]@{ name = 'project' } - createdBy = [PSCustomObject]@{ name = 'test' } - } - } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - } - - Context 'Add-VSTeamReleaseDefinition' { - BeforeAll { - Mock Invoke-RestMethod { return $results } - } - - Context 'Services' { - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - it 'should add release' { - ## Act - Add-VSTeamReleaseDefinition -projectName project -inFile 'Releasedef.json' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $InFile -eq 'Releasedef.json' -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)" - } - } - } - - Context 'Server' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - it 'local Auth should add release' { - ## Act - Add-VSTeamReleaseDefinition -projectName project -inFile 'Releasedef.json' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $InFile -eq 'Releasedef.json' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/release/definitions?api-version=$(_getApiVersion Release)" - } - } - } - } -} diff --git a/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 b/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 deleted file mode 100644 index bbdbb0a85..000000000 --- a/unit/test/Add-VSTeamServiceFabricEndpoint.Tests.ps1 +++ /dev/null @@ -1,102 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamServiceFabricEndpoint' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamServiceFabricEndpoint' { - BeforeAll { - Mock _hasProjectCacheExpired { return $false } - } - - Context 'Services' { - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } - - Mock Write-Progress - Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Post' } - Mock Invoke-RestMethod { - # This $i is in the module. Because we use InModuleScope - # we can see it - if ($iTracking -gt 9) { - return [PSCustomObject]@{ - isReady = $true - operationStatus = [PSCustomObject]@{state = 'Ready' } - } - } - - return [PSCustomObject]@{ - isReady = $false - createdBy = [PSCustomObject]@{ } - authorization = [PSCustomObject]@{ } - data = [PSCustomObject]@{ } - operationStatus = [PSCustomObject]@{state = 'InProgress' } - } - } - } - - It 'should create a new Service Fabric Serviceendpoint' { - Add-VSTeamServiceFabricEndpoint -projectName 'project' -endpointName 'PM_DonovanBrown' -url "tcp://0.0.0.0:19000" -useWindowsSecurity $false - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } - } - - It 'with AzureAD authentication should create a new Service Fabric Serviceendpoint' { - $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force - $username = "Test User" - $serverCertThumbprint = "0000000000000000000000000000000000000000" - Add-VSTeamServiceFabricEndpoint -projectName 'project' -endpointName 'PM_DonovanBrown' -url "tcp://0.0.0.0:19000" -username $username -password $password -serverCertThumbprint $serverCertThumbprint - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } - } - - It 'with Certificate authentication should create a new Service Fabric Serviceendpoint' { - $password = '00000000-0000-0000-0000-000000000000' | ConvertTo-SecureString -AsPlainText -Force - $base64Cert = "0000000000000000000000000000000000000000" - $serverCertThumbprint = "0000000000000000000000000000000000000000" - Add-VSTeamServiceFabricEndpoint -projectName 'project' -endpointName 'PM_DonovanBrown' -url "tcp://0.0.0.0:19000" -serverCertThumbprint $serverCertThumbprint -certificate $base64Cert -certificatePassword $password - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } - } - } - - Context 'Server' { - BeforeAll { - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } - } - - Context 'Add-VSTeamServiceFabricEndpoint' { - BeforeAll { - Mock Add-VSTeamServiceEndpoint -ParameterFilter { - $endpointType -eq 'servicefabric' - } - } - - # 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 -Not -Throw - } - - 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 deleted file mode 100644 index 96f78fee2..000000000 --- a/unit/test/Add-VSTeamSonarQubeEndpoint.Tests.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamSonarQubeEndpoint' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - Context 'Add-VSTeamSonarQubeEndpoint' { - BeforeAll { - Mock _hasProjectCacheExpired { return $false } - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } - - Mock Write-Warning - Mock Write-Error -Verifiable - Mock Invoke-RestMethod { - $e = [System.Management.Automation.ErrorRecord]::new( - [System.Net.WebException]::new("Endpoint type couldn't be recognized 'sonarqube'", [System.Net.WebExceptionStatus]::ProtocolError), - "Endpoint type couldn't be recognized 'sonarqube'", - [System.Management.Automation.ErrorCategory]::ProtocolError, - $null) - - # The error message is different on TFS and VSTS - $msg = ConvertTo-Json @{ - '$id' = 1 - message = "Unable to find service endpoint type 'sonarqube' using authentication scheme 'UsernamePassword'." - } - - $e.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($msg) - - $PSCmdlet.ThrowTerminatingError($e) - } - } - - It 'should not create SonarQube Serviceendpoint' { - Add-VSTeamSonarQubeEndpoint -projectName 'project' -endpointName 'PM_DonovanBrown' -sonarqubeUrl 'http://mysonarserver.local' -personalAccessToken '00000000-0000-0000-0000-000000000000' - - ## Verify that Write-Error was called - Should -InvokeVerifiable - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamTaskGroup.Tests.ps1 b/unit/test/Add-VSTeamTaskGroup.Tests.ps1 deleted file mode 100644 index 41c417e3b..000000000 --- a/unit/test/Add-VSTeamTaskGroup.Tests.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamTaskGroup' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" - $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'TaskGroups' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - } - - Context 'Add-VSTeamTaskGroup' { - BeforeAll { - Mock Invoke-RestMethod { - return Get-Content $taskGroupJson | ConvertFrom-Json - } - } - - It 'should create a task group using body param' { - Add-VSTeamTaskGroup -ProjectName Project -Body $taskGroupJsonAsString - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/Project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" -and - $Body -eq $taskGroupJsonAsString -and - $Method -eq "Post" - } - } - - It 'should create a task group using infile param' { - Add-VSTeamTaskGroup -ProjectName Project -InFile $taskGroupJson - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/Project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" -and - $InFile -eq $taskGroupJson -and - $Method -eq "Post" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamUserEntitlement.Tests.ps1 b/unit/test/Add-VSTeamUserEntitlement.Tests.ps1 deleted file mode 100644 index ee2eaa9f0..000000000 --- a/unit/test/Add-VSTeamUserEntitlement.Tests.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamUserEntitlement" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Add-VSTeamUserEntitlement' { - BeforeAll { - [VSTeamVersions]::ModuleVersion = '0.0.0' - Mock _getProjects { return @() } - Mock _getApiVersion { return 'VSTS' } - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock _callAPI - } - - It 'Should add a user' { - Add-VSTeamUserEntitlement -License earlyAdopter -LicensingSource msdn -MSDNLicenseType enterprise -Email 'test@user.com' - - Should -Invoke _callAPI -ParameterFilter { - $Method -eq 'Post' -and - $SubDomain -eq 'vsaex' -and - $Body -like '*"principalName":*"test@user.com"*' -and - $Body -like '*"subjectKind":*"user"*' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamVariableGroup.Tests.ps1 b/unit/test/Add-VSTeamVariableGroup.Tests.ps1 deleted file mode 100644 index 636055ccb..000000000 --- a/unit/test/Add-VSTeamVariableGroup.Tests.ps1 +++ /dev/null @@ -1,100 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamVariableGroup' { - BeforeAll { - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamVariableGroup.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getProjects { return @() } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'VariableGroups' } - } - - Context 'Add-VSTeamVariableGroup' { - Context 'Services' { - BeforeAll { - $sampleFileVSTS = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples.json" | ConvertFrom-Json) - - Mock _getInstance { return 'https://dev.azure.com/test' } - - Set-VSTeamAPIVersion -Target VSTS - - Mock Invoke-RestMethod { return $sampleFileVSTS.value[0] } - } - - It 'should create a new AzureRM Key Vault Variable Group' { - $testParameters = @{ - ProjectName = "project" - Name = "TestVariableGroup2" - Description = "A test variable group linked to an Azure KeyVault" - Type = "AzureKeyVault" - Variables = @{ - key3 = @{ - enabled = $true - contentType = "" - value = "" - isSecret = $true - } - } - ProviderData = @{ - serviceEndpointId = "0228e842-65a7-4c64-90f7-0f07f3aa4e10" - vault = "keyVaultName" - } - } - - Add-VSTeamVariableGroup @testParameters - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } - } - - It "should create a new var group when passing the json as the body" { - $body = $sampleFileVSTS - $projName = "project" - Add-VSTeamVariableGroup -Body $body -ProjectName $projName - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projName/_apis/distributedtask/variablegroups?api-version=$(_getApiVersion VariableGroups)" -and - $Method -eq 'Post' - } - } - } - - Context 'Server' { - BeforeAll { - $sampleFile2017 = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples2017.json" | ConvertFrom-Json) - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - - Set-VSTeamAPIVersion -Target TFS2017 - - Mock Invoke-RestMethod { return $sampleFile2017.value[0] } - } - - It 'should create a new Variable Group' { - $testParameters = @{ - ProjectName = "project" - Name = "TestVariableGroup2" - Description = "A test variable group linked to an Azure KeyVault" - Variables = @{ - key1 = @{ - value = "value" - } - } - } - - Add-VSTeamVariableGroup @testParameters - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Method -eq 'Post' } - } - } - } -} diff --git a/unit/test/Add-VSTeamWorkItemAreaPermission.Tests.ps1 b/unit/test/Add-VSTeamWorkItemAreaPermission.Tests.ps1 deleted file mode 100644 index 503af7452..000000000 --- a/unit/test/Add-VSTeamWorkItemAreaPermission.Tests.ps1 +++ /dev/null @@ -1,263 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamWorkItemAreaPermission' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamWorkItemAreaPermissions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGroup.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUser.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json - $userSingleResultObject = [VSTeamUser]::new($userSingleResult) - - $groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json - $groupSingleResultObject = [VSTeamGroup]::new($groupSingleResult) - - $projectResult = [PSCustomObject]@{ - name = 'Test Project Public' - description = '' - url = '' - id = '010d06f0-00d5-472a-bb47-58947c230876' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - - $projectResultObject = [VSTeamProject]::new($projectResult) - - $accessControlEntryResult = - @" -{ - "count": 1, - "value": [ - { - "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1", - "allow": 8, - "deny": 0, - "extendedInfo": {} - } - ] -} -"@ | ConvertFrom-Json - - $classificationNodeById = - @" -{ - "count": 1, - "value": [ - { - "id": 44, - "identifier": "90aa2c42-de51-450a-bfb6-6e264e364d9a", - "name": "Child 1 Level 2", - "structureType": "area", - "hasChildren": false, - "path": "\\Demo Public\\Area\\Child 1 Level 1\\Child 1 Level 2", - "_links": { - "self": { - "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201/Child%201%20Level%202" - }, - "parent": { - "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201" - } - }, - "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201/Child%201%20Level%202" - } - ] - } -"@ | ConvertFrom-Json | Select-Object -ExpandProperty value - - $classificationNodeByIdObject = [VSTeamClassificationNode]::new($classificationNodeById, "test") - - $parentClassificationNode = - @" -{ - "count": 1, - "value": [ - { - "id": 43, - "identifier": "38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b", - "name": "Child 1 Level 1", - "structureType": "area", - "hasChildren": true, - "path": "\\Demo Public\\Area\\Child 1 Level 1", - "_links": { - "self": { - "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201" - }, - "parent": { - "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas" - } - }, - "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas/Child%201%20Level%201" - } - ] - } -"@ | ConvertFrom-Json | Select-Object -ExpandProperty value - - $parentClassificationNodeObject = [VSTeamClassificationNode]::new($parentClassificationNode, "test") - - $areaRootNode = - @" -{ - "id": 24, - "identifier": "b33b12d7-6abb-4b7a-b9d6-2092d0933c99", - "name": "Demo Public", - "structureType": "area", - "hasChildren": true, - "path": "\\Demo Public\\Area", - "_links": { - "self": { - "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas" - } - }, - "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Areas" - } -"@ | ConvertFrom-Json - - $areaRootNodeObject = [VSTeamClassificationNode]::new($areaRootNode, "test") - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Add-VSTeamWorkItemAreaPermission' { - BeforeAll { - # Mock _getProjects { return "Test Project Public" } - Mock _hasProjectCacheExpired { return $false } - Mock Get-VSTeamClassificationNode { return $areaRootNodeObject } - Mock Get-VSTeamClassificationNode { return $parentClassificationNodeObject } -ParameterFilter { $Path -eq "Child%201%20Level%201" } - Mock Get-VSTeamClassificationNode { return $classificationNodeByIdObject } -ParameterFilter { $Ids -eq 44 -or $Path -eq "Child 1 Level 1/Child 1 Level 2" } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - return $accessControlEntryResult - } - } - - It 'by AreaID and User should return ACEs' { - Add-VSTeamWorkItemAreaPermission -Project $projectResultObject -AreaID 44 -User $userSingleResultObject -Allow ([VSTeamWorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') -Deny ([VSTeamWorkItemAreaPermissions]'GENERIC_WRITE,DELETE') - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and - $Body -like "*`"allow`": 65,*" -and - $Body -like "*`"deny`": 10,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by AreaID and Group should return ACEs' { - Add-VSTeamWorkItemAreaPermission -Project $projectResultObject -AreaID 44 -Group $groupSingleResultObject -Allow ([VSTeamWorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') -Deny ([VSTeamWorkItemAreaPermissions]'GENERIC_WRITE,DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 65,*" -and - $Body -like "*`"deny`": 10,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by AreaID and Descriptor should return ACEs' { - Add-VSTeamWorkItemAreaPermission -Project $projectResultObject -AreaID 44 -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([VSTeamWorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') -Deny ([VSTeamWorkItemAreaPermissions]'GENERIC_WRITE,DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 65,*" -and - $Body -like "*`"deny`": 10,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by AreaPath and User should return ACEs' { - Add-VSTeamWorkItemAreaPermission -Project $projectResultObject -AreaPath "Child 1 Level 1/Child 1 Level 2" -User $userSingleResultObject -Allow ([VSTeamWorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') -Deny ([VSTeamWorkItemAreaPermissions]'GENERIC_WRITE,DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and - $Body -like "*`"allow`": 65,*" -and - $Body -like "*`"deny`": 10,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by AreaPath and Group should return ACEs' { - Add-VSTeamWorkItemAreaPermission -Project $projectResultObject -AreaPath "Child 1 Level 1/Child 1 Level 2" -Group $groupSingleResultObject -Allow ([VSTeamWorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') -Deny ([VSTeamWorkItemAreaPermissions]'GENERIC_WRITE,DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 65,*" -and - $Body -like "*`"deny`": 10,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by AreaPath and Descriptor should return ACEs' { - Add-VSTeamWorkItemAreaPermission -Project $projectResultObject -AreaPath "Child 1 Level 1/Child 1 Level 2" -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([VSTeamWorkItemAreaPermissions]'GENERIC_READ,MANAGE_TEST_PLANS') -Deny ([VSTeamWorkItemAreaPermissions]'GENERIC_WRITE,DELETE') - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/83e28ad4-2d72-4ceb-97b0-c7726d5502c3*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/b33b12d7-6abb-4b7a-b9d6-2092d0933c99:vstfs:///Classification/Node/38de1ce0-0b1b-45f2-b4f9-f32e3a72b78b:vstfs:///Classification/Node/90aa2c42-de51-450a-bfb6-6e264e364d9a`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 65,*" -and - $Body -like "*`"deny`": 10,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Add-VSTeamWorkItemIterationPermission.Tests.ps1 b/unit/test/Add-VSTeamWorkItemIterationPermission.Tests.ps1 deleted file mode 100644 index a7e0ae3e9..000000000 --- a/unit/test/Add-VSTeamWorkItemIterationPermission.Tests.ps1 +++ /dev/null @@ -1,236 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamWorkItemIterationPermission' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamWorkItemIterationPermissions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGroup.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUser.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json - $userSingleResultObject = [VSTeamUser]::new($userSingleResult) - - $groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json - $groupSingleResultObject = [VSTeamGroup]::new($groupSingleResult) - - $projectResult = [PSCustomObject]@{ - name = 'Test Project Public' - description = '' - url = '' - id = '010d06f0-00d5-472a-bb47-58947c230876' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - - $projectResultObject = [VSTeamProject]::new($projectResult) - - $accessControlEntryResult = - @" -{ - "count": 1, - "value": [ - { - "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1", - "allow": 8, - "deny": 0, - "extendedInfo": {} - } - ] -} -"@ | ConvertFrom-Json - - $classificationNodeIterationId = - @" -{ - "count": 1, - "value": [ - { - "id": 20, - "identifier": "18e7998d-d0c5-4c01-b547-d7d4eb4c97c5", - "name": "Sprint 3", - "structureType": "iteration", - "hasChildren": false, - "path": "\\Demo Public\\Iteration\\Sprint 3", - "_links": { - "self": { - "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations/Sprint%203" - }, - "parent": { - "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations" - } - }, - "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations/Sprint%203" - } - ] - } -"@ | ConvertFrom-Json | Select-Object -ExpandProperty value - - $classificationNodeIterationIdObject = [VSTeamClassificationNode]::new($classificationNodeIterationId, "test") - - $iterationRootNode = - @" -{ - "id": 16, - "identifier": "dfa90792-403a-4119-a52b-bd142c08291b", - "name": "Demo Public", - "structureType": "iteration", - "hasChildren": true, - "path": "\\Demo Public\\Iteration", - "_links": { - "self": { - "href": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations" - } - }, - "url": "https://dev.azure.com/vsteampsmoduletest/53e2997d-3723-4c1c-aa62-a0194cb65a29/_apis/wit/classificationNodes/Iterations" - } -"@ | ConvertFrom-Json - - $iterationRootNodeObject = [VSTeamClassificationNode]::new($iterationRootNode, "test") - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock _hasProjectCacheExpired { return $true } - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context 'Add-VSTeamWorkItemIterationPermission' { - BeforeAll { - # Mock _getProjects { return "Test Project Public" } - Mock Get-VSTeamClassificationNode { return $iterationRootNodeObject } - Mock Get-VSTeamClassificationNode { return $classificationNodeIterationIdObject } -ParameterFilter { $Ids -eq 44 -or $Path -eq "Sprint 1" } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - return $accessControlEntryResult - } - } - - It 'by IterationID and User should return ACEs' { - Add-VSTeamWorkItemIterationPermission -Project $projectResultObject -IterationID 44 -User $userSingleResultObject -Allow ([VSTeamWorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') -Deny ([VSTeamWorkItemIterationPermissions]'DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and - $Body -like "*`"allow`": 5,*" -and - $Body -like "*`"deny`": 8,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by IterationID and Group should return ACEs' { - Add-VSTeamWorkItemIterationPermission -Project $projectResultObject -IterationID 44 -Group $groupSingleResultObject -Allow ([VSTeamWorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') -Deny ([VSTeamWorkItemIterationPermissions]'DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 5,*" -and - $Body -like "*`"deny`": 8,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by IterationID and Descriptor should return ACEs' { - Add-VSTeamWorkItemIterationPermission -Project $projectResultObject -IterationID 44 -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([VSTeamWorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') -Deny ([VSTeamWorkItemIterationPermissions]'DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 5,*" -and - $Body -like "*`"deny`": 8,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by IterationPath and User should return ACEs' { - Add-VSTeamWorkItemIterationPermission -Project $projectResultObject -IterationPath "Sprint 1" -User $userSingleResultObject -Allow ([VSTeamWorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') -Deny ([VSTeamWorkItemIterationPermissions]'DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.IdentityModel.Claims.ClaimsIdentity;788df857-dcd8-444d-885e-bff359bc1982\\test@testuser.com`",*" -and - $Body -like "*`"allow`": 5,*" -and - $Body -like "*`"deny`": 8,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by IterationPath and Group should return ACEs' { - Add-VSTeamWorkItemIterationPermission -Project $projectResultObject -IterationPath "Sprint 1" -Group $groupSingleResultObject -Allow ([VSTeamWorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') -Deny ([VSTeamWorkItemIterationPermissions]'DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 5,*" -and - $Body -like "*`"deny`": 8,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - - It 'by IterationPath and Descriptor should return ACEs' { - Add-VSTeamWorkItemIterationPermission -Project $projectResultObject -IterationPath "Sprint 1" -Descriptor "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1" -Allow ([VSTeamWorkItemIterationPermissions]'GENERIC_READ,CREATE_CHILDREN') -Deny ([VSTeamWorkItemIterationPermissions]'DELETE') - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrolentries/bf7bfa03-b2b7-47db-8113-fa2e002cc5b1*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Body -like "*`"token`": `"vstfs:///Classification/Node/dfa90792-403a-4119-a52b-bd142c08291b:vstfs:///Classification/Node/18e7998d-d0c5-4c01-b547-d7d4eb4c97c5`",*" -and - $Body -like "*`"descriptor`": `"Microsoft.TeamFoundation.Identity;S-1-9-1551374245-856009726-4193442117-2390756110-2740161821-0-0-0-0-1`",*" -and - $Body -like "*`"allow`": 5,*" -and - $Body -like "*`"deny`": 8,*" -and - $ContentType -eq "application/json" -and - $Method -eq "Post" - } - } - } -} diff --git a/unit/test/BuildCompleter.Tests.ps1 b/unit/test/BuildCompleter.Tests.ps1 deleted file mode 100644 index c1b473381..000000000 --- a/unit/test/BuildCompleter.Tests.ps1 +++ /dev/null @@ -1,71 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "BuildCompleter" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context "No default project" { - BeforeAll { - Mock _getDefaultProject { return $null } - } - - It "it should return empty list" { - $target = [BuildCompleter]::new() - - $actual = $target.CompleteArgument("Add-VSTeamRelease", "BuildNumber", "", $null, @{ }) - - $actual.count | Should -Be 0 - } - } - - Context "no builds" { - BeforeAll { - Mock _getDefaultProject { return "Test" } - Mock Get-VSTeamBuild { return @() } - } - - It "it should return empty list" { - $target = [BuildCompleter]::new() - - $actual = $target.CompleteArgument($null, $null, "", $null, @{ }) - - $actual.count | Should -Be 0 - } - } - - Context "with builds" { - BeforeAll { - Mock _getDefaultProject { return "DefaultProject" } - $builds = Get-Content "$PSScriptRoot\sampleFiles\get-vsteambuild.json" -Raw | ConvertFrom-Json - Mock Get-VSTeamBuild { $builds.value } - - $target = [BuildCompleter]::new() - } - - It "empty string should return all builds" { - $actual = $target.CompleteArgument($null, $null, "", $null, @{ }) - - $actual.count | Should -Be 15 - Should -Invoke Get-VSTeamBuild -Scope It -Exactly -Times 1 -ParameterFilter { $ProjectName -eq 'DefaultProject' } - } - - It "5 string should return 5 builds" { - # This tests makes sure that even if a default project is set that the projectName parameter - # will be used if passed in. - $actual = $target.CompleteArgument($null, $null, "5", $null, @{ProjectName = "ProjectParameter" }) - - $actual.count | Should -Be 5 - Should -Invoke Get-VSTeamBuild -Scope It -Exactly -Times 1 -ParameterFilter { $ProjectName -eq 'ProjectParameter' } - } - } -} - diff --git a/unit/test/Clear-VSTeamDefaultProject.Tests.ps1 b/unit/test/Clear-VSTeamDefaultProject.Tests.ps1 deleted file mode 100644 index 93f1c2ce9..000000000 --- a/unit/test/Clear-VSTeamDefaultProject.Tests.ps1 +++ /dev/null @@ -1,102 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamDefaultProject' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProcess.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - Context 'Clear-VSTeamDefaultProject on Non Windows' { - BeforeAll { - Mock _isOnWindows { return $false } - } - - AfterAll { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'should clear default project' { - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' - - Clear-VSTeamDefaultProject - - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -BeNullOrEmpty - } - } - - Context 'Clear-VSTeamDefaultProject as Non-Admin on Windows' { - BeforeAll { - Mock _isOnWindows { return $true } - Mock _testAdministrator { return $false } - } - - AfterAll { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'should clear default project' { - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' - - Clear-VSTeamDefaultProject - - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -BeNullOrEmpty - } - } - - Context 'Clear-VSTeamDefaultProject as Admin on Windows' { - BeforeAll { - Mock _isOnWindows { return $true } - Mock _testAdministrator { return $true } - } - - AfterAll { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'should clear default project' { - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'MyProject' - - Clear-VSTeamDefaultProject - - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -BeNullOrEmpty - } - } -} \ No newline at end of file diff --git a/unit/test/Disable-VSTeamAgent.Tests.ps1 b/unit/test/Disable-VSTeamAgent.Tests.ps1 deleted file mode 100644 index 86a08779b..000000000 --- a/unit/test/Disable-VSTeamAgent.Tests.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamAgent' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Disable-VSTeamAgent' { - ## Arrange - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod -ParameterFilter { $Uri -like "*950*" } - Mock Invoke-RestMethod { throw 'boom' } -ParameterFilter { $Uri -like "*101*" } - } - - It 'should throw' { - ## Act / Assert - { Disable-VSTeamAgent -Pool 36 -Id 101 } | Should -Throw - } - - It 'by Id should disable the agent with passed in Id' { - ## Act - Disable-VSTeamAgent -Pool 36 -Id 950 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - # The write-host below is great for seeing how many ways the mock is called. - # Write-Host "Assert Mock $Uri" - $Method -eq 'Patch' -and - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/36/agents/950?api-version=$(_getApiVersion DistributedTask)" - } - } - } -} diff --git a/unit/test/Enable-VSTeamAgent.Tests.ps1 b/unit/test/Enable-VSTeamAgent.Tests.ps1 deleted file mode 100644 index 1c36bc0dd..000000000 --- a/unit/test/Enable-VSTeamAgent.Tests.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamAgent' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Enable-VSTeamAgent' { - ## Arrnage - BeforeAll { - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod -ParameterFilter { $Uri -like "*950*" } - Mock Invoke-RestMethod { throw 'boom' } -ParameterFilter { $Uri -like "*101*" } - } - - It 'by Id should enable the agent with passed in Id' { - ## Act - Enable-VSTeamAgent -Pool 36 -Id 950 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/36/agents/950?api-version=$(_getApiVersion DistributedTask)" - } - } - - It 'should throw' { - ## Act / ## Assert - { Enable-VSTeamAgent -Pool 36 -Id 101 } | Should -Throw - } - } -} diff --git a/unit/test/Get-VSTeamAccessControlList.Tests.ps1 b/unit/test/Get-VSTeamAccessControlList.Tests.ps1 deleted file mode 100644 index 354a3f056..000000000 --- a/unit/test/Get-VSTeamAccessControlList.Tests.ps1 +++ /dev/null @@ -1,109 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamAccessControlList' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAccessControlList.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamDefaultProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - $accessControlListResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlListResult.json" -Raw | ConvertFrom-Json - - $securityNamespace = Get-Content "$PSScriptRoot\sampleFiles\securityNamespace.json" -Raw | ConvertFrom-Json - $securityNamespaceObject = [VSTeamSecurityNamespace]::new($securityNamespace.value[0]) - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - } - Context 'Get-VSTeamAccessControlList' { - BeforeAll { - Mock Invoke-RestMethod { return $accessControlListResult } - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*token=boom*" } - } - - It 'by SecurityNamespaceId should return ACLs' { - ## Arrange - # Even with a default set this URI should not have the project added. - Set-VSTeamDefaultProject -Project Testing - - ## Act - Get-VSTeamAccessControlList -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Token "SomeToken" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/5a27515b-ccd7-42c9-84f1-54c998f03866*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*descriptors=SomeDescriptor*" -and - $Uri -like "*includeExtendedInfo=True*" -and - $Uri -like "*token=SomeToken*" -and - $Uri -like "*recurse=True*" -and - $Method -eq "Get" - } - } - - It 'by SecurityNamespace should return ACLs' { - ## Act - # I use $securityNamespace.value[0] here because using securityNamespaceObject was leading to issues - Get-VSTeamAccessControlList -SecurityNamespace $($securityNamespace.value[0]) -Token "SomeToken" -Descriptors "SomeDescriptor" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*descriptors=SomeDescriptor*" -and - $Uri -like "*token=SomeToken*" -and - $Method -eq "Get" - } - } - - It 'by SecurityNamespace (pipeline) should return ACEs' { - ## Act - $securityNamespaceObject | Get-VSTeamAccessControlList -Token "AcesToken" -Descriptors "AcesDescriptor" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/accesscontrollists/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*descriptors=AcesDescriptor*" -and - $Uri -like "*token=AcesToken*" -and - $Method -eq "Get" - } - } - - It 'by SecurityNamespaceId should throw' { - ## Act / Assert - { Get-VSTeamAccessControlList -SecurityNamespaceId 5a27515b-ccd7-42c9-84f1-54c998f03866 -Token "boom" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse } | Should -Throw - } - - It 'by SecurityNamespace should throw' { - ## Act / Assert - { Get-VSTeamAccessControlList -SecurityNamespace $securityNamespaceObject -Token "boom" -Descriptors "SomeDescriptor" -IncludeExtendedInfo -Recurse } | Should -Throw - } - } -} - - diff --git a/unit/test/Get-VSTeamAgent.Tests.ps1 b/unit/test/Get-VSTeamAgent.Tests.ps1 deleted file mode 100644 index 12d857e32..000000000 --- a/unit/test/Get-VSTeamAgent.Tests.ps1 +++ /dev/null @@ -1,81 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAgent.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamDefaultProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" -} - -Describe 'VSTeamAgent' { - BeforeAll { - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - - $testAgent = Get-Content "$PSScriptRoot\sampleFiles\agentSingleResult.json" -Raw | ConvertFrom-Json - - 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*" } - - # Even with a default set this URI should not have the project added. - Set-VSTeamDefaultProject -Project Testing - } - - Context 'Get-VSTeamAgent' { - BeforeAll { - Mock Invoke-RestMethod { return [PSCustomObject]@{ - count = 1 - value = $testAgent - } - } - - Mock Invoke-RestMethod { return $testAgent } -ParameterFilter { $Uri -like "*101*" } - } - - it 'by pool id should return all the agents' { - ## Act - Get-VSTeamAgent -PoolId 1 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/1/agents?api-version=$(_getApiVersion DistributedTask)" - } - } - - it 'with agent id parameter should return on agent' { - ## Act - Get-VSTeamAgent -PoolId 1 -id 101 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/1/agents/101?api-version=$(_getApiVersion DistributedTask)" - } - } - - it 'PoolID from pipeline by value should return all the agents' { - ## Act - 1 | Get-VSTeamAgent - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/1/agents?api-version=$(_getApiVersion DistributedTask)" - } - } - } -} - diff --git a/unit/test/Get-VSTeamApproval.Tests.ps1 b/unit/test/Get-VSTeamApproval.Tests.ps1 deleted file mode 100644 index 1e4ebcfdc..000000000 --- a/unit/test/Get-VSTeamApproval.Tests.ps1 +++ /dev/null @@ -1,124 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" -} - -Describe 'VSTeamApproval' -Tag 'unit', 'approvals' { - BeforeAll { - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - return @{ - count = 1 - value = @( - @{ - id = 1 - revision = 1 - approver = @{ - id = 'c1f4b9a6-aee1-41f9-a2e0-070a79973ae9' - displayName = 'Test User' - } - } - ) - } - } - } - - Context 'Get-VSTeamApproval' { - Context 'Services' { - It 'should return approvals' { - # Act - Get-VSTeamApproval -projectName project - - # Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It ` - -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/approvals?api-version=$(_getApiVersion Release)" - } - } - - It 'should pass exception to _handleException' { - # Arrange - Mock _handleException -Verifiable - Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Uri -like "*boom*" } - - # Act - Get-VSTeamApproval -ProjectName "boom" - - # Assert - Should -InvokeVerifiable - } - - It 'with AssignedToFilter should return approvals only for value passed into AssignedToFilter' { - # Act - Get-VSTeamApproval -projectName project -AssignedToFilter 'Chuck Reinhart' - - # Assert - # With PowerShell core the order of the query string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # "https://vsrm.dev.azure.com/test/project/_apis/release/approvals/?api-version=$(_getApiVersion Release)&assignedtoFilter=Chuck%20Reinhart&includeMyGroupApprovals=true" - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It ` - -ParameterFilter { - $Uri -like "*https://vsrm.dev.azure.com/test/project/_apis/release/approvals*" -and - $Uri -like "*api-version=$(_getApiVersion Release)*" -and - $Uri -like "*assignedtoFilter=Chuck Reinhart*" -and - $Uri -like "*includeMyGroupApprovals=true*" - } - } - } - - Context 'Server' { - BeforeAll { - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - It 'should return approvals' { - ## Act - Get-VSTeamApproval -projectName project -ReleaseIdsFilter 1 -AssignedToFilter 'Test User' -StatusFilter Pending - - ## Assert - # With PowerShell core the order of the query string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # "http://localhost:8080/tfs/defaultcollection/project/_apis/release/approvals/?api-version=$(_getApiVersion Release)&statusFilter=Pending&assignedtoFilter=Test User&includeMyGroupApprovals=true&releaseIdsFilter=1" - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It ` - -ParameterFilter { - $Uri -like "*http://localhost:8080/tfs/defaultcollection/project/_apis/release/approvals*" -and - $Uri -like "*api-version=$(_getApiVersion Release)*" -and - $Uri -like "*statusFilter=Pending*" -and - $Uri -like "*assignedtoFilter=Test User*" -and - $Uri -like "*includeMyGroupApprovals=true*" -and - $Uri -like "*releaseIdsFilter=1*" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamArea.Tests.ps1 b/unit/test/Get-VSTeamArea.Tests.ps1 deleted file mode 100644 index 9bbebfd9f..000000000 --- a/unit/test/Get-VSTeamArea.Tests.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamClassificationNode" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" -} - -Describe 'Get-VSTeamArea' { - BeforeAll { - $classificationNodeResult = Get-Content "$PSScriptRoot\sampleFiles\classificationNodeResult.json" -Raw | ConvertFrom-Json - - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'simplest call' { - BeforeAll { - Mock Invoke-RestMethod { return $classificationNodeResult } - } - - It 'by path and depth should return areas' { - ## Act - Get-VSTeamArea -ProjectName "Public Demo" -Depth 5 -Path "test/test/test" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas/test/test/test*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$Depth=5*" - } - } - - It 'by Ids and depth should return areas' { - ## Act - Get-VSTeamArea -ProjectName "Public Demo" -Ids @(1, 2, 3, 4) -Depth 5 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*Ids=1,2,3,4*" -and - $Uri -like "*`$Depth=5*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamBuild.Tests.ps1 b/unit/test/Get-VSTeamBuild.Tests.ps1 deleted file mode 100644 index b4576782f..000000000 --- a/unit/test/Get-VSTeamBuild.Tests.ps1 +++ /dev/null @@ -1,101 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" -} - -Describe 'VSTeamBuild' { - BeforeAll { - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - # Sample result of a single build - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\buildSingleResult.json" -Raw | ConvertFrom-Json - - # Sample result for list of builds - $results = Get-Content "$PSScriptRoot\sampleFiles\buildResults.json" -Raw | ConvertFrom-Json - - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*101*" } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } - } - - Context 'Get-VSTeamBuild' { - Context 'Services' { - BeforeAll { - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - } - - It 'with no parameters should return builds' { - ## Act - Get-VSTeamBuild -projectName project - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)" - } - } - - It 'with Top parameter should return top builds' { - ## Act - Get-VSTeamBuild -projectName project -top 1 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds?api-version=$(_getApiVersion Build)&`$top=1" - } - } - - It 'by id should return top builds' { - ## Act - Get-VSTeamBuild -projectName project -id 101 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/101?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Server' { - BeforeAll { - ## Arrange - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - } - - It 'with no parameters on TFS local Auth should return builds' { - ## Act - Get-VSTeamBuild -projectName project - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds?api-version=$(_getApiVersion Build)" - } - } - - It 'should return builds' { - ## Act - Get-VSTeamBuild -projectName project -id 101 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/101?api-version=$(_getApiVersion Build)" } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamBuildArtifact.Tests.ps1 b/unit/test/Get-VSTeamBuildArtifact.Tests.ps1 deleted file mode 100644 index 56f6f66f5..000000000 --- a/unit/test/Get-VSTeamBuildArtifact.Tests.ps1 +++ /dev/null @@ -1,98 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" -} - -Describe 'VSTeamBuildArtifact' { - BeforeAll { - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - } - Context "Get-VSTeamBuildArtifact" { - BeforeAll { - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } - - Mock Invoke-RestMethod { return [PSCustomObject]@{ - value = [PSCustomObject]@{ - id = 150 - name = "Drop" - resource = [PSCustomObject]@{ - type = "filepath" - data = "C:\Test" - properties = [PSCustomObject]@{ } - } - } - } - } -ParameterFilter { - $Uri -like "*1*" - } - - Mock Invoke-RestMethod { return [PSCustomObject]@{ - value = [PSCustomObject]@{ - id = 150 - name = "Drop" - resource = [PSCustomObject]@{ - type = "filepath" - data = "C:\Test" - } - } - } - } -ParameterFilter { - $Uri -like "*2*" - } - } - Context "Services" { - It 'calls correct Url should return the build artifact data' { - ## Act - Get-VSTeamBuildArtifact -projectName project -id 1 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1/artifacts?api-version=$(_getApiVersion Build)" - } - } - - It 'result without properties should return the build artifact data' { - ## Act - Get-VSTeamBuildArtifact -projectName project -id 2 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/2/artifacts?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Server' { - BeforeAll { - ## Arrange - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - It 'calls correct Url on TFS local Auth should return the build artifact data' { - ## Act - Get-VSTeamBuildArtifact -projectName project -id 1 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1/artifacts?api-version=$(_getApiVersion Build)" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Get-VSTeamBuildDefinition.Tests.ps1 deleted file mode 100644 index c18d93461..000000000 --- a/unit/test/Get-VSTeamBuildDefinition.Tests.ps1 +++ /dev/null @@ -1,240 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" -} - -Describe 'VSTeamBuildDefinition' { - Context 'Get-VSTeamBuildDefinition' { - BeforeAll { - $resultsAzD = Get-Content "$PSScriptRoot\sampleFiles\buildDefAzD.json" -Raw | ConvertFrom-Json - $resultsVSTS = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json - $results2017 = Get-Content "$PSScriptRoot\sampleFiles\buildDef2017.json" -Raw | ConvertFrom-Json - $results2018 = Get-Content "$PSScriptRoot\sampleFiles\buildDef2018.json" -Raw | ConvertFrom-Json - - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } - - Mock Invoke-RestMethod { return $results2017 } -ParameterFilter { $Uri -like "*2017Project*" } - Mock Invoke-RestMethod { return $results2018 } -ParameterFilter { $Uri -like "*2018Project*" } - Mock Invoke-RestMethod { return $resultsAzD } -ParameterFilter { $Uri -like "*azd*" } - Mock Invoke-RestMethod { return $resultsVSTS } -ParameterFilter { $Uri -like "*vsts*" } - Mock Invoke-RestMethod { return $resultsVSTS.value } -ParameterFilter { $Uri -like "*101*" } - } - - Context 'Server' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - It 'TFS 2017 with no parameters should return build definitions' { - ## Act - Get-VSTeamBuildDefinition -projectName "2017Project" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*http://localhost:8080/tfs/defaultcollection/2017Project/_apis/build/definitions*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Uri -like "*type=All*" - } - } - - It 'TFS 2018 with no parameters should return build definitions' { - ## Act - Get-VSTeamBuildDefinition -projectName "2018Project" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*http://localhost:8080/tfs/defaultcollection/2018Project/_apis/build/definitions*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Uri -like "*type=All*" - } - } - - It 'by ID local auth should return build definition' { - ## Act - Get-VSTeamBuildDefinition -projectName project -id 101 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Services' { - BeforeAll { - ## Arrange - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - It 'AzD v5.0 of API with no parameters should return build definitions' { - ## Act - Get-VSTeamBuildDefinition -projectName azd - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/azd/_apis/build/definitions*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Uri -like "*type=All*" - } - } - - It 'should return build definitions' { - ## Act - Get-VSTeamBuildDefinition -projectName vsts - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/vsts/_apis/build/definitions*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Uri -like "*type=All*" - } - } - - It 'with type parameter "build" should return build definitions by type' { - ## Arrange - # This has not been supported since version 2.0 of the API which we - # no longer support. https://github.com/DarqueWarrior/vsteam/issues/87 - Mock Write-Warning - - ## Act - Get-VSTeamBuildDefinition -projectName vsts -type build - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/vsts/_apis/build/definitions*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Uri -like "*type=build*" - } - } - - It 'with type parameter "xaml" should return removal warning' { - ## Arrange - # This has not been supported since version 2.0 of the API which we - # no longer support. https://github.com/DarqueWarrior/vsteam/issues/87 - Mock Write-Warning - - Get-VSTeamBuildDefinition -ProjectName vsts -Type xaml - - Should -Invoke Write-Warning -Exactly -Times 1 -Scope It -ParameterFilter { - $Message -eq "You specified -Type xaml. This parameters is ignored and will be removed in future" - } - } - - It 'with filter parameter should return build definitions by filter' { - ## Act - Get-VSTeamBuildDefinition -projectName vsts -filter 'click*' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/vsts/_apis/build/definitions*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Uri -like "*name=click*" -and - $Uri -like "*type=All*" - } - } - - It 'with both parameters should return build definitions by filter' { - ## Arrange - # This has not been supported since version 2.0 of the API which we - # no longer support. https://github.com/DarqueWarrior/vsteam/issues/87 - Mock Write-Warning - - ## Act - Get-VSTeamBuildDefinition -projectName vsts -filter 'click*' -type build - - ## Asset - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/vsts/_apis/build/definitions*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Uri -like "*name=click*" -and - $Uri -like "*type=build*" - } - } - - It 'by id should return build definition' { - ## Act - $b = Get-VSTeamBuildDefinition -projectName project -id 101 - - ## Assert - $b | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'Team.BuildDefinition' - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)" - } - } - - It 'by ID -Raw should return build definition' { - ## Act - $raw = Get-VSTeamBuildDefinition -projectName project -id 101 -Raw - - ## Assert - $raw | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'System.Management.Automation.PSCustomObject' - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)" - } - } - - It 'by ID -Json should return build definition' { - ## Act - $b = Get-VSTeamBuildDefinition -projectName project -id 101 -Json - - ## Assert - $b | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'System.String' - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)" - } - } - - It 'with revision parameter should return build definitions by revision' { - ## Act - Get-VSTeamBuildDefinition -projectName project -id 101 -revision 1 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/101?api-version=$(_getApiVersion Build)&revision=1" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamBuildLog.Tests.ps1 b/unit/test/Get-VSTeamBuildLog.Tests.ps1 deleted file mode 100644 index 6f7f24e48..000000000 --- a/unit/test/Get-VSTeamBuildLog.Tests.ps1 +++ /dev/null @@ -1,97 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" -} - -Describe 'VSTeamBuildLog' { - Context 'Get-VSTeamBuildLog' { - BeforeAll { - ## Arrange - Mock Invoke-RestMethod { return @{ - count = 4 - value = @{ } - } - } - - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } - } - - Context 'Services' { - BeforeAll { - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - It 'with build id should return full log' { - ## Act - Get-VSTeamBuildLog -projectName project -Id 1 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1/logs?api-version=$(_getApiVersion Build)" - } - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1/logs/3?api-version=$(_getApiVersion Build)" - } - } - - It 'with build id and index should return full log' { - ## Act - Get-VSTeamBuildLog -projectName project -Id 1 -Index 2 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1/logs/2?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Server' { - BeforeAll { - ## Arrange - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - It 'with index on TFS local Auth Should return full log' { - ## Act - Get-VSTeamBuildLog -projectName project -Id 1 -Index 2 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1/logs/2?api-version=$(_getApiVersion Build)" - } - } - - It 'on TFS local Auth should return full log' { - ## Act - Get-VSTeamBuildLog -projectName project -Id 1 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1/logs?api-version=$(_getApiVersion Build)" - } - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1/logs/3?api-version=$(_getApiVersion Build)" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamBuildTag.Tests.ps1 b/unit/test/Get-VSTeamBuildTag.Tests.ps1 deleted file mode 100644 index f6b732cbe..000000000 --- a/unit/test/Get-VSTeamBuildTag.Tests.ps1 +++ /dev/null @@ -1,69 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" -} - -Describe 'VSTeamBuildTag' { - BeforeAll { - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' } - - $tags = 'Tag1', 'Tag2' - Mock Invoke-RestMethod { - return @{ value = $tags } - } - } - - Context 'Get-VSTeamBuildTag' { - Context 'Services' { - BeforeAll { - $returndata = Get-VSTeamBuildTag -projectName project -id 2 - } - - It 'should create correct URL.' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" - } - } - - It 'should return correct data.' { - Compare-Object $tags $returndata | Should -Be $null - } - } - - Context 'Server' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - - $returndata = Get-VSTeamBuildTag -projectName project -id 2 - } - - It 'should create correct URL.' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" - } - } - - It 'should return correct data.' { - Compare-Object $tags $returndata | Should -Be $null - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamBuildTimeline.Tests.ps1 b/unit/test/Get-VSTeamBuildTimeline.Tests.ps1 deleted file mode 100644 index 70852a3b3..000000000 --- a/unit/test/Get-VSTeamBuildTimeline.Tests.ps1 +++ /dev/null @@ -1,100 +0,0 @@ -Set-StrictMode -Version Latest - -BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" -} - -Describe 'VSTeamBuildTimeline' { - BeforeAll { - ## Arrnage - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - [VSTeamVersions]::Build = '1.0-unitTest' - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - $buildTimeline = Get-Content "$PSScriptRoot\sampleFiles\buildTimeline.json" -Raw | ConvertFrom-Json - $buildTimelineEmptyRecords = Get-Content "$PSScriptRoot\sampleFiles\buildTimelineEmptyRecords.json" -Raw | ConvertFrom-Json - } - - Context 'Get-VSTeamBuildTimeline by ID' { - BeforeAll { - Mock Invoke-RestMethod { return $buildTimeline } - } - - It 'should get timeline with multiple build IDs' { - Get-VSTeamBuildTimeline -BuildID @(1, 2) -Id 00000000-0000-0000-0000-000000000000 -ProjectName "MyProject" - - Should -Invoke Invoke-RestMethod -Scope It -Times 2 -ParameterFilter { - $Method -eq 'Get' -and - $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/*" -and - ($Uri -like "*builds/1/*" -or $Uri -like "*builds/2/*") - $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and - $Uri -like "*api-version=$([VSTeamVersions]::Build)*" - } - } - - It 'should get timeline with changeId and PlanId' { - Get-VSTeamBuildTimeline -BuildID 1 -Id 00000000-0000-0000-0000-000000000000 -ProjectName "MyProject" -ChangeId 4 -PlanId 00000000-0000-0000-0000-000000000000 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Get' -and - $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/builds/1/*" -and - $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and - $Uri -like "*planId=00000000-0000-0000-0000-000000000000*" -and - $Uri -like "*changeId=4*" -and - $Uri -like "*api-version=$([VSTeamVersions]::Build)*" - } - } - - It 'should get timeline without changeId' { - Get-VSTeamBuildTimeline -BuildID 1 -Id 00000000-0000-0000-0000-000000000000 -ProjectName "MyProject" -PlanId 00000000-0000-0000-0000-000000000000 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Get' -and - $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/builds/1/*" -and - $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and - $Uri -like "*planId=00000000-0000-0000-0000-000000000000*" -and - $Uri -like "*api-version=$([VSTeamVersions]::Build)*" - } - } - - It 'should get timeline without planId' { - Get-VSTeamBuildTimeline -BuildID 1 -Id 00000000-0000-0000-0000-000000000000 -ProjectName "MyProject" -ChangeId 4 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Get' -and - $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/builds/1/*" -and - $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and - $Uri -like "*changeId=4*" -and - $Uri -like "*api-version=$([VSTeamVersions]::Build)*" - } - } - - It 'should get timeline without planId and changeID' { - Get-VSTeamBuildTimeline -BuildID 1 -Id 00000000-0000-0000-0000-000000000000 -ProjectName "MyProject" - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Get' -and - $Uri -like "*https://dev.azure.com/test/MyProject/_apis/build/builds/1/*" -and - $Uri -like "*timeline/00000000-0000-0000-0000-000000000000*" -and - $Uri -like "*api-version=$([VSTeamVersions]::Build)*" - } - } - - It 'should get timeline without records and no exception' { - Mock Invoke-RestMethod { return $buildTimelineEmptyRecords } - - $null = Get-VSTeamBuildTimeline -BuildID 1 -Id 00000000-0000-0000-0000-000000000000 -ProjectName "MyProject" -ChangeId 4 -PlanId 00000000-0000-0000-0000-000000000000 - - { Get-VSTeamBuildTimeline -BuildID 1 -ProjectName "MyProject" } | Should -Not -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamClassificationNode.Tests.ps1 b/unit/test/Get-VSTeamClassificationNode.Tests.ps1 deleted file mode 100644 index 33b595862..000000000 --- a/unit/test/Get-VSTeamClassificationNode.Tests.ps1 +++ /dev/null @@ -1,103 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamClassificationNode' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - $withoutChildNode = Get-Content "$PSScriptRoot\sampleFiles\withoutChildNode.json" -Raw | ConvertFrom-Json - $classificationNodeResult = Get-Content "$PSScriptRoot\sampleFiles\classificationNodeResult.json" -Raw | ConvertFrom-Json - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context 'Get-VSTeamClassificationNode' { - BeforeAll { - Mock Invoke-RestMethod { return $classificationNodeResult } - Mock Invoke-RestMethod { return $withoutChildNode } -ParameterFilter { $Uri -like "*Ids=43,44*" } - } - - It 'with StructureGroup should return Nodes' { - ## Act - Get-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup "Iterations" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/Iterations*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'with depth should return Nodes' { - ## Act - Get-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup "Iterations" -Depth 10 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/Iterations*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$Depth=10*" - } - } - - It 'by Path should return Nodes' { - ## Act - Get-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup "Iterations" -Path "test/test/test" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/Iterations/test/test/test*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'by ids should return Nodes' { - ## Act - Get-VSTeamClassificationNode -ProjectName "Public Demo" -Ids @(1, 2, 3, 4) - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*Ids=1,2,3,4*" - } - } - - It 'should handle when there is no child nodes' { - ## Act - Get-VSTeamClassificationNode -ProjectName "Public Demo" -Ids @(43, 44) - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*Ids=43,44*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamCloudSubscription.Tests.ps1 b/unit/test/Get-VSTeamCloudSubscription.Tests.ps1 deleted file mode 100644 index 1903b1418..000000000 --- a/unit/test/Get-VSTeamCloudSubscription.Tests.ps1 +++ /dev/null @@ -1,54 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamCloudSubscription' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Get-VSTeamCloudSubscription' { - BeforeAll { - Mock Invoke-RestMethod { return @{value = 'subs' } } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context 'Services' { - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - It 'should return all AzureRM Subscriptions' { - Get-VSTeamCloudSubscription - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointproxy/azurermsubscriptions?api-version=$(_getApiVersion DistributedTask)" - } - } - } - - Context 'Server' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - It 'should return all AzureRM Subscriptions' { - Get-VSTeamCloudSubscription - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/serviceendpointproxy/azurermsubscriptions?api-version=$(_getApiVersion DistributedTask)" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamDescriptor.Tests.ps1 b/unit/test/Get-VSTeamDescriptor.Tests.ps1 deleted file mode 100644 index d1b00e9d6..000000000 --- a/unit/test/Get-VSTeamDescriptor.Tests.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamDescriptor" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDescriptor.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - - ## Arrange - $result = Get-Content "$PSScriptRoot\sampleFiles\descriptor.scope.TestProject.json" -Raw | ConvertFrom-Json - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context 'Get-VSTeamDescriptor' { - Context 'Services' { - BeforeAll { - ## Arrange - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _supportsGraph - - Mock Invoke-RestMethod { return $result } - } - - It 'by StorageKey Should return groups' { - ## Act - Get-VSTeamDescriptor -StorageKey '010d06f0-00d5-472a-bb47-58947c230876' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://vssps.dev.azure.com/test/_apis/graph/descriptors/010d06f0-00d5-472a-bb47-58947c230876?api-version=$(_getApiVersion Graph)" - } - } - } - - Context 'Server' { - BeforeAll { - ## Arrange - # TFS 2017 does not support this feature - Mock _callAPI { throw 'Should not be called' } -Verifiable - - # It is not supported on 2017 - Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Graph' } - } - - It 'Should throw' { - ## Act / Assert - { Get-VSTeamDescriptor -StorageKey '010d06f0-00d5-472a-bb47-58947c230876' } | Should -Throw - } - - It '_callAPI should not be called' { - Should -Invoke _callAPI -Exactly 0 - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamExtension.Tests.ps1 b/unit/test/Get-VSTeamExtension.Tests.ps1 deleted file mode 100644 index 36c4ab203..000000000 --- a/unit/test/Get-VSTeamExtension.Tests.ps1 +++ /dev/null @@ -1,77 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamExtension' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamInstallState.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamExtension.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ExtensionsManagement' } - - $results = Get-Content "$PSScriptRoot\sampleFiles\extensionResults.json" -Raw | ConvertFrom-Json - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\singleExtensionResult.json" -Raw | ConvertFrom-Json - } - - Context 'Get-VSTeamExtension' { - BeforeAll { - ## Arrange - $env:Team_TOKEN = '1234' - - Mock _callAPI { return $results } - Mock _callAPI { return $singleResult } -ParameterFilter { $id -eq "test/test" } - } - - AfterAll { - $env:TEAM_TOKEN = $null - } - - It 'Should return extensions' { - ## Act - Get-VSTeamExtension - - ## Assert - Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { - $subDomain -eq 'extmgmt' -and - $area -eq 'extensionmanagement' -and - $resource -eq 'installedextensions' -and - $version -eq $(_getApiVersion ExtensionsManagement) - } - } - - It 'Should return extensions with optional parameters' { - ## Act - Get-VSTeamExtension -IncludeInstallationIssues -IncludeDisabledExtensions -IncludeErrors - - ## Assert - Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { - $subDomain -eq 'extmgmt' -and - $area -eq 'extensionmanagement' -and - $resource -eq 'installedextensions' -and - $version -eq $(_getApiVersion ExtensionsManagement) - } - } - - It 'Should return the extension' { - ## Act - Get-VSTeamExtension -PublisherId test -ExtensionId test - - ## Assert - Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { - $id -eq 'test/test' -and - $subDomain -eq 'extmgmt' -and - $area -eq 'extensionmanagement' -and - $resource -eq 'installedextensionsbyname' -and - $version -eq $(_getApiVersion ExtensionsManagement) - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamFeed.Tests.ps1 b/unit/test/Get-VSTeamFeed.Tests.ps1 deleted file mode 100644 index a0a2f0010..000000000 --- a/unit/test/Get-VSTeamFeed.Tests.ps1 +++ /dev/null @@ -1,51 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamFeed' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Get-VSTeamFeed' { - 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 '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)" - } - } - - it 'by id should return one feed' { - ## Act - Get-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' - - ## 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)" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamGitCommit.Tests.ps1 b/unit/test/Get-VSTeamGitCommit.Tests.ps1 deleted file mode 100644 index 0b465cb38..000000000 --- a/unit/test/Get-VSTeamGitCommit.Tests.ps1 +++ /dev/null @@ -1,92 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamGitCommit" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitUserDate.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitCommitRef.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - $results = Get-Content "$PSScriptRoot\sampleFiles\gitCommitResults.json" -Raw | ConvertFrom-Json - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } - } - - Context 'Get-VSTeamGitCommit' { - BeforeAll { - Mock Invoke-RestMethod { return $results } - } - - It 'should return all commits for the repo' { - Get-VSTeamGitCommit -ProjectName Test -RepositoryId 06E176BE-D3D2-41C2-AB34-5F4D79AEC86B - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" - } - } - - It 'with many Parameters should return all commits for the repo' { - Get-VSTeamGitCommit -ProjectName Test -RepositoryId '06E176BE-D3D2-41C2-AB34-5F4D79AEC86B' ` - -FromDate '2020-01-01' -ToDate '2020-03-01' ` - -ItemVersionVersionType 'commit' -ItemVersionVersion 'abcdef1234567890abcdef1234567890' -ItemVersionVersionOptions 'previousChange' ` - -CompareVersionVersionType 'commit' -CompareVersionVersion 'abcdef1234567890abcdef1234567890' -CompareVersionVersionOptions 'previousChange' ` - -FromCommitId 'abcdef' -ToCommitId 'fedcba' ` - -Author "Test" ` - -Top 100 -Skip 50 ` - -User "Test" - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" -and - $Uri -like "*searchCriteria.fromDate=2020-01-01T00:00:00Z*" -and - $Uri -like "*searchCriteria.toDate=2020-03-01T00:00:00Z*" -and - $Uri -like "*searchCriteria.itemVersion.versionType=commit*" -and - $Uri -like "*searchCriteria.itemVersion.version=abcdef1234567890abcdef1234567890*" -and - $Uri -like "*searchCriteria.itemVersion.versionOptions=previousChange*" -and - $Uri -like "*searchCriteria.compareVersion.versionType=commit*" -and - $Uri -like "*searchCriteria.compareVersion.version=abcdef1234567890abcdef1234567890*" -and - $Uri -like "*searchCriteria.compareVersion.versionOptions=previousChange*" -and - $Uri -like "*searchCriteria.fromCommitId=abcdef*" -and - $Uri -like "*searchCriteria.toCommitId=fedcba*" -and - $Uri -like "*searchCriteria.author=Test*" -and - $Uri -like "*searchCriteria.user=Test*" -and - $Uri -like "*searchCriteria.`$top=100*" -and - $Uri -like "*searchCriteria.`$skip=50*" - } - } - - It 'with ItemPath parameters should return all commits for the repo' { - Get-VSTeamGitCommit -ProjectName Test -RepositoryId '06E176BE-D3D2-41C2-AB34-5F4D79AEC86B' ` - -ItemPath 'test' ` - -ExcludeDeletes ` - -HistoryMode 'fullHistory' ` - -Top 100 -Skip 50 ` - -User "Test" - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*repositories/06E176BE-D3D2-41C2-AB34-5F4D79AEC86B/commits*" -and - $Uri -like "*searchCriteria.itemPath=test*" -and - $Uri -like "*searchCriteria.excludeDeletes=true*" -and - $Uri -like "*searchCriteria.historyMode=fullHistory*" -and - $Uri -like "*searchCriteria.`$top=100*" -and - $Uri -like "*searchCriteria.`$skip=50*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamGitRef.Tests.ps1 b/unit/test/Get-VSTeamGitRef.Tests.ps1 deleted file mode 100644 index 0755088db..000000000 --- a/unit/test/Get-VSTeamGitRef.Tests.ps1 +++ /dev/null @@ -1,120 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamGitRef" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRef.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } - - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ - objectId = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - creator = [PSCustomObject]@{ - displayName = 'Microsoft.VisualStudio.Services.TFS' - id = '1' - uniqueName = 'some@email.com' - } - } - } - - # 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 } - Mock Invoke-RestMethod { throw [System.Net.WebException] "Test Exception." } -ParameterFilter { - $Uri -like "*00000000-0000-0000-0000-000000000001*" - } - } - - Context 'Get-VSTeamGitRef' { - It 'Should return a single ref by id' { - ## Act - Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/Test/_apis/git/repositories/00000000-0000-0000-0000-000000000000/refs?api-version=$(_getApiVersion Git)" - } - } - - It 'with Filter should return a single ref with filter' { - ## Act - Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -Filter "refs/heads" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*filter=refs*" - } - } - - It 'with FilterContains should return a single ref' { - ## Act - Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -FilterContains "test" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*filterContains=test" - } - } - - It 'Should return a single ref' { - ## Act - Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -Top 100 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*`$top=100" - } - } - - It 'with ContinuationToken should return a single ref' { - ## Act - Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -ContinuationToken "myToken" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*continuationToken=myToken" - } - } - - It 'with Filter, FilterContains, Top should return a single ref' { - ## Act - Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -Filter "/refs/heads" -FilterContains "test" -Top 500 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "*filter=/refs/heads*" -and - $Uri -like "*`$top=500*" -and - $Uri -like "*filterContains=test*" - } - } - - It 'by id throws should return a single repo by id' { - ## Act / Assert - { Get-VSTeamGitRef -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000001 } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamGitRepository.Tests.ps1 b/unit/test/Get-VSTeamGitRepository.Tests.ps1 deleted file mode 100644 index 998e60a48..000000000 --- a/unit/test/Get-VSTeamGitRepository.Tests.ps1 +++ /dev/null @@ -1,208 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamGitRepository" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/Clear-VSTeamDefaultProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ - id = '' - url = '' - sshUrl = '' - remoteUrl = '' - defaultBranch = '' - size = 0 - name = '' - project = [PSCustomObject]@{ - name = 'Project' - id = 1 - description = '' - url = '' - state = '' - revision = '' - visibility = '' - } - } - } - - $singleResult = [PSCustomObject]@{ - id = '' - url = '' - sshUrl = '' - remoteUrl = '' - defaultBranch = '' - size = 0 - name = '' - project = [PSCustomObject]@{ - name = 'Project' - id = 1 - description = '' - url = '' - state = '' - revision = '' - visibility = '' - } - } - - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Git' } - - ## If you don't call this and there is a default project in scope - ## these tests will fail. The API can be called with or without - ## a project and these tests are written to test without one. - Clear-VSTeamDefaultProject - - Mock Invoke-RestMethod { - # Write-Host "results $Uri" - return $results } - Mock Invoke-RestMethod { - # Write-Host "Single $Uri" - return $singleResult } -ParameterFilter { - $Uri -like "*00000000-0000-0000-0000-000000000000*" -or - $Uri -like "*testRepo*" - } - Mock Invoke-RestMethod { - # Write-Host "boom $Uri" - throw [System.Net.WebException] } -ParameterFilter { - $Uri -like "*00000000-0000-0000-0000-000000000101*" -or - $Uri -like "*boom*" - } - } - - Context 'Get-VSTeamGitRepository' { - Context 'Services' { - BeforeAll { - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - It 'no parameters should return all repos for all projects' { - ## Act - Get-VSTeamGitRepository - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/git/repositories?api-version=$(_getApiVersion Git)" - } - } - - It 'by Id should return a single repo by id' { - ## Act - Get-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000000 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)" - } - } - - It 'by name should return a single repo by name' { - ## Act - Get-VSTeamGitRepository -Name 'testRepo' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/git/repositories/testRepo?api-version=$(_getApiVersion Git)" - } - } - - It 'by id should throw' { - ## Act / Assert - { Get-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000101 } | Should -Throw - } - - It 'by name should throw' { - ## Act / Assert - { Get-VSTeamGitRepository -Name 'boom' } | Should -Throw - } - } - - Context 'Server' { - BeforeAll { - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - - Mock _useWindowsAuthenticationOnPremise { return $true } - } - - It 'no parameters Should return Git repo' { - ## Act - Get-VSTeamGitRepository - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/git/repositories?api-version=$(_getApiVersion Git)" - } - } - - It 'by Id should return a single repo by id' { - ## Act - Get-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000000 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)" - } - } - - It 'by name should return a single repo by name' { - ## Act - Get-VSTeamGitRepository -Name 'testRepo' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/git/repositories/testRepo?api-version=$(_getApiVersion Git)" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamGitStat.Tests.ps1 b/unit/test/Get-VSTeamGitStat.Tests.ps1 deleted file mode 100644 index feb9d281a..000000000 --- a/unit/test/Get-VSTeamGitStat.Tests.ps1 +++ /dev/null @@ -1,90 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "TeamGitStat" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Make sure the project name is valid. By returning an empty array - # all project names are valid. Otherwise, you name you pass for the - # project in your commands must appear in the list. - Mock _getProjects { return @() } - - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\gitStatSingleResult.json" -Raw | ConvertFrom-Json - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod { return $singleResult } - } - - Context 'Get-VSTeamGitStat' { - It 'should return multiple results' { - ## Act - Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*/Test/*" -and - $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" - } - } - - It 'by branch name should return multiple results' { - ## Act - Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName develop - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*/Test/*" -and - $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and - $Uri -like "*name=develop*" - } - } - - It 'by tag should return multiple results' { - ## Act - Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName "develop" -VersionType "tag" -Version "test" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*/Test/*" -and - $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and - $Uri -like "*baseVersionDescriptor.versionType=tag*" -and - $Uri -like "*baseVersionDescriptor.version=test*" - } - } - - It 'by tag with options should return multiple results' { - ## Act - Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -BranchName "develop" -VersionType "tag" -Version "test" -VersionOptions previousChange - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*/Test/*" -and - $Uri -like "*repositories/00000000-0000-0000-0000-000000000000/stats/branches*" -and - $Uri -like "*baseVersionDescriptor.versionType=tag*" -and - $Uri -like "*baseVersionDescriptor.version=test*" -and - $Uri -like "*baseVersionDescriptor.versionOptions=previousChange*" - } - } - - It 'by commit should throw because of invalid parameters' { - ## Act / Assert - { Get-VSTeamGitStat -ProjectName Test -RepositoryId 00000000-0000-0000-0000-000000000000 -VersionType commit -Version '' } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamGroup.Tests.ps1 b/unit/test/Get-VSTeamGroup.Tests.ps1 deleted file mode 100644 index b29fd55dc..000000000 --- a/unit/test/Get-VSTeamGroup.Tests.ps1 +++ /dev/null @@ -1,147 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamGroup" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGroup.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDescriptor.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamDescriptor.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Get-VSTeamGroup' { - Context 'Services' { - BeforeAll { - $groupListResult = Get-Content "$PSScriptRoot\sampleFiles\groups.json" -Raw | ConvertFrom-Json - $projectResult = Get-Content "$PSScriptRoot\sampleFiles\projectResult.json" -Raw | ConvertFrom-Json - $groupSingleResult = Get-Content "$PSScriptRoot\sampleFiles\groupsSingle.json" -Raw | ConvertFrom-Json - $scopeResult = Get-Content "$PSScriptRoot\sampleFiles\descriptor.scope.TestProject.json" -Raw | ConvertFrom-Json - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - Mock _supportsGraph - - Mock Invoke-RestMethod { return $groupListResult } - } - - It 'by project should return groups' { - Mock Get-VSTeamProject { return $projectResult } -Verifiable - Mock Get-VSTeamDescriptor { return [VSTeamDescriptor]::new($scopeResult) } -Verifiable - - Get-VSTeamGroup -ProjectName "Test Project Public" - - # With PowerShell core the order of the query string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # "https://vssps.dev.azure.com/test/_apis/graph/groups?api-version=$(_getApiVersion Graph)&scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2" - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" -and - $Uri -like "*scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2*" - } - } - - It 'by scopeDescriptor should return groups' { - Get-VSTeamGroup -ScopeDescriptor scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2 - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" -and - $Uri -like "*scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2*" - } - } - - It 'by subjectTypes should return groups' { - Get-VSTeamGroup -SubjectTypes vssgp, aadgp - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" -and - $Uri -like "*subjectTypes=vssgp,aadgp*" - } - } - - It 'by subjectTypes and scopeDescriptor should return groups' { - Get-VSTeamGroup -ScopeDescriptor scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2 -SubjectTypes vssgp, aadgp - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" -and - $Uri -like "*subjectTypes=vssgp,aadgp*" -and - $Uri -like "*scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2*" - } - } - - It 'by descriptor should return the group' { - Mock Invoke-RestMethod { return $groupSingleResult } -Verifiable - - Get-VSTeamGroup -GroupDescriptor 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/groups/vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" - } - } - - It 'Should throw' { - Mock Invoke-RestMethod { throw 'Error' } - { Get-VSTeamGroup -ProjectName Demo } | Should -Throw - } - - It 'Should throw' { - Mock Invoke-RestMethod { throw 'Error' } - { Get-VSTeamGroup -GroupDescriptor } | Should -Throw - } - } - } - - Context 'Server' { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - Mock _callAPI - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - # if you don't _callAPI will be called for this an throw off the count - # below. - Mock _getProjects { return @() } - - Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Graph' } - - # The Graph API is not supported on TFS - Mock _supportsGraph { throw 'This account does not support the graph API.' } - } - - It 'Should throw' { - { Get-VSTeamGroup } | Should -Throw - } - - It '_callAPI should not be called' { - Should -Invoke _callAPI -Exactly -Times 0 -Scope Context - } - } -} - diff --git a/unit/test/Get-VSTeamInfo.Tests.ps1 b/unit/test/Get-VSTeamInfo.Tests.ps1 deleted file mode 100644 index 9aa1b4d96..000000000 --- a/unit/test/Get-VSTeamInfo.Tests.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamInfo' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Get-VSTeamInfo' { - AfterAll { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'should return account and default project' { - [VSTeamVersions]::Account = "mydemos" - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'TestProject' - - ## Act - $info = Get-VSTeamInfo - - ## Assert - $info.Account | Should -Be "mydemos" - $info.DefaultProject | Should -Be "TestProject" - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamIteration.Tests.ps1 b/unit/test/Get-VSTeamIteration.Tests.ps1 deleted file mode 100644 index 94bccf054..000000000 --- a/unit/test/Get-VSTeamIteration.Tests.ps1 +++ /dev/null @@ -1,63 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamIteration' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamClassificationNode" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $withoutChildNode = Get-Content "$PSScriptRoot\sampleFiles\withoutChildNode.json" -Raw | ConvertFrom-Json - $classificationNodeResult = Get-Content "$PSScriptRoot\sampleFiles\classificationNodeResult.json" -Raw | ConvertFrom-Json - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context 'Get-VSTeamIteration' { - BeforeAll { - Mock Invoke-RestMethod { return $classificationNodeResult } - Mock Invoke-RestMethod { return $withoutChildNode } -ParameterFilter { $Uri -like "*Ids=43,44*" } - } - - It 'by path and depth should return iterations' { - ## Act - Get-VSTeamIteration -ProjectName "Public Demo" -Depth 5 -Path "test/test/test" - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/Iterations/test/test/test*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$Depth=5*" - } - } - - It 'by ids and depth should return iterations' { - ## Act - Get-VSTeamIteration -ProjectName "Public Demo" -Ids @(1, 2, 3, 4) -Depth 5 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*Ids=1,2,3,4*" -and - $Uri -like "*`$Depth=5*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamJobRequest.Tests.ps1 b/unit/test/Get-VSTeamJobRequest.Tests.ps1 deleted file mode 100644 index 4f9791493..000000000 --- a/unit/test/Get-VSTeamJobRequest.Tests.ps1 +++ /dev/null @@ -1,91 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "Get-VSTeamJobRequest" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamJobRequest.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - $resultsAzD = Get-Content "$PSScriptRoot/sampleFiles/jobrequestsAzD.json" -Raw | ConvertFrom-Json - $results2017 = Get-Content "$PSScriptRoot/sampleFiles/jobrequests2017.json" -Raw | ConvertFrom-Json - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - } - - Context "Server" { - BeforeAll { - ## Arrnage - Mock Invoke-RestMethod { return $results2017 } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - It "return all jobs" { - ## Act - Get-VSTeamJobRequest -PoolId 5 -AgentID 4 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/pools/5/jobrequests*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentid=4*" - } - } - - It "return 2 jobs" { - # This should stop the call to cache projects - Mock _hasProjectCacheExpired { return $false } - - Get-VSTeamJobRequest -PoolId 5 -AgentID 4 -completedRequestCount 2 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*http://localhost:8080/tfs/defaultcollection/_apis/distributedtask/pools/5/jobrequests*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentid=4*" -and - $Uri -like "*completedRequestCount=2*" - } - } - } - - Context "Services" { - BeforeAll { - Mock Invoke-RestMethod { return $resultsAzD } - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - It "return all jobs" { - # This should stop the call to cache projects - Mock _hasProjectCacheExpired { return $false } - - Get-VSTeamJobRequest -PoolId 5 -AgentID 4 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/5/jobrequests*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentid=4*" - } - } - - It "return 2 jobs" { - # This should stop the call to cache projects - Mock _hasProjectCacheExpired { return $false } - - Get-VSTeamJobRequest -PoolId 5 -AgentID 4 -completedRequestCount 2 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/5/jobrequests*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentid=4*" -and - $Uri -like "*completedRequestCount=2*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamMember.Tests.ps1 b/unit/test/Get-VSTeamMember.Tests.ps1 deleted file mode 100644 index 65e43be21..000000000 --- a/unit/test/Get-VSTeamMember.Tests.ps1 +++ /dev/null @@ -1,112 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamMember" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Get-VSTeamMember for specific project and team' { - BeforeAll { - Mock Invoke-RestMethod { return @{value = 'teams' } } - } - - It 'Should return teammembers' { - Get-VSTeamMember -ProjectName TestProject -TeamId TestTeam - # Make sure it was called with the correct URI - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members?api-version=$(_getApiVersion Core)" - } - } - } - - Context 'Get-VSTeamMember for specific project and team, with top' { - BeforeAll { - Mock Invoke-RestMethod { return @{value = 'teams' } } - } - - It 'Should return teammembers' { - Get-VSTeamMember -ProjectName TestProject -TeamId TestTeam -Top 10 - # Make sure it was called with the correct URI - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$top=10*" - } - } - } - - Context 'Get-VSTeamMember for specific project and team, with skip' { - BeforeAll { - Mock Invoke-RestMethod { return @{value = 'teams' } } - } - - It 'Should return teammembers' { - Get-VSTeamMember -ProjectName TestProject -TeamId TestTeam -Skip 5 - # Make sure it was called with the correct URI - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$skip=5*" - } - } - } - - Context 'Get-VSTeamMember for specific project and team, with top and skip' { - BeforeAll { - Mock Invoke-RestMethod { return @{value = 'teams' } } - } - - It 'Should return teammembers' { - Get-VSTeamMember -ProjectName TestProject -TeamId TestTeam -Top 10 -Skip 5 - # Make sure it was called with the correct URI - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$top=10*" -and - $Uri -like "*`$skip=5*" - } - } - } - - Context 'Get-VSTeamMember for specific team, fed through pipeline' { - BeforeAll { - Mock Invoke-RestMethod { return @{value = 'teammembers' } } - } - - It 'Should return teammembers' { - New-Object -TypeName PSObject -Prop @{projectname = "TestProject"; name = "TestTeam" } | Get-VSTeamMember - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam/members?api-version=$(_getApiVersion Core)" - } - } - } - - # Must be last because it sets [VSTeamVersions]::Account to $null - Context '_buildURL handles exception' { - BeforeAll { - - # Arrange - [VSTeamVersions]::Account = $null - } - - It 'should return approvals' { - - # Act - { _buildURL -ProjectName project -TeamId 1 } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamMembership.Tests.ps1 b/unit/test/Get-VSTeamMembership.Tests.ps1 deleted file mode 100644 index 73d6cad8d..000000000 --- a/unit/test/Get-VSTeamMembership.Tests.ps1 +++ /dev/null @@ -1,56 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamMembership' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/callMembershipAPI.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # You have to set the version or the api-version will not be added when [VSTeamVersions]::Graph = '' - Mock _supportsGraph - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - - $UserDescriptor = 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' - $GroupDescriptor = 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' - } - - Context 'Get-VSTeamMembership' { - It "for member should get a container's members" { - ## Act - $null = Get-VSTeamMembership -MemberDescriptor $UserDescriptor - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Get" -and - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$MemberDescriptor*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" - } - } - - It "for Group should get a container's members" { - ## Act - $null = Get-VSTeamMembership -ContainerDescriptor $GroupDescriptor - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Get" -and - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$GroupDescriptor*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" -and - $Uri -like "*direction=Down*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamOption.Tests.ps1 b/unit/test/Get-VSTeamOption.Tests.ps1 deleted file mode 100644 index c42f63694..000000000 --- a/unit/test/Get-VSTeamOption.Tests.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamOption' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Get-VSTeamOption' { - BeforeAll { - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - Mock Invoke-RestMethod { return @{ - count = 1 - value = @( - @{ - id = '5e8a8081-3851-4626-b677-9891cc04102e' - area = 'git' - resourceName = 'annotatedTags' - } - ) - } - } - } - - It 'Should return all options' { - ## Act - Get-VSTeamOption | Should -Not -Be $null - - ## Assert - Should -Invoke Invoke-RestMethod -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis" - } - } - - It 'Should return release options' { - ## Act - Get-VSTeamOption -subDomain vsrm | Should -Not -Be $null - - ## Assert - Should -Invoke Invoke-RestMethod -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/_apis" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamPermissionInheritance.Tests.ps1 b/unit/test/Get-VSTeamPermissionInheritance.Tests.ps1 deleted file mode 100644 index 416b4b498..000000000 --- a/unit/test/Get-VSTeamPermissionInheritance.Tests.ps1 +++ /dev/null @@ -1,97 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPermissionInheritance' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPermissionInheritance.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamReleaseDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamAccessControlList.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\projectResult.json" -Raw | ConvertFrom-Json - $buildDefresults = Get-Content "$PSScriptRoot\sampleFiles\buildDefAzD.json" -Raw | ConvertFrom-Json - $gitRepoResult = Get-Content "$PSScriptRoot\sampleFiles\singleGitRepo.json" -Raw | ConvertFrom-Json - $releaseDefresults = Get-Content "$PSScriptRoot\sampleFiles\releaseDefAzD.json" -Raw | ConvertFrom-Json - $buildDefHierarchyResults = Get-Content "$PSScriptRoot\sampleFiles\buildDefHierarchyQuery.json" -Raw | ConvertFrom-Json - $accesscontrollistsResult = Get-Content "$PSScriptRoot\sampleFiles\repoAccesscontrollists.json" -Raw | ConvertFrom-Json - $releaseDefHierarchyResults = Get-Content "$PSScriptRoot\sampleFiles\releaseDefHierarchyQuery.json" -Raw | ConvertFrom-Json - } - - Context 'Get-VSTeamPermissionInheritance' { - BeforeAll { - ## Arrange - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { - $Service -eq 'Build' -or - $Service -eq 'Release' -or - $Service -eq 'Git' - } - Mock _hasProjectCacheExpired { return $false } - - Mock Get-VSTeamProject { return $singleResult } - Mock Get-VSTeamGitRepository { return $gitRepoResult } - Mock Get-VSTeamBuildDefinition { return $buildDefresults.value } - Mock Get-VSTeamReleaseDefinition { return $releaseDefresults.value } - Mock Get-VSTeamAccessControlList { return $accesscontrollistsResult.value } - Mock Invoke-RestMethod { return $releaseDefHierarchyResults } -ParameterFilter { - $Body -like '*c788c23e-1b46-4162-8f5e-d7585343b5de*' - } - Mock Invoke-RestMethod { return $buildDefHierarchyResults } -ParameterFilter { - $Body -like '*010d06f0-00d5-472a-bb47-58947c230876/1432*' - } - } - - It 'buildDef should return true' { - ## Act - $actual = Get-VSTeamPermissionInheritance -projectName Project -Name dynamTest-Docker-CI -resourceType BuildDefinition - - ## Assert - $actual | Should -Be $true - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '*010d06f0-00d5-472a-bb47-58947c230876/1432*' -and - $Body -like '*33344d9c-fc72-4d6f-aba5-fa317101a7e9*' -and - $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/Project/010d06f0-00d5-472a-bb47-58947c230876*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" - } - } - - It 'releaseDef should return true' { - ## Act - Get-VSTeamPermissionInheritance -projectName project -Name PTracker-CD -resourceType ReleaseDefinition | Should -Be $true - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '*c788c23e-1b46-4162-8f5e-d7585343b5de*' -and - $Body -like '*010d06f0-00d5-472a-bb47-58947c230876//2*' -and - $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/project/010d06f0-00d5-472a-bb47-58947c230876*" -and - $Uri -like "*api-version=$(_getApiVersion Release)*" - } - } - - It 'repository should return true' { - ## Act - Get-VSTeamPermissionInheritance -projectName project -Name project -resourceType Repository | Should -Be $true - - ## Assert - Should -Invoke Get-VSTeamAccessControlList -Exactly -Scope It -Times 1 - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamPolicy.Tests.ps1 b/unit/test/Get-VSTeamPolicy.Tests.ps1 deleted file mode 100644 index 4436dcf7b..000000000 --- a/unit/test/Get-VSTeamPolicy.Tests.ps1 +++ /dev/null @@ -1,60 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPolicy' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ } - } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } - } - - Context 'Get-VSTeamPolicy' { - It 'by project should return policies' { - ## Act - Get-VSTeamPolicy -ProjectName Demo - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations?api-version=$(_getApiVersion Git)" - } - } - - It 'by project and id should return the policy' { - ## Act - Get-VSTeamPolicy -ProjectName Demo -Id 4 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations/4?api-version=$(_getApiVersion Git)" - } - } - - It 'by project should throw' { - ## Act / Assert - { Get-VSTeamPolicy -ProjectName boom } | Should -Throw - } - - It 'by project and id throws should throw' { - ## Act / Assert - { Get-VSTeamPolicy -ProjectName boom -Id 4 } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamPolicyType.Tests.ps1 b/unit/test/Get-VSTeamPolicyType.Tests.ps1 deleted file mode 100644 index 31e8b383e..000000000 --- a/unit/test/Get-VSTeamPolicyType.Tests.ps1 +++ /dev/null @@ -1,64 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamPolicyType" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrnage - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Policy' } - - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ } - } - - $singleResult = [PSCustomObject]@{ } - - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*90a51335-0c53-4a5f-b6ce-d9aff3ea60e0*" } - } - - Context 'Get-VSTeamPolicyType' { - It 'by project should return policies' { - ## Act - Get-VSTeamPolicyType -ProjectName Demo - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/types?api-version=$(_getApiVersion Policy)" - } - } - - It 'by project throws should throw' { - ## Act / Assert - { Get-VSTeamPolicyType -ProjectName boom } | Should -Throw - } - - It 'Should return policies' { - ## Act - Get-VSTeamPolicyType -ProjectName Demo -id 90a51335-0c53-4a5f-b6ce-d9aff3ea60e0 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/types/90a51335-0c53-4a5f-b6ce-d9aff3ea60e0?api-version=$(_getApiVersion Policy)" - } - } - - It 'Should return policies' { - ## Act / Assert - { Get-VSTeamPolicyType -ProjectName boom -id 90a51335-0c53-4a5f-b6ce-d9aff3ea60e1 } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamPool.Tests.ps1 b/unit/test/Get-VSTeamPool.Tests.ps1 deleted file mode 100644 index 48c119812..000000000 --- a/unit/test/Get-VSTeamPool.Tests.ps1 +++ /dev/null @@ -1,95 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPool' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _hasProjectCacheExpired { return $false } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - - $hostedPool = [PSCustomObject]@{ - owner = [PSCustomObject]@{ - displayName = 'Test User' - id = '1' - uniqueName = 'test@email.com' - } - createdBy = [PSCustomObject]@{ - displayName = 'Test User' - id = '1' - uniqueName = 'test@email.com' - } - id = 1 - size = 1 - isHosted = $true - Name = 'Hosted' - } - - $privatePool = [PSCustomObject]@{ - owner = [PSCustomObject]@{ - displayName = 'Test User' - id = '1' - uniqueName = 'test@email.com' - } - createdBy = [PSCustomObject]@{ - displayName = 'Test User' - id = '1' - uniqueName = 'test@email.com' - } - id = 1 - size = 1 - isHosted = $false - Name = 'Default' - } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - } - - Context 'Get-VSTeamPool with no parameters' { - BeforeAll { - Mock Invoke-RestMethod { return [PSCustomObject]@{ - count = 1 - value = $privatePool - } - } - - Mock Invoke-RestMethod { return $hostedPool } -ParameterFilter { $Uri -like "*101*" } - } - - it 'with no parameters should return all the pools' { - ## Act - Get-VSTeamPool - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools?api-version=$(_getApiVersion DistributedTask)" - } - } - - it 'with id parameter should return all the pools' { - ## Act - Get-VSTeamPool -id 101 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/101?api-version=$(_getApiVersion DistributedTask)" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamProcess.Tests.ps1 b/unit/test/Get-VSTeamProcess.Tests.ps1 deleted file mode 100644 index b55ffb822..000000000 --- a/unit/test/Get-VSTeamProcess.Tests.ps1 +++ /dev/null @@ -1,146 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProcess' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProcessTemplateCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProcessValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getProjects { return @() } - Mock _hasProjectCacheExpired { return $true } - Mock _hasProcessTemplateCacheExpired { return $true } - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Processes' } - - # 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 = '' - typeid = '123-5464-dee43' - isDefault = 'false' - type = 'Agile' - } - - Mock Write-Warning - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*123-5464-dee43*" } - } - - Context 'Get-VSTeamProcess' { - It 'should use process area for old APIs' { - Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Processes' } - - ## Act - $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*" - } - } - - It 'with no parameters using BearerToken should return process' { - ## Act - $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/work/processes*" -and - $Uri -like "*api-version=$(_getApiVersion Processes)*" - } - } - - It 'with top should return warning' { - ## Act - Get-VSTeamProcess -top 10 - - ## Assert - # Make sure you warn the user - Should -Invoke Write-Warning -Exactly -Times 1 -Scope It - - # 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/work/processes*" -and - $Uri -NotLike "*`$top=10*" - } - } - - It 'with skip should return warning' { - ## Act - Get-VSTeamProcess -skip 1 - - ## Assert - # Make sure you warn the user - Should -Invoke Write-Warning -Exactly -Times 1 -Scope It - - # 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/work/processes*" -and - $Uri -like "*api-version=$(_getApiVersion Processes)*" -and - $Uri -NotLike "*`$skip=1*" -and - $Uri -NotLike "*`$top=100*" - } - } - - It 'by Name should return Process by Name' { - [VSTeamProcessCache]::timestamp = -1 - $p = Get-VSTeamProcess -Name Agile - - $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 Processes)*" - } - } - - It 'by Id should return Process by Id' { - Get-VSTeamProcess -Id '123-5464-dee43' - - # 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/work/processes/123-5464-dee43*" -and - $Uri -like "*api-version=$(_getApiVersion Processes)*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamProject.Tests.ps1 b/unit/test/Get-VSTeamProject.Tests.ps1 deleted file mode 100644 index cc953de5a..000000000 --- a/unit/test/Get-VSTeamProject.Tests.ps1 +++ /dev/null @@ -1,154 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProject' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ - name = 'Test' - description = '' - url = '' - id = '123-5464-dee43' - state = '' - visibility = '' - revision = 0 - _links = [PSCustomObject]@{ } - } - } - - $singleResult = [PSCustomObject]@{ - name = 'Test' - description = '' - url = '' - id = '123-5464-dee43' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - } - - Context 'Get-VSTeamProject' { - BeforeAll { - $env:TEAM_TOKEN = '1234' - - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*TestProject*" } - } - - AfterAll { - $env:TEAM_TOKEN = $null - } - - It 'with no parameters using BearerToken should return projects' { - Get-VSTeamProject - - # 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/projects*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$top=100*" -and - $Uri -like "*stateFilter=WellFormed*" - } - } - - It 'with top 10 should return top 10 projects' { - Get-VSTeamProject -top 10 - - # 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/projects*" -and - $Uri -like "*`$top=10*" -and - $Uri -like "*stateFilter=WellFormed*" - } - } - - It 'with skip 1 should skip first project' { - Get-VSTeamProject -skip 1 - - # 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/projects*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$skip=1*" -and - $Uri -like "*`$top=100*" -and - $Uri -like "*stateFilter=WellFormed*" - } - } - - It 'with stateFilter All should return All projects' { - Get-VSTeamProject -stateFilter 'All' - - # 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/projects*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*`$top=100*" -and - $Uri -like "*stateFilter=All*" - } - } - - It 'with no Capabilities by name should return the project' { - Get-VSTeamProject -Name TestProject - - # Make sure it was called with the correct URI - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/TestProject?api-version=$(_getApiVersion Core)" - } - } - - It 'with Capabilities by name should return the project with capabilities' { - Get-VSTeamProject -projectId TestProject -includeCapabilities - - # 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/projects/TestProject*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*includeCapabilities=True*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamQueue.Tests.ps1 b/unit/test/Get-VSTeamQueue.Tests.ps1 deleted file mode 100644 index 28c65062d..000000000 --- a/unit/test/Get-VSTeamQueue.Tests.ps1 +++ /dev/null @@ -1,97 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamQueue' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getProjects { return $null } - Mock _hasProjectCacheExpired { return $true } - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'DistributedTask' } - - # 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 @{ value = @{ id = 3; name = 'Hosted'; pool = @{ } } } } - Mock Invoke-RestMethod { return @{ id = 101; name = 'Hosted'; pool = @{ } } } -ParameterFilter { $Uri -like "*101*" } - } - - Context 'Get-VSTeamQueue' { - It 'should return requested queue' { - ## Act - Get-VSTeamQueue -projectName project -queueId 101 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/queues/101?api-version=$(_getApiVersion DistributedTask)" - } - } - - it 'with actionFilter & queueName parameter should return all the queues' { - ## Act - Get-VSTeamQueue -projectName project -actionFilter 'None' -queueName 'Hosted' - - # With PowerShell core the order of the query string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # "https://dev.azure.com/test/project/_apis/distributedtask/queues/?api-version=$(_getApiVersion DistributedTask)&actionFilter=None&queueName=Hosted" - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/project/_apis/distributedtask/queues*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*actionFilter=None*" -and - $Uri -like "*queueName=Hosted*" - } - } - - it 'with no parameters should return all the queues' { - ## Act - Get-VSTeamQueue -ProjectName project - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/queues?api-version=$(_getApiVersion DistributedTask)" - } - } - - it 'with queueName parameter should return all the queues' { - ## Act - Get-VSTeamQueue -projectName project -queueName 'Hosted' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/queues?api-version=$(_getApiVersion DistributedTask)&queueName=Hosted" - } - } - - it 'with actionFilter parameter should return all the queues' { - ## Act - Get-VSTeamQueue -projectName project -actionFilter 'None' - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/queues?api-version=$(_getApiVersion DistributedTask)&actionFilter=None" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamRelease.Tests.ps1 b/unit/test/Get-VSTeamRelease.Tests.ps1 deleted file mode 100644 index 5e6ca431f..000000000 --- a/unit/test/Get-VSTeamRelease.Tests.ps1 +++ /dev/null @@ -1,98 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamRelease' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $results = Get-Content "$PSScriptRoot\sampleFiles\releaseResults.json" -Raw | ConvertFrom-Json - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\releaseSingleReult.json" -Raw | ConvertFrom-Json - - Mock _getProjects { return $null } - Mock _hasProjectCacheExpired { return $true } - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -like "*15*" } - } - - Context 'Get-VSTeamRelease' { - It 'by Id -Raw should return release as Raw' { - ## Act - $raw = Get-VSTeamRelease -ProjectName project -Id 15 -Raw - - ## Assert - $raw | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'System.Management.Automation.PSCustomObject' - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - - It 'by Id should return release as Object' { - ## Act - $r = Get-VSTeamRelease -ProjectName project -Id 15 - - ## Assert - $r | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'Team.Release' - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - - It 'by Id -JSON should return release as JSON' { - ## Act - $r = Get-VSTeamRelease -ProjectName project -Id 15 -JSON - - ## Assert - $r | Get-Member | Select-Object -First 1 -ExpandProperty TypeName | Should -Be 'System.String' - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - - It 'with no parameters should return releases' { - ## Act - Get-VSTeamRelease -projectName project - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)" - } - } - - It 'with expand environments should return releases' { - ## Act - Get-VSTeamRelease -projectName project -expand environments - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases?api-version=$(_getApiVersion Release)&`$expand=environments" - } - } - - It 'with no parameters & no project should return releases' { - ## Act - Get-VSTeamRelease - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/_apis/release/releases?api-version=$(_getApiVersion Release)" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Get-VSTeamReleaseDefinition.Tests.ps1 deleted file mode 100644 index b1d6ece59..000000000 --- a/unit/test/Get-VSTeamReleaseDefinition.Tests.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamReleaseDefinition' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $results = Get-Content "$PSScriptRoot\sampleFiles\releaseDefAzD.json" -Raw | ConvertFrom-Json - - Mock _getProjects { return $null } - Mock _hasProjectCacheExpired { return $true } - Mock Invoke-RestMethod { return $results } - Mock Invoke-RestMethod { return $results.value[0] } -ParameterFilter { $Uri -like "*15*" } - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } - } - - Context 'Get-VSTeamReleaseDefinition' { - It 'no parameters should return Release definitions' { - ## Act - Get-VSTeamReleaseDefinition -projectName project - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)" - } - } - - It 'expand environments should return Release definitions' { - ## Act - Get-VSTeamReleaseDefinition -projectName project -expand environments - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions?api-version=$(_getApiVersion Release)&`$expand=environments" - } - } - - It 'by Id should return Release definition' { - ## Act - Get-VSTeamReleaseDefinition -projectName project -id 15 - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions/15?api-version=$(_getApiVersion Release)" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamResourceArea.Tests.ps1 b/unit/test/Get-VSTeamResourceArea.Tests.ps1 deleted file mode 100644 index f1f28ea08..000000000 --- a/unit/test/Get-VSTeamResourceArea.Tests.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamResourceArea' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Get-VSTeamResourceArea' { - BeforeAll { - ## Arrange - Mock _callAPI { return @{ value = @{ } } } - } - - It 'Should return resources' { - ## Act - $actual = Get-VSTeamResourceArea - - ## Assert - $actual | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamSecurityNamespace.Tests.ps1 b/unit/test/Get-VSTeamSecurityNamespace.Tests.ps1 deleted file mode 100644 index 263a6ab24..000000000 --- a/unit/test/Get-VSTeamSecurityNamespace.Tests.ps1 +++ /dev/null @@ -1,114 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamSecurityNamespace" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context "Get-VSTeamSecurityNamespace" { - BeforeAll { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - # to avoid the - # Cannot validate argument on parameter 'ProjectName'. - # error when using test project names that do not really exist. - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context 'Services' { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _supportsSecurityNamespace { return $true } - - $securityNamespaceListResult = Get-Content "$PSScriptRoot\sampleFiles\securityNamespaces.json" -Raw | ConvertFrom-Json - $securityNamespaceSingleResult = Get-Content "$PSScriptRoot\sampleFiles\securityNamespace.single.json" -Raw | ConvertFrom-Json - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return 'AzD' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - Mock Invoke-RestMethod { return $securityNamespaceListResult } - Mock Invoke-RestMethod { return $securityNamespaceSingleResult } -ParameterFilter { $Uri -like "*58450c49-b02d-465a-ab12-59ae512d6531*" } - } - - It 'list should return namespaces' { - Get-VSTeamSecurityNamespace - # With PowerShell core the order of the query string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # "https://vssps.dev.azure.com/test/_apis/graph/groups?api-version=$(_getApiVersion Graph)&scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2" - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/securitynamespaces*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'by id should return a single namespace' { - Get-VSTeamSecurityNamespace -Id 58450c49-b02d-465a-ab12-59ae512d6531 - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/securitynamespaces/58450c49-b02d-465a-ab12-59ae512d6531*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'by name should return namespace' { - Get-VSTeamSecurityNamespace -Name "WorkItemTracking" - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/securitynamespaces*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'by list and localOnly should return namespaces' { - Get-VSTeamSecurityNamespace -LocalOnly - # With PowerShell core the order of the query string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # "https://vssps.dev.azure.com/test/_apis/graph/groups?api-version=$(_getApiVersion Graph)&scopeDescriptor=scp.ZGU5ODYwOWEtZjRiMC00YWEzLTgzOTEtODI4ZDU2MDI0MjU2" - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://dev.azure.com/test/_apis/securitynamespaces*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*localOnly=true*" - } - } - } - - Context "Server" { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - - Mock _callAPI { throw 'Should not be called' } -Verifiable - Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - It 'should throw' { - { Get-VSTeamSecurityNamespace } | Should -Throw - } - - It '_callAPI should not be called' { - Should -Invoke _callAPI -Exactly 0 - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamServiceEndpointType.Tests.ps1 b/unit/test/Get-VSTeamServiceEndpointType.Tests.ps1 deleted file mode 100644 index 8b4268c84..000000000 --- a/unit/test/Get-VSTeamServiceEndpointType.Tests.ps1 +++ /dev/null @@ -1,60 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamServiceEndpointType' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $sampleFile = $(Get-Content "$PSScriptRoot\sampleFiles\serviceEndpointTypeSample.json" -Raw | ConvertFrom-Json) - - Mock Invoke-RestMethod { return $sampleFile } - - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - Context 'Get-VSTeamServiceEndpointType' { - It 'should return all service endpoints types' { - Get-VSTeamServiceEndpointType - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" - } - } - - It 'by Type should return all service endpoints types' { - Get-VSTeamServiceEndpointType -Type azurerm - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" -and - $Body.type -eq 'azurerm' - } - } - - It 'by Type and scheme should return all service endpoints types' { - Get-VSTeamServiceEndpointType -Type azurerm -Scheme Basic - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" -and - $Body.type -eq 'azurerm' -and - $Body.scheme -eq 'Basic' - } - } - - It 'by scheme should return all service endpoints types' { - Get-VSTeamServiceEndpointType -Scheme Basic - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/serviceendpointtypes?api-version=$(_getApiVersion DistributedTask)" -and - $Body.scheme -eq 'Basic' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamTaskGroup.Tests.ps1 b/unit/test/Get-VSTeamTaskGroup.Tests.ps1 deleted file mode 100644 index ce709ea5c..000000000 --- a/unit/test/Get-VSTeamTaskGroup.Tests.ps1 +++ /dev/null @@ -1,81 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamTaskGroup' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $taskGroupsJson = "$PSScriptRoot\sampleFiles\taskGroups.json" - $taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'TaskGroups' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - } - - Context 'Get-VSTeamTaskGroup list' { - BeforeAll { - Mock Invoke-RestMethod { - return Get-Content $taskGroupsJson | ConvertFrom-Json - } - } - - It 'Should return all task groups' { - Get-VSTeamTaskGroup -projectName project - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" - } - } - } - - Context 'Get-VSTeamTaskGroup Id' { - BeforeAll { - Mock Invoke-RestMethod { - return Get-Content $taskGroupJson | ConvertFrom-Json - } - } - - It 'Should return one task group' { - $projectID = "d30f8b85-6b13-41a9-bb77-2e1a9c611def" - Get-VSTeamTaskGroup -projectName project -id $projectID - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($projectID)?api-version=$(_getApiVersion TaskGroups)" - } - } - } - - Context 'Get-VSTeamTaskGroup Name' { - BeforeAll { - Mock Invoke-RestMethod { - # Return multiple task groups, because the function filters by name after getting the list from the server. - return Get-Content $taskGroupsJson | ConvertFrom-Json - } - } - - It 'Should return one task group' { - $taskGroupName = "For Unit Tests 2" - $taskGroup = Get-VSTeamTaskGroup -projectName project -Name $taskGroupName - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups?api-version=$(_getApiVersion TaskGroups)" - } - - # Ensure that we only have one task group, in other words, that the name filter was applied. - $taskGroup.name | Should -Be $taskGroupName - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamTfvcBranch.Tests.ps1 b/unit/test/Get-VSTeamTfvcBranch.Tests.ps1 deleted file mode 100644 index cdd122b18..000000000 --- a/unit/test/Get-VSTeamTfvcBranch.Tests.ps1 +++ /dev/null @@ -1,297 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamTfvcBranch' -Tag 'unit', 'tfvc' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $singleResult = [PSCustomObject]@{ - path = "$/TfvcProject/Master"; - description = 'desc'; - children = @(); - } - - $multipleResults = [PSCustomObject]@{ - value = @( - [PSCustomObject]@{ - path = '$/TfvcProject/Master'; - description = 'desc'; - children = @(); - }, - [PSCustomObject]@{ - path = '$/AnotherProject/Master'; - description = 'desc'; - children = @(); - } - ) - } - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Tfvc' } - } - - Describe 'Get-VSTeamTfvcBranch' { - BeforeAll { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $singleResult - } -Verifiable - } - - $testCases = @( - @{ a = 'https://dev.azure.com/test'; t = 'vsts' } - @{ a = 'http://localhost:8080/tfs/defaultcollection'; t = 'tfs' } - ) - It 'should call the REST endpoint with correct parameters for ' -TestCases $testCases { - BeforeAll { - param ($a) - - Mock _getInstance { return $a } - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master - - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "$a/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - } - - Describe 'Get-VSTeamTfvcBranch VSTS' { - BeforeAll { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - } - - Context 'Get-VSTeamTfvcBranch with one path' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with one path from pipeline' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - '$/TfvcProject/Master' | Get-VSTeamTfvcBranch - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with two paths' { - BeforeAll { - Mock Invoke-RestMethod { return $multipleResults } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master, $/TfvcProject/Feature - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Feature?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeChildren' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeParent' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeParent - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeParent=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeDeleted' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeDeleted - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with all switches' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren -IncludeParent -IncludeDeleted - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeParent=True&includeDeleted=True" - } - } - } - } - - Describe 'Get-VSTeamTfvcBranch TFS' { - BeforeAll { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - Mock _useWindowsAuthenticationOnPremise { return $true } - } - - Context 'Get-VSTeamTfvcBranch with one path' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with one path from pipeline' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - '$/TfvcProject/Master' | Get-VSTeamTfvcBranch - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with two paths' { - BeforeAll { - Mock Invoke-RestMethod { return $multipleResults } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master, $/TfvcProject/Feature - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)" - } - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Feature?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeChildren' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeParent' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeParent - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeParent=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with IncludeDeleted' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeDeleted - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" - } - } - } - - Context 'Get-VSTeamTfvcBranch with all switches' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcBranch -Path $/TfvcProject/Master -IncludeChildren -IncludeParent -IncludeDeleted - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches/$/TfvcProject/Master?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeParent=True&includeDeleted=True" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamTfvcRootBranch.Tests.ps1 b/unit/test/Get-VSTeamTfvcRootBranch.Tests.ps1 deleted file mode 100644 index 68e8eaeec..000000000 --- a/unit/test/Get-VSTeamTfvcRootBranch.Tests.ps1 +++ /dev/null @@ -1,226 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamTfvcRootBranch' -Tag 'unit', 'tfvc', 'get' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $singleResult = [PSCustomObject]@{ - path = "$/TfvcProject/Master"; - description = 'desc'; - children = @(); - } - - $multipleResults = [PSCustomObject]@{ - value = @( - [PSCustomObject]@{ - path = '$/TfvcProject/Master'; - description = 'desc'; - children = @(); - }, - [PSCustomObject]@{ - path = '$/AnotherProject/Master'; - description = 'desc'; - children = @(); - } - ) - } - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Tfvc' } - } - - Context 'Get-VSTeamTfvcRootBranch' { - Context 'Services' { - BeforeAll { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - } - - Context 'Get-VSTeamTfvcRootBranch with no parameters and single result' { - BeforeAll { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $singleResult - } -Verifiable - - $res = Get-VSTeamTfvcRootBranch - } - - It 'should get 1 branch' { - $res.path | Should -Be $singleResult.path - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcRootBranch with no parameters and multiple results' { - BeforeAll { - Mock Invoke-RestMethod { return $multipleResults } -Verifiable - - $res = Get-VSTeamTfvcRootBranch - } - - It 'should get 2 branches' { - $res.Count | Should -Be 2 - $multipleResults.value[0] | Should -BeIn $res - $multipleResults.value[1] | Should -BeIn $res - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcRootBranch with IncludeChildren' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcRootBranch -IncludeChildren - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeChildren=True" - } - } - } - - Context 'Get-VSTeamTfvcRootBranch with IncludeDeleted' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcRootBranch -IncludeDeleted - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" - } - } - } - - Context 'Get-VSTeamTfvcRootBranch with all switches' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcRootBranch -IncludeChildren -IncludeDeleted - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeDeleted=True" - } - } - } - } - - Context 'Server' { - BeforeAll { - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - Mock _useWindowsAuthenticationOnPremise { return $true } - } - - Context 'Get-VSTeamTfvcRootBranch with no parameters and single result' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - $res = Get-VSTeamTfvcRootBranch - } - - It 'should get 1 branch' { - $res.path | Should -Be $singleResult.path - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcRootBranch with no parameters and multiple results' { - BeforeAll { - Mock Invoke-RestMethod { return $multipleResults } -Verifiable - - $res = Get-VSTeamTfvcRootBranch - } - - It 'should get 2 branches' { - $res.Count | Should -Be 2 - $multipleResults.value[0] | Should -BeIn $res - $multipleResults.value[1] | Should -BeIn $res - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)" - } - } - } - - Context 'Get-VSTeamTfvcRootBranch with IncludeChildren' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcRootBranch -IncludeChildren - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeChildren=True" - } - } - } - - Context 'Get-VSTeamTfvcRootBranch with IncludeDeleted' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcRootBranch -IncludeDeleted - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeDeleted=True" - } - } - } - - Context 'Get-VSTeamTfvcRootBranch with all switches' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } -Verifiable - - Get-VSTeamTfvcRootBranch -IncludeChildren -IncludeDeleted - } - - It 'should call the REST endpoint with correct parameters' { - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/tfvc/branches?api-version=$(_getApiVersion Tfvc)&includeChildren=True&includeDeleted=True" - } - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamUser.Tests.ps1 b/unit/test/Get-VSTeamUser.Tests.ps1 deleted file mode 100644 index f5b9692fb..000000000 --- a/unit/test/Get-VSTeamUser.Tests.ps1 +++ /dev/null @@ -1,136 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamUser' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUser.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context "Get-VSTeamUser" { - BeforeAll { - $userListResult = Get-Content "$PSScriptRoot\sampleFiles\users.json" -Raw | ConvertFrom-Json - $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json - } - - Context "Server" { - BeforeAll { - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - Context 'Get-VSTeamUser' { - BeforeAll { - Mock _callAPI { throw 'Should not be called' } - Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'Graph' } - } - - It 'Should throw' { - { Get-VSTeamUser } | Should -Throw - } - } - } - - Context 'Services' { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - # You have to set the version or the api-version will not be added when [VSTeamVersions]::Graph = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } - } - - Context 'Get-VSTeamUser list' { - BeforeAll { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $userListResult - } - - Get-VSTeamUser - } - - It 'Should return users' { - # With PowerShell core the order of the query string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # "https://vssps.dev.azure.com/test/_apis/graph/users?api-version=$(_getApiVersion Graph)" - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope Context -ParameterFilter { - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/users*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" - } - } - } - - Context 'Get-VSTeamUser by subjectTypes' { - BeforeAll { - Mock Invoke-RestMethod { return $userListResult } -Verifiable - - Get-VSTeamUser -SubjectTypes vss, aad - } - - It 'Should return users' { - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope Context -ParameterFilter { - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/users*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" -and - $Uri -like "*subjectTypes=vss,aad*" - } - } - } - - Context 'Get-VSTeamUser by descriptor' { - BeforeAll { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - return $userSingleResult - } - } - - It 'Should return the user' { - Get-VSTeamUser -UserDescriptor 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/users/aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" - } - } - } - - Context 'Get-VSTeamUser list throws' { - BeforeAll { - Mock Invoke-RestMethod { throw 'Error' } - } - - It 'Should throw' { - { Get-VSTeamUser } | Should -Throw - } - } - - Context 'Get-VSTeamUser by descriptor throws' { - BeforeAll { - Mock Invoke-RestMethod { throw 'Error' } - } - - It 'Should throw' { - { Get-VSTeamUser -UserDescriptor } | Should -Throw - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamUserEntitlement.Tests.ps1 b/unit/test/Get-VSTeamUserEntitlement.Tests.ps1 deleted file mode 100644 index d6606a8ee..000000000 --- a/unit/test/Get-VSTeamUserEntitlement.Tests.ps1 +++ /dev/null @@ -1,87 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamUserEntitlement" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context "Get-VSTeamUserEntitlement" { - BeforeAll { - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context "Server" { - BeforeAll { - Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - Context 'Get-VSTeamUserEntitlement' { - BeforeAll { - Mock _callAPI { throw 'Should not be called' } - } - - It 'not supported should throw' { - { Get-VSTeamUserEntitlement } | Should -Throw - } - - It '_callAPI should not be called' { - Should -Invoke _callAPI -Exactly -Times 0 -Scope Context - } - } - } - - Context "Services" { - BeforeAll { - Mock _getApiVersion { return 'VSTS' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - Context 'Get-VSTeamUserEntitlement' { - BeforeAll { - Mock Invoke-RestMethod { return [PSCustomObject]@{ members = [PSCustomObject]@{ accessLevel = [PSCustomObject]@{ } } } } - Mock Invoke-RestMethod { return [PSCustomObject]@{ accessLevel = [PSCustomObject]@{ }; email = 'fake@email.com' } } -ParameterFilter { - $Uri -like "*00000000-0000-0000-0000-000000000000*" - } - Mock Invoke-RestMethod { return [PSCustomObject]@{ members = [PSCustomObject]@{ accessLevel = [PSCustomObject]@{ }; email = 'fake@email.com' } } } -ParameterFilter { - $Uri -like "*select=Projects*" - } - } - - It 'no parameters should return users' { - Get-VSTeamUserEntitlement - - # Make sure it was called with the correct URI - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://vsaex.dev.azure.com/test/_apis/userentitlements?api-version=$(_getApiVersion MemberEntitlementManagement)&top=100&skip=0" - } - } - - It 'by Id should return users with projects' { - Get-VSTeamUserEntitlement -Id '00000000-0000-0000-0000-000000000000' - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://vsaex.dev.azure.com/test/_apis/userentitlements/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion MemberEntitlementManagement)" - } - } - - It 'with select for projects should return users with projects' { - Get-VSTeamUserEntitlement -Select Projects - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Uri -eq "https://vsaex.dev.azure.com/test/_apis/userentitlements?api-version=$(_getApiVersion MemberEntitlementManagement)&top=100&skip=0&select=Projects" - } - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamVariableGroup.Tests.ps1 b/unit/test/Get-VSTeamVariableGroup.Tests.ps1 deleted file mode 100644 index 610e0eab8..000000000 --- a/unit/test/Get-VSTeamVariableGroup.Tests.ps1 +++ /dev/null @@ -1,91 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamVariableGroup' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'VariableGroups' } - } - - Context 'Get-VSTeamVariableGroup' { - Context 'Services' { - BeforeAll { - $sampleFileVSTS = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples.json" | ConvertFrom-Json) - - Mock _getApiVersion { return 'VSTS' } - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod { return $sampleFileVSTS } - Mock Invoke-RestMethod { return $sampleFileVSTS.value[0] } -ParameterFilter { $Uri -like "*101*" } - } - - It 'list should return all variable groups' { - Get-VSTeamVariableGroup -projectName project - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups?api-version=$(_getApiVersion VariableGroups)" - } - } - - - It 'by Id should return one variable group' { - $projectID = 101 - Get-VSTeamVariableGroup -projectName project -id $projectID - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$(_getApiVersion VariableGroups)" - } - } - } - - Context 'Server' { - BeforeAll { - $sampleFile2017 = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples2017.json" | ConvertFrom-Json) - - Mock _getApiVersion { return 'TFS2017' } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - - Mock Invoke-RestMethod { return $sampleFile2017 } - Mock Invoke-RestMethod { return $sampleFile2017.value[0] } -ParameterFilter { $Uri -like "*101*" } - } - - It 'list should return all variable groups' { - Get-VSTeamVariableGroup -projectName project - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups?api-version=$(_getApiVersion VariableGroups)" - } - } - - It 'by Id should return one variable group' { - $projectID = 101 - Get-VSTeamVariableGroup -projectName project -id $projectID - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$(_getApiVersion VariableGroups)" - } - } - - It 'by name should return one variable group' { - $varGroupName = "TestVariableGroup1" - Get-VSTeamVariableGroup -projectName project -Name $varGroupName - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups?api-version=$(_getApiVersion VariableGroups)&groupName=$varGroupName" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamWiql.Tests.ps1 b/unit/test/Get-VSTeamWiql.Tests.ps1 deleted file mode 100644 index 47ef09f93..000000000 --- a/unit/test/Get-VSTeamWiql.Tests.ps1 +++ /dev/null @@ -1,174 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamWiql' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$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" - . "$PSScriptRoot/../../Source/Public/$sut" - - 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*" } - - $workItem = @{ - id = 47 - url = "https://dev.azure.com/test/_apis/wit/workItems/47" - } - - $column = @{ - referenceName = "System.Id" - name = "ID" - url = "https://dev.azure.com/razorspoint-test/_apis/wit/fields/System.Id" - } - - $sortColumn = @{ - field = $column - descending = $false - } - - $expandedWorkItems = @{ - count = 1 - value = @($workItem, $workItem) - } - } - - Context 'Get-VSTeamWiql' { - BeforeAll { - Mock Invoke-RestMethod { - # 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 - } - - # function is mocked because it is used when switch 'Expanded' is being used. - Mock Get-VSTeamWorkItem { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $expandedWorkItems - } - - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'Get work items with custom WIQL query' { - $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" - Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '`{*' -and # Make sure the body is an object - $Body -like "*[System.Id]*" -and - $Body -like "*[System.Title]*" -and - $Body -like "*[System.State]*" -and - $Body -like '*`}' -and # Make sure the body is an object - $ContentType -eq 'application/json' -and - $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)&`$top=100" - } - } - - It 'Get work items with custom WIQL query with -Top 250' { - $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" - Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Top 250 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '`{*' -and # Make sure the body is an object - $Body -like "*[System.Id]*" -and - $Body -like "*[System.Title]*" -and - $Body -like "*[System.State]*" -and - $Body -like '*`}' -and # Make sure the body is an object - $ContentType -eq 'application/json' -and - $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)&`$top=250" - } - } - - It 'Get work items with custom WIQL query with -Top 0' { - $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" - Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Top 0 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '`{*' -and # Make sure the body is an object - $Body -like "*[System.Id]*" -and - $Body -like "*[System.Title]*" -and - $Body -like "*[System.State]*" -and - $Body -like '*`}' -and # Make sure the body is an object - $ContentType -eq 'application/json' -and - $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)" - } - } - - It 'Get work items with custom WIQL query with expanded work items' { - $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" - Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -Expand - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '`{*' -and # Make sure the body is an object - $Body -like "*[System.Id]*" -and - $Body -like "*[System.Title]*" -and - $Body -like "*[System.State]*" -and - $Body -like '*`}' -and # Make sure the body is an object - $ContentType -eq 'application/json' -and - $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql?api-version=$(_getApiVersion Core)&`$top=100" - } - } - - It 'Get work items with custom WIQL query with time precision' { - $wiqlQuery = "Select [System.Id], [System.Title], [System.State] From WorkItems" - Get-VSTeamWiql -ProjectName "test" -Team "test team" -Query $wiqlQuery -TimePrecision - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '`{*' -and # Make sure the body is an object - $Body -like "*[System.Id]*" -and - $Body -like "*[System.Title]*" -and - $Body -like "*[System.State]*" -and - $Body -like '*`}' -and # Make sure the body is an object - $ContentType -eq 'application/json' -and - $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' { - Get-VSTeamWiql -ProjectName "test" -Team "test team" -Id 1 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql/1?api-version=$(_getApiVersion Core)&`$top=100" - } - } - - It 'Get work items with query ID query with expanded work items' { - Get-VSTeamWiql -ProjectName "test" -Team "test team" -Id 1 -Expand - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/test/test team/_apis/wit/wiql/1?api-version=$(_getApiVersion Core)&`$top=100" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamWorkItem.Tests.ps1 b/unit/test/Get-VSTeamWorkItem.Tests.ps1 deleted file mode 100644 index 405b2bcc8..000000000 --- a/unit/test/Get-VSTeamWorkItem.Tests.ps1 +++ /dev/null @@ -1,65 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamWorkItem' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - $obj = @{ - id = 47 - rev = 1 - url = "https://dev.azure.com/test/_apis/wit/workItems/47" - } - - $collection = @{ - count = 1 - value = @($obj) - } - } - - Context 'Get-VSTeamWorkItem' { - BeforeAll { - Mock Invoke-RestMethod { return $obj } - Mock Invoke-RestMethod { return $collection } -ParameterFilter { $Uri -like "*ids=47,48*" } - } - - It 'by id should return work items' { - Get-VSTeamWorkItem -Id 47, 48 - - # With PowerShell core the order of the query string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - # https://dev.azure.com/test/test/_apis/wit/workitems/?api-version=$(_getApiVersion Core)&ids=47,48&`$Expand=None&errorPolicy=omit - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/wit/workitems*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*ids=47,48*" -and - $Uri -like "*`$Expand=None*" -and - $Uri -like "*errorPolicy=omit*" - } - } - - It 'by Id with Default Project should return single work item' { - Get-VSTeamWorkItem -Id 47 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/wit/workitems/47?api-version=$(_getApiVersion Core)&`$Expand=None" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Get-VSTeamWorkItemType.Tests.ps1 b/unit/test/Get-VSTeamWorkItemType.Tests.ps1 deleted file mode 100644 index 708c1538c..000000000 --- a/unit/test/Get-VSTeamWorkItemType.Tests.ps1 +++ /dev/null @@ -1,75 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamWorkItemType' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/WorkItemTypeCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/WorkItemTypeValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - $sampleFile = $(Get-Content "$PSScriptRoot\sampleFiles\get-vsteamworkitemtype.json" -Raw) - } - - Context 'Get-VSTeamWorkItemType' { - BeforeAll { - $bug = @{ - name = "Bug" - referenceName = "Microsoft.VSTS.WorkItemTypes.Bug" - description = "Describes a divergence between required and actual behavior, and tracks the work done to correct the defect and verify the correction." - color = "CC293D" - } - - Mock Invoke-RestMethod { return ConvertTo-Json $sampleFile } - Mock Invoke-RestMethod { return ConvertTo-Json $bug } -ParameterFilter { $Uri -like "*bug*" } - } - - It 'with project only should return all work item types' { - ## Act - Get-VSTeamWorkItemType -ProjectName test - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/test/_apis/wit/workitemtypes?api-version=$(_getApiVersion Core)" - } - } - - It 'by type with default project should return 1 work item type' { - ## Arrange - $Global:PSDefaultParameterValues["*-vsteam*:projectName"] = 'test' - - ## Act - Get-VSTeamWorkItemType -WorkItemType bug - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/test/_apis/wit/workitemtypes/bug?api-version=$(_getApiVersion Core)" - } - } - - It 'by type with explicit project should return 1 work item type' { - ## Arrange - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - - ## Act - Get-VSTeamWorkItemType -ProjectName test -WorkItemType bug - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/test/_apis/wit/workitemtypes/bug?api-version=$(_getApiVersion Core)" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Invoke-VSTeamRequest.Tests.ps1 b/unit/test/Invoke-VSTeamRequest.Tests.ps1 deleted file mode 100644 index c29684cac..000000000 --- a/unit/test/Invoke-VSTeamRequest.Tests.ps1 +++ /dev/null @@ -1,89 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamRequest' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/InvokeCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getProjects { return @() } - Mock _hasProjectCacheExpired { return $true } - } - - Context 'Invoke-VSTeamRequest Options' { - BeforeAll { - Mock Invoke-RestMethod - Mock _getInstance { return 'https://dev.azure.com/test' } - - $projectResult = $(Get-Content "$PSScriptRoot\sampleFiles\projectResult.json" | ConvertFrom-Json) - - Mock _callAPI { return $projectResult } -ParameterFilter { - $Area -eq 'projects' -and - $id -eq 'testproject' -and - $Version -eq "$(_getApiVersion Core)" -and - $IgnoreDefaultProject -eq $true - } - } - - It 'options should call API' { - Invoke-VSTeamRequest -Method Options -NoProject - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq "Options" -and - $Uri -eq "https://dev.azure.com/test/_apis" - } - } - - It 'release should call API' { - Invoke-VSTeamRequest -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' -ProjectName testproject -JSON - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/testproject/_apis/release/releases/1?api-version=4.1-preview" - } - } - - It 'AdditionalHeaders should call API' { - Invoke-VSTeamRequest -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' -ProjectName testproject -JSON -AdditionalHeaders @{Test = "Test" } - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Headers["Test"] -eq 'Test' -and - $Uri -eq "https://vsrm.dev.azure.com/test/testproject/_apis/release/releases/1?api-version=4.1-preview" - } - } - - It 'by Product Id should call API with product id instead of name' { - Invoke-VSTeamRequest -ProjectName testproject -UseProjectId -Area release -Resource releases -Id 1 -SubDomain vsrm -Version '4.1-preview' - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/010d06f0-00d5-472a-bb47-58947c230876/_apis/release/releases/1?api-version=4.1-preview" - } - } - } -} \ No newline at end of file diff --git a/unit/test/InvokeCompleter.Tests.ps1 b/unit/test/InvokeCompleter.Tests.ps1 deleted file mode 100644 index 37dba12bf..000000000 --- a/unit/test/InvokeCompleter.Tests.ps1 +++ /dev/null @@ -1,59 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "InvokeCompleter" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamOption.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - - $result = Get-Content "$PSScriptRoot\sampleFiles\Get-VSTeamOption.json" -Raw | ConvertFrom-Json - $resultVsrmSubDomain = Get-Content "$PSScriptRoot\sampleFiles\Get-VSTeamOption_vsrm.json" -Raw | ConvertFrom-Json - - Mock Get-VSTeamOption { return $result.value } - Mock Get-VSTeamOption { return $resultVsrmSubDomain.value } -ParameterFilter { $subDomain -eq 'vsrm' } - } - - Context "Area" { - It "it should return all areas" { - $target = [InvokeCompleter]::new() - - $actual = $target.CompleteArgument("Invoke-VSTeamRequest", "Area", "", $null, @{ }) - - $actual.count | Should -Be 76 - } - } - - Context "Sub Domain" { - It "it should return all areas for sub domain" { - $target = [InvokeCompleter]::new() - - $actual = $target.CompleteArgument("Invoke-VSTeamRequest", "Area", "", $null, @{ subDomain = 'vsrm' }) - - $actual.count | Should -Be 31 - } - } - - Context "with area and subdomain" { - It "should return resources for no area with sub domain" { - $target = [InvokeCompleter]::new() - - $actual = $target.CompleteArgument("Invoke-VSTeamRequest", "Resource", "", $null, @{ subDomain = 'vsrm' }) - - $actual.count | Should -Be 0 - } - - It "should return resources for area and sub domain" { - $target = [InvokeCompleter]::new() - - $actual = $target.CompleteArgument("Invoke-VSTeamRequest", "Resource", "", $null, @{ subDomain = 'vsrm'; Area = 'Release' }) - - $actual.count | Should -Be 38 - } - } -} \ No newline at end of file diff --git a/unit/test/ProcessTemplateCompleter.Tests.ps1 b/unit/test/ProcessTemplateCompleter.Tests.ps1 deleted file mode 100644 index e1eb2a674..000000000 --- a/unit/test/ProcessTemplateCompleter.Tests.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 62f60c591..000000000 --- a/unit/test/ProcessValidateAttribute.Tests.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -Set-StrictMode -Version Latest - -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 Get-VSTeamProcess { - return @( - [PSCustomObject]@{ Name = "Test1"; url = 'http://bogus.none/100' }, - [PSCustomObject]@{ Name = "Test2"; url = 'http://bogus.none/101' } - ) - } - - [VSTeamProcessCache]::Invalidate() - } - - 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 - } - } - - Context "No Processes" { - BeforeAll { - Mock Get-VSTeamProcess { - return @() - } - - [VSTeamProcessCache]::Invalidate() - } - - It "list is empty and should not throw" { - $target = [ProcessValidateAttribute]::new() - - { $target.Validate("Test", $null) } | Should -Not -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/ProjectValidateAttribute.Tests.ps1 b/unit/test/ProjectValidateAttribute.Tests.ps1 deleted file mode 100644 index d39bc2502..000000000 --- a/unit/test/ProjectValidateAttribute.Tests.ps1 +++ /dev/null @@ -1,44 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "ProjectValidateAttribute" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context "Existing Project" { - BeforeAll { - Mock _hasProjectCacheExpired { return $true } - Mock _getProjects { return @("Test1", "Test2") } - } - - It "it is not in list and should throw" { - $target = [ProjectValidateAttribute]::new() - - { $target.Validate("Test", $null) } | Should -Throw - } - - It "it is in list and should not throw" { - $target = [ProjectValidateAttribute]::new() - - { $target.Validate("Test1", $null) } | Should -Not -Throw - } - } - - Context "No Projects" { - BeforeAll { - Mock _getProjects { return @() } - Mock _hasProjectCacheExpired { return $true } - } - - It "list is empty and should not throw" { - $target = [ProjectValidateAttribute]::new() - - { $target.Validate("Test", $null) } | Should -Not -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeam.Tests.ps1 b/unit/test/Remove-VSTeam.Tests.ps1 deleted file mode 100644 index 358b2faf1..000000000 --- a/unit/test/Remove-VSTeam.Tests.ps1 +++ /dev/null @@ -1,89 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeam" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeam.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeam.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $singleResult = [PSCustomObject]@{ - id = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - description = 'team description' - } - } - - Context "Remove-VSTeam" { - Context "services" { - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Remove-VSTeam' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } - } - - It 'Should remove the team' { - Remove-VSTeam -ProjectName Test -TeamId "TestTeam" -Force - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams/TestTeam?api-version=$(_getApiVersion Core)" -and - $Method -eq "Delete" - } - } - } - - Context 'Remove-VSTeam, fed through pipeline' { - BeforeAll { - Mock Get-VSTeam { return New-Object -TypeName PSObject -Prop @{projectname = "TestProject"; name = "TestTeam" } } - Mock Invoke-RestMethod { return $singleResult } - } - - It 'Should remove the team' { - Get-VSTeam -ProjectName TestProject -TeamId "TestTeam" | Remove-VSTeam -Force - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/TestProject/teams/TestTeam?api-version=$(_getApiVersion Core)" -and - $Method -eq "Delete" - } - } - } - } - - Context "Server" { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - Context 'Remove-VSTeam on TFS local Auth' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } - } - - It 'Should remove the team' { - Remove-VSTeam -ProjectName Test -TeamId "TestTeam" -Force - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/projects/Test/teams/TestTeam?api-version=$(_getApiVersion Core)" -and - $Method -eq "Delete" - } - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamAccessControlEntry.Tests.ps1 b/unit/test/Remove-VSTeamAccessControlEntry.Tests.ps1 deleted file mode 100644 index d4b40c702..000000000 --- a/unit/test/Remove-VSTeamAccessControlEntry.Tests.ps1 +++ /dev/null @@ -1,181 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamSecurityNamespace' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - - $securityNamespace = - @" -{ - "namespaceId": "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87", - "name": "Git Repositories", - "displayName": "Git Repositories", - "separatorValue": "/", - "elementLength": -1, - "writePermission": 8192, - "readPermission": 2, - "dataspaceCategory": "Git", - "actions": [ - { - "DisplayName": "Administer", - "Name": "Administer", - "Bit": 1 - }, - { - "DisplayName": "Read", - "Name": "GenericRead", - "Bit": 2 - }, - { - "DisplayName": "Contribute", - "Name": "GenericContribute", - "Bit": 4 - }, - { - "DisplayName": "Force push (rewrite history, delete branches and tags)", - "Name": "ForcePush", - "Bit": 8 - }, - { - "DisplayName": "Create branch", - "Name": "CreateBranch", - "Bit": 16 - }, - { - "DisplayName": "Create tag", - "Name": "CreateTag", - "Bit": 32 - }, - { - "DisplayName": "Manage notes", - "Name": "ManageNote", - "Bit": 64 - }, - { - "DisplayName": "Bypass policies when pushing", - "Name": "PolicyExempt", - "Bit": 128 - }, - { - "DisplayName": "Create repository", - "Name": "CreateRepository", - "Bit": 256 - }, - { - "DisplayName": "Delete repository", - "Name": "DeleteRepository", - "Bit": 512 - }, - { - "DisplayName": "Rename repository", - "Name": "RenameRepository", - "Bit": 1024 - }, - { - "DisplayName": "Edit policies", - "Name": "EditPolicies", - "Bit": 2048 - }, - { - "DisplayName": "Remove others\u0027 locks", - "Name": "RemoveOthersLocks", - "Bit": 4096 - }, - { - "DisplayName": "Manage permissions", - "Name": "ManagePermissions", - "Bit": 8192 - }, - { - "DisplayName": "Contribute to pull requests", - "Name": "PullRequestContribute", - "Bit":"16384" - }, - { - "DisplayName": "Bypass policies when completing pull requests", - "Name": "PullRequestBypassPolicy", - "Bit": 32768 - } - ], - "structureValue": 1, - "extensionType": "Microsoft.TeamFoundation.Git.Server.Plugins.GitSecurityNamespaceExtension", - "isRemotable": true, - "useTokenTranslator": true, - "systemBitMask": 0 -} -"@ | ConvertFrom-Json - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - # You have to set the version or the api-version will not be Removed when - # versions = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - Mock Get-VSTeamSecurityNamespace { return $securityNamespace } - } - - Context 'Remove-VSTeamAccessControlEntry by SecurityNamespaceId' { - It 'Should succeed with a properly formatted descriptor if descriptor is on ACL' { - Mock _callAPI { return $true } -Verifiable - Remove-VSTeamAccessControlEntry -SecurityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -Descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTkxNDc4NTk1LTU1MDM1MzIxOC0yNDM3MjM2NDgzLTQyMjkyNzUyNDktMC0wLTAtOC04") -Token xyz -confirm:$false | Should -Be "Removal of ACE from ACL succeeded." - } - It 'Should fail with a properly formatted descriptor if descriptor is not on ACL already' { - Mock _callAPI { return $false } -Verifiable - Remove-VSTeamAccessControlEntry -SecurityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -Descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTkxNDc4NTk1LTU1MDM1MzIxOC0yNDM3MjM2NDgzLTQyMjkyNzUyNDktMC0wLTAtOC04") -Token xyz -confirm:$false -ErrorVariable err -ErrorAction SilentlyContinue - $err.count | Should -Be 1 - $err[0].Exception.Message | Should -Be "Removal of ACE from ACL failed. Ensure descriptor and token are correct." - $err - } - It 'Should fail with an improperly formatted descriptor' { - Remove-VSTeamAccessControlEntry -SecurityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -Descriptor @("vssgp.NotARealDescriptor") -Token xyz -confirm:$false -ErrorVariable err -ErrorAction SilentlyContinue - $err.count | Should -Be 2 - $err[1].Exception.Message | Should -Be "Could not convert base64 string to string." - } - It 'Should fail if the REST API gives a non true/false response' { - Mock _callAPI { return "Not a valid return" } -Verifiable - Remove-VSTeamAccessControlEntry -SecurityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -Descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTkxNDc4NTk1LTU1MDM1MzIxOC0yNDM3MjM2NDgzLTQyMjkyNzUyNDktMC0wLTAtOC04") -Token xyz -confirm:$false -ErrorVariable err -ErrorAction SilentlyContinue - $err.count | Should -Be 1 - $err[0].Exception.Message | Should -Be "Unexpected response from REST API." - } - } - - Context 'Remove-VSTeamAccessControlEntry by SecurityNamespace' { - It 'Should succeed with a properly formatted descriptor if descriptor is on ACL' { - $securityNamespace = Get-VSTeamSecurityNamespace -Id "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" - Mock _callAPI { return $true } -Verifiable - Remove-VSTeamAccessControlEntry -SecurityNamespace $securityNamespace -Descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTkxNDc4NTk1LTU1MDM1MzIxOC0yNDM3MjM2NDgzLTQyMjkyNzUyNDktMC0wLTAtOC04") -Token xyz -confirm:$false | Should -Be "Removal of ACE from ACL succeeded." - } - It 'Should fail with a properly formatted descriptor if descriptor is not on ACL already' { - $securityNamespace = Get-VSTeamSecurityNamespace -Id "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" - Mock _callAPI { return $false } -Verifiable - Remove-VSTeamAccessControlEntry -SecurityNamespace $securityNamespace -Descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTkxNDc4NTk1LTU1MDM1MzIxOC0yNDM3MjM2NDgzLTQyMjkyNzUyNDktMC0wLTAtOC04") -Token xyz -confirm:$false -ErrorVariable err -ErrorAction SilentlyContinue - $err.count | Should -Be 1 - $err[0].Exception.Message | Should -Be "Removal of ACE from ACL failed. Ensure descriptor and token are correct." - } - It 'Should fail with an improperly formatted descriptor' { - $securityNamespace = Get-VSTeamSecurityNamespace -Id "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" - Remove-VSTeamAccessControlEntry -SecurityNamespace $securityNamespace -Descriptor @("vssgp.NotARealDescriptor") -Token xyz -confirm:$false -ErrorVariable err -ErrorAction SilentlyContinue - $err.count | Should -Be 2 - $err[1].Exception.Message | Should -Be "Could not convert base64 string to string." - } - It 'Should fail if the REST API gives a non true/false response' { - Mock _callAPI { return "Not a valid return" } -Verifiable - Remove-VSTeamAccessControlEntry -SecurityNamespaceId "2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87" -Descriptor @("vssgp.Uy0xLTktMTU1MTM3NDI0NS0yMTkxNDc4NTk1LTU1MDM1MzIxOC0yNDM3MjM2NDgzLTQyMjkyNzUyNDktMC0wLTAtOC04") -Token xyz -confirm:$false -ErrorVariable err -ErrorAction SilentlyContinue - $err.count | Should -Be 1 - $err[0].Exception.Message | Should -Be "Unexpected response from REST API." - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamAgent.Tests.ps1 b/unit/test/Remove-VSTeamAgent.Tests.ps1 deleted file mode 100644 index 7e8d49c80..000000000 --- a/unit/test/Remove-VSTeamAgent.Tests.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamAgent' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - [VSTeamVersions]::DistributedTask = '1.0-unitTest' - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - } - - Context 'Remove-VSTeamAgent by ID' { - BeforeAll { - Mock Invoke-RestMethod - } - - It 'should remove the agent with passed in Id' { - Remove-VSTeamAgent -Pool 36 -Id 950 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://dev.azure.com/test/_apis/distributedtask/pools/36/agents/950?api-version=$(_getApiVersion DistributedTask)" - } - } - } - - Context 'Remove-VSTeamAgent throws' { - BeforeAll { - Mock Invoke-RestMethod { throw 'boom' } - } - - It 'should remove the agent with passed in Id' { - { Remove-VSTeamAgent -Pool 36 -Id 950 -Force } | Should -Throw - } - } -} - diff --git a/unit/test/Remove-VSTeamArea.Tests.ps1 b/unit/test/Remove-VSTeamArea.Tests.ps1 deleted file mode 100644 index abc84c7bf..000000000 --- a/unit/test/Remove-VSTeamArea.Tests.ps1 +++ /dev/null @@ -1,94 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamArea' { - BeforeAll { - Import-Module SHiPS - - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Remove-VSTeamArea' { - BeforeAll { - Mock Invoke-RestMethod { - #Write-Host $args - return $null - } - } - - It 'should delete area' -TestCases @( - ) { - ## Act - Remove-VSTeamArea -ProjectName "Public Demo" -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'should delete area with reclassification id ' -TestCases @( - @{ReClassifyId = 4 } - ) { - param ($ReClassifyId) - ## Act - Remove-VSTeamArea -ProjectName "Public Demo" -ReClassifyId $ReClassifyId -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'with Path "" should delete area' -TestCases @( - @{Path = "SubPath" } - @{Path = "Path/SubPath" } - ) { - param ($Path) - ## Act - Remove-VSTeamArea -ProjectName "Public Demo" -Path $Path -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas/$Path*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'with empty Path "" should delete area' -TestCases @( - @{Path = "" } - @{Path = $null } - ) { - param ($Path) - ## Act - Remove-VSTeamArea -ProjectName "Public Demo" -Path $Path -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/areas?*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - } -} - diff --git a/unit/test/Remove-VSTeamBuild.Tests.ps1 b/unit/test/Remove-VSTeamBuild.Tests.ps1 deleted file mode 100644 index bcf9dab04..000000000 --- a/unit/test/Remove-VSTeamBuild.Tests.ps1 +++ /dev/null @@ -1,79 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'Remove-VSTeamBuild' { - BeforeAll { - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - } - - Context 'Service' { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Arrange - Mock Invoke-RestMethod - - # Act - Remove-VSTeamBuild -projectName project -id 2 -Force - } - - It 'should delete build' { - # Assert - Should -Invoke Invoke-RestMethod -Scope Context -Exactly -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/2?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Server local Auth' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - Mock Invoke-RestMethod - } - - It 'should delete build' { - Remove-VSTeamBuild -projectName project -id 2 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/2?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Server local Auth handles exception' { - BeforeAll { - - # Arrange - Mock _handleException -Verifiable - Mock Invoke-RestMethod { throw 'Testing error handling.' } - - # Act - Remove-VSTeamBuild -ProjectName project -id 2 -Force - } - - It 'should add tags to Build' { - - # Assert - Should -InvokeVerifiable - } - } -} - diff --git a/unit/test/Remove-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Remove-VSTeamBuildDefinition.Tests.ps1 deleted file mode 100644 index 7b5467c82..000000000 --- a/unit/test/Remove-VSTeamBuildDefinition.Tests.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'Remove-VSTeamBuildDefinition' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $resultsVSTS = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - } - - Context 'Succeeds' { - BeforeAll { - Mock Invoke-RestMethod { return $resultsVSTS } - } - - It 'should delete build definition' { - Remove-VSTeamBuildDefinition -projectName project -id 2 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Succeeds on TFS local Auth' { - BeforeAll { - Mock Invoke-RestMethod { return $resultsVSTS } - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - - Remove-VSTeamBuildDefinition -projectName project -id 2 -Force - } - - It 'should delete build definition' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamBuildTag.Tests.ps1 b/unit/test/Remove-VSTeamBuildTag.Tests.ps1 deleted file mode 100644 index dbc2af406..000000000 --- a/unit/test/Remove-VSTeamBuildTag.Tests.ps1 +++ /dev/null @@ -1,69 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamBuildTag' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Remove-VSTeamBuildTag' { - BeforeAll { - [string[]] $inputTags = "Test1", "Test2", "Test3" - Mock Invoke-RestMethod { return @{ value = $null } } - } - - Context 'Services' { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - 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*" - } - } - - It 'should add tags to Build' { - Remove-VSTeamBuildTag -ProjectName project -id 2 -Tags $inputTags - - foreach ($inputTag in $inputTags) { - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" - } - } - } - } - - Context 'Server' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - It 'should add tags to Build' { - Remove-VSTeamBuildTag -ProjectName project -id 2 -Tags $inputTags - - foreach ($inputTag in $inputTags) { - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/2/tags?api-version=$(_getApiVersion Build)" + "&tag=$inputTag" - } - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamClassificationNode.Tests.ps1 b/unit/test/Remove-VSTeamClassificationNode.Tests.ps1 deleted file mode 100644 index 7a640540d..000000000 --- a/unit/test/Remove-VSTeamClassificationNode.Tests.ps1 +++ /dev/null @@ -1,100 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamClassificationNode' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $classificationNodeResult = Get-Content "$PSScriptRoot\sampleFiles\classificationNodeResult.json" -Raw | ConvertFrom-Json - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Remove-VSTeamClassificationNode' { - BeforeAll { - Mock Invoke-RestMethod { - #Write-Host $args - return $classificationNodeResult - } - } - - It 'with StructureGroup "" should delete Nodes' -TestCases @( - @{StructureGroup = "areas" } - @{StructureGroup = "iterations" } - ) { - param ($StructureGroup) - ## Act - Remove-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'with StructureGroup "" should delete Nodes with reclassification id ' -TestCases @( - @{StructureGroup = "areas"; ReClassifyId = 4 } - @{StructureGroup = "iterations"; ReClassifyId = 99 } - ) { - param ($StructureGroup, $ReClassifyId) - ## Act - Remove-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -ReClassifyId $ReClassifyId -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'with StructureGroup "" by Path "" should delete Nodes' -TestCases @( - @{StructureGroup = "areas"; Path = "SubPath" } - @{StructureGroup = "areas"; Path = "Path/SubPath" } - @{StructureGroup = "iterations"; Path = "SubPath" } - @{StructureGroup = "iterations"; Path = "Path/SubPath" } - ) { - param ($StructureGroup, $Path) - ## Act - Remove-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Path $Path -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup/$Path*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'with StructureGroup "" by empty Path "" should delete Nodes' -TestCases @( - @{StructureGroup = "areas"; Path = "" } - @{StructureGroup = "areas"; Path = $null } - @{StructureGroup = "iterations"; Path = "" } - @{StructureGroup = "iterations"; Path = $null } - ) { - param ($StructureGroup, $Path) - ## Act - Remove-VSTeamClassificationNode -ProjectName "Public Demo" -StructureGroup $StructureGroup -Path $Path -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/$StructureGroup?*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamExtension.Tests.ps1 b/unit/test/Remove-VSTeamExtension.Tests.ps1 deleted file mode 100644 index 1e1cd83ea..000000000 --- a/unit/test/Remove-VSTeamExtension.Tests.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamExtension' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamInstallState.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamExtension.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $singleResult = Get-Content "$PSScriptRoot\sampleFiles\singleExtensionResult.json" -Raw | ConvertFrom-Json - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - } - - Context 'Remove-VSTeamExtension' { - BeforeAll { - $env:Team_TOKEN = '1234' - - Mock _callAPI { return $singleResult } - } - - AfterAll { - $env:TEAM_TOKEN = $null - } - - It 'Should remove an extension' { - Remove-VSTeamExtension -PublisherId 'test' -ExtensionId 'test' -Force - - Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { - $Method -eq 'Delete' -and - $subDomain -eq 'extmgmt' -and - $version -eq [VSTeamVersions]::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/Remove-VSTeamFeed.Tests.ps1 b/unit/test/Remove-VSTeamFeed.Tests.ps1 deleted file mode 100644 index e623daed8..000000000 --- a/unit/test/Remove-VSTeamFeed.Tests.ps1 +++ /dev/null @@ -1,32 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamFeed' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getApiVersion { return '1.0-unitTests' } - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context 'Remove-VSTeamFeed' { - It 'should delete feed' { - Remove-VSTeamFeed -id '00000000-0000-0000-0000-000000000000' -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://feeds.dev.azure.com/test/_apis/packaging/feeds/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Packaging)" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamGitRepository.Tests.ps1 b/unit/test/Remove-VSTeamGitRepository.Tests.ps1 deleted file mode 100644 index cfb478aa7..000000000 --- a/unit/test/Remove-VSTeamGitRepository.Tests.ps1 +++ /dev/null @@ -1,124 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamGitRepository" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - $singleResult = [PSCustomObject]@{ - id = '' - url = '' - sshUrl = '' - remoteUrl = '' - defaultBranch = '' - size = 0 - name = '' - project = [PSCustomObject]@{ - name = 'Project' - id = 1 - description = '' - url = '' - state = '' - revision = '' - visibility = '' - } - } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - Mock Invoke-RestMethod { - # Write-Host "Single $Uri" - return $singleResult } -ParameterFilter { - $Uri -like "*00000000-0000-0000-0000-000000000000*" -or - $Uri -like "*testRepo*" - } - Mock Invoke-RestMethod { - # Write-Host "boom $Uri" - throw [System.Net.WebException] } -ParameterFilter { - $Uri -like "*00000000-0000-0000-0000-000000000101*" -or - $Uri -like "*boom*" - } - } - - Context 'Remove-VSTeamGitRepository' { - Context 'Services' { - BeforeAll { - ## Arrange - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - It 'by id should remove Git repo' { - ## Act - Remove-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000000 -Force - - ## Assert - Should -Invoke Invoke-RestMethod -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://dev.azure.com/test/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)" - } - } - - It 'by Id should throw' { - { Remove-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000101 -Force } | Should -Throw - } - } - - Context 'Server' { - BeforeAll { - ## Arrange - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - It 'by id should remove Git repo' { - ## Act - Remove-VSTeamGitRepository -id 00000000-0000-0000-0000-000000000000 -Force - - ## Assert - Should -Invoke Invoke-RestMethod -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamIteration.Tests.ps1 b/unit/test/Remove-VSTeamIteration.Tests.ps1 deleted file mode 100644 index 8443842e6..000000000 --- a/unit/test/Remove-VSTeamIteration.Tests.ps1 +++ /dev/null @@ -1,92 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamIteration' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamClassificationNode.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '5.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Remove-VSTeamIteration' { - BeforeAll { - Mock Invoke-RestMethod { - #Write-Host $args - return $null - } - } - - It 'should delete iteration' -TestCases @( - ) { - ## Act - Remove-VSTeamIteration -ProjectName "Public Demo" -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'should delete iteration with reclassification id ' -TestCases @( - @{ReClassifyId = 4 } - ) { - param ($ReClassifyId) - ## Act - Remove-VSTeamIteration -ProjectName "Public Demo" -ReClassifyId $ReClassifyId -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'with Path "" should delete iteration' -TestCases @( - @{Path = "SubPath" } - @{Path = "Path/SubPath" } - ) { - param ($Path) - ## Act - Remove-VSTeamIteration -ProjectName "Public Demo" -Path $Path -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations/$Path*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - - It 'with empty Path "" should delete iteration' -TestCases @( - @{Path = "" } - @{Path = $null } - ) { - param ($Path) - ## Act - Remove-VSTeamIteration -ProjectName "Public Demo" -Path $Path -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://dev.azure.com/test/Public Demo/_apis/wit/classificationnodes/iterations?*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamMembership.Tests.ps1 b/unit/test/Remove-VSTeamMembership.Tests.ps1 deleted file mode 100644 index ce6715a18..000000000 --- a/unit/test/Remove-VSTeamMembership.Tests.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamMembership' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/callMembershipAPI.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # You have to set the version or the api-version will not be added when [VSTeamVersions]::Graph = '' - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' } - Mock _supportsGraph - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - - $UserDescriptor = 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' - $GroupDescriptor = 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' - } - - Context 'Remove-VSTeamMembership' { - It 'Should remove a membership' { - ## Act - $null = Remove-VSTeamMembership -MemberDescriptor $UserDescriptor -ContainerDescriptor $GroupDescriptor -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Delete" -and - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$UserDescriptor/$GroupDescriptor*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamPolicy.Tests.ps1 b/unit/test/Remove-VSTeamPolicy.Tests.ps1 deleted file mode 100644 index dc75d5361..000000000 --- a/unit/test/Remove-VSTeamPolicy.Tests.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPolicy' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } - } - - Context 'Remove-VSTeamPolicy' { - It 'by id should delete the policy' { - ## Act - Remove-VSTeamPolicy -ProjectName Demo -id 4 -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations/4?api-version=$(_getApiVersion Git)" - } - } - - It 'Should throw' { - ## Act / Assert - { Remove-VSTeamPolicy -ProjectName boom -id 4 -Force } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamProfile.Tests.ps1 b/unit/test/Remove-VSTeamProfile.Tests.ps1 deleted file mode 100644 index 6da1a7ec7..000000000 --- a/unit/test/Remove-VSTeamProfile.Tests.ps1 +++ /dev/null @@ -1,40 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProfile' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProfile.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - $expectedPath = "$HOME/vsteam_profiles.json" - - Mock Set-Content { } - Mock Get-VSTeamProfile { return '[{"Name":"test","URL":"https://dev.azure.com/test","Type":"Pat","Pat":"12345","Version":"VSTS"}]' | ConvertFrom-Json | ForEach-Object { $_ } } - } - - Context 'Remove-VSTeamProfile' { - It 'should save remaining profiles to disk' { - ## Act - Remove-VSTeamProfile test - - ## Assert - Should -Invoke Set-Content -Exactly -Times 1 -Scope It -ParameterFilter { - $Path -eq $expectedPath -and ([string]$Value -eq '') - } - } - - It 'entry does not exist should save original profiles to disk' { - ## Act - Remove-VSTeamProfile demos - - ## Assert - Should -Invoke Set-Content -Exactly -Times 1 -Scope It -ParameterFilter { - $Path -eq $expectedPath -and $Value -like "*https://dev.azure.com/test*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamProject.Tests.ps1 b/unit/test/Remove-VSTeamProject.Tests.ps1 deleted file mode 100644 index a0505a37e..000000000 --- a/unit/test/Remove-VSTeamProject.Tests.ps1 +++ /dev/null @@ -1,77 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProject' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - - $singleResult = [PSCustomObject]@{ - name = 'Test' - description = '' - url = '' - id = '123-5464-dee43' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Write-Progress - Mock _trackProjectProgress - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - Mock Invoke-RestMethod { return @{status = 'inProgress'; url = 'https://someplace.com' } } -ParameterFilter { $Method -eq 'Delete' -and $Uri -eq "https://dev.azure.com/test/_apis/projects/123-5464-dee43?api-version=$(_getApiVersion Core)" } - } - - Context 'Remove-VSTeamProject with Force' { - It 'Should not call Invoke-RestMethod' { - ## Act - Remove-VSTeamProject -ProjectName Test -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - Should -Invoke Invoke-RestMethod -Times 1 -ParameterFilter { $Method -eq 'Delete' -and $Uri -eq "https://dev.azure.com/test/_apis/projects/123-5464-dee43?api-version=$(_getApiVersion Core)" } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamRelease.Tests.ps1 b/unit/test/Remove-VSTeamRelease.Tests.ps1 deleted file mode 100644 index 62c843f25..000000000 --- a/unit/test/Remove-VSTeamRelease.Tests.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamRelease' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamReleaseDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - 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*" } - } - - Context 'Remove-VSTeamRelease' { - BeforeAll { - Mock Invoke-RestMethod - Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Uri -like "*101*" } - } - - It 'by Id should remove release' { - ## Act - Remove-VSTeamRelease -ProjectName project -Id 15 -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - - It 'by Id should throw' { - ## Act / Assert - { Remove-VSTeamRelease -ProjectName project -Id 101 -Force } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Remove-VSTeamReleaseDefinition.Tests.ps1 deleted file mode 100644 index 68873ca4a..000000000 --- a/unit/test/Remove-VSTeamReleaseDefinition.Tests.ps1 +++ /dev/null @@ -1,77 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamReleaseDefinition' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - $results = [PSCustomObject]@{ - value = [PSCustomObject]@{ - queue = [PSCustomObject]@{ name = 'Default' } - _links = [PSCustomObject]@{ - self = [PSCustomObject]@{ } - web = [PSCustomObject]@{ } - } - retentionPolicy = [PSCustomObject]@{ } - lastRelease = [PSCustomObject]@{ } - artifacts = [PSCustomObject]@{ } - modifiedBy = [PSCustomObject]@{ name = 'project' } - createdBy = [PSCustomObject]@{ name = 'test' } - } - } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context 'Remove-VSTeamReleaseDefinition' { - BeforeAll { - Mock Invoke-RestMethod { return $results } - } - - Context 'Services' { - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - It 'should delete release definition' { - ## Act - Remove-VSTeamReleaseDefinition -projectName project -id 2 -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/definitions/2?api-version=$(_getApiVersion Release)" - } - } - } - - Context 'Server' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - It 'local Auth should delete release definition' { - ## Act - Remove-VSTeamReleaseDefinition -projectName project -id 2 -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Method -eq 'Delete' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/release/definitions/2?api-version=$(_getApiVersion Release)" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamTaskGroup.Tests.ps1 b/unit/test/Remove-VSTeamTaskGroup.Tests.ps1 deleted file mode 100644 index 87297b788..000000000 --- a/unit/test/Remove-VSTeamTaskGroup.Tests.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamTaskGroup' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'TaskGroups' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - } - - Context 'Remove-VSTeamTaskGroup' { - BeforeAll { - Mock Invoke-RestMethod - } - - It 'should delete Task group' { - $projectID = "d30f8b85-6b13-41a9-bb77-2e1a9c611def" - - Remove-VSTeamTaskGroup -projectName "project" -Id $projectID -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($projectID)?api-version=$(_getApiVersion TaskGroups)" -and - $Method -eq 'Delete' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamUserEntitlement.Tests.ps1 b/unit/test/Remove-VSTeamUserEntitlement.Tests.ps1 deleted file mode 100644 index 5ed0424ef..000000000 --- a/unit/test/Remove-VSTeamUserEntitlement.Tests.ps1 +++ /dev/null @@ -1,80 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamUserEntitlement" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context "Remove-VSTeamUserEntitlement" { - BeforeAll { - Mock _getApiVersion { return 'VSTS' } - # This will cause the call the _getProject to be skipped - Mock _hasProjectCacheExpired { return $false } - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } - } - - Context 'Remove-VSTeamUserEntitlement' { - BeforeAll { - # Get-VSTeamUserEntitlement by Id - Mock _callAPI { - return [PSCustomObject]@{ - accessLevel = [PSCustomObject]@{ } - email = 'test@user.com' - userName = 'Test User' - id = '00000000-0000-0000-0000-000000000000' - } - } -ParameterFilter { $Id -eq '00000000-0000-0000-0000-000000000000' } - - # Get-VSTeamUserEntitlement by email - Mock _callAPI { - return [PSCustomObject]@{ - members = [PSCustomObject]@{ - accessLevel = [PSCustomObject]@{ } - email = 'test@user.com' - userName = 'Test User' - id = '00000000-0000-0000-0000-000000000000' - } - } - } - - # Remove Call - Mock _callAPI -ParameterFilter { $Method -eq 'Delete' } - } - - It 'by Id should remove user' { - Remove-VSTeamUserEntitlement -UserId '00000000-0000-0000-0000-000000000000' -Force - Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { - $subDomain -eq 'vsaex' -and - $id -eq '00000000-0000-0000-0000-000000000000' -and - $resource -eq 'userentitlements' -and - $method -eq 'Delete' -and - $version -eq $(_getApiVersion MemberEntitlementManagement) - } - } - - It 'bye email should remove user' { - Remove-VSTeamUserEntitlement -Email 'test@user.com' -Force - Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Delete' -and - $subDomain -eq 'vsaex' -and - $id -eq '00000000-0000-0000-0000-000000000000' -and - $resource -eq 'userentitlements' -and - $version -eq $(_getApiVersion MemberEntitlementManagement) - } - } - - It 'by invalid email should throw' { - { Remove-VSTeamUserEntitlement -Email 'not@found.com' -Force } | Should -Throw - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamVariableGroup.Tests.ps1 b/unit/test/Remove-VSTeamVariableGroup.Tests.ps1 deleted file mode 100644 index b1fa51ccb..000000000 --- a/unit/test/Remove-VSTeamVariableGroup.Tests.ps1 +++ /dev/null @@ -1,69 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamVariableGroup' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - } - - Context 'Remove-VSTeamVariableGroup' { - Context 'Services' { - BeforeAll { - Mock _getApiVersion { return '5.0-preview.1' } -ParameterFilter { $Service -eq 'VariableGroups' } - - Mock _getInstance { return 'https://dev.azure.com/test' } - - BeforeAll { - Set-VSTeamAPIVersion -Target VSTS - } - - Mock Invoke-RestMethod - } - - It 'should delete variable group' { - $projectID = 1 - Remove-VSTeamVariableGroup -projectName project -Id $projectID -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$(_getApiVersion VariableGroups)" -and - $Method -eq 'Delete' - } - } - } - - Context 'Server' { - BeforeAll { - Mock _getApiVersion { return '3.2-preview.1' } -ParameterFilter { $Service -eq 'VariableGroups' } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - - BeforeAll { - Set-VSTeamAPIVersion -Target TFS2017 - } - - Mock Invoke-RestMethod - } - - It 'should delete variable group' { - $projectID = 1 - Remove-VSTeamVariableGroup -projectName project -id $projectID -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups/$($projectID)?api-version=$(_getApiVersion VariableGroups)" -and - $Method -eq 'Delete' - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Remove-VSTeamWorkItem.Tests.ps1 b/unit/test/Remove-VSTeamWorkItem.Tests.ps1 deleted file mode 100644 index 0c1fa08d9..000000000 --- a/unit/test/Remove-VSTeamWorkItem.Tests.ps1 +++ /dev/null @@ -1,101 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamWorkItem' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - $obj = @{ - id = 47 - rev = 1 - url = "https://dev.azure.com/test/_apis/wit/workItems/47" - } - - $objDeleted = @{ - id = 47 - name = "Test Work Item 47" - deletedBy = "Theobald Test " - deletedDate = "10/19/2019 9:08:48 PM" - code = 200 - resource = $obj - } - - $collectionDeleted = @( - $objDeleted - ) - } - - Context 'Remove-WorkItem' { - BeforeAll { - } - - It 'Should delete single work item' { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - #Write-Host $args - - return $collectionDeleted - } - - Remove-VSTeamWorkItem -Id 47 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/wit/workitems*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - $Uri -like "*workitems/47*" - } - } - - It 'Should throw single work item with id equals $null' { - { Remove-VSTeamWorkItem -Id $null } | Should -Throw - } - - It 'Should delete multipe work items' { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - #Write-Host $args - - return $collectionDeleted - } - - Remove-VSTeamWorkItem -Id 47, 48 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 2 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/wit/workitems*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - ($Uri -like "*workitems/47*" -or $Uri -like "*workitems/48*") - } - } - - It 'Single Work Item Should be deleted permanently' { - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - #Write-Host $args - - return $collectionDeleted - } - - Remove-VSTeamWorkItem -Id 47, 48 -Destroy -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 2 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/_apis/wit/workitems*" -and - $Uri -like "*api-version=$(_getApiVersion Core)*" -and - ($Uri -like "*workitems/47*" -or $Uri -like "*workitems/48*") -and - $Uri -like "*destroy=True*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Set-VSTeamAPIVersion.Tests.ps1 b/unit/test/Set-VSTeamAPIVersion.Tests.ps1 deleted file mode 100644 index 66997a654..000000000 --- a/unit/test/Set-VSTeamAPIVersion.Tests.ps1 +++ /dev/null @@ -1,94 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamAPIVersion' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Set-VSTeamAPIVersion' { - It 'Should default to TFS2017' { - Set-VSTeamAPIVersion - [VSTeamVersions]::Version | Should -Be 'TFS2017' - } - - It 'Should return TFS2018' { - Set-VSTeamAPIVersion -Target TFS2018 - [VSTeamVersions]::Version | Should -Be 'TFS2018' - } - - It 'Should return AzD2019' { - Set-VSTeamAPIVersion -Target AzD2019 - [VSTeamVersions]::Version | Should -Be 'AzD2019' - } - - It 'Should VSTS' { - Set-VSTeamAPIVersion -Target VSTS - [VSTeamVersions]::Version | Should -Be 'VSTS' - } - - It 'Should AzD' { - Set-VSTeamAPIVersion -Target AzD - [VSTeamVersions]::Version | Should -Be 'AzD' - } - - It 'Should change just TaskGroups' { - Set-VSTeamAPIVersion -Service TaskGroups -Version '7.0' - [VSTeamVersions]::TaskGroups | Should -Be '7.0' - } - - It 'Should change just Build' { - Set-VSTeamAPIVersion -Service Build -Version '7.0' - [VSTeamVersions]::Build | Should -Be '7.0' - } - - It 'Should change just Git' { - Set-VSTeamAPIVersion -Service Git -Version '7.0' - [VSTeamVersions]::Git | Should -Be '7.0' - } - - It 'Should change just Core' { - Set-VSTeamAPIVersion -Service Core -Version '7.0' - [VSTeamVersions]::Core | Should -Be '7.0' - } - - It 'Should change just Release' { - Set-VSTeamAPIVersion -Service Release -Version '7.0' - [VSTeamVersions]::Release | Should -Be '7.0' - } - - It 'Should change just DistributedTask' { - Set-VSTeamAPIVersion -Service DistributedTask -Version '7.0' - [VSTeamVersions]::DistributedTask | Should -Be '7.0' - } - - It 'Should change just Tfvc' { - Set-VSTeamAPIVersion -Service Tfvc -Version '7.0' - [VSTeamVersions]::Tfvc | Should -Be '7.0' - } - - It 'Should change just Packaging' { - Set-VSTeamAPIVersion -Service Packaging -Version '7.0' - [VSTeamVersions]::Packaging | Should -Be '7.0' - } - - It 'Should change just MemberEntitlementManagement' { - Set-VSTeamAPIVersion -Service MemberEntitlementManagement -Version '7.0' - [VSTeamVersions]::MemberEntitlementManagement | Should -Be '7.0' - } - - It 'Should change just ServiceFabricEndpoint' { - Set-VSTeamAPIVersion -Service ServiceEndpoints -Version '7.0' - [VSTeamVersions]::ServiceEndpoints | Should -Be '7.0' - } - - It 'Should change just ExtensionsManagement' { - Set-VSTeamAPIVersion -Service ExtensionsManagement -Version '7.0' - [VSTeamVersions]::ExtensionsManagement | Should -Be '7.0' - } - } -} \ No newline at end of file diff --git a/unit/test/Set-VSTeamApproval.Tests.ps1 b/unit/test/Set-VSTeamApproval.Tests.ps1 deleted file mode 100644 index 346aa6f3e..000000000 --- a/unit/test/Set-VSTeamApproval.Tests.ps1 +++ /dev/null @@ -1,87 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamApproval' -Tag 'unit', 'approvals' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - 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*" - } - } - - Context 'Set-VSTeamApproval' { - BeforeAll { - Mock Invoke-RestMethod { return @{ - id = 1 - revision = 1 - approver = @{ - id = 'c1f4b9a6-aee1-41f9-a2e0-070a79973ae9' - displayName = 'Test User' - } - } } - - Set-VSTeamApproval -projectName project -Id 1 -Status Rejected -Force - } - - It 'should set approval' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 ` - -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/approvals/1?api-version=$(_getApiVersion Release)" - } - } - } - - Context 'Set-VSTeamApproval handles exception' { - BeforeAll { - Mock _handleException -Verifiable - Mock Invoke-RestMethod { throw 'testing error handling' } - - Set-VSTeamApproval -projectName project -Id 1 -Status Rejected -Force - } - - It 'should set approval' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 ` - -ParameterFilter { - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/approvals/1?api-version=$(_getApiVersion Release)" - } - } - } - - Context 'Set-VSTeamApproval' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock Invoke-RestMethod { return @{ - id = 1 - revision = 1 - approver = @{ - id = 'c1f4b9a6-aee1-41f9-a2e0-070a79973ae9' - displayName = 'Test User' - } - } } - - Set-VSTeamApproval -projectName project -Id 1 -Status Rejected -Force - } - - It 'should set approval' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 ` - -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/approvals/1?api-version=$(_getApiVersion Release)" - } - } - } -} - diff --git a/unit/test/Set-VSTeamDefaultProject.Tests.ps1 b/unit/test/Set-VSTeamDefaultProject.Tests.ps1 deleted file mode 100644 index aa691ba75..000000000 --- a/unit/test/Set-VSTeamDefaultProject.Tests.ps1 +++ /dev/null @@ -1,105 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamDefaultProject' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProcessTemplateCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProcessValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProcess.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - Context 'Set-VSTeamDefaultProject' { - AfterAll { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'should set default project' { - Set-VSTeamDefaultProject 'DefaultProject' - - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -Be 'DefaultProject' - } - - It 'should update default project' { - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] = 'DefaultProject' - - Set-VSTeamDefaultProject -Project 'NextProject' - - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -Be 'NextProject' - } - } - - Context 'Set-VSTeamDefaultProject on Non Windows' { - BeforeAll { - Mock _isOnWindows { return $false } -Verifiable - } - - AfterAll { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'should set default project' { - Set-VSTeamDefaultProject 'MyProject' - - Should -InvokeVerifiable - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -Be 'MyProject' - } - } - - Context 'Set-VSTeamDefaultProject As Admin on Windows' { - BeforeAll { - Mock _isOnWindows { return $true } - Mock _testAdministrator { return $true } -Verifiable - } - - AfterAll { - $Global:PSDefaultParameterValues.Remove("*-vsteam*:projectName") - } - - It 'should set default project' { - Set-VSTeamDefaultProject 'MyProject' - - Should -InvokeVerifiable - $Global:PSDefaultParameterValues['*-vsteam*:projectName'] | Should -Be 'MyProject' - } - } -} \ No newline at end of file diff --git a/unit/test/Set-VSTeamEnvironmentStatus.Tests.ps1 b/unit/test/Set-VSTeamEnvironmentStatus.Tests.ps1 deleted file mode 100644 index ce87a4523..000000000 --- a/unit/test/Set-VSTeamEnvironmentStatus.Tests.ps1 +++ /dev/null @@ -1,56 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamReleaseStatus' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamReleaseDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - 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*" } - } - - Context 'Set-VSTeamEnvironmentStatus by ID' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $false } - Mock Invoke-RestMethod - Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Uri -like "*101*" } - - $expectedBody = ConvertTo-Json ([PSCustomObject]@{status = 'inProgress'; comment = ''; scheduledDeploymentTime = $null }) - } - - It 'should set environments' { - ## Act - Set-VSTeamEnvironmentStatus -ProjectName project -ReleaseId 1 -Id 15 -Status inProgress -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Patch' -and - $Body -eq $expectedBody -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/1/environments/15?api-version=$(_getApiVersion Release)" - } - } - - It 'by Id should throw' { - ## Act / Assert - { Set-VSTeamEnvironmentStatus -ProjectName project -ReleaseId 101 -Id 101 -Status inProgress -Force } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Set-VSTeamPermissionInheritance.Tests.ps1 b/unit/test/Set-VSTeamPermissionInheritance.Tests.ps1 deleted file mode 100644 index e3084a5a6..000000000 --- a/unit/test/Set-VSTeamPermissionInheritance.Tests.ps1 +++ /dev/null @@ -1,165 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPermissionInheritance' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamSecurityNamespace.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPermissionInheritance.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamReleaseDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamAccessControlList.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $gitRepoResult = Get-Content "$PSScriptRoot\sampleFiles\singleGitRepo.json" -Raw | ConvertFrom-Json - $buildDefresults = Get-Content "$PSScriptRoot\sampleFiles\buildDefAzD.json" -Raw | ConvertFrom-Json - $releaseDefresults = Get-Content "$PSScriptRoot\sampleFiles\releaseDefAzD.json" -Raw | ConvertFrom-Json - $accesscontrollistsResult = Get-Content "$PSScriptRoot\sampleFiles\repoAccesscontrollists.json" -Raw | ConvertFrom-Json - $gitRepoHierarchyUpdateResults = Get-Content "$PSScriptRoot\sampleFiles\gitReopHierarchyQuery_Update.json" -Raw | ConvertFrom-Json - $buildDefHierarchyUpdateResults = Get-Content "$PSScriptRoot\sampleFiles\buildDefHierarchyQuery_Update.json" -Raw | ConvertFrom-Json - $releaseDefHierarchyUpdateResults = Get-Content "$PSScriptRoot\sampleFiles\releaseDefHierarchyQuery_Update.json" -Raw | ConvertFrom-Json - - $singleResult = [PSCustomObject]@{ - name = 'Project' - description = '' - url = '' - id = '123-5464-dee43' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Build' -or $Service -eq 'Release' -or $Service -eq 'Git' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - Mock _callAPI { return $singleResult } -ParameterFilter { - $Area -eq 'projects' -and - $id -eq 'project' -and - $Version -eq "$(_getApiVersion Core)" -and - $IgnoreDefaultProject -eq $true - } - - Mock _useWindowsAuthenticationOnPremise { return $true } - } - - Context 'Set-VSTeamPermissionInheritance buildDef' { - BeforeAll { - Mock _callAPI { return $buildDefresults } -ParameterFilter { - $Area -eq 'build' -and - $Resource -eq 'definitions' -and - $Version -eq "$(_getApiVersion Build)" - } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - # Write-Host $(_getApiVersion Build) - - return $buildDefHierarchyUpdateResults - } - } - - It 'should return true' { - Set-VSTeamPermissionInheritance -projectName project -Name dynamTest-Docker-CI -resourceType BuildDefinition -NewState $false -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '*123-5464-dee43/1432*' -and - $Body -like '*33344d9c-fc72-4d6f-aba5-fa317101a7e9*' -and - $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/123-5464-dee43*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" - } - } - } - - Context 'Set-VSTeamPermissionInheritance releaseDef' { - BeforeAll { - Mock Get-VSTeamReleaseDefinition { return $releaseDefresults.value } - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - # Write-Host $(_getApiVersion Release) - - return $releaseDefHierarchyUpdateResults - } - } - - It 'should return true' { - Set-VSTeamPermissionInheritance -projectName project -Name PTracker-CD -resourceType ReleaseDefinition -NewState $false -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '*c788c23e-1b46-4162-8f5e-d7585343b5de*' -and - $Body -like '*123-5464-dee43//2*' -and - $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/123-5464-dee43*" -and - $Uri -like "*api-version=$(_getApiVersion Release)*" - } - } - } - - Context 'Set-VSTeamPermissionInheritance repository' { - BeforeAll { - Mock Get-VSTeamGitRepository { return $gitRepoResult } - Mock Get-VSTeamAccessControlList { return $accesscontrollistsResult.value } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - #Write-Host $args - #Write-Host $(_getApiVersion Git) - - return $gitRepoHierarchyUpdateResults - } - } - - It 'should return true' { - Set-VSTeamPermissionInheritance -projectName project -Name project -resourceType Repository -NewState $false -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Body -like '*2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87*' -and - $Body -like '*repoV2/123-5464-dee43/00000000-0000-0000-0000-000000000001*' -and - $Uri -like "*https://dev.azure.com/test/_apis/Contribution/HierarchyQuery/123-5464-dee43*" -and - $Uri -like "*api-version=$(_getApiVersion Git)*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Set-VSTeamReleaseStatus.Tests.ps1 b/unit/test/Set-VSTeamReleaseStatus.Tests.ps1 deleted file mode 100644 index 3776f6b0f..000000000 --- a/unit/test/Set-VSTeamReleaseStatus.Tests.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamReleaseStatus' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamReleaseDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - 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*" } - } - - Context 'Set-VSTeamReleaseStatus' { - BeforeAll { - ## Arrange - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock Invoke-RestMethod - Mock Invoke-RestMethod { throw 'error' } -ParameterFilter { $Uri -like "*101*" } - } - - It 'by Id should set release status' { - ## Act - Set-VSTeamReleaseStatus -ProjectName project -Id 15 -Status Abandoned -Force - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Patch' -and - $Body -eq '{ "id": 15, "status": "Abandoned" }' -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - - It 'by Id should throw' { - ## Act / Assert - { Set-VSTeamReleaseStatus -ProjectName project -Id 101 -Status Abandoned -Force } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeam.Tests.ps1 b/unit/test/Show-VSTeam.Tests.ps1 deleted file mode 100644 index 7fcfe2cb5..000000000 --- a/unit/test/Show-VSTeam.Tests.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeam' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Show-Browser -Verifiable - } - - Context 'Show-VSTeam' { - It 'Should open browser' { - Show-VSTeam - - Should -InvokeVerifiable - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamApproval.Tests.ps1 b/unit/test/Show-VSTeamApproval.Tests.ps1 deleted file mode 100644 index 59cc08a0b..000000000 --- a/unit/test/Show-VSTeamApproval.Tests.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamApproval' -Tag 'unit', 'approvals' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - 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 Show-Browser -Verifiable - } - - Context 'Show-VSTeamApproval' { - It 'should open in browser' { - Show-VSTeamApproval -projectName project -ReleaseDefinitionId 1 - - Should -InvokeVerifiable - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamBuild.Tests.ps1 b/unit/test/Show-VSTeamBuild.Tests.ps1 deleted file mode 100644 index e87782e0d..000000000 --- a/unit/test/Show-VSTeamBuild.Tests.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamBuild' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock Show-Browser - } - - Context 'Show-VSTeamBuild' { - it 'By ID should return url for mine' { - Show-VSTeamBuild -projectName project -Id 15 - - Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { $url -eq 'https://dev.azure.com/test/project/_build/index?buildId=15' } - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamFeed.Tests.ps1 b/unit/test/Show-VSTeamFeed.Tests.ps1 deleted file mode 100644 index 4d1870b33..000000000 --- a/unit/test/Show-VSTeamFeed.Tests.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamFeed' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - Mock Show-Browser - } - - Context 'Show-VSTeamFeed' { - It 'by name should call show-browser' { - Show-VSTeamFeed -Name module - - Should -Invoke Show-Browser - } - - It 'by id should call show-browser' { - Show-VSTeamFeed -Id '00000000-0000-0000-0000-000000000000' - - Should -Invoke Show-Browser - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamGitRepository.Tests.ps1 b/unit/test/Show-VSTeamGitRepository.Tests.ps1 deleted file mode 100644 index b862d4fb8..000000000 --- a/unit/test/Show-VSTeamGitRepository.Tests.ps1 +++ /dev/null @@ -1,72 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamGitRepository" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - Mock Show-Browser - Mock _getInstance { return 'https://dev.azure.com/test' } - } - - Context 'Show-VSTeamGitRepository' { - it 'by project should return url for mine' { - Show-VSTeamGitRepository -projectName project - - Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { - $url -eq 'https://dev.azure.com/test/_git/project' - } - } - - it 'by remote url should return url for mine' { - Show-VSTeamGitRepository -RemoteUrl 'https://dev.azure.com/test/_git/project' - - Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { - $url -eq 'https://dev.azure.com/test/_git/project' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamProject.Tests.ps1 b/unit/test/Show-VSTeamProject.Tests.ps1 deleted file mode 100644 index 2658ae764..000000000 --- a/unit/test/Show-VSTeamProject.Tests.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProject' { - BeforeAll { - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Show-Browser - } - - Context 'Show-VSTeamProject' { - It 'by ID should call start' { - Show-VSTeamProject -Id 123456 - - Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { - $Url -eq "https://dev.azure.com/test/123456" - } - } - - It 'by nameed ProjectName parameter should call open' { - Show-VSTeamProject -ProjectName ShowProject - - Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { - $Url -eq "https://dev.azure.com/test/ShowProject" - } - } - - It 'by postion projectName parameter should call open' { - Show-VSTeamProject ShowProject - - Should -Invoke Show-Browser -Exactly -Times 1 -Scope It -ParameterFilter { - $Url -eq "https://dev.azure.com/test/ShowProject" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamPullRequest.Tests.ps1 b/unit/test/Show-VSTeamPullRequest.Tests.ps1 deleted file mode 100644 index ccd5684bc..000000000 --- a/unit/test/Show-VSTeamPullRequest.Tests.ps1 +++ /dev/null @@ -1,54 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPullRequest' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamPullRequest.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTest' } -ParameterFilter { $Service -eq 'Git' } - - $singleResult = @{ - pullRequestId = 1 - repositoryName = "testreponame" - repository = @{ - project = @{ - name = "testproject" - } - } - reviewers = @{ - vote = 0 - } - } - - Mock Invoke-RestMethod { return $singleResult } - - Mock Show-Browser - } - - Context 'Show-VSTeamPullRequest' { - It 'by Id' { - Show-VSTeamPullRequest -Id 1 - - Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { - $url -eq "https://dev.azure.com/test/testproject/_git/testreponame/pullrequest/1" - } - } - - It 'with invalid ID' { - Mock Show-Browser { throw } - - { Show-VSTeamPullRequest -Id 999999 } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamRelease.Tests.ps1 b/unit/test/Show-VSTeamRelease.Tests.ps1 deleted file mode 100644 index 53ee32d15..000000000 --- a/unit/test/Show-VSTeamRelease.Tests.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamRelease' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamReleaseDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - Mock Show-Browser - } - - Context 'Show-VSTeamRelease' { - it 'by Id should show release' { - ## Act - Show-VSTeamRelease -projectName project -Id 15 - - ## Assert - Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { - $url -eq 'https://dev.azure.com/test/project/_release?releaseId=15' - } - } - - ## Act / Assert - it 'with invalid Id should throw' { - { Show-VSTeamRelease -projectName project -Id 0 } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Show-VSTeamReleaseDefinition.Tests.ps1 deleted file mode 100644 index 21c4001c6..000000000 --- a/unit/test/Show-VSTeamReleaseDefinition.Tests.ps1 +++ /dev/null @@ -1,35 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamReleaseDefinition' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Show-Browser - } - - Context 'Show-VSTeamReleaseDefinition' { - it 'by Id should return release definitions' { - Show-VSTeamReleaseDefinition -projectName project -Id 15 - - Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { - $url -eq 'https://dev.azure.com/test/project/_release?definitionId=15' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Show-VSTeamWorkItem.Tests.ps1 b/unit/test/Show-VSTeamWorkItem.Tests.ps1 deleted file mode 100644 index cc12c9cf5..000000000 --- a/unit/test/Show-VSTeamWorkItem.Tests.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamWorkItem' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - 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 Show-Browser - } - - Context 'Show-VSTeamWorkItem' { - it 'should return url for mine' { - Show-VSTeamWorkItem -projectName project -Id 15 - - Should -Invoke Show-Browser -Exactly -Scope It -Times 1 -ParameterFilter { $url -eq 'https://dev.azure.com/test/project/_workitems/edit/15' } - } - } -} \ No newline at end of file diff --git a/unit/test/Stop-VSTeamBuild.Tests.ps1 b/unit/test/Stop-VSTeamBuild.Tests.ps1 deleted file mode 100644 index bedfcad0a..000000000 --- a/unit/test/Stop-VSTeamBuild.Tests.ps1 +++ /dev/null @@ -1,54 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamBuild' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock Invoke-RestMethod - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - } - - Context 'Update Build status' { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - - } - - It 'should post changes' { - Stop-VSTeamBuild -projectName project -id 1 - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -ParameterFilter { - $Method -eq 'Patch' -and - $Body -eq '{"status":"Cancelling"}' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1?api-version=$(_getApiVersion Build)" } - } - - It 'should process pipeline with multiple ids' { - - $idArr = (1..3) - - $idArr | Stop-VSTeamBuild -projectName project - - Should -Invoke Invoke-RestMethod -Exactly -Times $idArr.Count -ParameterFilter { - $Method -eq 'Patch' -and - $Body -eq '{"status":"Cancelling"}' -and - $Uri -like "https://dev.azure.com/test/project/_apis/build/builds/*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Test-VSTeamMembership.Tests.ps1 b/unit/test/Test-VSTeamMembership.Tests.ps1 deleted file mode 100644 index aa744a7f3..000000000 --- a/unit/test/Test-VSTeamMembership.Tests.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamMembership' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/callMembershipAPI.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - Mock _supportsGraph - Mock _getApiVersion { return '5.0' } -ParameterFilter { $Service -eq 'Graph' } - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - - $UserDescriptor = 'aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj' - $GroupDescriptor = 'vssgp.Uy0xLTktMTU1MTM3NDI0NS04NTYwMDk3MjYtNDE5MzQ0MjExNy0yMzkwNzU2MTEwLTI3NDAxNjE4MjEtMC0wLTAtMC0x' - } - - Context 'Test-VSTeamMembership' { - It 'Should test membership' { - ## Act - $result = Test-VSTeamMembership -MemberDescriptor $UserDescriptor -ContainerDescriptor $GroupDescriptor - - ## Assert - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq "Head" -and - $Uri -like "https://vssps.dev.azure.com/test/_apis/graph/memberships/$UserDescriptor/$GroupDescriptor*" -and - $Uri -like "*api-version=$(_getApiVersion Graph)*" - } - - $result | Should -Be $true - } - } -} \ No newline at end of file diff --git a/unit/test/Test-VSTeamYamlPipeline.Tests.ps1 b/unit/test/Test-VSTeamYamlPipeline.Tests.ps1 deleted file mode 100644 index a3b3be31c..000000000 --- a/unit/test/Test-VSTeamYamlPipeline.Tests.ps1 +++ /dev/null @@ -1,72 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamYamlPipeline' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $resultsAzD = Get-Content "$PSScriptRoot\sampleFiles\pipelineDefYamlResult.json" -Raw | ConvertFrom-Json - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - - $testYamlPath = "$PSScriptRoot\sampleFiles\azure-pipelines.test.yml" - - Mock Invoke-RestMethod { return $resultsAzD } - } - - Context 'Test-VSTeamYamlPipeline' { - - It 'With Pipeline with PipelineID and without extra YAML' { - Test-VSTeamYamlPipeline -projectName project -PipelineId 24 - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Body -like '*"PreviewRun":*true*' -and - $Body -notlike '*YamlOverride*' - } - } - - It 'With Pipeline with PipelineID and YAML file path' { - Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -FilePath $testYamlPath - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Body -like '*"PreviewRun":*true*' -and - $Body -like '*YamlOverride*' - } - } - - It 'With Pipeline with PipelineID and YAML code' { - $yamlOverride = [string](Get-Content -raw $testYamlPath) - - Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -YamlOverride $yamlOverride - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -like "*https://dev.azure.com/test/project/_apis/pipelines/24/runs*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" -and - $Body -like '*"PreviewRun":*true*' -and - $Body -like '*YamlOverride*' - } - } - - It 'Should create Yaml result' { - $yamlResult = Test-VSTeamYamlPipeline -projectName project -PipelineId 24 -FilePath $testYamlPath - - $yamlResult | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeam.Tests.ps1 b/unit/test/Update-VSTeam.Tests.ps1 deleted file mode 100644 index 99199705f..000000000 --- a/unit/test/Update-VSTeam.Tests.ps1 +++ /dev/null @@ -1,141 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeam" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeam.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeam.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - - $singleResult = [PSCustomObject]@{ - id = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - description = 'team description' - } - } - - Context "Get-VSTeam" { - Context "services" { - BeforeAll { - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Core' } - } - - Context 'Update-VSTeam without name or description' { - It 'Should throw' { - { Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" } | Should -Throw - } - } - - Context 'Update-VSTeam with new team name' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } - } - - It 'Should update the team' { - Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" -NewTeamName "NewTeamName" - - $expectedBody = '{ "name": "NewTeamName" }' - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and - $Method -eq "Patch" -and - $Body -eq $expectedBody - } - } - } - - Context 'Update-VSTeam with new description' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } - } - - It 'Should update the team' { - Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" -Description "New Description" - - $expectedBody = '{"description": "New Description" }' - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and - $Method -eq "Patch" -and - $Body -eq $expectedBody - } - } - } - - Context 'Update-VSTeam with new team name and description' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } - } - - It 'Should update the team' { - Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" -NewTeamName "NewTeamName" -Description "New Description" - - $expectedBody = '{ "name": "NewTeamName", "description": "New Description" }' - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/Test/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and - $Method -eq "Patch" -and - $Body -eq $expectedBody - } - } - } - - Context 'Update-VSTeam, fed through pipeline' { - BeforeAll { - Mock Get-VSTeam { return New-Object -TypeName PSObject -Prop @{projectname = "TestProject"; name = "OldTeamName" } } - Mock Invoke-RestMethod { return $singleResult } - } - - It 'Should update the team' { - Get-VSTeam -ProjectName TestProject -TeamId "OldTeamName" | Update-VSTeam -NewTeamName "NewTeamName" -Description "New Description" - - $expectedBody = '{ "name": "NewTeamName", "description": "New Description" }' - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/_apis/projects/TestProject/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and - $Method -eq "Patch" -and - $Body -eq $expectedBody - } - } - } - } - - Context "Server" { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - } - - Context 'Update-VSTeam with new team name on TFS local Auth' { - BeforeAll { - Mock Invoke-RestMethod { return $singleResult } - } - - It 'Should update the team' { - Update-VSTeam -ProjectName Test -TeamToUpdate "OldTeamName" -NewTeamName "NewTeamName" - - $expectedBody = '{ "name": "NewTeamName" }' - - Should -Invoke Invoke-RestMethod -Exactly 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/_apis/projects/Test/teams/OldTeamName?api-version=$(_getApiVersion Core)" -and - $Method -eq "Patch" -and - $Body -eq $expectedBody - } - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamAgent.Tests.ps1 b/unit/test/Update-VSTeamAgent.Tests.ps1 deleted file mode 100644 index c5394df05..000000000 --- a/unit/test/Update-VSTeamAgent.Tests.ps1 +++ /dev/null @@ -1,44 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamAgent' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'DistributedTask' } - } - - Context 'Update-VSTeamAgent by ID' { - BeforeAll { - Mock Invoke-RestMethod - } - - It 'should update the agent with passed in Id' { - Update-VSTeamAgent -Pool 36 -Id 950 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Post' -and - $Uri -like "*https://dev.azure.com/test/_apis/distributedtask/pools/36/messages*" -and - $Uri -like "*api-version=$(_getApiVersion DistributedTask)*" -and - $Uri -like "*agentId=950*" - } - } - } - - Context 'Update-VSTeamAgent throws' { - BeforeAll { - Mock Invoke-RestMethod { throw 'boom' } - } - - It 'should update the agent with passed in Id' { - { Update-VSTeamAgent -Pool 36 -Id 950 -Force } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamBuild.Tests.ps1 b/unit/test/Update-VSTeamBuild.Tests.ps1 deleted file mode 100644 index 45f2d133c..000000000 --- a/unit/test/Update-VSTeamBuild.Tests.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamBuild' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock Invoke-RestMethod - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - } - - Context 'Update Build keep forever' { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - Update-VSTeamBuild -projectName project -id 1 -KeepForever $true -Force - } - - It 'should post changes' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Method -eq 'Patch' -and - $Body -eq '{"keepForever": true}' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/builds/1?api-version=$(_getApiVersion Build)" } - } - } - - Context 'Update Build number' { - BeforeAll { - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - - Mock _useWindowsAuthenticationOnPremise { return $true } - - Update-VSTeamBuild -projectName project -id 1 -BuildNumber 'TestNumber' -KeepForever $true -Force - } - - It 'should post changes' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Method -eq 'Patch' -and - $Body -eq '{"keepForever": true, "buildNumber": "TestNumber"}' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/builds/1?api-version=$(_getApiVersion Build)" } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamBuildDefinition.Tests.ps1 b/unit/test/Update-VSTeamBuildDefinition.Tests.ps1 deleted file mode 100644 index 0ac5190d8..000000000 --- a/unit/test/Update-VSTeamBuildDefinition.Tests.ps1 +++ /dev/null @@ -1,90 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamBuildDefinition" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $resultsAzD = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json - - Mock _hasProjectCacheExpired { return $false } - } - - Context "Update-VSTeamBuildDefinition" { - Context "Services" { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $resultsAzD - } - } - - It "should update build definition from json" { - # This should stop the call to cache projects - Mock _hasProjectCacheExpired { return $false } - - Update-VSTeamBuildDefinition -ProjectName Demo -Id 23 -BuildDefinition 'JSON' - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Put' -and - $Uri -like "*https://dev.azure.com/test/Demo/_apis/build/definitions/23*" -and - $Uri -like "*api-version=$(_getApiVersion Build)*" - } - } - - It 'should update build definition from file' { - # This should stop the call to cache projects - Mock _hasProjectCacheExpired { return $false } - - Update-VSTeamBuildDefinition -projectName project -id 2 -inFile 'sampleFiles/builddef.json' -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Put' -and - $InFile -eq 'sampleFiles/builddef.json' -and - $Uri -eq "https://dev.azure.com/test/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" - } - } - } - - Context 'Server' { - BeforeAll { - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Remove-VSTeamAccount - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } - - Mock _useWindowsAuthenticationOnPremise { return $true } - - Mock Invoke-RestMethod { - # If this test fails uncomment the line below to see how the mock was called. - # Write-Host $args - - return $resultsAzD - } - - Update-VSTeamBuildDefinition -projectName project -id 2 -inFile 'sampleFiles/builddef.json' -Force - } - - It 'should update build definition' { - Should -Invoke Invoke-RestMethod -Exactly -Scope Context -Times 1 -ParameterFilter { - $Method -eq 'Put' -and - $InFile -eq 'sampleFiles/builddef.json' -and - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/build/definitions/2?api-version=$(_getApiVersion Build)" - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamExtension.Tests.ps1 b/unit/test/Update-VSTeamExtension.Tests.ps1 deleted file mode 100644 index b58c29464..000000000 --- a/unit/test/Update-VSTeamExtension.Tests.ps1 +++ /dev/null @@ -1,58 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamExtension' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamInstallState.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamExtension.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } -Verifiable - - $singleResult = [PSCustomObject]@{ - extensionId = 'test' - extensionName = 'test' - publisherId = 'test' - publisherName = 'test' - version = '1.0.0' - registrationId = '12345678-9012-3456-7890-123456789012' - manifestVersion = 1 - baseUri = '' - fallbackBaseUri = '' - scopes = [PSCustomObject]@{ } - installState = [PSCustomObject]@{ - flags = 'none' - lastUpdated = '2018-10-09T11:26:47.187Z' - } - } - } - - Context 'Update-VSTeamExtension' { - BeforeAll { - $env:Team_TOKEN = '1234' - - Mock _callAPI { return $singleResult } - } - - AfterAll { - $env:TEAM_TOKEN = $null - } - - It 'Should update an extension' { - Update-VSTeamExtension -PublisherId 'test' -ExtensionId 'test' -ExtensionState disabled -Force - - Should -Invoke _callAPI -Exactly 1 -Scope It -ParameterFilter { - $Method -eq 'Post' -and - $subDomain -eq 'extmgmt' -and - $version -eq [VSTeamVersions]::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/Update-VSTeamPolicy.Tests.ps1 b/unit/test/Update-VSTeamPolicy.Tests.ps1 deleted file mode 100644 index 45ba7eb44..000000000 --- a/unit/test/Update-VSTeamPolicy.Tests.ps1 +++ /dev/null @@ -1,111 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPolicy' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamPolicy.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - ## Arrange - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod - Mock Invoke-RestMethod { throw 'Error' } -ParameterFilter { $Uri -like "*boom*" } - Mock Get-VSTeamPolicy { return @{ type = @{ id = 'babcf51f-d853-43a2-9b05-4a64ca577be0' } } } - } - - Context 'Update-VSTeamPolicy' { - It 'with type should add the policy' { - ## Act - Update-VSTeamPolicy -ProjectName Demo -id 1 -type babcf51f-d853-43a2-9b05-4a64ca577be0 -enabled -blocking -settings @{ - MinimumApproverCount = 1 - scope = @( - @{ - refName = 'refs/heads/release' - matchKind = 'Exact' - repositoryId = '20000000-0000-0000-0000-0000000000002' - }) - } - - ## Assert - # With PowerShell core the order of the boty string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - #'{"isBlocking":true,"isEnabled":true,"type":{"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"},"settings":{"scope":[{"repositoryId":"20000000-0000-0000-0000-0000000000002","matchKind":"Exact","refName":"refs/heads/release"}],"MinimumApproverCount":1}}' - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Put' -and - $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations/1?api-version=$(_getApiVersion Git)" -and - $Body -like '*"isBlocking":true*' -and - $Body -like '*"isEnabled":true*' -and - $Body -like '*"type":*' -and - $Body -like '*"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"*' -and - $Body -like '*"settings":*' -and - $Body -like '*"scope":*' -and - $Body -like '*"repositoryId":"20000000-0000-0000-0000-0000000000002"*' -and - $Body -like '*"matchKind":"Exact"*' -and - $Body -like '*"refName":"refs/heads/release"*' -and - $Body -like '*"MinimumApproverCount":1*' - } - } - - It 'without type should add the policy' { - ## Act - Update-VSTeamPolicy -ProjectName Demo -id 1 -enabled -blocking -settings @{ - MinimumApproverCount = 1 - scope = @( - @{ - refName = 'refs/heads/release' - matchKind = 'Exact' - repositoryId = '20000000-0000-0000-0000-0000000000002' - }) - } - - ## Assert - # With PowerShell core the order of the boty string is not the - # same from run to run! So instead of testing the entire string - # matches I have to search for the portions I expect but can't - # assume the order. - # The general string should look like this: - #'{"isBlocking":true,"isEnabled":true,"type":{"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"},"settings":{"scope":[{"repositoryId":"20000000-0000-0000-0000-0000000000002","matchKind":"Exact","refName":"refs/heads/release"}],"MinimumApproverCount":1}}' - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Put' -and - $Uri -eq "https://dev.azure.com/test/Demo/_apis/policy/configurations/1?api-version=$(_getApiVersion Git)" -and - $Body -like '*"isBlocking":true*' -and - $Body -like '*"isEnabled":true*' -and - $Body -like '*"type":*' -and - $Body -like '*"id":"babcf51f-d853-43a2-9b05-4a64ca577be0"*' -and - $Body -like '*"settings":*' -and - $Body -like '*"scope":*' -and - $Body -like '*"repositoryId":"20000000-0000-0000-0000-0000000000002"*' -and - $Body -like '*"matchKind":"Exact"*' -and - $Body -like '*"refName":"refs/heads/release"*' -and - $Body -like '*"MinimumApproverCount":1*' - } - } - - It 'should throw' { - ## Act / Assert - { Update-VSTeamPolicy -ProjectName boom -id 1 -type babcf51f-d853-43a2-9b05-4a64ca577be0 -enabled -blocking -settings @{ - MinimumApproverCount = 1 - scope = @( - @{ - refName = 'refs/heads/release' - matchKind = 'Exact' - repositoryId = '20000000-0000-0000-0000-0000000000002' - }) - } - } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamProfile.Tests.ps1 b/unit/test/Update-VSTeamProfile.Tests.ps1 deleted file mode 100644 index 66b51e755..000000000 --- a/unit/test/Update-VSTeamProfile.Tests.ps1 +++ /dev/null @@ -1,96 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProfile' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProfile.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $expectedPath = "$HOME/vsteam_profiles.json" - - Mock Get-Content { return '' } - # Waiting for bug fix in Pester5 - # Mock Test-Path { return $true } - } - - Context 'Update-VSTeamProfile entry does not exist' { - BeforeAll { - Mock Get-VSTeamProfile { return '[{"Name":"test","URL":"https://dev.azure.com/test","Type":"Pat","Pat":"12345","Version":"VSTS"}]' | ConvertFrom-Json | ForEach-Object { $_ } } - } - - It 'Should throw' { - { Update-VSTeamProfile -Name Testing -PersonalAccessToken 678910 } | Should -Throw - } - } - - Context 'Update-VSTeamProfile with PAT to empty file' { - BeforeAll { - Mock Set-Content - Mock Get-VSTeamProfile - Mock Write-Warning -Verifiable - } - - It 'Should save profile to disk' { - Update-VSTeamProfile -name demos -PersonalAccessToken 12345 - - Should -InvokeVerifiable - } - } - - Context 'Update-VSTeamProfile with securePersonalAccessToken' { - BeforeAll { - Mock Set-Content - Mock Get-VSTeamProfile { return '[{"Name":"test","URL":"https://dev.azure.com/test/","Type":"Pat","Pat":"12345","Version":"VSTS"}]' | ConvertFrom-Json | ForEach-Object { $_ } } - } - - It 'Should update profile' { - $password = '678910' | ConvertTo-SecureString -AsPlainText -Force - - Update-VSTeamProfile -Name test -SecurePersonalAccessToken $password - - Should -Invoke Set-Content -ParameterFilter { - $Path -eq $expectedPath -and - $Value -like "*OjY3ODkxMA==*" -and - $Value -like "*https://dev.azure.com/test*" -and - $Value -like "*VSTS*" - } - } - } - - Context 'Update-VSTeamProfile with PAT' { - BeforeAll { - Mock Set-Content - Mock Get-VSTeamProfile { return '[{"Name":"test","URL":"https://dev.azure.com/test/","Type":"Pat","Pat":"12345","Version":"VSTS"}]' | ConvertFrom-Json | ForEach-Object { $_ } } - } - - It 'Should update profile' { - Update-VSTeamProfile -Name test -PersonalAccessToken 678910 - - Should -Invoke Set-Content -ParameterFilter { - $Path -eq $expectedPath -and - $Value -like "*OjY3ODkxMA==*" -and - $Value -like "*https://dev.azure.com/test*" -and - $Value -like "*VSTS*" } - } - } - - Context 'Update-VSTeamProfile with old URL' { - BeforeAll { - Mock Test-Path { return $true } - Mock Get-Content { return '[{"Name":"test","URL":"https://test.visualstudio.com","Type":"Pat","Pat":"12345","Version":"VSTS"}]' } - Mock Set-Content - } - - It 'Should update profile with new URL' { - Update-VSTeamProfile -Name test -PersonalAccessToken 678910 - Should -Invoke Set-Content -ParameterFilter { - $Path -eq $expectedPath -and - $Value -like "*OjY3ODkxMA==*" -and - $Value -like "*https://dev.azure.com/test*" -and - $Value -like "*VSTS*" } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamProject.Tests.ps1 b/unit/test/Update-VSTeamProject.Tests.ps1 deleted file mode 100644 index 0d172bf9b..000000000 --- a/unit/test/Update-VSTeamProject.Tests.ps1 +++ /dev/null @@ -1,113 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProject' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProcessCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/ProcessTemplateCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProcessValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getApiVersion { return '1.0-unitTests' } - Mock _getInstance { return 'https://dev.azure.com/test' } - - $singleResult = [PSCustomObject]@{ - name = 'Test' - description = '' - url = '' - id = '123-5464-dee43' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - } - - Context 'Update-VSTeamProject' { - BeforeAll { - Mock Invoke-RestMethod { - return $singleResult - } - - Mock Invoke-RestMethod { - return $singleResult - } -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - - Mock Invoke-RestMethod { - return @{status = 'inProgress'; url = 'https://someplace.com' } - } -ParameterFilter { $Method -eq 'Patch' } - - Mock _trackProjectProgress - - Mock Invoke-RestMethod { return $singleResult } -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Testing123?api-version=$(_getApiVersion Core)" } - } - - It 'with no op by id should not call Invoke-RestMethod' { - Update-VSTeamProject -id '123-5464-dee43' - - Should -Invoke Invoke-RestMethod -Exactly 0 - } - - It 'with newName should change name' { - Update-VSTeamProject -ProjectName Test -newName Testing123 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { $Method -eq 'Patch' -and $Body -eq '{"name": "Testing123"}' } - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Testing123?api-version=$(_getApiVersion Core)" } - } - - It 'with newDescription should change description' { - Update-VSTeamProject -ProjectName Test -newDescription Testing123 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Times 2 -Scope It -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { $Method -eq 'Patch' -and $Body -eq '{"description": "Testing123"}' } - } - - It 'with new name and description should not call Invoke-RestMethod' { - Update-VSTeamProject -ProjectName Test -newName Testing123 -newDescription Testing123 -Force - - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Test?api-version=$(_getApiVersion Core)" } - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { $Method -eq 'Patch' } - Should -Invoke Invoke-RestMethod -Exactly -Times 1 -Scope It -ParameterFilter { $Uri -eq "https://dev.azure.com/test/_apis/projects/Testing123?api-version=$(_getApiVersion Core)" } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamPullRequest.Tests.ps1 b/unit/test/Update-VSTeamPullRequest.Tests.ps1 deleted file mode 100644 index 7f61b83a0..000000000 --- a/unit/test/Update-VSTeamPullRequest.Tests.ps1 +++ /dev/null @@ -1,103 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamPullRequest' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUser.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamUser.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - - # You have to set the version or the api-version will not be added when versions = '' - Mock _getApiVersion { return '1.0-unitTest' } -ParameterFilter { $Service -eq 'Git' -or $Service -eq 'Graph' } - - $result = Get-Content "$PSScriptRoot\sampleFiles\updatePullRequestResponse.json" -Raw | ConvertFrom-Json - $userSingleResult = Get-Content "$PSScriptRoot\sampleFiles\users.single.json" -Raw | ConvertFrom-Json - } - - Context 'Update-VSTeamPullRequest' { - It 'Update-VSTeamPullRequest to Draft' { - Mock Invoke-RestMethod { return $result } - - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Draft -Force - - Should -Invoke Invoke-RestMethod -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"isDraft": true }' - } - } - - It 'Update-VSTeamPullRequest to Published' { - Mock Invoke-RestMethod { return $result } - - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Force - - Should -Invoke Invoke-RestMethod -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"isDraft": false }' - } - } - - It 'Update-VSTeamPullRequest to set status to abandoned' { - Mock Invoke-RestMethod { return $result } - - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -Status abandoned -Force - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"status": "abandoned"}' - } - } - - It 'Update-VSTeamPullRequest to set to enable auto complete' { - Mock Invoke-RestMethod { return $userSingleResult } - - $user = Get-VSTeamUser -Descriptor "aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj" - - Mock Invoke-RestMethod { return $result } - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" ` - -PullRequestId 19543 ` - -EnableAutoComplete ` - -AutoCompleteIdentity $user ` - -Force - - Should -Invoke Invoke-RestMethod -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"autoCompleteSetBy": "aad.OTcyOTJkNzYtMjc3Yi03OTgxLWIzNDMtNTkzYmM3ODZkYjlj"}' - } - } - - It 'Update-VSTeamPullRequest to set to disable auto complete' { - Mock Invoke-RestMethod { return $result } - Update-VSTeamPullRequest -RepositoryId "45df2d67-e709-4557-a7f9-c6812b449277" -PullRequestId 19543 -DisableAutoComplete -Force - - Should -Invoke Invoke-RestMethod -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $Uri -like "*repositories/45df2d67-e709-4557-a7f9-c6812b449277/*" -and - $Uri -like "*pullrequests/19543*" -and - $Body -eq '{"autoCompleteSetBy": null}' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamRelease.Tests.ps1 b/unit/test/Update-VSTeamRelease.Tests.ps1 deleted file mode 100644 index 9e3ba2673..000000000 --- a/unit/test/Update-VSTeamRelease.Tests.ps1 +++ /dev/null @@ -1,60 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamRelease' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unittest' } -ParameterFilter { $Service -eq 'Release' } - - $singleResult = [PSCustomObject]@{ - environments = [PSCustomObject]@{ } - variables = [PSCustomObject]@{ - BrowserToUse = [PSCustomObject]@{ - value = "phantomjs" - } - } - _links = [PSCustomObject]@{ - self = [PSCustomObject]@{ } - web = [PSCustomObject]@{ } - } - } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { - $Uri -like "*_apis/projects*" - } - } - - Context 'Update-VSTeamRelease' { - BeforeAll { - Mock _useWindowsAuthenticationOnPremise { return $true } - Mock Invoke-RestMethod { - return $singleResult - } - } - - It 'should return releases' { - $r = Get-VSTeamRelease -ProjectName project -Id 15 - - $r.variables | Add-Member NoteProperty temp(@{value = 'temp' }) - - Update-VSTeamRelease -ProjectName project -Id 15 -Release $r - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Put' -and - $Body -ne $null -and - $Uri -eq "https://vsrm.dev.azure.com/test/project/_apis/release/releases/15?api-version=$(_getApiVersion Release)" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamReleaseDefinition.Tests.ps1 b/unit/test/Update-VSTeamReleaseDefinition.Tests.ps1 deleted file mode 100644 index a181956a4..000000000 --- a/unit/test/Update-VSTeamReleaseDefinition.Tests.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamReleaseDefinition" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context "Update-VSTeamReleaseDefinition" { - BeforeAll { - Mock _callApi - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Release' } - } - - It "with infile should update release" { - Update-VSTeamReleaseDefinition -ProjectName Test -InFile "releaseDef.json" -Force - - Should -Invoke _callApi -Scope It -Exactly -Times 1 -ParameterFilter { - $Method -eq "Put" -and - $SubDomain -eq 'vsrm' -and - $Area -eq 'Release' -and - $Resource -eq 'definitions' -and - $Version -eq "$(_getApiVersion Release)" -and - $InFile -eq 'releaseDef.json' - } - } - - It "with release definition should update release" { - Update-VSTeamReleaseDefinition -ProjectName Test -ReleaseDefinition "{}" -Force - - Should -Invoke _callApi -Scope It -Exactly -Times 1 -ParameterFilter { - $Method -eq "Put" -and - $SubDomain -eq 'vsrm' -and - $Area -eq 'Release' -and - $Resource -eq 'definitions' -and - $Version -eq "$(_getApiVersion Release)" -and - $InFile -eq $null -and - $Body -eq "{}" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 b/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 deleted file mode 100644 index 97e735038..000000000 --- a/unit/test/Update-VSTeamServiceEndpoint.Tests.ps1 +++ /dev/null @@ -1,58 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamServiceEndpoint' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Add-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamServiceEndpoint.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Update-VSTeamServiceEndpoint' { - BeforeAll { - Mock _hasProjectCacheExpired { return $false } - - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'ServiceEndpoints' } - - Mock Write-Progress - Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Get' } - Mock Invoke-RestMethod { return @{id = '23233-2342' } } -ParameterFilter { $Method -eq 'Put' } - Mock Invoke-RestMethod { - - # This $i is in the module. Because we use InModuleScope - # we can see it - if ($iTracking -gt 9) { - return [PSCustomObject]@{ - isReady = $true - operationStatus = [PSCustomObject]@{state = 'Ready' } - } - } - - return [PSCustomObject]@{ - isReady = $false - createdBy = [PSCustomObject]@{ } - authorization = [PSCustomObject]@{ } - data = [PSCustomObject]@{ } - operationStatus = [PSCustomObject]@{state = 'InProgress' } - } - } - } - - It 'should update Serviceendpoint' { - Update-VSTeamServiceEndpoint -projectName 'project' -id '23233-2342' ` - -object @{ key = 'value' } - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Method -eq 'Put' - } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamTaskGroup.Tests.ps1 b/unit/test/Update-VSTeamTaskGroup.Tests.ps1 deleted file mode 100644 index d62b472af..000000000 --- a/unit/test/Update-VSTeamTaskGroup.Tests.ps1 +++ /dev/null @@ -1,59 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamTaskGroup' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamTaskGroup.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - $taskGroupJson = "$PSScriptRoot\sampleFiles\taskGroup.json" - $taskGroupJsonAsString = Get-Content $taskGroupJson -Raw - - # Set the account to use for testing. A normal user would do this - # using the Set-VSTeamAccount function. - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'TaskGroups' } - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - } - - Context 'Update-VSTeamTaskGroup' { - BeforeAll { - Mock Invoke-RestMethod { - return Get-Content $taskGroupJson | ConvertFrom-Json - } - } - - It 'should update a task group using body param' { - $taskGroupToUpdate = Get-VSTeamTaskGroup -Name "For Unit Tests" -ProjectName 'project' - - Update-VSTeamTaskGroup -ProjectName 'project' -Body $taskGroupJsonAsString -Id $taskGroupToUpdate.id - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($taskGroupToUpdate.id)?api-version=$(_getApiVersion TaskGroups)" -and - $Body -eq $taskGroupJsonAsString -and - $Method -eq "Put" - } - } - - It 'should update a task group using infile param' { - $taskGroupToUpdate = Get-VSTeamTaskGroup -Name "For Unit Tests" -ProjectName 'project' - - Update-VSTeamTaskGroup -ProjectName 'project' -InFile $taskGroupJson -Id $taskGroupToUpdate.id - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/taskgroups/$($taskGroupToUpdate.id)?api-version=$(_getApiVersion TaskGroups)" -and - $InFile -eq $taskGroupJson -and - $Method -eq "Put" - } - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamUserEntitlement.Tests.ps1 b/unit/test/Update-VSTeamUserEntitlement.Tests.ps1 deleted file mode 100644 index 8a011fe95..000000000 --- a/unit/test/Update-VSTeamUserEntitlement.Tests.ps1 +++ /dev/null @@ -1,91 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamUserEntitlement" { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - } - - Context 'Update-VSTeamUserEntitlement' { - BeforeAll { - Mock _getApiVersion { return 'VSTS' } - # This will cause the call the _getProject to be skipped - Mock _hasProjectCacheExpired { return $false } - Mock _getInstance { return 'https://dev.azure.com/test' } - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'MemberEntitlementManagement' } - - # Update Call - Mock _callAPI -ParameterFilter { $Method -eq 'Patch' } - - # Get-VSTeamUserEntitlement by email - Mock _callAPI { - return [PSCustomObject]@{ - members = [PSCustomObject]@{ - accessLevel = [PSCustomObject]@{ - accountLicenseType = "Stakeholder" - licensingSource = "msdn" - msdnLicenseType = "enterprise" - } - email = 'test@user.com' - userName = 'Test User' - id = '00000000-0000-0000-0000-000000000000' - } - } - } - - # Get-VSTeamUserEntitlement by id - Mock _callAPI { - return [PSCustomObject]@{ - accessLevel = [PSCustomObject]@{ - accountLicenseType = "Stakeholder" - licensingSource = "msdn" - msdnLicenseType = "enterprise" - } - email = 'test@user.com' - userName = 'Test User' - id = '00000000-0000-0000-0000-000000000000' - } - } -ParameterFilter { $id -eq '00000000-0000-0000-0000-000000000000' } - } - - It 'by email should update a user' { - Update-VSTeamUserEntitlement -License 'Stakeholder' -LicensingSource msdn -MSDNLicenseType enterprise -Email 'test@user.com' -Force - - Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $subDomain -eq 'vsaex' -and - $id -eq '00000000-0000-0000-0000-000000000000' -and - $resource -eq 'userentitlements' -and - $version -eq $(_getApiVersion MemberEntitlementManagement) - } - } - - It 'by id should update a user' { - Update-VSTeamUserEntitlement -Id '00000000-0000-0000-0000-000000000000' -Force - - Should -Invoke _callAPI -Exactly -Times 1 -Scope It -ParameterFilter { - $Method -eq 'Patch' -and - $subDomain -eq 'vsaex' -and - $id -eq '00000000-0000-0000-0000-000000000000' -and - $resource -eq 'userentitlements' -and - $version -eq $(_getApiVersion MemberEntitlementManagement) - } - } - - It 'with wrong email should update user with invalid email should throw' { - { Update-VSTeamUserEntitlement -Email 'not@found.com' -License 'Express' -Force } | Should -Throw - } - - It 'with invalid id should update user with invalid id should throw' { - { Update-VSTeamUserEntitlement -Id '11111111-0000-0000-0000-000000000000' -License 'Express' -Force } | Should -Throw - } - } -} \ No newline at end of file diff --git a/unit/test/Update-VSTeamVariableGroup.Tests.ps1 b/unit/test/Update-VSTeamVariableGroup.Tests.ps1 deleted file mode 100644 index 81a22373d..000000000 --- a/unit/test/Update-VSTeamVariableGroup.Tests.ps1 +++ /dev/null @@ -1,115 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamVariableGroup' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Set-VSTeamAPIVersion.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamVariableGroup.ps1" - . "$PSScriptRoot/../../Source/Public/$sut" - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/project*" } - } - - Context 'Update-VSTeamVariableGroup' { - Context 'Services' { - BeforeAll { - $sampleFileVSTS = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples.json" | ConvertFrom-Json) - - Mock _getApiVersion { return 'VSTS' } - Mock _getApiVersion { return '5.0-preview.1-unitTests' } -ParameterFilter { $Service -eq 'VariableGroups' } - - Mock _getInstance { return 'https://dev.azure.com/test' } - - Mock Invoke-RestMethod { return $sampleFileVSTS.value[0] } - } - - It 'should update an exisiting Variable Group' { - $testParameters = @{ - ProjectName = "project" - Id = 1 - Name = "TestVariableGroup1" - Description = "A test variable group" - Type = "Vsts" - Variables = @{ - key1 = @{ - value = "value" - } - key2 = @{ - value = "" - isSecret = $true - } - } - ProviderData = @{ - serviceEndpointId = "AzureRMServiceEndpointGuid" - vault = "name_of_existing_key_vault" - } - } - - Update-VSTeamVariableGroup @testParameters - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/project/_apis/distributedtask/variablegroups/$($testParameters.id)?api-version=$(_getApiVersion VariableGroups)" -and - $Method -eq 'Put' - } - } - - It "should update an existing var group when passing the json as the body" { - $body = $sampleFileVSTS - $projName = "project" - $id = "1" - Update-VSTeamVariableGroup -Body $body -ProjectName $projName -Id $id - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "https://dev.azure.com/test/$projName/_apis/distributedtask/variablegroups/$($id)?api-version=$(_getApiVersion VariableGroups)" -and - $Method -eq 'Put' - } - } - } - - Context 'Server' { - BeforeAll { - $sampleFile2017 = $(Get-Content "$PSScriptRoot\sampleFiles\variableGroupSamples2017.json" | ConvertFrom-Json) - - Mock _getApiVersion { return 'TFS2017' } - Mock _getApiVersion { return '3.2-preview.1-unitTests' } - Mock _getInstance { return 'http://localhost:8080/tfs/defaultcollection' } -Verifiable - - Mock Invoke-RestMethod { return $sampleFile2017.value[0] } - } - - It 'should update an exisiting Variable Group' { - $testParameters = @{ - ProjectName = "project" - id = 1 - Name = "TestVariableGroup1" - Description = "A test variable group" - Type = "AzureKeyVault" - Variables = @{ - key1 = @{ - value = "value" - } - key2 = @{ - value = "" - isSecret = $true - } - } - } - - Update-VSTeamVariableGroup @testParameters - - Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { - $Uri -eq "http://localhost:8080/tfs/defaultcollection/project/_apis/distributedtask/variablegroups/$($testParameters.id)?api-version=$(_getApiVersion VariableGroups)" -and - $Method -eq 'Put' - } - } - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamAccessControlEntry.Tests.ps1 b/unit/test/VSTeamAccessControlEntry.Tests.ps1 deleted file mode 100644 index 2e09e94a6..000000000 --- a/unit/test/VSTeamAccessControlEntry.Tests.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamAccessControlEntry" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'Constructor' { - BeforeAll { - $accessControlEntryResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlEntryResult.json" -Raw | ConvertFrom-Json - $securityNamespaceObject = [VSTeamAccessControlEntry]::new($accessControlEntryResult.value[0]) - } - - It 'constructor should create VSTeamAccessControlEntry' { - $securityNamespaceObject | Should -Not -Be $null - } - - It 'ToString should return full description' { - $securityNamespaceObject.ToString() | Should -Be "Descriptor=Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1; Allow=8; Deny=0; ExtendedInfo=@{message=Hello World}" - } - } -} - diff --git a/unit/test/VSTeamAccessControlList.Tests.ps1 b/unit/test/VSTeamAccessControlList.Tests.ps1 deleted file mode 100644 index 9d9b5d645..000000000 --- a/unit/test/VSTeamAccessControlList.Tests.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamAccessControlList" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAccessControlEntry.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - - $accessControlListResult = Get-Content "$PSScriptRoot\sampleFiles\accessControlListResult.json" -Raw | ConvertFrom-Json - } - - Context "Constructor" { - BeforeAll { - $target = [VSTeamAccessControlList]::new($accessControlListResult.value[0]) - } - - It "toString should return token" { - $target.ToString() | Should -Be '1ba198c0-7a12-46ed-a96b-f4e77554c6d4' - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamAccount.Tests.ps1 b/unit/test/VSTeamAccount.Tests.ps1 deleted file mode 100644 index e26863194..000000000 --- a/unit/test/VSTeamAccount.Tests.ps1 +++ /dev/null @@ -1,112 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamAccount" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPools.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamExtensions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeeds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGroups.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUsers.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPermissions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'Constructor' { - BeforeAll { - Mock _getApiVersion { return '1.0-unitTests' } -ParameterFilter { $Service -eq 'Graph' -or $Service -eq 'Packaging' } - Mock Get-VSTeamProject { return [VSTeamProject]::new([PSCustomObject]@{ - name = 'TestProject' - description = '' - url = '' - id = '123 - 5464-dee43' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - ) - } - - Mock Get-VSTeamPool { - return [PSCustomObject]@{ - name = 'Default' - id = 1 - size = 1 - createdBy = [PSCustomObject]@{ } - administratorsGroup = [PSCustomObject]@{ } - serviceAccountsGroup = [PSCustomObject]@{ } - } - } - - $account = [VSTeamAccount]::new('TestAccount') - - # Skip 0 because that will be Agent Pools - # Skip 1 because that will be Extensions - # Skip 2 because that will be Feeds - # Skip 3 because that will be Permissions - $project = $account.GetChildItem()[4] - - $actual = $project.GetChildItem() - } - - It 'Should create VSTeamAccount' { - $account | Should -Not -Be $null - } - - It 'Should return projects' { - $project | Should -Not -Be $null - } - - It 'Should return builds, releases, repositories and teams' { - $actual | Should -Not -Be $null - $actual[0].Name | Should -Be 'Build Definitions' - $actual[0].ProjectName | Should -Be 'TestProject' - $actual[1].Name | Should -Be 'Builds' - $actual[1].ProjectName | Should -Be 'TestProject' - $actual[2].Name | Should -Be 'Queues' - $actual[2].ProjectName | Should -Be 'TestProject' - $actual[3].Name | Should -Be 'Release Definitions' - $actual[3].ProjectName | Should -Be 'TestProject' - $actual[4].Name | Should -Be 'Releases' - $actual[4].ProjectName | Should -Be 'TestProject' - $actual[5].Name | Should -Be 'Repositories' - $actual[5].ProjectName | Should -Be 'TestProject' - $actual[6].Name | Should -Be 'Teams' - $actual[6].ProjectName | Should -Be 'TestProject' - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamAgent.Tests.ps1 b/unit/test/VSTeamAgent.Tests.ps1 deleted file mode 100644 index 77c2a0d36..000000000 --- a/unit/test/VSTeamAgent.Tests.ps1 +++ /dev/null @@ -1,40 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamAgent" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamJobRequest.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamJobRequest.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context "GetChildItem" { - BeforeAll { - $resultsAzD = Get-Content "$PSScriptRoot/sampleFiles/jobrequestsAzD.json" -Raw | ConvertFrom-Json - Mock Get-VSTeamJobRequest { - $objs = @() - - foreach ($item in $resultsAzD.value) { - $objs += [VSTeamJobRequest]::new($item) - } - - Write-Output $objs - } - - $testAgent = Get-Content "$PSScriptRoot\sampleFiles\agentSingleResult.json" -Raw | ConvertFrom-Json - $target = [VSTeamAgent]::new($testAgent, 1) - } - - It "should return child items." { - $actual = $target.GetChildItem() - $actual | Should -Not -Be $Null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamBuildDefinitions.Tests.ps1 b/unit/test/VSTeamBuildDefinitions.Tests.ps1 deleted file mode 100644 index d2e801094..000000000 --- a/unit/test/VSTeamBuildDefinitions.Tests.ps1 +++ /dev/null @@ -1,163 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamBuildDefinitions" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - - $buildDefResultsAzD = Get-Content "$PSScriptRoot\sampleFiles\buildDefAzD.json" -Raw | ConvertFrom-Json - $buildDefResults2017 = Get-Content "$PSScriptRoot\sampleFiles\buildDef2017.json" -Raw | ConvertFrom-Json - $buildDefResults2018 = Get-Content "$PSScriptRoot\sampleFiles\buildDef2018.json" -Raw | ConvertFrom-Json - $buildDefResultsVSTS = Get-Content "$PSScriptRoot\sampleFiles\buildDefvsts.json" -Raw | ConvertFrom-Json - $buildDefResultsyaml = Get-Content "$PSScriptRoot\sampleFiles\buildDefyaml.json" -Raw | ConvertFrom-Json - - # Mock the call to Get-Projects by the dynamic parameter for ProjectName - Mock Invoke-RestMethod { return @() } -ParameterFilter { $Uri -like "*_apis/projects*" } - } - - Context "Server 2017 Constructor" { - BeforeAll { - Mock Get-VSTeamBuildDefinition { return @([VSTeamBuildDefinition]::new($buildDefResults2017.value[0], 'TestProject')) } - - $buildDefinitions = [VSTeamBuildDefinitions]::new('Build Definitions', 'TestProject') - - $hasSteps = $buildDefinitions.GetChildItem()[0] - - $steps = $hasSteps.GetChildItem() - } - - It 'Should create Build definitions' { - $buildDefinitions | Should -Not -Be $null - } - - It 'Should have Steps' { - $hasSteps | Should -Not -Be $null - } - - It 'Should parse steps' { - $steps.Length | Should -Be 10 - } - } - - Context 'Server 2018 Constructor' { - BeforeAll { - Mock Get-VSTeamBuildDefinition { return @([VSTeamBuildDefinition]::new($buildDefResults2018.value[0], 'TestProject')) } - - $buildDefinitions = [VSTeamBuildDefinitions]::new('Build Definitions', 'TestProject') - - $hasSteps = $buildDefinitions.GetChildItem()[0] - - $steps = $hasSteps.GetChildItem() - } - - It 'Should create Build definitions' { - $buildDefinitions | Should -Not -Be $null - } - - It 'Should have Steps' { - $hasSteps | Should -Not -Be $null - } - - It 'Should parse steps' { - $steps.Length | Should -Be 9 - } - } - - Context 'Services' { - BeforeAll { - Mock Get-VSTeamBuildDefinition { - return @( - [VSTeamBuildDefinition]::new($buildDefResultsVSTS.value[0], 'TestProject'), - [VSTeamBuildDefinition]::new($buildDefResultsyaml.value[0], 'TestProject'), - [VSTeamBuildDefinition]::new($buildDefResultsAzD.value[0], 'TestProject') - ) - } - - $buildDefinitions = [VSTeamBuildDefinitions]::new('Build Definitions', 'TestProject') - - $VSTeamBuildDefinitionWithPhases = $buildDefinitions.GetChildItem()[0] - - $process = $VSTeamBuildDefinitionWithPhases.GetChildItem()[0] - $steps = $process.GetChildItem() - $yamlBuild = $buildDefinitions.GetChildItem()[1] - $yamlFile = $yamlBuild.GetChildItem() - $version5Build = $buildDefinitions.GetChildItem()[2] - } - - It 'Should create Build definitions' { - $buildDefinitions | Should -Not -Be $null - } - - It 'Should parse phases' { - $VSTeamBuildDefinitionWithPhases.Process.Phases.Length | Should -Be 1 - } - - It 'Should show steps in tostring' { - $VSTeamBuildDefinitionWithPhases.Process.ToString() | Should -Be 'Number of phases: 1' - } - - It 'Should return process' { - $process | Should -Not -Be $null - } - - It 'Should parse steps' { - $steps.Length | Should -Be 9 - } - - It 'Should have yamlFilename' { - $yamlFile | Should -Be '.vsts-ci.yml' - } - - It 'Should have jobCancelTimeoutInMinutes' { - $version5Build.JobCancelTimeoutInMinutes | Should -Be '5' - } - } - - Context 'Build Definitions' { - BeforeAll { - Mock Get-VSTeamBuildDefinition { return @( - [VSTeamBuildDefinition]::new(@{ }, 'TestProject'), - [VSTeamBuildDefinition]::new(@{ }, 'TestProject') - ) - } - - $buildDefinitions = [VSTeamBuildDefinitions]::new('Build Definitions', 'TestProject') - } - - It 'Should create Build definitions' { - $buildDefinitions | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamBuilds.Tests.ps1 b/unit/test/VSTeamBuilds.Tests.ps1 deleted file mode 100644 index 09fc70aa0..000000000 --- a/unit/test/VSTeamBuilds.Tests.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamBuilds" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context "Constructor" { - BeforeAll { - Mock Get-VSTeamBuild { return @([PSCustomObject]@{ - id = 1 - description = '' - buildNumber = '1' - status = 'completed' - result = 'succeeded' - startTime = Get-Date - lastChangedBy = [PSCustomObject]@{ - id = '' - displayName = 'Test User' - uniqueName = 'test@email.com' - } - requestedBy = [PSCustomObject]@{ - id = '' - displayName = 'Test User' - uniqueName = 'test@email.com' - } - requestedFor = [PSCustomObject]@{ - id = '' - displayName = 'Test User' - uniqueName = 'test@email.com' - } - definition = [PSCustomObject]@{ - name = 'Test CI' - fullname = 'Test CI' - } - project = [PSCustomObject]@{ - name = 'Test Project' - } - } - ) - } - - $builds = [VSTeamBuilds]::new('TestBuild', 'TestProject') - $build = $builds.GetChildItem() - } - - It 'Should create Builds' { - $builds | Should -Not -Be $null - } - - It 'Should return build' { - $build | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamFeeds.Tests.ps1 b/unit/test/VSTeamFeeds.Tests.ps1 deleted file mode 100644 index dd7cfc5ef..000000000 --- a/unit/test/VSTeamFeeds.Tests.ps1 +++ /dev/null @@ -1,40 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamFeeds" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamFeed.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'Constructor' { - BeforeAll { - $feedResults = Get-Content "$PSScriptRoot\sampleFiles\feeds.json" -Raw | ConvertFrom-Json - $singleResult = $feedResults.value[0] - - Mock Get-VSTeamFeed { - return [VSTeamFeed]::new($singleResult) - } - - $target = [VSTeamFeeds]::new('Feeds') - $feed = $target.GetChildItem()[0] - } - - It 'Should create Feeds' { - $target | Should -Not -Be $null - } - - It 'Should return feed' { - $feed | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamPermissions.Tests.ps1 b/unit/test/VSTeamPermissions.Tests.ps1 deleted file mode 100644 index 5ae0f5243..000000000 --- a/unit/test/VSTeamPermissions.Tests.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamPermissions" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGroups.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUsers.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamUser.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamGroup.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context "Constructor" { - BeforeAll { - Mock Get-VSTeamUser { return [VSTeamGroup]::new(@{ }) } - Mock Get-VSTeamGroup { return [VSTeamGroup]::new(@{ }) } - - $permissions = [VSTeamPermissions]::new('Permissions') - $groups = $permissions.GetChildItem()[0] - $users = $permissions.GetChildItem()[1] - } - - It 'Should create Permissions' { - $permissions | Should -Not -Be $null - $permissions.GetChildItem().Count | Should -Be 2 - } - - It 'Should return groups' { - $groups | Should -Not -Be $null - } - - It 'Should return users' { - $users | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamPools.Tests.ps1 b/unit/test/VSTeamPools.Tests.ps1 deleted file mode 100644 index 2f8b94a78..000000000 --- a/unit/test/VSTeamPools.Tests.ps1 +++ /dev/null @@ -1,77 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamPools" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAgent.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamAgent.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'Constructor' { - BeforeAll { - Mock Get-VSTeamPool { - return [VSTeamPool]::new(@{ - owner = [PSCustomObject]@{ - displayName = 'Test User' - id = '1' - uniqueName = 'test@email.com' - } - createdBy = [PSCustomObject]@{ - displayName = 'Test User' - id = '1' - uniqueName = 'test@email.com' - } - id = 1 - size = 1 - isHosted = $false - Name = 'Default' - } - ) - } - - Mock Get-VSTeamAgent { return [VSTeamAgent]::new(@{ - _links = [PSCustomObject]@{ } - createdOn = '2018-03-28T16:48:58.317Z' - maxParallelism = 1 - id = 102 - enabled = $false - status = 'Online' - version = '1.336.1' - osDescription = 'Linux' - name = 'Test_Agent' - systemCapabilities = [PSCustomObject]@{ } - }, 1 - ) - } - - $target = [VSTeamPools]::new('Agent Pools') - $pool = $target.GetChildItem()[0] - $agent = $pool.GetChildItem()[0] - } - - It 'Should create Agent Pools' { - $target | Should -Not -Be $null - } - - It 'Should return pool' { - $pool | Should -Not -Be $null - } - - It 'Should return agent' { - $agent | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamProcessCache.Tests.ps1 b/unit/test/VSTeamProcessCache.Tests.ps1 deleted file mode 100644 index 3f1bdf8a3..000000000 --- a/unit/test/VSTeamProcessCache.Tests.ps1 +++ /dev/null @@ -1,149 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamProcessCache" { - BeforeAll { - Import-Module SHiPS - - $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/Public/Get-VSTeamProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'GetCurrent' { - BeforeAll { - # Arrange - Mock Get-VSTeamProcess { - return @( - [PSCustomObject]@{ Name = "Test1"; url = 'http://bogus.none/100' }, - [PSCustomObject]@{ Name = "Test2"; url = 'http://bogus.none/101' } - ) - } - - # I am mocking the date so I can test below that the timestamp was updated - Mock Get-Date { - return New-Object DateTime 1970, 1, 1, 0, 15, 0, ([DateTimeKind]::Utc) - } - - # Act - [VSTeamProcessCache]::Invalidate() - $actual = [VSTeamProcessCache]::GetCurrent() - } - - It 'Should call Get-VSTeamProcess' { - Should -Invoke Get-VSTeamProcess -Exactly -Scope Context -Times 1 - } - - It 'Should return array' { - # Assert - $actual.length | Should -Be 2 - } - - It 'Should set timestamp' { - # Assert - [VSTeamProcessCache]::timestamp | Should -Be 15 - } - } - - Context 'GetURl' { - BeforeAll { - # Arrange - Mock Get-VSTeamProcess { - return @( - [PSCustomObject]@{ Name = "Test1"; url = 'http://bogus.none/100' }, - [PSCustomObject]@{ Name = "Test2"; url = 'http://bogus.none/101' } - ) - } - - Mock Get-Date { - return New-Object DateTime 1970, 1, 1, 0, 15, 0, ([DateTimeKind]::Utc) - } - - # Act - [VSTeamProcessCache]::Invalidate() - $actual = [VSTeamProcessCache]::GetURL("Test1") - } - - It 'Should call Get-VSTeamProcess' { - Should -Invoke Get-VSTeamProcess -Exactly -Scope Context -Times 1 - } - - It 'Should return cache entry' { - # Assert - $actual | Should -Not -Be $null - } - - It 'Should set timestamp' { - # Assert - [VSTeamProcessCache]::timestamp | Should -Be 15 - } - } - - Context 'Update with provided list' { - BeforeAll { - # Arrange - Mock Get-VSTeamProcess - - Mock Get-Date { - return New-Object DateTime 1970, 1, 1, 0, 15, 0, ([DateTimeKind]::Utc) - } - - $list = @( - [PSCustomObject]@{ Name = "Test1"; url = 'http://bogus.none/100' }, - [PSCustomObject]@{ Name = "Test2"; url = 'http://bogus.none/101' } - ) - - # Act - [VSTeamProcessCache]::Update($list) - } - - It 'Should call Get-VSTeamProcess' { - Should -Invoke Get-VSTeamProcess -Exactly -Scope Context -Times 0 - } - - It 'Should return array' { - # Assert - [VSTeamProcessCache]::processes.length | Should -Be 2 - } - - It 'Should set timestamp' { - # Assert - [VSTeamProcessCache]::timestamp | Should -Be 15 - } - } - - Context 'Update with empty list' { - BeforeAll { - # Arrange - Mock Get-VSTeamProcess { - return @() - } - - Mock Get-Date { - return New-Object DateTime 1970, 1, 1, 0, 15, 0, ([DateTimeKind]::Utc) - } - - # Act - [VSTeamProcessCache]::Update($null) - } - - It 'Should call Get-VSTeamProcess' { - Should -Invoke Get-VSTeamProcess -Exactly -Scope Context -Times 1 - } - - It 'Should return empty array' { - # Assert - [VSTeamProcessCache]::processes.length | Should -Be 0 - } - - It 'Should set timestamp' { - # Assert - [VSTeamProcessCache]::timestamp | Should -Be 15 - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamProject.Tests.ps1 b/unit/test/VSTeamProject.Tests.ps1 deleted file mode 100644 index 531424fbd..000000000 --- a/unit/test/VSTeamProject.Tests.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamProject' -Tag 'Classes', 'Unit' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'ToString' { - BeforeAll { - $obj = @{ - name = 'Test Project' - id = 1 - description = '' - url = '' - state = '' - revision = '' - visibility = '' - } - - $target = [VSTeamProject]::new($obj) - } - - It 'should return name' { - $target.ToString() | Should -Be 'Test Project' - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamProjectCache.Tests.ps1 b/unit/test/VSTeamProjectCache.Tests.ps1 deleted file mode 100644 index f5a02d8db..000000000 --- a/unit/test/VSTeamProjectCache.Tests.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamProjectCache" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/UncachedProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Public/Remove-VSTeamAccount.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamBuildDefinition.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'GetCurrent' { - BeforeAll { - # Arrange - Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } - - Mock Get-Date { - return New-Object DateTime 1970, 1, 1, 0, 15, 0, ([DateTimeKind]::Utc) - } - - # Act - $actual = [VSTeamProjectCache]::GetCurrent($true) - } - - It 'Should call _getProjects' { - Should -Invoke _getProjects -Exactly -Scope Context -Times 1 - } - - It 'Should return array' { - # Assert - $actual.length | Should -Be 2 - } - - It 'Should set timestamp' { - # Assert - [VSTeamProjectCache]::timestamp | Should -Be 15 - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamReleases.Tests.ps1 b/unit/test/VSTeamReleases.Tests.ps1 deleted file mode 100644 index 76a3d7135..000000000 --- a/unit/test/VSTeamReleases.Tests.ps1 +++ /dev/null @@ -1,112 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamReleases" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'Constructor' { - BeforeAll { - Mock Get-VSTeamRelease { return [PSCustomObject]@{ - id = 1 - name = 'Release - 007' - status = 'active' - createdBy = [PSCustomObject]@{ - displayname = 'Test User' - uniqueName = 'test@email.com' - id = '1' - } - modifiedBy = [PSCustomObject]@{ - displayname = 'Test User' - uniqueName = 'test@email.com' - id = '1' - } - requestedFor = [PSCustomObject]@{ - displayname = '' - uniqueName = '' - id = '' - } - createdOn = Get-Date - releaseDefinition = [PSCustomObject]@{ - name = 'Test Release Def' - } - environments = @([PSCustomObject]@{ - id = 1 - name = 'Dev' - status = 'Succeeded' - deploySteps = @([PSCustomObject]@{ - id = 963 - deploymentId = 350 - attempt = 1 - reason = 'automated' - status = 'succeeded' - releaseDeployPhases = @([PSCustomObject]@{ - deploymentJobs = @([PSCustomObject]@{ - tasks = @([PSCustomObject]@{ - name = 'Initialize Job' - status = 'succeeded' - id = 1 - logUrl = '' - } - ) - } - ) - } - ) - } - ) - } - ) - } - } - - $releases = [VSTeamReleases]::new('Releases', 'TestProject') - $release = $releases.GetChildItem()[0] - $env = $release.GetChildItem()[0] - $attempt = $env.GetChildItem()[0] - $task = $attempt.GetChildItem()[0] - } - - It 'Should create Releases directory' { - $releases | Should -Not -Be $null - } - - It 'Should be named Releases' { - $releases.Name | Should -Be 'Releases' - } - - It 'Should return releases' { - $release | Should -Not -Be $null - } - - It 'Should return environments' { - $env | Should -Not -Be $null - } - - It 'Should return attempts' { - $attempt | Should -Not -Be $null - } - - It 'Should return tasks' { - $task | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamRepositories.Tests.ps1 b/unit/test/VSTeamRepositories.Tests.ps1 deleted file mode 100644 index a212a442f..000000000 --- a/unit/test/VSTeamRepositories.Tests.ps1 +++ /dev/null @@ -1,96 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamRepositories" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRef.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhaseStep.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcessPhase.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitionProcess.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamUserEntitlement.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamPool.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueue.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamQueues.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRepositories.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeams.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleaseDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuild.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuilds.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTask.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamAttempt.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamEnvironment.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamRelease.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamReleases.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamBuildDefinitions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProject.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamGitRepository.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeamGitRef.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'Constructor' { - BeforeAll { - Mock Get-VSTeamGitRepository { return [VSTeamGitRepository]::new(@{ - id = "fa7b6ac1-0d4c-46cb-8565-8fd49e2031ad" - name = '' - url = '' - defaultBranch = '' - size = '' - remoteUrl = '' - sshUrl = '' - project = [PSCustomObject]@{ - name = 'TestProject' - description = '' - url = '' - id = '123 - 5464-dee43' - state = '' - visibility = '' - revision = 0 - defaultTeam = [PSCustomObject]@{ } - _links = [PSCustomObject]@{ } - } - }, 'TestProject') - } - - Mock Get-VSTeamGitRef { return [VSTeamRef]::new([PSCustomObject]@{ - objectId = '6f365a7143e492e911c341451a734401bcacadfd' - name = 'refs/heads/master' - creator = [PSCustomObject]@{ - displayName = 'Microsoft.VisualStudio.Services.TFS' - id = '1' - uniqueName = 'some@email.com' - } - }, 'TestProject') - } - - $repositories = [VSTeamRepositories]::new('Repositories', 'TestProject') - $repository = $repositories.GetChildItem()[0] - $ref = $repository.GetChildItem()[0] - } - - It 'Should create Repositories' { - $repositories | Should -Not -Be $null - } - - It 'Should return repository' { - $repository | Should -Not -Be $null - } - - It 'Should return ref' { - $ref | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamTeams.Tests.ps1 b/unit/test/VSTeamTeams.Tests.ps1 deleted file mode 100644 index ccc3f8af9..000000000 --- a/unit/test/VSTeamTeams.Tests.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -Set-StrictMode -Version Latest - -Describe "VSTeamTeams" { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamDirectory.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamTeam.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectCompleter.ps1" - . "$PSScriptRoot/../../Source/Classes/ProjectValidateAttribute.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Public/Get-VSTeam.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context "Constructor" { - BeforeAll { - Mock Get-VSTeam { return [VSTeamTeam]::new(@{ - name = '' - ProjectName = '' - description = '' - id = 1 - }, 'TestProject') - } - - $teams = [VSTeamTeams]::new('Teams', 'TestProject') - $team = $teams.GetChildItem()[0] - } - - It 'Should create Teams' { - $teams | Should -Not -Be $null - } - - It 'Should return team' { - $team | Should -Not -Be $null - } - } -} \ No newline at end of file diff --git a/unit/test/VSTeamUserEntitlement.Tests.ps1 b/unit/test/VSTeamUserEntitlement.Tests.ps1 deleted file mode 100644 index 21b8bd8f9..000000000 --- a/unit/test/VSTeamUserEntitlement.Tests.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'VSTeamUserEntitlement' -Tag 'Classes', 'Unit' { - BeforeAll { - Import-Module SHiPS - - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamLeaf.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Private/applyTypes.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Classes/$sut" - } - - Context 'ToString' { - BeforeAll { - $obj = [PSCustomObject]@{ - displayName = 'Test User' - id = '1' - uniqueName = 'test@email.com' - } - - $target = [VSTeamUserEntitlement]::new($obj, 'Test Project') - } - - It 'should return displayname' { - $target.ToString() | Should -Be 'Test User' - } - } -} \ No newline at end of file diff --git a/unit/test/common.Tests.ps1 b/unit/test/common.Tests.ps1 deleted file mode 100644 index ccbe18c7c..000000000 --- a/unit/test/common.Tests.ps1 +++ /dev/null @@ -1,262 +0,0 @@ -Set-StrictMode -Version Latest - -Describe 'Common' { - BeforeAll { - $sut = (Split-Path -Leaf $PSCommandPath).Replace(".Tests.", ".") - - . "$PSScriptRoot/../../Source/Classes/VSTeamVersions.ps1" - . "$PSScriptRoot/../../Source/Classes/VSTeamProjectCache.ps1" - . "$PSScriptRoot/../../Source/Private/common.ps1" - . "$PSScriptRoot/../../Source/Private/$sut" - } - - Context '_convertSecureStringTo_PlainText' { - It 'Should return plain text' { - $emptySecureString = ConvertTo-SecureString 'Test String' -AsPlainText -Force - - $actual = _convertSecureStringTo_PlainText -SecureString $emptySecureString - - $actual | Should -Be 'Test String' - } - } - - Context '_buildProjectNameDynamicParam set Alias' { - BeforeAll { - Mock _getProjects - } - - It 'Should set the alias of dynamic parameter' { - $actual = _buildProjectNameDynamicParam -AliasName TestAlias - $actual["ProjectName"].Attributes[1].AliasNames | Should -Be 'TestAlias' - } - } - - Context '_getUserAgent on Mac' { - BeforeAll { - Mock Get-OperatingSystem { return 'macOS' } - [VSTeamVersions]::ModuleVersion = '0.0.0' - - $actual = _getUserAgent - } - - It 'Should return User Agent for macOS' { - $actual | Should -BeLike '*macOS*' - } - - It 'Should return User Agent for Module Version' { - $actual | Should -BeLike '*0.0.0*' - } - - It 'Should return User Agent for PowerShell Version' { - $actual | Should -BeLike "*$($PSVersionTable.PSVersion.ToString())*" - } - } - - Context '_getUserAgent on Linux' { - BeforeAll { - Mock Get-OperatingSystem { return 'Linux' } - [VSTeamVersions]::ModuleVersion = '0.0.0' - - $actual = _getUserAgent - } - - It 'Should return User Agent for Linux' { - $actual | Should -BeLike '*Linux*' - } - - It 'Should return User Agent for Module Version' { - $actual | Should -BeLike '*0.0.0*' - } - - It 'Should return User Agent for PowerShell Version' { - $actual | Should -BeLike "*$($PSVersionTable.PSVersion.ToString())*" - } - } - - Context '_buildProjectNameDynamicParam' { - BeforeAll { - Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } - } - - It 'should return dynamic parameter' { - _buildProjectNameDynamicParam | Should -Not -BeNullOrEmpty - } - } - - Context '_buildDynamicParam no defaults' { - BeforeAll { - Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } - - $testParams = @{ - ParameterName = 'TestParam' - arrSet = @(@{A = 'A' }, @{B = 'B' }) - Mandatory = $true - ParameterSetName = "NewTest" - Position = 0 - ParameterType = ([hashtable]) - ValueFromPipelineByPropertyName = $false - AliasName = "TestAlieas" - HelpMessage = "Test Help Message" - } - $param = (_buildDynamicParam @testParams) - } - - It 'should return dynamic parameter' { - $param | Should -Not -BeNullOrEmpty - } - - It 'should return dynamic parameter name' { - $param.Name | Should -Be $testParams.ParameterName - } - - It 'should return dynamic parameter type' { - $param.ParameterType.FullName | Should -Be $testParams.ParameterType.FullName - } - - It 'Should set the basic attributes of the dynamic parameter' { - $param.Attributes[0].Position | Should -Be $testParams.Position - $param.Attributes[0].Mandatory | Should -Be $testParams.Mandatory - $param.Attributes[0].ParameterSetName | Should -Be $testParams.ParameterSetName - $param.Attributes[0].ValueFromPipelineByPropertyName | Should -Be $testParams.ValueFromPipelineByPropertyName - $param.Attributes[0].HelpMessage | Should -Be $testParams.HelpMessage - } - - It 'Should set the alias attributes of the dynamic parameter' { - $param.Attributes[1].AliasNames | Should -Be $testParams.AliasName - } - - It 'Should set the possible vaule attributes of the dynamic parameter' { - (Compare-Object -ReferenceObject $param.Attributes[2].ValidValues -DifferenceObject $testParams.arrSet) | Should -BeNullOrEmpty - } - } - - Context '_buildDynamicParam defaults' { - BeforeAll { - Mock _getProjects { return ConvertFrom-Json '["Demo", "Universal"]' } - - $param = (_buildDynamicParam) - } - - It 'should return dynamic parameter' { - $param | Should -Not -BeNullOrEmpty - } - - It 'should return dynamic parameter name' { - $param.Name | Should -Be 'QueueName' - } - - It 'should return dynamic parameter type' { - $param.ParameterType.FullName | Should -Be ([string]).FullName - } - - It 'Should set the basic attributes of the dynamic parameter' { - ($param.Attributes[0].Position -lt 0) | Should -Be ($true) - $param.Attributes[0].Mandatory | Should -Be $false - $param.Attributes[0].ParameterSetName | Should -Be '__AllParameterSets' - $param.Attributes[0].ValueFromPipelineByPropertyName | Should -Be $true - $param.Attributes[0].HelpMessage | Should -BeNullOrEmpty - } - - It 'Should have no additoinal attributes of the dynamic parameter' { - $param.Attributes.Count | Should -Be 1 - } - } - - Context '_getWorkItemTypes' { - BeforeAll { - Mock _getInstance { return $null } -Verifiable - } - - It 'should return empty array' { - _getWorkItemTypes -ProjectName test | Should -Be @() - Should -InvokeVerifiable - } - } - - Context '_handleException' { - # Build a proper error - BeforeAll { - $obj = "{Value: {Message: 'Top Message'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '401'}}}" - - if ($PSVersionTable.PSEdition -ne 'Core') { - $r = [System.Net.HttpWebResponse]::new() - $e = [System.Net.WebException]::new("Test Exception", $null, [System.Net.WebExceptionStatus]::ProtocolError, $r) - } - else { - $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::Unauthorized) - $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) - } - $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue - $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) - } - - It 'Should Write two warnings' { - Mock Write-Warning -ParameterFilter { $Message -eq 'An error occurred: Test Exception' -or $Message -eq 'Top Message' } -Verifiable - - _handleException $ex - - Should -InvokeVerifiable - } - } - - Context '_handleException should re-throw' { - BeforeAll { - $e = [System.Management.Automation.RuntimeException]::new('You must call Set-VSTeamAccount before calling any other functions in this module.') - $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue - } - - It 'Should throw' { - - { _handleException $ex } | Should -Throw - } - } - - Context '_handleException message only' { - # Build a proper error - BeforeAll { - $obj = "{Value: {Message: 'Test Exception'}, Exception: {Message: 'Test Exception', Response: { StatusCode: '400'}}}" - - if ($PSVersionTable.PSEdition -ne 'Core') { - $e = [System.Net.WebException]::new("Test Exception", $null) - } - else { - $r = [System.Net.Http.HttpResponseMessage]::new([System.Net.HttpStatusCode]::BadRequest) - $e = [Microsoft.PowerShell.Commands.HttpResponseException]::new("Test Exception", $r) - } - - $ex = Write-Error -Exception $e 2>&1 -ErrorAction Continue - $ex.ErrorDetails = [System.Management.Automation.ErrorDetails]::new($obj) - } - - It 'Should Write one warnings' { - Mock Write-Warning -ParameterFilter { $Message -eq 'Test Exception' } -Verifiable - - _handleException $ex - - Should -InvokeVerifiable - } - } - - Context '_isVSTS' { - It '.visualstudio.com should return true' { - _isVSTS 'https://dev.azure.com/test' | Should -Be $true - } - - It '.visualstudio.com with / should return true' { - _isVSTS 'https://dev.azure.com/test/' | Should -Be $true - } - - It 'https://dev.azure.com should return true' { - _isVSTS 'https://dev.azure.com/test' | Should -Be $true - } - - It 'https://dev.azure.com with / should return true' { - _isVSTS 'https://dev.azure.com/test/' | Should -Be $true - } - - It 'should return false' { - _isVSTS 'http://localhost:8080/tfs/defaultcollection' | Should -Be $false - } - } -} - diff --git a/unit/test/sampleFiles/accessControlEntryResult.json b/unit/test/sampleFiles/accessControlEntryResult.json deleted file mode 100644 index 577be22f2..000000000 --- a/unit/test/sampleFiles/accessControlEntryResult.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "count": 1, - "value": [ - { - "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1", - "allow": 8, - "deny": 0, - "extendedInfo": { - "message": "Hello World" - } - } - ] -} \ No newline at end of file diff --git a/unit/test/sampleFiles/agentSingleResult.json b/unit/test/sampleFiles/agentSingleResult.json deleted file mode 100644 index d91be3ec5..000000000 --- a/unit/test/sampleFiles/agentSingleResult.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "_links": {}, - "createdOn": "2018-03-28T16:48:58.317Z", - "maxParallelism": 1, - "id": 102, - "status": "Online", - "version": "1.336.1", - "enabled": true, - "osDescription": "Linux", - "name": "Test_Agent", - "authorization": {}, - "systemCapabilities": {} -} \ No newline at end of file diff --git a/unit/test/sampleFiles/buildResults.json b/unit/test/sampleFiles/buildResults.json deleted file mode 100644 index db2215180..000000000 --- a/unit/test/sampleFiles/buildResults.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "value": { - "logs": {}, - "queue": {}, - "_links": {}, - "project": {}, - "repository": {}, - "requestedFor": {}, - "orchestrationPlan": {}, - "definition": {}, - "lastChangedBy": {}, - "requestedBy": {} - } - } \ No newline at end of file diff --git a/unit/test/sampleFiles/buildSingleResult.json b/unit/test/sampleFiles/buildSingleResult.json deleted file mode 100644 index d1a04d9f8..000000000 --- a/unit/test/sampleFiles/buildSingleResult.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "logs": {}, - "queue": {}, - "_links": {}, - "project": {}, - "repository": {}, - "requestedFor": {}, - "orchestrationPlan": {}, - "definition": {}, - "lastChangedBy": {}, - "requestedBy": {} -} \ No newline at end of file diff --git a/unit/test/sampleFiles/feeds.json b/unit/test/sampleFiles/feeds.json deleted file mode 100644 index a0379bea8..000000000 Binary files a/unit/test/sampleFiles/feeds.json and /dev/null differ diff --git a/unit/test/sampleFiles/get-vsteam.json b/unit/test/sampleFiles/get-vsteam.json deleted file mode 100644 index bd7757b6a..000000000 --- a/unit/test/sampleFiles/get-vsteam.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "00000000-0000-0000-0000-000000000000", - "name": "Project Team", - "url": "https://dev.azure.com/Project/_apis/projects/00000000-0000-0000-0000-000000000000/teams/00000000-0000-0000-0000-000000000000", - "description": "The default project team.", - "identityUrl": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "projectName": "Project", - "projectId": "00000000-0000-0000-0000-000000000000" -} diff --git a/unit/test/sampleFiles/get-vsteambuild.json b/unit/test/sampleFiles/get-vsteambuild.json deleted file mode 100644 index 090b390a6..000000000 --- a/unit/test/sampleFiles/get-vsteambuild.json +++ /dev/null @@ -1,2069 +0,0 @@ -{ - "count": 15, - "value": [ - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=568" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 568, - "buildNumber": "568", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-11-14T00:49:33.4869922Z", - "startTime": "2019-11-14T00:49:37.916511Z", - "finishTime": "2019-11-14T00:56:02.1824107Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/568", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 163, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/568", - "sourceBranch": "refs/heads/master", - "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-11-14T00:56:14.133Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/568/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": true, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/567" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=567" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 567, - "buildNumber": "567", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-11-13T22:57:31.1366485Z", - "startTime": "2019-11-13T22:57:35.3378265Z", - "finishTime": "2019-11-13T23:01:48.4753281Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/567", - "definition": { - "drafts": [], - "id": 35, - "name": "PTracker-CI-NoMobile", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=7", - "uri": "vstfs:///Build/Definition/35", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 7, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/567", - "sourceBranch": "refs/heads/master", - "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-11-13T23:02:00.413Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/567/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": true, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/561" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=561" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 561, - "buildNumber": "561", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-09-24T09:47:50.3503432Z", - "startTime": "2019-09-24T09:47:55.8261537Z", - "finishTime": "2019-09-24T09:54:09.609426Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/561", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 163, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/561", - "sourceBranch": "refs/heads/master", - "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-09-24T09:54:22.31Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/561/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/560" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=560" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 560, - "buildNumber": "560", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-09-16T14:07:31.5444889Z", - "startTime": "2019-09-16T14:07:36.8564926Z", - "finishTime": "2019-09-16T14:13:54.1086977Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/560", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 163, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/560", - "sourceBranch": "refs/heads/master", - "sourceVersion": "4aed57b05fb1840a916ed7aca0d2b81784b916be", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "individualCI", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Microsoft.VisualStudio.Services.TFS", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "lastChangedDate": "2019-09-16T14:14:07.007Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/560/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/559" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=559" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 559, - "buildNumber": "559", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-09-16T13:34:59.7905462Z", - "startTime": "2019-09-16T13:35:06.5445281Z", - "finishTime": "2019-09-16T13:41:24.5546558Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/559", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=163", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 163, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/559", - "sourceBranch": "refs/heads/master", - "sourceVersion": "b3ffb9a7c9c4a3d78da50c581aaaf3fc708d1b6c", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "individualCI", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Microsoft.VisualStudio.Services.TFS", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "lastChangedDate": "2019-09-16T13:41:36.677Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/559/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/439" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=439" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/439/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/439/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 439, - "buildNumber": "439", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-08-11T01:39:00.0335414Z", - "startTime": "2019-08-11T01:39:04.0259789Z", - "finishTime": "2019-08-11T01:45:15.9902888Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/439", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=160", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 160, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/439", - "sourceBranch": "refs/heads/master", - "sourceVersion": "3675df748e52db693ee212753e55f1c7dbf8d5cb", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-08-11T01:45:27.513Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/439/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/437" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=437" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/437/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/437/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 437, - "buildNumber": "437", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-08-10T21:17:06.5166358Z", - "startTime": "2019-08-10T21:17:10.7955997Z", - "finishTime": "2019-08-10T21:20:46.9614646Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/437", - "definition": { - "drafts": [], - "id": 35, - "name": "PTracker-CI-NoMobile", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=3", - "uri": "vstfs:///Build/Definition/35", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 3, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/437", - "sourceBranch": "refs/heads/master", - "sourceVersion": "3675df748e52db693ee212753e55f1c7dbf8d5cb", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "individualCI", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Microsoft.VisualStudio.Services.TFS", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "lastChangedDate": "2019-08-10T21:20:57.987Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/437/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/436" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=436" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/436/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/436/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 436, - "buildNumber": "436", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-08-10T20:24:49.2169814Z", - "startTime": "2019-08-10T20:24:53.4360947Z", - "finishTime": "2019-08-10T20:28:23.7547621Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/436", - "definition": { - "drafts": [], - "id": 35, - "name": "PTracker-CI-NoMobile", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=3", - "uri": "vstfs:///Build/Definition/35", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 3, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/436", - "sourceBranch": "refs/heads/master", - "sourceVersion": "704daae62cc0b089d766e252b4b1b6d5df5e8cc7", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "individualCI", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Microsoft.VisualStudio.Services.TFS", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "lastChangedDate": "2019-08-10T20:28:35.323Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/436/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/435" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=435" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/435/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/435/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 435, - "buildNumber": "435", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-08-10T19:43:50.8088667Z", - "startTime": "2019-08-10T19:43:54.8276414Z", - "finishTime": "2019-08-10T19:47:46.4447025Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/435", - "definition": { - "drafts": [], - "id": 35, - "name": "PTracker-CI-NoMobile", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=3", - "uri": "vstfs:///Build/Definition/35", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 3, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/435", - "sourceBranch": "refs/heads/master", - "sourceVersion": "ad4c7ac13f391de1b3578c626b552cf0c989362b", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "individualCI", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Microsoft.VisualStudio.Services.TFS", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "lastChangedDate": "2019-08-10T19:47:57.407Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/435/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/434" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=434" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/434/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/434/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/35" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 434, - "buildNumber": "434", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-08-10T18:22:36.8537588Z", - "startTime": "2019-08-10T18:22:40.7924134Z", - "finishTime": "2019-08-10T18:26:11.4338339Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/434", - "definition": { - "drafts": [], - "id": 35, - "name": "PTracker-CI-NoMobile", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/35?revision=3", - "uri": "vstfs:///Build/Definition/35", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 3, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/434", - "sourceBranch": "refs/heads/master", - "sourceVersion": "d053f177ccb502742f59fa82a83fd62c03049ab2", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "individualCI", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Microsoft.VisualStudio.Services.TFS", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "lastChangedDate": "2019-08-10T18:26:21.677Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/434/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/378" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=378" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/378/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/378/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 378, - "buildNumber": "378", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-07-21T11:13:16.3812613Z", - "startTime": "2019-07-21T11:13:20.271675Z", - "finishTime": "2019-07-21T11:19:35.6806252Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/378", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=139", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 139, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/378", - "sourceBranch": "refs/heads/ai", - "sourceVersion": "dcfa73e5ba9902d9418d8e95f1b6109866288bca", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-07-21T11:19:46.37Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/378/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/375" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=375" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/375/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/375/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 375, - "buildNumber": "375", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-07-20T06:07:42.8970532Z", - "startTime": "2019-07-20T06:07:46.2556853Z", - "finishTime": "2019-07-20T06:13:45.7807549Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/375", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=139", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 139, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/375", - "sourceBranch": "refs/heads/ai", - "sourceVersion": "3fd0eda7ed7a9b07d67059cf2b1a41f97b28342d", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-07-20T06:13:55.08Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/375/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/374" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=374" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/374/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/374/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 374, - "buildNumber": "374", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-07-20T05:44:18.9264275Z", - "startTime": "2019-07-20T05:44:22.0483519Z", - "finishTime": "2019-07-20T05:50:26.895186Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/374", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=139", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 139, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/374", - "sourceBranch": "refs/heads/ai", - "sourceVersion": "ea7e90eb93a52b638d8e36035f42bf3779df8572", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-07-20T05:50:36.777Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/374/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/360" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=360" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/360/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/360/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 360, - "buildNumber": "360", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-07-18T12:56:22.3506669Z", - "startTime": "2019-07-18T12:56:25.8594256Z", - "finishTime": "2019-07-18T13:05:08.4010842Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/360", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=138", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 138, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/360", - "sourceBranch": "refs/heads/ai", - "sourceVersion": "cada3319a0970da5028d37adf65bb226db53724f", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-07-18T13:05:20.217Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/360/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - }, - { - "_links": { - "self": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/358" - }, - "web": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_build/results?buildId=358" - }, - "sourceVersionDisplayUri": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/358/sources" - }, - "timeline": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/358/Timeline" - }, - "badge": { - "href": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/status/23" - } - }, - "properties": {}, - "tags": [], - "validationResults": [], - "plans": [ - { - "planId": "00000000-0000-0000-0000-000000000000" - } - ], - "triggerInfo": {}, - "id": 358, - "buildNumber": "358", - "status": "completed", - "result": "succeeded", - "queueTime": "2019-07-13T15:43:12.8662868Z", - "startTime": "2019-07-13T15:43:17.087519Z", - "finishTime": "2019-07-13T15:49:25.7371406Z", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Builds/358", - "definition": { - "drafts": [], - "id": 23, - "name": "PTracker-CI", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/Definitions/23?revision=138", - "uri": "vstfs:///Build/Definition/23", - "path": "\\", - "type": "build", - "queueStatus": "enabled", - "revision": 138, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - } - }, - "project": { - "id": "00000000-0000-0000-0000-000000000000", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/_apis/projects/00000000-0000-0000-0000-000000000000", - "state": "wellFormed", - "revision": 150, - "visibility": "private", - "lastUpdateTime": "2019-09-25T20:47:14.247Z" - }, - "uri": "vstfs:///Build/Build/358", - "sourceBranch": "refs/heads/ai", - "sourceVersion": "cada3319a0970da5028d37adf65bb226db53724f", - "queue": { - "id": 81, - "name": "Default", - "pool": { - "id": 1, - "name": "Default" - } - }, - "priority": "normal", - "reason": "manual", - "requestedFor": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "requestedBy": { - "displayName": "Donovan Brown", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "Test@fakedomain.com", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/aad.redacted", - "descriptor": "aad.redacted" - }, - "lastChangedDate": "2019-07-13T15:49:36.66Z", - "lastChangedBy": { - "displayName": "Microsoft.VisualStudio.Services.ReleaseManagement", - "url": "https://spsprodcus3.vssps.visualstudio.com/00000000-0000-0000-0000-000000000000/_apis/Identities/00000000-0000-0000-0000-000000000000", - "_links": { - "avatar": { - "href": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted" - } - }, - "id": "00000000-0000-0000-0000-000000000000", - "uniqueName": "00000000-0000-0000-0000-000000000000@00000000-0000-0000-0000-000000000000", - "imageUrl": "https://dev.azure.com/Test/_apis/GraphProfile/MemberAvatars/s2s.redacted", - "descriptor": "s2s.redacted" - }, - "parameters": "{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"system.debug\":\"false\"}", - "orchestrationPlan": { - "planId": "00000000-0000-0000-0000-000000000000" - }, - "logs": { - "id": 0, - "type": "Container", - "url": "https://dev.azure.com/Test/00000000-0000-0000-0000-000000000000/_apis/build/builds/358/logs" - }, - "repository": { - "id": "00000000-0000-0000-0000-000000000000", - "type": "TfsGit", - "name": "PeopleTracker", - "url": "https://dev.azure.com/Test/PeopleTracker/_git/PeopleTracker", - "clean": null, - "checkoutSubmodules": false - }, - "keepForever": false, - "retainedByRelease": true, - "triggeredByBuild": null - } - ] -} \ No newline at end of file diff --git a/unit/test/sampleFiles/releaseResults.json b/unit/test/sampleFiles/releaseResults.json deleted file mode 100644 index be4b479fb..000000000 --- a/unit/test/sampleFiles/releaseResults.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "value": { - "environments": {}, - "_links": { - "self": {}, - "web": {} - } - } - } \ No newline at end of file diff --git a/unit/test/sampleFiles/releaseSingleReult.json b/unit/test/sampleFiles/releaseSingleReult.json deleted file mode 100644 index c2b7e8882..000000000 --- a/unit/test/sampleFiles/releaseSingleReult.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "environments": {}, - "variables": { - "BrowserToUse": { - "value": "phantomjs" - } - }, - "_links": { - "self": {}, - "web": {} - } -} \ No newline at end of file diff --git a/unit/test/sampleFiles/variableGroupSamples.json b/unit/test/sampleFiles/variableGroupSamples.json deleted file mode 100644 index 24ea0d8f8..000000000 --- a/unit/test/sampleFiles/variableGroupSamples.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "count": 2, - "value": [ - { - "variables": { - "key1": { - "value": "value1" - }, - "key2": { - "value": null, - "isSecret": true - } - }, - "id": 1, - "type": "Vsts", - "name": "TestVariableGroup1", - "description": "A test variable group", - "createdBy": { - "displayName": "Test User", - "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", - "uniqueName": "test.user@the.cloud" - }, - "createdOn": "2019-06-28T21:04:30.56Z", - "modifiedBy": { - "displayName": "Test User", - "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", - "uniqueName": "test.user@the.cloud" - }, - "modifiedOn": "2019-06-28T21:04:30.56Z", - "isShared": false - }, - { - "variables": { - "key3": { - "enabled": true, - "contentType": "", - "value": null, - "isSecret": true - } - }, - "id": 2, - "type": "AzureKeyVault", - "name": "TestVariableGroup2", - "description": "A test variable group linked to an Azure KeyVault", - "providerData": { - "serviceEndpointId": "0228e842-65a7-4c64-90f7-0f07f3aa4e10", - "vault": "keyVaultName" - }, - "createdBy": { - "displayName": "Test User", - "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", - "uniqueName": "test.user@the.cloud" - }, - "createdOn": "2019-06-21T05:51:23.8866667Z", - "modifiedBy": { - "displayName": "Test User", - "id": "3965414d-7e1b-480b-a9fb-f9193b7a1b41", - "uniqueName": "test.user@the.cloud" - }, - "modifiedOn": "2019-06-21T05:51:24.5666667Z", - "isShared": false - } - ] -} \ No newline at end of file diff --git a/vsteam-lib.sln b/vsteam-lib.sln new file mode 100644 index 000000000..9b15c8a5a --- /dev/null +++ b/vsteam-lib.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30320.27 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vsteam-lib.Test", "Tests\library\vsteam-lib.Test.csproj", "{367B75C2-7A9B-4054-9A81-CB7749093EB7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vsteam-lib", "Source\Classes\vsteam-lib.csproj", "{E5DD8377-6932-415C-80F2-6BCAC6A3BB10}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + LibOnly|Any CPU = LibOnly|Any CPU + Release|Any CPU = Release|Any CPU + VS|Any CPU = VS|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {367B75C2-7A9B-4054-9A81-CB7749093EB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {367B75C2-7A9B-4054-9A81-CB7749093EB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {367B75C2-7A9B-4054-9A81-CB7749093EB7}.LibOnly|Any CPU.ActiveCfg = LibOnly|Any CPU + {367B75C2-7A9B-4054-9A81-CB7749093EB7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {367B75C2-7A9B-4054-9A81-CB7749093EB7}.Release|Any CPU.Build.0 = Release|Any CPU + {367B75C2-7A9B-4054-9A81-CB7749093EB7}.VS|Any CPU.ActiveCfg = VS|Any CPU + {367B75C2-7A9B-4054-9A81-CB7749093EB7}.VS|Any CPU.Build.0 = VS|Any CPU + {E5DD8377-6932-415C-80F2-6BCAC6A3BB10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5DD8377-6932-415C-80F2-6BCAC6A3BB10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5DD8377-6932-415C-80F2-6BCAC6A3BB10}.LibOnly|Any CPU.ActiveCfg = LibOnly|Any CPU + {E5DD8377-6932-415C-80F2-6BCAC6A3BB10}.LibOnly|Any CPU.Build.0 = LibOnly|Any CPU + {E5DD8377-6932-415C-80F2-6BCAC6A3BB10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5DD8377-6932-415C-80F2-6BCAC6A3BB10}.Release|Any CPU.Build.0 = Release|Any CPU + {E5DD8377-6932-415C-80F2-6BCAC6A3BB10}.VS|Any CPU.ActiveCfg = VS|Any CPU + {E5DD8377-6932-415C-80F2-6BCAC6A3BB10}.VS|Any CPU.Build.0 = VS|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4ACB3691-A58A-44A4-844D-99762A2D5C7F} + EndGlobalSection +EndGlobal