In this article I am going to demonstrates How to Export SharePoint custom list schema to CSV file. This example applies to SharePoint 2010 and SharePoint 2013 environment.
[system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint") $listName="DemoList"; $siteURL="http://localhost/"; $csvPath="C:PowerOutput"+ $listName + ".csv"; $oSite= New-Object Microsoft.SharePoint.SPSite($siteURL) $oWeb=$oSite.OpenWeb() $oList=$oWeb.Lists[$listName] #Get only custom fields which are created by user $oList.Fields | ?{$_.CanBeDeleted -eq $true -and $_.Hidden -eq $false} | select Title,Internalname,Type |Sort-Object title| Export-Csv -Path $csvPath -Encoding ascii -NoTypeInformation $oWeb.Dispose() $oSite.Dispose()