I want to do a simple task, I made a script who get all followed site from a user. But I want to filter it with compatibilitylevel.
With few sites, it's Ok, I do :
$currentSite = Get-SPSite -Identity $siteFollowed.Uri.AbsoluteUri
if($currentSite.CompatibilityLevel -eq 15){
#...
}
But with many sites, it's not Ok because I get SPWeb too... So I have this error :
Get-SPSite : Cannot find an SPSite object with Id or Url:
When I replace Get-SPSite by Get-SPWeb, I can get this site but I can't get compatibilitylevel....
Object SPSite :
Url CompatibilityLevel
--- ------------------
https://site.fr/sites/test 15
Object SPWeb :
Url
---
https://site.domain.fr/sites/Collec_SRO/en...
=> No compatibilityLevel...
Do you have an idea to get the sharepoint version? (2010/2013, 14/15)
Thanks.