Created
October 9, 2013 13:31
-
-
Save ecoffman/6901323 to your computer and use it in GitHub Desktop.
How to Ignore SPSite Root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([string]$spSiteUrl) | |
$spSite = Get-SPSite -Identity $spSiteUrl | |
if($SPSite -eq $null) | |
{ | |
Write-Host "`nSPSite at '$($spSiteUrl)' is null."; | |
return; | |
} | |
$siteRootWeb = $spSite.RootWeb | |
foreach ($spWeb in $SPSite.AllWebs) | |
{ | |
if ($siteRootWeb.Url -eq $spWeb.Url) | |
{ | |
continue # Ignore site root! | |
} | |
Write-Host $spWeb.Url; | |
} | |
$spSite.Dispose(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment