tankcr

While_Do

Aug 22nd, 2013
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $mysitefeatures = get-spfeature -Web $mysitesweb.url
  2.     $i=0
  3.     WHILE ($MysiteBranding -notin $mysitefeatures.displayname -and($i -le 3))
  4.     DO
  5.     {
  6.         $i++
  7.         $MyWarning = "Warning $MysiteBranding is not enabled on "+$MySitesWeb.url+" attempting to enable now attempt "+$i
  8.         mywarning
  9.         clearmsg
  10.         Enable-SPFeature -Identity $MysiteBrandingID -Url $MySitesWeb.url -force
  11.         $mysitefeatures.update()
  12.         clear-variable -name mysitefeatures
  13.         $mysitefeatures = get-spfeature -Web $mysitesweb.url
  14.      }
Advertisement
Add Comment
Please, Sign In to add comment