sharepoint count sitecollection subsites

$site = get-spsite “http://spsitecollection

$site.AllWebs.Count

$site.Dispose();