Assuming Connect-SPOService is connected successfully. Why am I getting error for Get-SPOWebs error. I am trying to get subsite of sposite but getting this error.
function get-siteCollections{
#Get all site collections
$siteCollections = Get-SPOSite
#loop through all site collections
foreach ($siteCollection in $siteCollections)
{
#set variable for a tab in the table
$pixelsweb = 0
$pixelslist = 0
#add info to HTML document
add-content -value "<tr style='background-color:cyan'><td>$($siteCollection.url)</td><td>TopSite</td><td>$($sitecollection.template)</td><td></td></tr>" -path $filePath
write-host "Info: Found $($siteCollection.url)" -foregroundcolor green
#search for webs
$AllWebs = Get-SPOWebs($siteCollection.url)
Write-Host $AllWebs
}
get-sitecollections