Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

In search of help to create a CSV of Farm SP 2010 sites and the state of their Visual Upgrade

$
0
0

Good afternoon.

I do not  yet think in PowerShell. I am famliar with various other scripting languages on other OS platforms and have been trying to learn how to use it with SharePoint 2010.

I want to set up a script that produces a CSV file that would have lines that look like:

http://myfarm/,3

http://myfarm/sites/Comics,4

etc

where the 3 would indicate the site is using the SP 2007 interface and 4 would indicate the site is using the SP 2010 ribbon interface.

The script that I have so far cobbled together from bits on a particular SharePoint site plus my changes to get what I am wanting looks like this:

$SPwebApp = Get-SPWebApplication http://myfarm
foreach ($SPsite in $SPwebApp.Sites)
 {
    foreach($SPweb in $SPsite.AllWebs)
      {
         write-host "$spweb.url,$spweb.UIVersion"
      }
 } | out-file "d:\temp\VisualUpgrade.csv"

When I run this, no file is created, and the message:

| : An empty pipe element is not allowed.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : EmptyPipeElement

appears.

I would really appreciate any advice regarding what I am doing wrong.

Thank you so much.


Viewing all articles
Browse latest Browse all 6937

Trending Articles