File tree Expand file tree Collapse file tree 1 file changed +10
-18
lines changed
Site Management/Remove SPO subsite Expand file tree Collapse file tree 1 file changed +10
-18
lines changed Original file line number Diff line number Diff line change @@ -9,38 +9,30 @@ function GetAllSubsitesAndDelete($SiteUrl)
99 $ctx2.Load ($sites2 )
1010 $ctx2.ExecuteQuery ()
1111
12- if ($sites2.Count -gt 0 )
13- {
14- for ($i = 0 ;$i -lt $sites2.Count ;$i ++ )
15- {
12+ if ($sites2.Count -gt 0 ) {
13+ for ($i = 0 ;$i -lt $sites2.Count ;$i ++ ) {
1614 GetAllSubsitesAndDelete($sites2 [$i ].Url)
1715 }
1816
19- try
20- {
21- $rootWeb2.DeleteObject ()
17+ try {
18+ $rootWeb2.DeleteObject ()
2219 $ctx2.ExecuteQuery ()
2320 Write-Host " Subsite " $rootWeb2.Url " has been removed"
2421 }
25- catch [Net.WebException ]
26- {
22+ catch [Net.WebException ] {
2723 Write-Host $_.Exception.ToString ()
2824 }
29- }
30- else
31- {
32- try
33- {
25+ }
26+ else {
27+ try {
3428 $rootWeb2.DeleteObject ()
3529 $ctx2.ExecuteQuery ()
3630 Write-Host " Subsite " $rootWeb2.Url " has been removed"
3731 }
38- catch [Net.WebException ]
39- {
32+ catch [Net.WebException ] {
4033 Write-Host $_.Exception.ToString ()
4134 }
42- }
43-
35+ }
4436}
4537
4638# paths to SDK (copied from Victor's comment)
You can’t perform that action at this time.
0 commit comments