Saturday, February 16, 2013

Get choice values of choice column through PowerShell


If you have a choice site column or even a field in list , library and want to get the choices values that is present in that field , here is how you can get that.

To demonstrate, I have one site column with name US States which holds US state names. 


Let's write PowerShell to get this site column reference and then take out all the choice values in it.

If you would like to know what this PowerShell initial few lines are all about,  I would recommend reading Get Values From Configuration post and then continue.

Now run the script

and here is the result. you get each choice value in the choice column.



I hope this helps.

No comments:




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com