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 | UpdateCalendarLookups.ps1 | Sun Aug 19 20:27:02 2018 UTC |
2 | RAMS-2.3.0.zip\RAMS-2.3.0\ps | UpdateCalendarLookups.ps1 | Thu Nov 8 21:18:20 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 364 |
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 | Update the Commi ttee Calen dar Meetin g Minute L ookups. | |
4 | ||
5 | .DESCRIPTI ON | |
6 | This u pdated the Meeting M inute Look ups for th e Committe es. | |
7 | ||
8 | .EXAMPLE | |
9 | #when run from d eploymentD river.ps1 | |
10 | Run-Sc ript 110 U pdateCalen darLookups .ps1 | |
11 | ||
12 | .EXAMPLE | |
13 | #when run from t he powersh ell comman d prompt. | |
14 | .\Upda teCalendar Lookups.ps 1 | |
15 | #> | |
16 | ||
17 | Add-PSSnap in Microso ft.SharePo int.Powers hell | |
18 | ||
19 | function G etAllWebs( $url) { | |
20 | <# | |
21 | ||
22 | .SYNOP SIS | |
23 | Th is functio n loops th rough all subsites. | |
24 | ||
25 | .DESCR IPTION | |
26 | Th is functio n loops th rough all subsites a nd calls D eletes and creates d ocument li brary for each subsi te. | |
27 | ||
28 | .EXAMP LE | |
29 | #w hen run fr om script | |
30 | Ge tAllWebs $ url | |
31 | ||
32 | #> | |
33 | ||
34 | try { | |
35 | wr ite-log -m essage "$ ([String]: :Format("P rocesing w eb {0}",$w .Url))" -c onsoleFore ground Dar kCyan | |
36 | if ($w.Webs.C ount -gt 0 ) { | |
37 | foreach( $web in $w .Webs) { | |
38 | writ e-log -mes sage "$([ String]::F ormat("Pro cesing web {0}",$web .Url))" -c onsoleFore ground Cya n | |
39 | <# | |
40 | $upd Needed = $ false | |
41 | ||
42 | $ct = $web.Con tentTypes[ "Event"] | |
43 | ||
44 | $rdc FieldLink = $web.Fie lds.TryGet FieldBySta ticName("R DCCalendar MeetingMin uteLookup" ) | |
45 | $irb FieldLink = $web.Fie lds.TryGet FieldBySta ticName("C ommitteeCa lendarMeet ingMinuteL ookup") | |
46 | $iac ucFieldLin k = $web.F ields.TryG etFieldByS taticName( "IACUCCale ndarMeetin gMinuteLoo kup") | |
47 | $srs FieldLink = $web.Fie lds.TryGet FieldBySta ticName("S RSCalendar MeetingMin uteLookup" ) | |
48 | ||
49 | #Rem ove the fi eld from t he ct and update | |
50 | if ( $rdcFieldL ink) { | |
51 | $ct.FieldL inks.Delet e($rdcFiel dLink.Id) | |
52 | $updNeeded = $true | |
53 | } | |
54 | if ( $irbFieldL ink) { | |
55 | $ct.FieldL inks.Delet e($irbFiel dLink.Id) | |
56 | $updNeeded = $true | |
57 | } | |
58 | if ( $iacucFiel dLink) { | |
59 | $ct.FieldL inks.Delet e($iacucFi eldLink.Id ) | |
60 | $updNeeded = $true | |
61 | } | |
62 | if ( $srsFieldL ink) { | |
63 | $ct.FieldL inks.Delet e($srsFiel dLink.Id) | |
64 | $updNeeded = $true | |
65 | } | |
66 | writ e-log -mes sage "Dele ting Old L ookups (RD C/Committe e/IACUC/SR S Meeting Minute Loo kup) From Event Cont ent Type" -consoleFo reground C yan | |
67 | ||
68 | if ( $updNeeded ) { | |
69 | $ct.Update () | |
70 | } | |
71 | #> | |
72 | dele teSiteColu mn "RDC" $ web | |
73 | dele teSiteColu mn "IRB" $ web | |
74 | dele teSiteColu mn "IACUC" $web | |
75 | dele teSiteColu mn "SRS" $ web | |
76 | ||
77 | fixC alendar "R DC" $web | |
78 | fixC alendar "I RB" $web | |
79 | fixC alendar "I ACUC" $web | |
80 | fixC alendar "S RS" $web | |
81 | ||
82 | New- MeetingMin uteLookup $web "RDC" | |
83 | New- MeetingMin uteLookup $web "IRB" | |
84 | New- MeetingMin uteLookup $web "IACU C" | |
85 | New- MeetingMin uteLookup $web "SRS" | |
86 | ||
87 | #Add MeetingMin ute to Eve nt Content Type? | |
88 | ||
89 | AddL ookupsToCa lendar "RD C" $web | |
90 | AddL ookupsToCa lendar "IR B" $web | |
91 | AddL ookupsToCa lendar "IA CUC" $web | |
92 | AddL ookupsToCa lendar "SR S" $web | |
93 | ||
94 | #dis pose the w eb-object | |
95 | $web .Dispose() | |
96 | } | |
97 | } | |
98 | } catc h { | |
99 | wr ite-log -m essage "$( [String]:: Format("Er ror proces sing web a t $web, wi th Excepti on: {0}", $_.Excepti on.Message ))" -conso leForegrou nd Red | |
100 | if ($($_.Exc eption.Err orRecord)) { write-l og -messag e "$($_.Ex ception.Er rorRecord) " -console Foreground Red } | |
101 | if ($($_.Exc eption.sta cktrace)) { write-lo g -message "$($_.Exc eption.sta cktrace)" -consoleFo reground R ed } | |
102 | if ($($_.Scr iptStackTr ace)) { wr ite-log -m essage "$( $_.ScriptS tackTrace) " -console Foreground Red } | |
103 | } | |
104 | } | |
105 | ||
106 | function d eleteSiteC olumn($com mittee, $w eb) { | |
107 | if ($c ommittee - eq "IRB") { | |
108 | $S iteColumnT oRemove = "Committee Meeting M inute Look up" | |
109 | } else { | |
110 | $S iteColumnT oRemove = $committee + " Meeti ng Minute Lookup" | |
111 | } | |
112 | ||
113 | if ($w eb.Fields. ContainsFi eld($SiteC olumnToRem ove)) { | |
114 | #d elete site column po wershell s harepoint | |
115 | $w eb.Fields. Delete($Si teColumnTo Remove) | |
116 | wr ite-log -m essage "$S iteColumnT oRemove Si te column has been D eleted Suc cessfully on $($web. url)" -con soleForegr ound green | |
117 | } | |
118 | } | |
119 | ||
120 | function f ixCalendar ($committ ee, $web) { | |
121 | write-l og -messag e "Fixing Calendar f or $commit tee Commit tee in $we b" -consol eForegroun d Cyan | |
122 | if ($c ommittee - eq "IRB") { | |
123 | $co mmitteeLis t = $web.L ists.TryGe tList("Com mittee Cal endar") | |
124 | $Co lumnName = "Committe e Meeting Minute Loo kup" | |
125 | } else { | |
126 | $co mmitteeLis t = $web.L ists.TryGe tList($com mittee + " Calendar ") | |
127 | $Co lumnName = $committe e + " Meet ing Minute Lookup" | |
128 | } | |
129 | if($co mmitteeLis t -ne $nul l) { | |
130 | #G et the col umn | |
131 | if ($committ eeList.Fie lds.Contai nsField($C olumnName) ) { | |
132 | $column = $committ eeList.Fie lds.GetFie ld($column Name) | |
133 | if($colu mn -ne $nu ll) { | |
134 | #Res et column properties to allow delete | |
135 | $col umn.Hidden = $false | |
136 | $col umn.ReadOn lyField = $false | |
137 | $col umn.AllowD eletion = $true | |
138 | $col umn.Update () | |
139 | ||
140 | #Del ete the co lumn from list | |
141 | $com mitteeList .Fields.De lete($colu mn) | |
142 | writ e-log -mes sage "Colu mn '$Colum nName' del eted on $( $web.Url)" -consoleF oreground Green | |
143 | } else { | |
144 | writ e-log -mes sage "Colu mn '$Colum nName' not found on $($web.Url )" -consol eForegroun d Yellow | |
145 | } | |
146 | } else { | |
147 | write-log -message "Column $C olumnName Not on lis t $($Commi tteelist.T itle)" -co nsoleForeg round Yell ow | |
148 | } | |
149 | } else { | |
150 | wr ite-log -m essage "Sp ecified Li st is not found!" -c onsoleFore ground Red | |
151 | } | |
152 | } | |
153 | ||
154 | function A ddLookupsT oCalendar ($committe e, $web) { | |
155 | write-l og -messag e "AddLook upsToCalen dar for $c ommittee C ommittee i n $web" -c onsoleFore ground Cya n | |
156 | if ($c ommittee - eq "IRB") { | |
157 | $co mmitteeLis t = $web.L ists.TryGe tList("Com mittee Cal endar") | |
158 | $Co lumnName = "Committe e Meeting Minute Loo kup" | |
159 | } else { | |
160 | $co mmitteeLis t = $web.L ists.TryGe tList($com mittee + " Calendar ") | |
161 | $Co lumnName = $committe e + " Meet ing Minute Lookup" | |
162 | } | |
163 | ||
164 | if($co mmitteeLis t -ne $nul l) { | |
165 | $l ookupField = $commit teeList.Fi elds[$Colu mnName] | |
166 | if ($lookupF ield -eq $ null) { | |
167 | $meeting MinuteLook upName = $ ColumnName .Replace(" ","") | |
168 | $newFiel d = $web.F ields.TryG etFieldByS taticName( $meetingMi nuteLookup Name) | |
169 | $committ eeList.Fie lds.Add($n ewField); | |
170 | write-lo g -message "$columnN ame added to $commit teeList on $web" -co nsoleForeg round Gree n | |
171 | ||
172 | } else { | |
173 | write-lo g -message "$columnN ame found on $commit teeList on $web" -co nsoleForeg round Yell ow | |
174 | } | |
175 | } | |
176 | } | |
177 | ||
178 | ||
179 | ||
180 | #This is t o test the driver co ntains a $ siteUrl | |
181 | #$siteUrl= "https:// DNS . URL /sites/IRB Applicatio ns/"; | |
182 | $w = Get-S PWeb $site Url; | |
183 | GetAllWebs ($siteUrl) |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.