Quantcast
Channel: SharePoint 2010 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 13778

Adding an existing site column to an existing list using powershell

$
0
0

I am trying to add an existing site column to a list in Sharepoint.  I know how to create a new column in a list but I am having issues adding an exising column to my list using powershell.  Below is what I have put together and I'm pretty sure the line below with the $list.Fields.Add value is wrong.  Ha!  Any help would be appreciated.

Cheers!

$webURL = "https://xyz.com/abc/"
$web = Get-SPWeb $webURL
$list = $web.Lists["List Center"]
$list.Fields.Add(web.AvailableFields["Text1"])
$list.Update()





Viewing all articles
Browse latest Browse all 13778

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>