Copy column data to another column

In order to strip out columns from lists, you may still need to retain that data. Feel free to use the following sample code.

$spw = Get-SPWeb "https://localhost/"
$oldField = "oldFieldName"
$newField = "newFieldName"

$list = ($spw.lists | where { $_.Title -match "ListName" })
$list.Items | ForEach-Object { 
    $_[$newField] = $_[$oldField]
    $_.Update()
} 

It may take longer than expected for this operation to run!

You may also like