SharePoint PnP ..为ModerationStatus设置值

时间:2017-07-04 20:25:34

标签: powershell sharepoint csom

我尝试在启用了内容审批的SharePoint列表中设置“_ModerationStatus”。我使用SharePoint PnP(ClientSide)。

我试过了:

Set-PnPListItem -List $item.parentlist -Identity $item -Values @{"_ModerationStatus" = 0}

但没有任何反应。我可以改变物品的每个区域。我尝试了几种格式的0或“0”或“已批准”或“Genehmigt”..但没有任何影响。

任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

您可以通过直接访问列表项属性来设置列表项$item["_ModerationStatus"] = 0 $item.Update() Execute-PnPQuery

apiVersion: v1
clusters:
- cluster:
    certificate-authority: /etc/kubernetes/ssl/ca.pem
    server: https://172.16.1.9:8443
  name: default-cluster
- cluster:
    certificate-authority: /etc/kubernetes/ssl/ca.pem
    server: https://172.16.1.9:8443
  name: remote-server
contexts:
- context:
    cluster: remote-server
    user: myself
  name: bcmt
- context:
    cluster: default-cluster
    user: default-admin
  name: default-system
current-context: default-system
kind: Config
preferences: {}
users:
- name: default-admin
  user:
    client-certificate: /etc/kubernetes/ssl/kubelet.pem
    client-key: /etc/kubernetes/ssl/kubelet-key.pem
- name: myself
  user:
    password: secret
    username: admin

我已在启用了内容审批的列表中对此进行了测试。希望它也适合你