@@ -19,7 +19,7 @@ function Get-ADOWorkItemTypes([string]$ProcessId, [string]$WorkItemType, [string
1919 $results = $client.GetStringAsync ($url )
2020 $workItemTypes = ($results.Result | convertfrom-json ).value
2121 if ($WorkItemType ) {
22- return $workItemTypes | Where-Object {$_.name -ieq $WorkItemType }
22+ return $workItemTypes | Where-Object { $_.name -ieq $WorkItemType }
2323 }
2424 else {
2525 return $workItemTypes
@@ -57,7 +57,7 @@ function Get-ADOLists([string]$listName, [string]$org) {
5757 $results = $client.GetStringAsync ($url )
5858 $lists = ($results.Result | convertfrom-json ).value
5959 if ($listName ) {
60- return $lists | Where-Object {$_.name -ieq $listName }
60+ return $lists | Where-Object { $_.name -ieq $listName }
6161 }
6262 else {
6363 return $lists
@@ -77,26 +77,26 @@ function Add-ADOProjectFields([string]$project, [string]$witRefName, [string]$cs
7777 $isPickList = $false
7878 if ($_.picklist ) {
7979 $pickListName = $_.picklist
80- $list = $lists | Where-Object {$_.name -ieq $pickListName }
80+ $list = $lists | Where-Object { $_.name -ieq $pickListName }
8181 $isPickList = $true
8282 }
8383
8484 $field = [PSCustomObject ]@ {
85- _links = $null
86- canSortyBy = $true
87- description = $null
88- isIdentity = ($_.type -ieq " identity" )
89- isPicklist = $isPickList
85+ _links = $null
86+ canSortyBy = $true
87+ description = $null
88+ isIdentity = ($_.type -ieq " identity" )
89+ isPicklist = $isPickList
9090 isPicklistSuggested = $false
91- isQueryable = $true
92- name = $_.name
93- picklistId = $list.id
94- readOnly = $false
95- referenceName = $_.refName
91+ isQueryable = $true
92+ name = $_.name
93+ picklistId = $list.id
94+ readOnly = $false
95+ referenceName = $_.refName
9696 supportedOperations = $null
97- type = $_.type
98- url = $baseUrl + $_.refname
99- usage = " workItem"
97+ type = $_.type
98+ url = $baseUrl + $_.refname
99+ usage = " workItem"
100100 }
101101
102102 $fieldjson = $field | convertto-json
@@ -120,26 +120,26 @@ function Add-ADOFields([string]$processId, [string]$witRefName, [string]$csvFile
120120 $picklist = $null
121121 if ($_.picklist ) {
122122 $pickListName = $_.picklist
123- $list = $lists | Where-Object {$_.name -ieq $pickListName }
123+ $list = $lists | Where-Object { $_.name -ieq $pickListName }
124124 $picklist = [PSCustomObject ]@ {
125- id = $list.id
125+ id = $list.id
126126 isSuggested = $null
127- Name = $pickListName
128- type = $null
129- url = $null
127+ Name = $pickListName
128+ type = $null
129+ url = $null
130130 }
131131 }
132132
133133 $field = [PSCustomObject ]@ {
134134 referenceName = $_.refName
135- name = $_.name
136- type = $_.type
137- pickList = $picklist
138- readOnly = $false
139- required = $false
140- defaultValue = $null
141- url = $baseUrl + $_.refName
142- allowGroups = $null
135+ name = $_.name
136+ type = $_.type
137+ pickList = $picklist
138+ readOnly = $false
139+ required = $false
140+ defaultValue = $null
141+ url = $baseUrl + $_.refName
142+ allowGroups = $null
143143 }
144144
145145 $fieldjson = $field | convertto-json
@@ -157,7 +157,7 @@ function Get-ADOProjectFields([string]$projectName, [string]$org, [string]$pat)
157157
158158 $headers = (New-HTTPHeaders - pat $pat )
159159
160- $url = " $org /_apis/projects/" + $projectName + " ?api-version=5.1"
160+ $url = " $org /_apis/projects/" + $projectName + " ?api-version=5.1"
161161 try {
162162 $project = Invoke-RestMethod - Method Get - uri $url - headers $headers
163163 }
@@ -166,7 +166,7 @@ function Get-ADOProjectFields([string]$projectName, [string]$org, [string]$pat)
166166 return
167167 }
168168
169- $fieldsUrl = " $org /" + $project.id + " /_apis/wit/fields?api-version=5.0-preview.2"
169+ $fieldsUrl = " $org /" + $project.id + " /_apis/wit/fields?api-version=5.0-preview.2"
170170 try {
171171 $fields = Invoke-RestMethod - Method Get - uri $fieldsUrl - headers $headers
172172 }
@@ -178,7 +178,7 @@ function Get-ADOProjectFields([string]$projectName, [string]$org, [string]$pat)
178178}
179179
180180function Delete-ADOWorkItemField ([string ]$fieldName , [string ]$org , [string ]$pat ) {
181- # DELETE https://dev.azure.com/aiz-test /_apis/wit/fields/Custom.ARCID
181+ # DELETE https://dev.azure.com/org-name /_apis/wit/fields/Custom.ARCID
182182 try {
183183 $results = Invoke-RestMethod - Method Delete - uri " $org /_apis/wit/fields/$fieldName " - headers (New-HTTPHeaders - pat $pat )
184184 }
0 commit comments