Powershell to move Columns from List to the other List in SharePoint

$web = Get-SPWeb “http://fromsite”
$Toweb = Get-SPWeb “http://tostie”

$FromList = $Web.Lists[“FromList”]
$ToList = $ToWeb.Lists[“ToList”]

foreach ($spField in $FromList.Fields)
{
if( $Tolist.Fields.ContainsField($spField) -ne $true)
{
Write-Host $spField
$ToList.Fields.Add($spField)
$ToList.Update()
}
}

$web.dispose()
$To.dispose()

About gkondameda
Gopi Kondameda is a Cloud Architect, SharePoint Saturday Speaker, developer and trainer with more than 18 years of experience in implementing solutions for clients ranging from small businesses to Fortune 500 companies, as well as governmental organizations. He has been involved in leading teams that implemented a wide range of Development projects, SharePoint Implementations and Migrations. He is passionate about leading teams, architecting solutions, designing information architectures as well as architecting various custom solutions, and integrating with line of business applications.

Leave a comment