如何在Powershell的PSI调用中返回一些企业自定义字段? (包括示例代码) [英] How can I return some enterprise custom fields in a PSI call from Powershell? (Sample code included)
问题描述
我在这里看过Brian的文章,但其中很多都是关于创建项目的。
http://blogs.msdn.com/b/brismith/archive/2007/12/06/setting-custom-field-values-using-the-psi.aspx 。 我只想阅读一些企业自定义字段。
I've looked at Brian's article here, but so much of this is about creating projects. http://blogs.msdn.com/b/brismith/archive/2007/12/06/setting-custom-field-values-using-the-psi.aspx. I just want to read some enterprise custom fields.
例如,如果你在Project Server 2010实例中指出这个两行的Powershell脚本,你会得到一个很酷的大师级弹出窗口项目(PROJ_TYPE eq 6):
For example, if you point this two-line Powershell script at your Project Server 2010 instance, you'll get a cool pop up of master projects (PROJ_TYPE eq 6):
$ ps = new-webserviceproxy -uri
http:// servername / projectserverinstance / _vti_bin / PSI / Project。 asmx?wsdl
$ ps.ReadProjectList()。项目| where-object {$ _.PROJ_TYPE -eq 6} | ogv -title" Projects List"
$ps = new-webserviceproxy -uri
http://servername/projectserverinstance/_vti_bin/PSI/Project.asmx?wsdl
$ps.ReadProjectList().Project | where-object { $_.PROJ_TYPE -eq 6 } | ogv -title "Projects List"
ReadProjectList()只返回ProjUID,名称和类型。
ReadProjectList() just brings back the ProjUID, the Name, and the type.
我怎样才能简单而干净地带回一些企业自定义字段? 只是想阅读它们,而不是设置它们。
How can I simply and cleanly bring back some enterprise custom fields as well? Just want to read them, not set them.
我可以看到我必须在一些CustomFieldDataRows中潜入但是如何? 我不清楚在哪里可以找到它们。 项目类中有一个名为GetChildRows()的方法...是我找到CustomFieldDataRows的地方吗?
I can see I have to dive down in some CustomFieldDataRows but how? I'm unclear on where to get at them. There's a method on the Project class called GetChildRows()... is that where I find the CustomFieldDataRows?
推荐答案
仍然不完全是你在寻找格伦,但来自克里斯博伊德的文章在
http://blogs.msdn.com/b/project_programmability/archive/2007/ 12/10 / publishing-projects-based-a-project-custom-field-value.aspx 可能比我的博客更接近,帮助您了解自定义字段的位置。
Still not exactly what you are looking for Glenn, but the article from Chris Boyd at http://blogs.msdn.com/b/project_programmability/archive/2007/12/10/publishing-projects-based-off-a-project-custom-field-value.aspx is probably closer than my blog in helping you understand where you can get at the custom fields.
如果我下周有时间,我肯定会看看你使用PowerShell的做法,看看我是否能够以这种方式获得CF.
If I get time next week I'll certainly take a look at your approach with PowerShell to see if I can get at CFs that way too.
最好的问候,
Brian。
这篇关于如何在Powershell的PSI调用中返回一些企业自定义字段? (包括示例代码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!