Hi,
I'm struggeling with collections in Powershell in general.
I have a variable of type SPWebCollection created and want to add
1) a single SPWeb - Object
2) another collection of SPWeb - Objects
Can someone tell me please why the following doesn't work:
[Microsoft.Sharepoint.SPWebCollection]$allWebs += Get-SPWeb $URL1
or this
[Microsoft.Sharepoint.SPWebCollection]$allWebs += $site.AllWebs | Where-Object {$_.Url -like $URL2}
Finally I want to empty the $allWebs collection i.e. remove all objects. How do I do that?
I appreciate any feedback
Thank you