Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.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 SharePoint PnP。。设置ModerationStatus的值_Powershell_Sharepoint_Csom - Fatal编程技术网

Powershell SharePoint PnP。。设置ModerationStatus的值

Powershell SharePoint PnP。。设置ModerationStatus的值,powershell,sharepoint,csom,Powershell,Sharepoint,Csom,我尝试在已启用内容审批的SharePoint列表中设置“\u ModerationStatus”。我使用SharePoint PnP(客户端)完成此操作 我试过: Set-PnPListItem -List $item.parentlist -Identity $item -Values @{"_ModerationStatus" = 0} 但什么也没发生。我可以更改项目的每个字段。我尝试了几种0或“0”或“Approved”或“Genehmigt”格式。。但没有任何效果 有人能帮我吗?您可以

我尝试在已启用内容审批的SharePoint列表中设置“\u ModerationStatus”。我使用SharePoint PnP(客户端)完成此操作

我试过:

Set-PnPListItem -List $item.parentlist -Identity $item -Values @{"_ModerationStatus" = 0}
但什么也没发生。我可以更改项目的每个字段。我尝试了几种0或“0”或“Approved”或“Genehmigt”格式。。但没有任何效果


有人能帮我吗?

您可以通过直接访问列表项属性来设置列表项
\u ModerationStatus

$item["_ModerationStatus"] = 0
$item.Update()
Execute-PnPQuery
我已经在启用内容批准的列表上对此进行了测试。希望它对你也有用