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:
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.