Like Us
Plus One
Follow Us
 Author Mike Smith  Views 3182 View Original Article

  While the following example is for PowerShell, the same applies to C# code. Collections that are being modified do not like to be processed with FOR EACH."Collection was modified; enumeration operation may not execute" For example:$web = Get-SPWeb someurl... ForEach($list in $w.Lists) { if (!$list.Hidden) { # do something to change the list # like add a new view... $
View Original Article

Recent Articles from Tech Training Notes