internal/functions/invoke-adoteamsettingsmigration.ps1
|
<# .SYNOPSIS Migrates team settings from source team to target team. .DESCRIPTION Internal helper function to migrate team settings like area paths, iterations, etc. This requires additional permissions and API calls to manage team configurations. .PARAMETER SourceOrganization Source Azure DevOps organization name. .PARAMETER TargetOrganization Target Azure DevOps organization name. .PARAMETER SourceProjectName Source project name or ID. .PARAMETER TargetProjectName Target project name or ID. .PARAMETER SourceToken Source organization Personal Access Token (PAT). .PARAMETER TargetToken Target organization Personal Access Token (PAT). .PARAMETER SourceTeamId Source team ID or name. .PARAMETER TargetTeamId Target team ID or name. .PARAMETER ApiVersion API version to use (default: 7.2-preview.3). .EXAMPLE Invoke-ADOTeamSettingsMigration -SourceOrganization "contoso" -TargetOrganization "fabrikam" -SourceProjectName "WebApp" -TargetProjectName "WebApp-New" -SourceToken $sourcePat -TargetToken $targetPat -SourceTeamId "team1-id" -TargetTeamId "team1-new-id" Migrates team settings from source team to target team. .NOTES Author: Oleksandr Nikolaiev (@onikolaiev) This is a placeholder implementation that requires additional API endpoints: - GET/PUT https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings - GET/PUT https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/iterations - GET/PUT https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/teamfieldvalues .LINK https://learn.microsoft.com/azure/devops/organizations/security/about-permissions #> function Invoke-ADOTeamSettingsMigration { [CmdletBinding()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')] param( [Parameter(Mandatory)][string]$SourceOrganization, [Parameter(Mandatory)][string]$TargetOrganization, [Parameter(Mandatory)][string]$SourceProjectName, [Parameter(Mandatory)][string]$TargetProjectName, [Parameter(Mandatory)][string]$SourceToken, [Parameter(Mandatory)][string]$TargetToken, [Parameter(Mandatory)][string]$SourceTeamId, [Parameter(Mandatory)][string]$TargetTeamId, [Parameter(Mandatory)][string]$ApiVersion ) begin { Write-PSFMessage -Level Verbose -Message "Starting team settings migration for team '$SourceTeamId' to '$TargetTeamId'..." } process { try { # Note: Team settings migration would require additional API endpoints: # - GET/PUT https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings # - GET/PUT https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/iterations # - GET/PUT https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/teamfieldvalues Write-PSFMessage -Level Warning -Message "Team settings migration is not yet fully implemented. This feature requires additional API endpoints for team configurations." # Future implementation would: # 1. Get source team settings using GET /work/teamsettings # 2. Get source team iterations using GET /work/teamsettings/iterations # 3. Get source team field values using GET /work/teamsettings/teamfieldvalues # 4. Apply settings to target team using corresponding PUT endpoints } catch { Write-PSFMessage -Level Error -Message "Error during team settings migration: $($_.Exception.Message)" throw } } end { Write-PSFMessage -Level Verbose -Message "Team settings migration completed." } } |