Link to home
Start Free TrialLog in
Avatar of Gary_Brown_Applied
Gary_Brown_Applied

asked on

Get documentset fields in powershell

I am using the following powershell to add an entry to my document set.

$web = Get-SPWeb http://mysp/products  
$list = $web.Lists["RMSpecs"]    
$cType = $list.ContentTypes["RM Spec"]    
[Hashtable]$docsetProperties = @{"RMCode"="MyRM";"RMDescription"="myStuff"}
$newDocumentSet = [Microsoft.Office.DocumentManagement.DocumentSets.DocumentSet]::Create($list.RootFolder,"My Title",$cType.Id,$docsetProperties) 

Open in new window


I end up with a new documentset in my libruary called "My Title" as expected, but the other fields I was trying to populate (RMCode and RMDescription) are blank.

How do I find out the names for these fields?     or
What am I doing wrong?

Thanks.
Avatar of milindsaraswala
milindsaraswala

Use U2U Camel Query Builder to find out the exact name of the fields which you are using
try ows_RMCode and ows_RMSDescription
Failing that, try sharepoint manager or other to get the true internal names
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary_Brown_Applied

ASKER

Thanks Rainer, showed me exactly what I needed to know.