[英]SharePoint PnP PowerShell - Get choices from a Choice field
I am attempting to get the choice selected from a choice field but the choice fields are not returned as text. 我试图从选择字段中选择选择,但是选择字段未作为文本返回。
The title field is a choice field: 标题字段是一个选择字段:
Id Title GUID
-- ----- ----
76 76_ 0452370b-7278-43ab-915a-e29aa6a815f7
What I am expecting is one of the following: 我期望的是以下之一:
Here is the relevant code: 以下是相关代码:
foreach ($subsite in $sites) {
# Get the web object of the subsite
$subWeb = Get-PnPWeb -Identity $subsite.Id
$ctx.load($subWeb.Lists)
$projectStatus = Get-PnPList -Identity "Lists/Project Status" -Web $subWeb
Invoke-PnPQuery
if ($projectStatus) {
Write-Host "$($subsite.Title): $($projectStatus.Id)"
$listItems = Get-PnpListItem -List $projectStatus.Id -Web $subWeb
foreach ($item in $listItems) {
$item
}
}
}
我需要在$listItems
部分添加().FieldValues
:
$listItems = (Get-PnpListItem -List $projectStatus.Id -Web $subWeb).FieldValues
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.