-
Notifications
You must be signed in to change notification settings - Fork 31
Get-AdoPicklist -Orphan bugfix for on-premises AzD Server #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d9b6eb8
f3894b3
0573cac
c13f994
8cf2bec
523d7f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,4 @@ | ||||||
| function Get-ADOPicklist | ||||||
| { | ||||||
| function Get-ADOPicklist { | ||||||
| <# | ||||||
| .Synopsis | ||||||
| Gets picklists from Azure DevOps. | ||||||
|
|
@@ -16,43 +15,43 @@ | |||||
| .Link | ||||||
| https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/lists/get | ||||||
| #> | ||||||
| [OutputType('PSDevOps.Project','PSDevOps.Property')] | ||||||
| [CmdletBinding(DefaultParameterSetName='work/processes/lists')] | ||||||
| [OutputType('PSDevOps.Project', 'PSDevOps.Property')] | ||||||
| [CmdletBinding(DefaultParameterSetName = 'work/processes/lists')] | ||||||
| param( | ||||||
| # The Organization | ||||||
| [Parameter(Mandatory,ParameterSetName='work/processes/lists',ValueFromPipelineByPropertyName)] | ||||||
| [Parameter(Mandatory,ParameterSetName='work/processes/lists/{PickListID}',ValueFromPipelineByPropertyName)] | ||||||
| [Parameter(Mandatory,ParameterSetName='Orphan')] | ||||||
| [Alias('Org')] | ||||||
| [string] | ||||||
| $Organization, | ||||||
|
|
||||||
| # The Picklist Identifier. | ||||||
| [Parameter(Mandatory,ParameterSetName='work/processes/lists/{PickListID}',ValueFromPipelineByPropertyName)] | ||||||
| [string] | ||||||
| $PickListID, | ||||||
|
|
||||||
| # The name of the picklist | ||||||
| [Parameter(ValueFromPipelineByPropertyName)] | ||||||
| [string] | ||||||
| $PicklistName = '*', | ||||||
|
|
||||||
| # If set, will return orphan picklists. These picklists are not associated with any field. | ||||||
| [Parameter(Mandatory,ParameterSetName='Orphan')] | ||||||
| [switch] | ||||||
| $Orphan, | ||||||
|
|
||||||
| # The server. By default https://dev.azure.com/. | ||||||
| # To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). | ||||||
| [Parameter(ValueFromPipelineByPropertyName)] | ||||||
| [uri] | ||||||
| $Server = "https://dev.azure.com/", | ||||||
|
|
||||||
| # The api version. By default, 5.1-preview. | ||||||
| # If targeting TFS, this will need to change to match your server version. | ||||||
| # See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops | ||||||
| [string] | ||||||
| $ApiVersion = "5.1-preview" | ||||||
| # The Organization | ||||||
| [Parameter(Mandatory, ParameterSetName = 'work/processes/lists', ValueFromPipelineByPropertyName)] | ||||||
| [Parameter(Mandatory, ParameterSetName = 'work/processes/lists/{PickListID}', ValueFromPipelineByPropertyName)] | ||||||
| [Parameter(Mandatory, ParameterSetName = 'Orphan')] | ||||||
| [Alias('Org')] | ||||||
| [string] | ||||||
| $Organization, | ||||||
|
|
||||||
| # The Picklist Identifier. | ||||||
| [Parameter(Mandatory, ParameterSetName = 'work/processes/lists/{PickListID}', ValueFromPipelineByPropertyName)] | ||||||
| [string] | ||||||
| $PickListID, | ||||||
|
|
||||||
| # The name of the picklist | ||||||
| [Parameter(ValueFromPipelineByPropertyName)] | ||||||
| [string] | ||||||
| $PicklistName = '*', | ||||||
|
|
||||||
| # If set, will return orphan picklists. These picklists are not associated with any field. | ||||||
| [Parameter(Mandatory, ParameterSetName = 'Orphan')] | ||||||
| [switch] | ||||||
| $Orphan, | ||||||
|
|
||||||
| # The server. By default https://dev.azure.com/. | ||||||
| # To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). | ||||||
| [Parameter(ValueFromPipelineByPropertyName)] | ||||||
| [uri] | ||||||
| $Server = "https://dev.azure.com/", | ||||||
|
|
||||||
| # The api version. By default, 5.1-preview. | ||||||
| # If targeting TFS, this will need to change to match your server version. | ||||||
| # See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops | ||||||
| [string] | ||||||
| $ApiVersion = "5.1-preview" | ||||||
| ) | ||||||
|
|
||||||
| dynamicParam { . $GetInvokeParameters -DynamicParameter } | ||||||
|
|
@@ -64,27 +63,43 @@ | |||||
| $q = [Collections.Queue]::new() | ||||||
| } | ||||||
| process { | ||||||
| if ($ApiVersion -like '5.*') { | ||||||
| Write-Warning "The API version '$ApiVersion' may not be compatible with field operations. Consider using '7.0' or later." | ||||||
| } | ||||||
|
|
||||||
| if ($Orphan) { | ||||||
| $allPicklists = Get-ADOPicklist -Organization $organization | ||||||
| $allUsedPicklists = Get-ADOField @invokeParams -Organization $Organization | | ||||||
| $allPicklists = @() | ||||||
| $allUsedPicklists = @() | ||||||
|
||||||
| $allUsedPicklists = @() |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected abbreviation from 'AzD' to 'ADO' to match the naming convention used throughout the codebase (Azure DevOps = ADO).
| Write-Verbose "AzD Server currently is: $Server/$organization" | |
| Write-Verbose "ADO Server currently is: $Server/$organization" |
Uh oh!
There was an error while loading. Please reload this page.