I have to export all the columns in a particular sharepoint list along with the data contained in the columns.
I am currently able to get all column names but not data. Need help with that. Below is my code.
$url = "$url"
$listName = "$list"
$path ="c:\ColumnsOfList.csv"
$web = Get-SPWeb $url
$list = $web.Lists.TryGetList($listName)
$list.ContentTypes | % { $_.FieldLinks } | select Name | Export-Csv -path $path