Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 获取pnplistitem使用标题而不是内部名称_Powershell_Sharepoint - Fatal编程技术网

Powershell 获取pnplistitem使用标题而不是内部名称

Powershell 获取pnplistitem使用标题而不是内部名称,powershell,sharepoint,Powershell,Sharepoint,我是新来的,所以请原谅我的无知 我在Sharepoint中有一个列表,我们想把它拉下来做一些事情。我使用CAML查询仅获取列表中的新请求。我的基本代码是: $url = "https://site.sharepoint.com/sites/dept" $listQuery = "<View><Query><Where><Eq><FieldRef Name='Status'/><Value Type='

我是新来的,所以请原谅我的无知

我在Sharepoint中有一个列表,我们想把它拉下来做一些事情。我使用CAML查询仅获取列表中的新请求。我的基本代码是:

$url = "https://site.sharepoint.com/sites/dept"
$listQuery = "<View><Query><Where><Eq><FieldRef Name='Status'/><Value Type='Text'>New</Value></Eq></Where></Query></View>"

Connect-PnPOnline -URL $url -Credentials pnpconnectuser

$requests = Get-PnPListItem -List "List Name" -Query $listQuery
$url=”https://site.sharepoint.com/sites/dept"
$listQuery=“新建”
连接PnPOnline-URL$URL-Credentials pnpconnectuser
$requests=Get PnPListItem-List“List Name”-Query$listQuery
这似乎奏效了。我可以看到$requests包含测试列表中的两项。但我的字段有一些非常奇怪的内部名称:


当我需要使用这些数据做一些事情时,如何通过它们的人类可读列名引用这些值?例如,“名字”而不是“头衔”。或者用“Department”代替“etaj”。

这是出于设计,在获取特定字段名称时,应该使用字段内部名称而不是显示名称


例如,当“test space”字段中有空格时,内部名称将转换为“test_x0020_space”。

谢谢。我最终重新创建了整个列表,这样内部名称就可以阅读了。我认为原始列表是从一个表单自动创建的,因此有了奇怪的名称。现在有了有意义的名字就容易多了。