none
How to set multiple value for a lookup field with powershell script? RRS feed

  • Question

  • I have a list that has a lookup column and can have multiple values.  I know how to set value to this field with powershell script. I need to know how to set multiple values to this field. 

    Also, how can I create this field with powershell script?

    Thanks and regards,

     

    Tuesday, November 9, 2010 12:18 AM

Answers

  • Hey ak2010,

    Can you post your script for choosing one item - then maybe we could just modify what you already have.

    Below is the script for creating a multiple choice field:

    PS > Add-SPMultiChoiceField -url http://moss -List "My List" -Name "Favorite Music" -Description "Favorite Music" -Choices $("Country","Metal","Rock","Soul","Jazz")
    PS > Add-SPFieldToView -url http://moss -List "My List" -Field "Favorite Music" -View "All Items"

    Also - below is a great post on some very useful SP PowerShell Scripts:

    http://www.powershell.nu/2009/09/08/moss-2007-script-collection/

    I hope that helps!

    Tom


    Tom Molskow - SharePoint Architect - Advice on All Things SharePoint Great and Small
    • Marked as answer by KeFang Chen Tuesday, November 16, 2010 6:45 AM
    Monday, November 15, 2010 9:11 PM