Produced by Araxis Merge on 11/9/2018 12:16:35 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | RAMS-2.3.0.zip\RAMS-2.3.0\ps | MigrateCommitteeRoster.ps1 | Sun Aug 19 22:26:20 2018 UTC |
2 | RAMS-2.3.0.zip\RAMS-2.3.0\ps | MigrateCommitteeRoster.ps1 | Fri Nov 9 14:54:12 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 200 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | <# | |
2 | .SYNOPSIS | |
3 | Adds t he Facilit ies Lookup to the Co mmittee Ro ster List and migrat es the dat a. | |
4 | ||
5 | .DESCRIPTI ON | |
6 | Adds t he Facilit iesLookup to the Com mittee Ros ter CT | |
7 | For ea ch record in the Com mitteeRost er, migrat e the Old Facility L ookup to t he new Fac ilities Lo okup | |
8 | Update the Forms to show t he new Fac ilities Lo okup | |
9 | ||
10 | .EXAMPLE | |
11 | #when run from d eploymentD river.ps1 | |
12 | Run-Sc ript 310 M igrateComm itteeRoste r.ps1 | |
13 | ||
14 | .EXAMPLE | |
15 | #when run from t he powersh ell comman d prompt. | |
16 | .\Migr ateCommitt eeRoster.p s1 | |
17 | ||
18 | #> | |
19 | ||
20 | Add-PSSnap in Microso ft.SharePo int.Powers hell | |
21 | ||
22 | function G etRosterIt ems($url) | |
23 | { | |
24 | try | |
25 | { | |
26 | wr ite-log -m essage "$( [String]:: Format("Pr ocesing we b {0}",$w. Url))" -co nsoleForeg round Cyan | |
27 | $r osterlist =$w.Lists[ "Committee Roster"] | |
28 | $r osteritems = $roster list.items | |
29 | #CRE ATE SITE C OLUMNS | |
30 | writ e-log -mes sage "ADDI NG SITE CO LUMNS TO C ONTENT TYP E" -consol eForegroun d Green | |
31 | Ad d-SiteColu mnToCT -we b (Get-Sit eWeb) -ctN ame "Commi ttee Roste r CT" -sFi eldInterna lName "Fac ilitiesLoo kup" -sFie ldStaticNa me "Facili tiesLookup " | |
32 | ||
33 | #L oop throug h List | |
34 | #G et Facilit y Lookup | |
35 | #C opy record to correc t field | |
36 | fore ach ($item in $roste ritems) { | |
37 | $ rosterItem ID=$item[" ID"] | |
38 | $rosterF acilityLoo kup=$item[ "Facility" ] | |
39 | ||
40 | if($w .Webs.Coun t -gt 0 -a nd $roster FacilityLo okup) | |
41 | { | |
42 | ||
43 | $f acilityTit le = $rost erFacility Lookup.sub string(4); | |
44 | $facil itiesItem = GetFacil itiesItem( $facilityT itle) | |
45 | $i tem["Facil ities Look up"] = $fa cilitiesIt em.ID | |
46 | $item. Update() | |
47 | ||
48 | } | |
49 | } | |
50 | $f acilityFie ld=$roster list.Field s["Facilit y"] | |
51 | $f acilityFie ld.Delete( ) | |
52 | Fi xForms $ro sterlist | |
53 | $r osterlist. Update() | |
54 | ||
55 | } | |
56 | ||
57 | catch | |
58 | { | |
59 | wr ite-log -m essage "$( [String]:: Format("Er ror proces sing web a t $url, wi th Excepti on: {0}", $_.Excepti on.Message ))" -conso leForegrou nd Red | |
60 | if ($($_.Exc eption.Err orRecord)) { write-l og -messag e "$($_.Ex ception.Er rorRecord) " -console Foreground Red } | |
61 | if ($($_.Exc eption.sta cktrace)) { write-lo g -message "$($_.Exc eption.sta cktrace)" -consoleFo reground R ed } | |
62 | if ($($_.Scr iptStackTr ace)) { wr ite-log -m essage "$( $_.ScriptS tackTrace) " -console Foreground Red } | |
63 | } | |
64 | ||
65 | ||
66 | } | |
67 | ||
68 | function FixForms ( $list) { | |
69 | ||
70 | $c t = $list. ContentTyp es["Commit tee Roster CT"] | |
71 | ||
72 | $fldLi st = @( | |
73 | " MemberName ", | |
74 | " Membership Type", | |
75 | " Membership Status", | |
76 | " Facilities Lookup", | |
77 | " CommitteeM embership" , | |
78 | " ServiceSpe cialty", | |
79 | " Position", | |
80 | " Employment Status", | |
81 | " TermExpira tion" | |
82 | ||
83 | ||
84 | ) | |
85 | $c t.FieldLin ks.Reorder ($fldList) | |
86 | $ct.Up date() | |
87 | $list. Update() | |
88 | ||
89 | } | |
90 | ||
91 | ||
92 | functi on GetFaci litiesItem ($title) { | |
93 | $rosterL ist = (Get -SiteWeb). Lists.TryG etList("Fa cilities") | |
94 | $spListI tem = $ro sterList.I tems | ? { $_["Title" ] -match $ title} | |
95 | return $ spListItem ; | |
96 | } | |
97 | ||
98 | #This is t o test the driver co ntains a $ siteUrl | |
99 | #$siteUrl= "https:// DNS . URL /sites/IRB Applicatio ns/"; | |
100 | $w = Get-S PWeb $site Url; | |
101 | GetRosterI tems($site Url) |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.