diff --git a/README.md b/README.md index 8cc2122d7..e199ced9f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ To get started you can visit this blog [PowerShell I would like you to meet TFS The cases of every file is very important. This module is to be used on Windows, Linux and OSx so case is important. If the casing does not match Linux and OSx might fail. # Release Notes +## 0.1.18 +Merge [Pull Request](https://github.com/DarqueWarrior/team/pull/5) from [Christopher Mank](https://github.com/ChristopherMank) which included the following: +- Created new function in the release module named 'Add-ReleaseEnvironment'. New function deploys an environment from an existing release. + ## 0.1.16 Merge [Pull Request](https://github.com/DarqueWarrior/team/pull/4) from [Andy Neillans](https://github.com/aneillans) which included the following: - Bug fix for broken PAT code handling. diff --git a/Team.psd1 b/Team.psd1 index 461d0fcee..6898e92ae 100644 --- a/Team.psd1 +++ b/Team.psd1 @@ -86,6 +86,7 @@ 'Add-BuildDefinition', 'Add-Project', 'Add-Release', + 'Add-ReleaseEnvironment', 'Add-ReleaseDefinition', 'Add-TeamAccount', 'Clear-DefaultProject', diff --git a/en-US/Team-Help.xml b/en-US/Team-Help.xml index 70b1f3074..3ec7c9fa7 100644 --- a/en-US/Team-Help.xml +++ b/en-US/Team-Help.xml @@ -1,6 +1,6 @@ - + - + @@ -9,11 +9,11 @@ Gets a list of approvals for all releases for a team project. - + Get Approval - + The Get-Approval function gets the approvals for all releases for a team @@ -39,7 +39,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + StatusFilter @@ -47,7 +47,7 @@ you do not have to pass the ProjectName with each call. 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 - + ReleaseIdFilter @@ -55,7 +55,7 @@ you do not have to pass the ProjectName with each call. Onlt approvals for the release ids provided will be returned. Int32[] - + AssignedToFilter @@ -63,7 +63,7 @@ you do not have to pass the ProjectName with each call. Approvals are filtered to only those assigned to this user. String - + @@ -77,9 +77,9 @@ you do not have to pass the ProjectName with each call. String String - + - + ReleaseIdFilter @@ -89,9 +89,9 @@ you do not have to pass the ProjectName with each call. Int32[] Int32[] - + - + AssignedToFilter @@ -101,9 +101,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -119,9 +119,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -129,10 +129,10 @@ you do not have to pass the ProjectName with each call. You can pipe build defintion IDs to this function. - + - + @@ -141,16 +141,16 @@ you do not have to pass the ProjectName with each call. Team.BuildDefinition - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. @@ -201,7 +201,7 @@ to pass the ProjectName with each call. Set-DefaultProject Add-BuildDefinition Remove-BuildDefinition - + @@ -210,17 +210,17 @@ Remove-BuildDefinition Add-AzureRMServiceEndpoint - + - + Add AzureRMServiceEndpoint - + - + @@ -238,33 +238,33 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + DisplayName - + String SubscriptionId - + String SubscriptionTenantId - + String EndpointName - + String @@ -275,50 +275,50 @@ you do not have to pass the ProjectName with each call. DisplayName - + String String - + - + SubscriptionId - + String String - + - + SubscriptionTenantId - + String String - + - + EndpointName - + String String - + - + @@ -334,9 +334,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -345,10 +345,10 @@ you do not have to pass the ProjectName with each call. System.String - + - + @@ -357,10 +357,10 @@ you do not have to pass the ProjectName with each call. System.Object - + - + @@ -370,20 +370,19 @@ you do not have to pass the ProjectName with each call. Add-Release - Creates a new release defintion from a JSON file. + Queues a new release - + Add Release - + - Reads a JSON file off disk and uses that file to create a new release defintion -in the provided project. - -You must call Add-TeamAccount before calling this function. + Add-Release will queue a new release. The environments will deploy according to how the +release definition is configured in the Triggers tab. + You must call Add-TeamAccount before calling this function. @@ -401,47 +400,47 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Description - + String Name - + String SourceBranch - + String ArtifactAlias - + String DefinitionId - + Int32 BuildId - + String @@ -467,26 +466,26 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Description - + String Name - + String SourceBranch - + String @@ -501,7 +500,7 @@ you do not have to pass the ProjectName with each call. DefinitionName - + String @@ -509,7 +508,7 @@ you do not have to pass the ProjectName with each call. BuildNumber - + String @@ -520,62 +519,62 @@ you do not have to pass the ProjectName with each call. DefinitionId - + Int32 Int32 - + 0 Description - + String String - + - + ArtifactAlias - + String String - + - + Name - + String String - + - + BuildId - + String String - + - + @@ -591,34 +590,34 @@ you do not have to pass the ProjectName with each call. String String - + - + DefinitionName - + String String - + - + SourceBranch - + String String - + - + Force @@ -628,7 +627,7 @@ you do not have to pass the ProjectName with each call. SwitchParameter SwitchParameter - + False @@ -636,14 +635,14 @@ you do not have to pass the ProjectName with each call. BuildNumber - + String String - + - + @@ -651,16 +650,16 @@ you do not have to pass the ProjectName with each call. System.String - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release s. @@ -685,7 +684,7 @@ id name 44 Demo-CI-44 -PS C:\>Get-ReleaseDefinition -Expand artifacts | ft id,name,@{l='Alais';e={$_.artifacts[0].alias}} +PS C:\>Get-ReleaseDefinition -Expand artifacts | ft id,name,@{l='Alais';e={$_.artifacts[0].alias}} id name Alais -- ---- ----- @@ -720,11 +719,11 @@ You must set a default project to tab complete DefinitionName and BuildNumber.Sets the status of approval to Approved, Rejected, Pending, or ReAssigned. - + Set Approval - + Set-Approval sets the status of approval to Approved, Rejected, Pending, or ReAssigned. @@ -745,7 +744,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -753,14 +752,14 @@ you do not have to pass the ProjectName with each call. Specifies the approval IDs of the approvals to set. Int32[] - + Status Specifies the status to set for the approval. -Valid values: 'Approved', 'Rejected', 'Pending', 'ReAssigned' +Valid values: 'Approved', 'Rejected', 'Pending', 'ReAssigned' String Approved @@ -772,7 +771,7 @@ Valid values: 'Approved', 'Rejected', 'Pending', & Alias of the user. chuckreinhart@outlook.com, for example. String - + Comment @@ -780,7 +779,7 @@ Alias of the user. chuckreinhart@outlook.com, for example. Specifies the comment to be stored with this approval. String - + Force @@ -788,7 +787,7 @@ Alias of the user. chuckreinhart@outlook.com, for example. Sets the status without prompting for confirmation. SwitchParameter - + @@ -808,9 +807,9 @@ you do not have to pass the ProjectName with each call. String String - + - + Id @@ -820,21 +819,21 @@ you do not have to pass the ProjectName with each call. Int32[] Int32[] - + - + Status Specifies the status to set for the approval. -Valid values: 'Approved', 'Rejected', 'Pending', 'ReAssigned' +Valid values: 'Approved', 'Rejected', 'Pending', 'ReAssigned' String String - + Approved @@ -847,9 +846,9 @@ Alias of the user. chuckreinhart@outlook.com, for example. String String - + - + Comment @@ -859,9 +858,9 @@ Alias of the user. chuckreinhart@outlook.com, for example. String String - + - + Force @@ -871,9 +870,9 @@ Alias of the user. chuckreinhart@outlook.com, for example. SwitchParameter SwitchParameter - + - + @@ -883,10 +882,10 @@ Alias of the user. chuckreinhart@outlook.com, for example. System.Int32[] System.String - + - + @@ -895,10 +894,10 @@ System.String System.Object - + - + @@ -938,11 +937,11 @@ System.String Creates a new build defintion from a JSON file. - + Add BuildDefinition - + Reads a JSON file off disk and uses that file to create a new build defintion @@ -966,7 +965,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + InFile @@ -989,9 +988,9 @@ a path and file name. String String - + - + @@ -1007,9 +1006,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -1017,16 +1016,16 @@ you do not have to pass the ProjectName with each call. System.String - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. @@ -1060,11 +1059,11 @@ on the demo team project. Gets the build defintions for a team project. - + Get BuildDefinition - + The Get-BuildDefinition function gets the build defintions for a team @@ -1091,7 +1090,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Filter @@ -1124,7 +1123,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -1155,9 +1154,9 @@ definitions whose names start with this value. For example: MS*. String String - + - + Type @@ -1168,7 +1167,7 @@ specified, all types will be returned. String String - + All @@ -1186,9 +1185,9 @@ you do not have to pass the ProjectName with each call. String String - + - + Id @@ -1200,9 +1199,9 @@ Get-BuildDefinition. Int32[] Int32[] - + - + Revision @@ -1212,7 +1211,7 @@ Get-BuildDefinition. Int32 Int32 - + -1 @@ -1222,10 +1221,10 @@ Get-BuildDefinition. You can pipe build defintion IDs to this function. - + - + @@ -1234,10 +1233,10 @@ Get-BuildDefinition. Team.BuildDefinition - + - + @@ -1266,7 +1265,7 @@ displays all available properties (*) of the build defintion objects. - + @@ -1278,11 +1277,11 @@ Remove-BuildDefinition Removes the build defintions for a team project. - + Remove BuildDefinition - + The Remove-BuildDefinition function removes the build defintions for a @@ -1305,7 +1304,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -1339,9 +1338,9 @@ Get-BuildDefinition. Int32[] Int32[] - + - + Force @@ -1353,7 +1352,7 @@ removing any build defintion. SwitchParameter SwitchParameter - + False @@ -1371,9 +1370,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -1381,10 +1380,10 @@ you do not have to pass the ProjectName with each call. You can pipe build defintion IDs to this function. - + - + @@ -1393,16 +1392,16 @@ you do not have to pass the ProjectName with each call. None - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets build definitions. @@ -1435,7 +1434,7 @@ function, which removes each build defintion object. Set-DefaultProject Add-BuildDefinition Get-BuildDefinition - + @@ -1447,11 +1446,11 @@ Get-BuildDefinition Gets the builds for a team project. - + Get Build - + The Get-Build function gets the builds for a team project. @@ -1475,7 +1474,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Top @@ -1491,7 +1490,7 @@ you do not have to pass the ProjectName with each call. Failed, or Canceled. String - + ReasonFilter @@ -1501,7 +1500,7 @@ IndividualCI, BatchedCI, Schedule, UserCreated, ValidateShelveset, CheckInShelveset, Triggered, or All. String - + StatusFilter @@ -1510,7 +1509,7 @@ CheckInShelveset, Triggered, or All. Cancelling, Postponed, NotStarted, or All. String - + Queues @@ -1534,7 +1533,7 @@ to return. with search i.e. 2015* will return all build numbers that start with 2015. String - + Type @@ -1573,7 +1572,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -1595,7 +1594,7 @@ separate the IDs. To find the ID of a build, type Get-Build. Int32 Int32 - + 0 @@ -1608,9 +1607,9 @@ Failed, or Canceled. String String - + - + ReasonFilter @@ -1622,9 +1621,9 @@ CheckInShelveset, Triggered, or All. String String - + - + StatusFilter @@ -1635,9 +1634,9 @@ Cancelling, Postponed, NotStarted, or All. String String - + - + Queues @@ -1647,9 +1646,9 @@ Cancelling, Postponed, NotStarted, or All. Int32[] Int32[] - + - + Definitions @@ -1660,9 +1659,9 @@ to return. Int32[] Int32[] - + - + BuildNumber @@ -1673,9 +1672,9 @@ with search i.e. 2015* will return all build numbers that start with 2015.String String - + - + Type @@ -1685,9 +1684,9 @@ with search i.e. 2015* will return all build numbers that start with 2015.String String - + - + MaxBuildsPerDefinition @@ -1698,7 +1697,7 @@ valid when definitions is also specified. Int32 Int32 - + 0 @@ -1710,9 +1709,9 @@ valid when definitions is also specified. String[] String[] - + - + @@ -1728,9 +1727,9 @@ you do not have to pass the ProjectName with each call. String String - + - + Id @@ -1741,9 +1740,9 @@ separate the IDs. To find the ID of a build, type Get-Build. Int32[] Int32[] - + - + @@ -1751,10 +1750,10 @@ separate the IDs. To find the ID of a build, type Get-Build. You can pipe build IDs to this function. - + - + @@ -1763,16 +1762,16 @@ separate the IDs. To find the ID of a build, type Get-Build. Team.Build - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets builds. @@ -1835,7 +1834,7 @@ displays all available properties (*) of the build objects. Set-DefaultProject Add-Build Remove-Build - + @@ -1847,11 +1846,11 @@ Remove-Build Queues a new build. - + Add Build - + Add-Build will queue a new build. You can override the queue in the build defintion by using the QueueName parameter. @@ -1874,7 +1873,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + @@ -1883,7 +1882,7 @@ you do not have to pass the ProjectName with each call. The name of the build defintion to use to queue to build. String - + @@ -1892,7 +1891,7 @@ you do not have to pass the ProjectName with each call. The name of the queue to use for this build. String - + @@ -1912,9 +1911,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -1925,9 +1924,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -1938,9 +1937,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -1948,7 +1947,7 @@ you do not have to pass the ProjectName with each call. System.String - + Build Defintion Name @@ -1957,7 +1956,7 @@ you do not have to pass the ProjectName with each call. System.String - + Queue Name @@ -1969,7 +1968,7 @@ you do not have to pass the ProjectName with each call. Team-Build - + The team build just created. @@ -2007,17 +2006,17 @@ PS C:\>Add-Build -BuildDefinition Demo-CI Remove-Build - + - + Remove Build - + - + @@ -2035,7 +2034,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -2045,7 +2044,7 @@ use commas to separate the IDs. To find the ID of a build, type Get-Build. Int32[] - + Force @@ -2055,7 +2054,7 @@ By default, Remove-Build prompts for confirmation before removing any build. SwitchParameter - + @@ -2071,9 +2070,9 @@ type Get-Build. Int32[] Int32[] - + - + Force @@ -2085,9 +2084,9 @@ any build. SwitchParameter SwitchParameter - + - + @@ -2103,9 +2102,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -2115,10 +2114,10 @@ you do not have to pass the ProjectName with each call. System.Int32[] System.String - + - + @@ -2127,10 +2126,10 @@ System.String System.Object - + - + @@ -2156,11 +2155,11 @@ System.String Gets the Azure subscriptions associated with the Team Services account. - + Get CloudSubscription - + The Get-CloudSubscription function gets the Azure subscriptions @@ -2180,10 +2179,10 @@ associated with the Team Services account. None - + - + @@ -2192,10 +2191,10 @@ associated with the Team Services account. Team.AzureSubscription - + - + @@ -2224,7 +2223,7 @@ Team Services account. Add-TeamAccount - + @@ -2233,17 +2232,17 @@ Team Services account. Get-Pool - + - + Get Pool - + - + @@ -2252,14 +2251,14 @@ Team Services account. PoolName - + String ActionFilter - + String @@ -2269,7 +2268,7 @@ Team Services account. Id - + String @@ -2280,38 +2279,38 @@ Team Services account. PoolName - + String String - + - + ActionFilter - + String String - + - + Id - + String String - + - + @@ -2320,10 +2319,10 @@ Team Services account. System.String - + - + @@ -2332,10 +2331,10 @@ Team Services account. System.Object - + - + @@ -2348,11 +2347,11 @@ Team Services account. Returns a list of projects in the Team Services or Team Foundation Server account. - + Get Project - + The list of projects returned can be controlled by using the stateFilter, top @@ -2412,7 +2411,7 @@ or All. If you do not provide a value the default is WellFormed. Name - + String @@ -2429,7 +2428,7 @@ or All. If you do not provide a value the default is WellFormed. String String - + WellFormed @@ -2441,7 +2440,7 @@ or All. If you do not provide a value the default is WellFormed. Int32 Int32 - + 100 @@ -2453,7 +2452,7 @@ or All. If you do not provide a value the default is WellFormed. Int32 Int32 - + 0 @@ -2465,9 +2464,9 @@ or All. If you do not provide a value the default is WellFormed. String String - + - + IncludeCapabilites @@ -2477,7 +2476,7 @@ or All. If you do not provide a value the default is WellFormed. SwitchParameter SwitchParameter - + False @@ -2485,14 +2484,14 @@ or All. If you do not provide a value the default is WellFormed. Name - + String String - + - + @@ -2500,10 +2499,10 @@ or All. If you do not provide a value the default is WellFormed. System.String - + - + @@ -2536,7 +2535,7 @@ or All. If you do not provide a value the default is WellFormed. Add-TeamAccount Add-Project Remove-Project - + @@ -2553,11 +2552,11 @@ Remove-Project Creates a new release defintion from a JSON file. - + Add ReleaseDefinition - + Reads a JSON file off disk and uses that file to create a new release defintion @@ -2581,7 +2580,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + InFile @@ -2604,9 +2603,9 @@ a path and file name. String String - + - + @@ -2622,9 +2621,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -2632,16 +2631,16 @@ you do not have to pass the ProjectName with each call. System.String - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. @@ -2675,11 +2674,11 @@ on the demo team project. Gets the releases for a team project. - + Get Release - + The Get-Release function gets the releases for a team @@ -2706,7 +2705,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Expand @@ -2719,56 +2718,56 @@ you do not have to pass the ProjectName with each call. StatusFilter - + String DefinitionId - + Int32 Top - + Int32 CreatedBy - + String MinCreatedTime - + DateTime MaxCreatedTime - + DateTime QueryOrder - + String ContinuationToken - + String @@ -2787,7 +2786,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -2811,105 +2810,105 @@ Get-Release. String String - + - + StatusFilter - + String String - + - + DefinitionId - + Int32 Int32 - + 0 Top - + Int32 Int32 - + 0 CreatedBy - + String String - + - + MinCreatedTime - + DateTime DateTime - + - + MaxCreatedTime - + DateTime DateTime - + - + QueryOrder - + String String - + - + ContinuationToken - + String String - + - + @@ -2925,9 +2924,9 @@ you do not have to pass the ProjectName with each call. String String - + - + Id @@ -2939,9 +2938,9 @@ Get-Release. Int32[] Int32[] - + - + @@ -2949,10 +2948,10 @@ Get-Release. You can pipe release defintion IDs to this function. - + - + @@ -2961,16 +2960,16 @@ Get-Release. Team.Release - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release s. @@ -3003,7 +3002,7 @@ displays all available properties (*) of the release defintion objects. - + @@ -3015,11 +3014,11 @@ Remove-Release Adds a Team Project to your Team Services account. - + Add Project - + This will create a new Team Project in your Team Services @@ -3035,7 +3034,7 @@ account. The name of the project to create. String - + ProcessTemplate @@ -3071,9 +3070,9 @@ Agile, Scrum or CMMI. String String - + - + ProcessTemplate @@ -3084,7 +3083,7 @@ Agile, Scrum or CMMI. String String - + Scrum @@ -3096,9 +3095,9 @@ Agile, Scrum or CMMI. String String - + - + TFVC @@ -3108,7 +3107,7 @@ Agile, Scrum or CMMI. SwitchParameter SwitchParameter - + False @@ -3120,7 +3119,7 @@ Agile, Scrum or CMMI. PS C:\> - Add-Project 'MyProject' + Add-Project 'MyProject' This will add a project name MyProject with no description using the Scrum process template and Git source control. @@ -3131,7 +3130,7 @@ template and Git source control. PS C:\> - Add-Project 'MyProject' -TFVC -ProcessTemplate Agile + Add-Project 'MyProject' -TFVC -ProcessTemplate Agile This will add a project name MyProject with no description using the Agile process template and TFVC source control. @@ -3143,7 +3142,7 @@ template and TFVC source control. Add-TeamAccount Remove-Project - + @@ -3156,11 +3155,11 @@ Remove-Project functions in this module. - + Add TeamAccount - + On Windows you have to option to store the information at the process, user @@ -3193,7 +3192,7 @@ to provide your personal access token without displaying it in plain text. To use pat simply omit it from the Add-TeamAccount command. SecureString - + @@ -3202,7 +3201,7 @@ To use pat simply omit it from the Add-TeamAccount command. 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. String - + @@ -3234,7 +3233,7 @@ http://localhost:8080/tfs/DefaultCollection 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. String - + @@ -3258,10 +3257,10 @@ http://localhost:8080/tfs/DefaultCollection UseWindowsAuthentication - Allows the use of the current user's Windows credentials to authenticate against a local TFS. + Allows the use of the current user's Windows credentials to authenticate against a local TFS. SwitchParameter - + @@ -3281,9 +3280,9 @@ http://localhost:8080/tfs/DefaultCollection String String - + - + PAT @@ -3296,9 +3295,9 @@ To use pat simply omit it from the Add-TeamAccount command. SecureString SecureString - + - + @@ -3309,9 +3308,9 @@ To use pat simply omit it from the Add-TeamAccount command. String String - + - + PersonalAccessToken @@ -3321,18 +3320,18 @@ To use pat simply omit it from the Add-TeamAccount command. String String - + - + UseWindowsAuthentication - Allows the use of the current user's Windows credentials to authenticate against a local TFS. + Allows the use of the current user's Windows credentials to authenticate against a local TFS. SwitchParameter - + @@ -3372,7 +3371,7 @@ To use pat simply omit it from the Add-TeamAccount command. Add-TeamAccount - + @@ -3384,11 +3383,11 @@ To use pat simply omit it from the Add-TeamAccount command. Clears the value stored in the default project parameter value. - + Clear DefaultProject - + Clears the value stored in the default project parameter value. @@ -3397,15 +3396,14 @@ To use pat simply omit it from the Add-TeamAccount command. Clear-DefaultProject - + Level On Windows allows you to clear your default project at the Process, User or Machine levels. String - - + @@ -3420,10 +3418,9 @@ To use pat simply omit it from the Add-TeamAccount command. String String - + - - + @@ -3445,7 +3442,7 @@ provide a project for any functions that require a project. Set-Project Add-TeamAccount - + @@ -3454,17 +3451,17 @@ Add-TeamAccount Get-Queue - + - + Get Queue - + - + @@ -3482,19 +3479,19 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + QueueName - + String ActionFilter - + String @@ -3513,12 +3510,12 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id - + String @@ -3529,26 +3526,26 @@ you do not have to pass the ProjectName with each call. QueueName - + String String - + - + ActionFilter - + String String - + - + @@ -3564,21 +3561,21 @@ you do not have to pass the ProjectName with each call. String String - + - + Id - + String String - + - + @@ -3587,10 +3584,10 @@ you do not have to pass the ProjectName with each call. System.String - + - + @@ -3599,10 +3596,10 @@ you do not have to pass the ProjectName with each call. System.Object - + - + @@ -3615,11 +3612,11 @@ you do not have to pass the ProjectName with each call. Gets the release defintions for a team project. - + Get ReleaseDefinition - + The Get-ReleaseDefinition function gets the release defintions for a team @@ -3646,7 +3643,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Expand @@ -3655,7 +3652,7 @@ you do not have to pass the ProjectName with each call. Definition (environments, artifacts, none). String - + @@ -3672,7 +3669,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -3701,9 +3698,9 @@ you do not have to pass the ProjectName with each call. String String - + - + Expand @@ -3714,9 +3711,9 @@ Definition (environments, artifacts, none). String String - + - + Id @@ -3728,9 +3725,9 @@ Get-ReleaseDefinition. Int32[] Int32[] - + - + @@ -3738,10 +3735,10 @@ Get-ReleaseDefinition. Int[] - + - + @@ -3750,10 +3747,10 @@ Get-ReleaseDefinition. Team.ReleaseDefinition - + - + @@ -3780,7 +3777,7 @@ displays all available properties (*) of the release defintion objects. Add-TeamAccount - + Set-DefaultProject @@ -3798,17 +3795,17 @@ displays all available properties (*) of the release defintion objects. Get-ServiceEndpoint - + - + Get ServiceEndpoint - + - + @@ -3826,7 +3823,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + @@ -3843,12 +3840,12 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id - + String @@ -3870,21 +3867,21 @@ you do not have to pass the ProjectName with each call. String String - + - + Id - + String String - + - + @@ -3893,10 +3890,10 @@ you do not have to pass the ProjectName with each call. System.String - + - + @@ -3905,10 +3902,10 @@ you do not have to pass the ProjectName with each call. System.Object - + - + @@ -3921,11 +3918,11 @@ you do not have to pass the ProjectName with each call. Removes the releases for a team project. - + Remove Release - + The Remove-Release function removes the releases for a @@ -3948,7 +3945,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -3982,9 +3979,9 @@ Get-Release. Int32[] Int32[] - + - + Force @@ -3996,7 +3993,7 @@ removing any release defintion. SwitchParameter SwitchParameter - + False @@ -4014,9 +4011,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -4024,10 +4021,10 @@ you do not have to pass the ProjectName with each call. You can pipe release defintion IDs to this function. - + - + @@ -4036,16 +4033,16 @@ you do not have to pass the ProjectName with each call. None - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release s. @@ -4078,7 +4075,7 @@ function, which removes each release defintion object. Set-DefaultProject Add-Release Get-Release - + @@ -4090,11 +4087,11 @@ Get-Release Removes the release defintions for a team project. - + Remove ReleaseDefinition - + The Remove-ReleaseDefinition function removes the release defintions for a @@ -4117,7 +4114,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -4151,9 +4148,9 @@ Get-ReleaseDefinition. Int32[] Int32[] - + - + Force @@ -4165,7 +4162,7 @@ removing any release defintion. SwitchParameter SwitchParameter - + False @@ -4183,9 +4180,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -4193,10 +4190,10 @@ you do not have to pass the ProjectName with each call. You can pipe release defintion IDs to this function. - + - + @@ -4205,16 +4202,16 @@ you do not have to pass the ProjectName with each call. None - + - + - + This function has a Dynamic Parameter for ProjectName that specifies the project for which this function gets release definitions. @@ -4247,7 +4244,7 @@ function, which removes each release defintion object. Set-DefaultProject Add-ReleaseDefinition Get-ReleaseDefinition - + @@ -4256,17 +4253,17 @@ Get-ReleaseDefinition Remove-ServiceEndpoint - + - + Remove ServiceEndpoint - + - + @@ -4284,19 +4281,19 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id - + String[] Force - + SwitchParameter @@ -4307,26 +4304,26 @@ you do not have to pass the ProjectName with each call. Id - + String[] String[] - + - + Force - + SwitchParameter SwitchParameter - + - + @@ -4342,9 +4339,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -4354,10 +4351,10 @@ you do not have to pass the ProjectName with each call. System.String[] System.String - + - + @@ -4366,10 +4363,10 @@ System.String System.Object - + - + @@ -4382,11 +4379,11 @@ System.String Deletes the Team Project from your Team Services account. - + Remove Project - + This will permanently delete your Team Project from your Team Services @@ -4406,7 +4403,7 @@ the Pipeline by Property Name Name of the project to remove. String - + Force @@ -4431,7 +4428,7 @@ the project. SwitchParameter SwitchParameter - + False @@ -4444,9 +4441,9 @@ the project. String String - + - + @@ -4454,10 +4451,10 @@ the project. System.String - + - + @@ -4468,7 +4465,7 @@ the project. PS C:\> - Remove-Project 'MyProject' + Remove-Project 'MyProject' You will be prompted for confirmation and the project will be deleted. @@ -4478,7 +4475,7 @@ the project. PS C:\> - Remove-Project 'MyProject' -Force + Remove-Project 'MyProject' -Force You will NOT be prompted for confirmation and the project will be deleted. @@ -4499,7 +4496,7 @@ the project. Add-TeamAccount Add-Project - + @@ -4511,14 +4508,14 @@ Add-Project Displays your current account and default project. - + Get TeamInfo - + - + @@ -4546,7 +4543,7 @@ Add-Project Add-TeamAccount - + @@ -4558,11 +4555,11 @@ Add-Project Sets the status of a release to Active or Abandoned. - + Set ReleaseStatus - + Set-ReleaseStatus lets you set the status of the release to Acitve or Abandoned. @@ -4583,7 +4580,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + Id @@ -4593,7 +4590,7 @@ use commas to separate the IDs. To find the ID of a release type Get-Release. Int32[] - + Status @@ -4601,7 +4598,7 @@ type Get-Release. The status to set for the release Active or Abandoned. String - + Force @@ -4611,7 +4608,7 @@ By default, Set-ReleaseStatus prompts for confirmation before changing the status. SwitchParameter - + @@ -4627,9 +4624,9 @@ type Get-Release. Int32[] Int32[] - + - + Status @@ -4639,9 +4636,9 @@ type Get-Release. String String - + - + Force @@ -4653,9 +4650,9 @@ changing the status. SwitchParameter SwitchParameter - + - + @@ -4671,9 +4668,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -4683,10 +4680,10 @@ you do not have to pass the ProjectName with each call. System.Int32[] System.String - + - + @@ -4695,10 +4692,10 @@ System.String System.Object - + - + @@ -4724,11 +4721,11 @@ System.String Clears your default project, account name and personal access token. - + Remove TeamAccount - + Clears the environment variables that hold your default project, account and personal access token. @@ -4754,8 +4751,7 @@ To remove from the Machine level you must be running PowerShell as administrator On Windows allows you to clear your account information at the Process, User or Machine levels. String - - + @@ -4770,10 +4766,9 @@ To remove from the Machine level you must be running PowerShell as administrator String String - + - - + Force @@ -4783,7 +4778,7 @@ To remove from the Machine level you must be running PowerShell as administrator SwitchParameter SwitchParameter - + False @@ -4805,7 +4800,7 @@ To remove from the Machine level you must be running PowerShell as administrator Add-TeamAccount - + @@ -4817,11 +4812,11 @@ To remove from the Machine level you must be running PowerShell as administrator Updates the name and/or description of a team project. - + Update Project - + You can pass just name, description or both. @@ -4842,7 +4837,7 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + NewName @@ -4850,7 +4845,7 @@ you do not have to pass the ProjectName with each call. The new name for the project. String - + NewDescription @@ -4858,7 +4853,7 @@ you do not have to pass the ProjectName with each call. The new description for the project. String - + @@ -4872,9 +4867,9 @@ you do not have to pass the ProjectName with each call. String String - + - + NewDescription @@ -4884,9 +4879,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -4902,9 +4897,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -4913,10 +4908,10 @@ you do not have to pass the ProjectName with each call. System.String - + - + @@ -4925,10 +4920,10 @@ you do not have to pass the ProjectName with each call. System.Object - + - + @@ -4954,11 +4949,11 @@ you do not have to pass the ProjectName with each call. Sets the default project to be used with other calls in the module. - + Set DefaultProject - + 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. @@ -4979,9 +4974,9 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + - + Level @@ -5007,9 +5002,9 @@ you do not have to pass the ProjectName with each call. String String - + - + @@ -5020,10 +5015,9 @@ you do not have to pass the ProjectName with each call. String String - + - - + @@ -5032,10 +5026,10 @@ you do not have to pass the ProjectName with each call. System.String - + - + @@ -5044,10 +5038,10 @@ you do not have to pass the ProjectName with each call. System.Object - + - + @@ -5081,11 +5075,11 @@ you do not have to pass the ProjectName with each call. Get all the repositories in your Visual Studio Team Services or Team Founcation Server account, or a specific project. - + Get GitRepository - + Get-GitRepository gets all the repositories in your Visual Studio Team Services or Team Founcation Server account, or a specific project. @@ -5094,7 +5088,7 @@ you do not have to pass the ProjectName with each call. Get-GitRepository - + ProjectName @@ -5106,9 +5100,9 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + - + Id Specifies one or more repositories by ID. To specify multiple IDs, use @@ -5116,7 +5110,7 @@ commas to separate the IDs. To find the ID of a repository, type Get-Repository. Guid[] - + @@ -5136,9 +5130,9 @@ you do not have to pass the ProjectName with each call. String String - + - + Id @@ -5150,9 +5144,9 @@ Get-Repository. Guid[] Int32[] - + - + @@ -5197,11 +5191,11 @@ Get-Repository. Adds a Git repository to your Visual Studio Team Services or Team Founcation Server account. - + Add GitRepository - + Add-GitRepository adds a Git repository to your Visual Studio Team Services or Team Founcation Server account. @@ -5210,7 +5204,7 @@ Get-Repository. Add-GitRepository - + ProjectName @@ -5222,15 +5216,15 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + - + Name Specifies the name of the repository. System.String - + @@ -5250,9 +5244,9 @@ you do not have to pass the ProjectName with each call. String String - + - + Name @@ -5262,9 +5256,9 @@ you do not have to pass the ProjectName with each call. System.String Int32[] - + - + @@ -5289,11 +5283,11 @@ you do not have to pass the ProjectName with each call. Removes the Git repository from your Visual Studio Team Services or Team Founcation Server account. - + Remove GitRepository - + Remove-GitRepository removes the Git repository from your Visual Studio Team Services or Team Founcation Server account. @@ -5302,7 +5296,7 @@ you do not have to pass the ProjectName with each call. Remove-GitRepository - + ProjectName @@ -5314,9 +5308,9 @@ You can use Set-DefaultProject to set a default project so you do not have to pass the ProjectName with each call. String - + - + Id Specifies one or more repositories by ID. To specify multiple IDs, use @@ -5324,9 +5318,9 @@ commas to separate the IDs. To find the ID of a repository, type Get-Repository. Guid[] - + - + Force Removes the specified repository without prompting for confirmation. @@ -5353,9 +5347,9 @@ you do not have to pass the ProjectName with each call. String String - + - + Id @@ -5367,9 +5361,9 @@ Get-Repository. Guid[] Int32[] - + - + Force @@ -5381,7 +5375,7 @@ removing any repository. SwitchParameter SwitchParameter - + False @@ -5400,5 +5394,167 @@ removing any repository. - + + + + + Add-ReleaseEnvironment + + Starts the deployment of an environment in an existing release. + + + + + Add + ReleaseEnvironment + + + + Add-ReleaseEnvironment will start the deployment of an environment +within an existing release. + You must call Add-TeamAccount before calling this function. + + + + + Add-ReleaseEnvironment + + + ProjectName + + Specifies the team project for which this function operates. + +You can tab complete from a list of available projects. + +You can use Set-DefaultProject to set a default project so +you do not have to pass the ProjectName with each call. + + String + + + + Force + + Forces the command without confirmation + + SwitchParameter + + + ReleaseId + + Specifies the Id of an existing Release in which you want to deploy +to a particular environment. + + String + + + + EnvironmentId + + Specifies the Id of the Environment you wish to deploy to. +The Environment Ids are unique for each environment and in each release. + + String + + + + EnvironmentStatus + + Specifies the status in which to set the environment. +The deployment of an environment is triggered by changing the status of the environment. + The currently supported status change is from 'notStarted' to 'inProgress' + + String + + + + + + + + + ProjectName + + Specifies the team project for which this function operates. + +You can tab complete from a list of available projects. + +You can use Set-DefaultProject to set a default project so +you do not have to pass the ProjectName with each call. + + String + + String + + + + + + Force + + Forces the command without confirmation + + SwitchParameter + + SwitchParameter + + + False + + + ReleaseId + + Specifies the Id of an existing Release in which you want to deploy +to a particular environment. + + String + + + + EnvironmentId + + Specifies the Id of the Environment you wish to deploy to. +The Environment Ids are unique for each environment and in each release. + + String + + + + EnvironmentStatus + + Specifies the status in which to set the environment. +The deployment of an environment is triggered by changing the status of the environment. + The currently supported status change is from 'notStarted' to 'inProgress' + + String + + + + + + + + System.String + + + + + + + + + + + + This function has a Dynamic Parameter for ProjectName that specifies the +project for which this function gets release s. + +You can tab complete from a list of avaiable projects. + +You can use Set-DefaultProject 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/src/releases.psm1 b/src/releases.psm1 index cf5eed47d..e79eda7c0 100644 --- a/src/releases.psm1 +++ b/src/releases.psm1 @@ -320,4 +320,105 @@ function Set-ReleaseStatus { } } -Export-ModuleMember -Alias * -Function Get-Release, Add-Release, Remove-Release, Set-ReleaseStatus \ No newline at end of file +function Add-ReleaseEnvironment { + [CmdletBinding(DefaultParameterSetName='ById', SupportsShouldProcess=$true, ConfirmImpact="Medium")] + param( + [Parameter(ParameterSetName='ById', Mandatory=$true)] + [int] $ReleaseId, + + [Parameter(ParameterSetName='ById', Mandatory=$true)] + [string] $EnvironmentId, + + [Parameter(ParameterSetName='ById', Mandatory=$true)] + [string] $EnvironmentStatus, + + # Forces the command without confirmation + [switch] $Force + ) + + DynamicParam { + $dp = _buildProjectNameDynamicParam + + # If they have not set the default project you can't find the + # validateset so skip that check. However, we still need to give + # the option to pass by name. + if ($Global:PSDefaultParameterValues["*:projectName"]) { + $defs = Get-ReleaseDefinition -ProjectName $Global:PSDefaultParameterValues["*:projectName"] -expand artifacts + $arrSet = $defs.name + } else { + Write-Verbose 'Call Set-DefaultProject for Tab Complete of DefinitionName' + $defs = $null + $arrSet = $null + } + + $ParameterName = 'DefinitionName' + $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet $arrSet -ParameterSetName 'ByName' -Mandatory $true + $dp.Add($ParameterName, $rp) + + if($Global:PSDefaultParameterValues["*:projectName"]) { + $builds = Get-Build -ProjectName $Global:PSDefaultParameterValues["*:projectName"] + $arrSet = $builds.name + } else { + Write-Verbose 'Call Set-DefaultProject for Tab Complete of BuildName' + $builds = $null + $arrSet = $null + } + + $ParameterName = 'BuildNumber' + $rp = _buildDynamicParam -ParameterName $ParameterName -arrSet $arrSet -ParameterSetName 'ByName' -Mandatory $true + $dp.Add($ParameterName, $rp) + + $dp + } + + process { + Write-Debug 'Add-ReleaseEnvironment Process' + + # Bind the parameter to a friendly variable + $BuildNumber = $PSBoundParameters["BuildNumber"] + $ProjectName = $PSBoundParameters["ProjectName"] + $DefinitionName = $PSBoundParameters["DefinitionName"] + + #Write-Verbose $builds + + if ($builds -and -not $buildId) { + $buildId = $builds | Where-Object {$_.name -eq $BuildNumber} | Select-Object -ExpandProperty id + } + + if ($defs -and -not $artifactAlias) { + $def = $defs | Where-Object {$_.name -eq $DefinitionName} + $definitionId = $def | Select-Object -ExpandProperty id + + $artifactAlias = $def.artifacts[0].alias + } + + # Build the url + $url = _buildReleaseURL -resource "releases/$ReleaseId/environments/$EnvironmentId" -version '3.0-preview.2' -projectName $projectName + + $body = '{"status": "' + $EnvironmentStatus + '"}' + + Write-Verbose $body + + # Call the REST API + if ($force -or $pscmdlet.ShouldProcess("Add ReleaseEnvironment")) { + + try { + Write-Debug 'Add-ReleaseEnvironment Call the REST API' + if (_useWindowsAuthenticationOnPremise) { + $resp = Invoke-RestMethod -UserAgent (_getUserAgent) -Method Patch -Uri $url -ContentType "application/json" -UseDefaultCredentials -Body $body + } else { + $resp = Invoke-RestMethod -UserAgent (_getUserAgent) -Method Patch -Uri $url -ContentType "application/json" -Headers @{Authorization = "Basic $env:TEAM_PAT"} -Body $body + } + + # _applyTypes $resp + + Write-Output $resp + } + catch { + _handleException $_ + } + } + } +} + +Export-ModuleMember -Alias * -Function Get-Release, Add-Release, Remove-Release, Set-ReleaseStatus, Add-ReleaseEnvironment \ No newline at end of file