I have a simple question, how to determine with PowerShell if a SharePoint Site is a SPSite
object or SPWeb
?
I get all Site followed by user but some are SPSite
.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI have a simple question, how to determine with PowerShell if a SharePoint Site is a SPSite
object or SPWeb
?
I get all Site followed by user but some are SPSite
.
You can use GetType()
method
$web.GetType().Name
If it is web it gives you SPWeb otherwise SPSite
Edit
$currentSite = Get-SPSite -Identity $siteFollowed.Uri.AbsoluteUri if($currentSite.GetType().Name -eq "SPSite" ...