Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get documentset fields in powershell

Posted on 2013-05-19
4
Medium Priority
?
789 Views
Last Modified: 2013-05-20
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.
0
Comment
Question by:Gary_Brown_Applied
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Expert Comment

by:milindsaraswala
ID: 39180313
Use U2U Camel Query Builder to find out the exact name of the fields which you are using
0
 
LVL 29

Expert Comment

by:QPR
ID: 39180403
try ows_RMCode and ows_RMSDescription
Failing that, try sharepoint manager or other to get the true internal names
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 2000 total points
ID: 39180560
Hi,
you can use this Powershell script to get both the title and the internal name of the fields - just adjust the site url and the list name:
$siteUrl = "http://dev.rainerj.local/sites/ee/"
$listName = "EEReorderFields"
$site= New-Object Microsoft.SharePoint.SPSite ($siteUrl) 
$web=$site.OpenWeb() 
$list=$web.Lists[$listName] 
$list.Fields |select ID, title, internalname | Sort-Object title

Open in new window


@QPR: the "ows_" are the names which are returned when you use the lists web service.

HTH
Rainer
0
 

Author Closing Comment

by:Gary_Brown_Applied
ID: 39182932
Thanks Rainer, showed me exactly what I needed to know.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question