-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInfopath scripts
31 lines (23 loc) · 1.1 KB
/
Infopath scripts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
para saber los campos utilizar este script
add-pssnapin microsoft.sharepoint.powershell
$web = Get-SPWeb http://xxx
$list = $web.Lists["Risk Register"]
#$list.fields | select title | sort title | ft -AutoSize# $field = $list.Fields.GetFieldByInternalName("fieldinternalname");
$list.fields | select Title, InternalName, xpath, Hidden, Sealed, CanBeDeleted | where {$_.Hidden -eq $false} | sort title | ft -AutoSize
también podemos encontrarnos con campos duplicados, para eliminarlos utilizar este script
$web = Get-SPWeb “http://xxx”
$list = $web.Lists["Risk Register"]
$field = $list.Fields["Location"]
# $field = $list.Fields.GetFieldByInternalName("Location0");
$field.Allowdeletion = $true
$field.Sealed = $false
$field.Delete()
$list.Update()
y también podemos encontrarnos con que la referencia xpath esté mal para ello
$web = Get-SPWeb “http://xxxx”
$list = $web.Lists["Risk Register"]
$field = $list.Fields["Location"]
# $field = $list.Fields.GetFieldByInternalName("fieldinternalname");
$field.xpath = "/my:myFields/my:Location"
$field.Update()
$list.Update()