Produced by Araxis Merge on 11/9/2018 12:16:34 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 | CreateAFDocumentLibrary.ps1 | Sun Aug 19 23:09:30 2018 UTC |
2 | RAMS-2.3.0.zip\RAMS-2.3.0\ps | CreateAFDocumentLibrary.ps1 | Fri Nov 9 14:54:12 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 212 |
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 | Create s the AF D ocument Li brary for each Facil ity and de letes it i f it exist s. | |
4 | ||
5 | .DESCRIPTI ON | |
6 | This c reates the AF Docume nt Library for each Facility a nd deletes it if it exists. | |
7 | ||
8 | .EXAMPLE | |
9 | #when run from d eploymentD river.ps1 | |
10 | Run-Sc ript 110 C reateAFDoc umentLibra ry.ps1 | |
11 | ||
12 | .EXAMPLE | |
13 | #when run from t he powersh ell comman d prompt. | |
14 | .\Crea teAFDocume ntLibrary. ps1 | |
15 | #> | |
16 | ||
17 | function G etAllWebs( $url) { | |
18 | <# | |
19 | .SYNOPSIS | |
20 | This f unction lo ops throug h all subs ites. | |
21 | ||
22 | .DESCRIPTI ON | |
23 | This f unction lo ops throug h all subs ites and c alls Delet es and cre ates docum ent librar y for each subsite. | |
24 | ||
25 | .EXAMPLE | |
26 | #when run from d eploymentD river.ps1 | |
27 | Run-Sc ript 110 C reateAFDoc umentLibra ry.ps1 | |
28 | #> | |
29 | Add-PSSnap in Microso ft.SharePo int.Powers hell | |
30 | ||
31 | try { | |
32 | wr ite-log -m essage "$( [String]:: Format("Pr ocesing we b {0}",$w. Url))" -co nsoleForeg round Cyan | |
33 | if ($w.Webs.C ount -gt 0 ) { | |
34 | foreach( $web in $w .Webs) { | |
35 | Delete AFDocument Library $w eb; | |
36 | Create AFDocument Library $w eb; | |
37 | } | |
38 | } | |
39 | } catc h { | |
40 | 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 | |
41 | if ($($_.Exc eption.Err orRecord)) { write-l og -messag e "$($_.Ex ception.Er rorRecord) " -console Foreground Red } | |
42 | if ($($_.Exc eption.sta cktrace)) { write-lo g -message "$($_.Exc eption.sta cktrace)" -consoleFo reground R ed } | |
43 | if ($($_.Scr iptStackTr ace)) { wr ite-log -m essage "$( $_.ScriptS tackTrace) " -console Foreground Red } | |
44 | ||
45 | } | |
46 | } | |
47 | ||
48 | function D eleteAFDoc umentLibra ry($web) { | |
49 | <# | |
50 | .SYNOPSIS | |
51 | Th is functio n deletes the AF Doc ument Libr ary. | |
52 | ||
53 | .DESCRIPTI ON | |
54 | Th is functio n creates the AF doc ument Libr ary for ea ch subsite . | |
55 | ||
56 | .EXAMPLE | |
57 | #w hen run fr om the pow ershell co mmand prom pt. | |
58 | D eleteAFDoc umentLibra ry $web ($ web of sub site) | |
59 | #> | |
60 | ||
61 | $list = $web.Lists .TryGetLis t("AF Docu ments") | |
62 | if($li st -ne $nu ll) { | |
63 | # The list a lready exi sts | |
64 | $L istToDelet eName = "A F Document s" | |
65 | ||
66 | #G et Web and List obje cts | |
67 | $l ist = $web .Lists[$Li stToDelete Name] | |
68 | ||
69 | #R eset the " Allow Dele tion" Flag | |
70 | $l ist.AllowD eletion = $true | |
71 | ||
72 | $l ist.Update () | |
73 | $l ist.Delete () | |
74 | wr ite-log -m essage "De leted Anim al Facilit y Document $ListToDe leteName L ibrary on $($web.url )" -consol eForegroun d Yellow | |
75 | } | |
76 | } | |
77 | ||
78 | function C reateAFDoc umentLibra ry($web) { | |
79 | <# | |
80 | .SYNOPSIS | |
81 | Th is functio n creates the AF Doc ument Libr ary. | |
82 | ||
83 | .DESCRIPTI ON | |
84 | Th is functio n creates the AF doc ument Libr ary for ea ch subsite . | |
85 | ||
86 | .EXAMPLE | |
87 | #w hen run fr om the pow ershell co mmand prom pt. | |
88 | C reateAFDoc umentLibra ry $web ($ web of sub site) | |
89 | #> | |
90 | $SPTem plate = [M icrosoft.S harepoint. SPListTemp lateType]: :DocumentL ibrary | |
91 | $web.L ists.Add(" AFDocument s","AFDocu ments",$SP Template) | |
92 | ||
93 | $list = $web.Lis ts.TryGetL ist("AFDoc uments") | |
94 | ||
95 | if($li st -ne $nu ll) { | |
96 | $l ist.Title= "Animal Fa cility Doc uments" | |
97 | $l ist.Update () | |
98 | wr ite-log -m essage "An imal Facil ity Docume nt Library $($list.T itle) is c reated on $($web.url )" -consol eForegroun d Green | |
99 | } else { | |
100 | wr ite-log -m essage "Co uld not cr eate Anima l Facility Document Library on $($web.ur l)" -conso leForegrou nd Red | |
101 | } | |
102 | } | |
103 | ||
104 | #This is t o test the driver co ntains a $ siteUrl | |
105 | #$siteUrl= "https:// DNS . URL /sites/IRB Applicatio ns/"; | |
106 | $w = Get-S PWeb $site Url; | |
107 | GetAllWebs ($siteUrl) |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.