PowerShell: Loop through all the sites in a site collection (not recursive)

$site = Get-SPSite "http://mysitetosearch.com"
$topWeb = Get-SPWeb $site.Url
$site | Get-SPWeb -limit all | ForEach-Object { Write-Host "Found $_.Name"; }

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

How can I call a JIRA api through Powershell?