代码之家  ›  专栏  ›  技术社区  ›  john Gu

如何在PnP Power Shell for SharePoint Online中创建表示[Microsoft.SharePoint.SPFieldUserValueCollection]的变量

  •  0
  • john Gu  · 技术社区  · 3 年前

    在本地使用SharePoint时,我们可以定义用户值列表,如下所示:-

    [Microsoft.SharePoint.SPFieldUserValueCollection]$HRCollabs = New-Object Microsoft.SharePoint.SPFieldUserValueCollection 
    

    那么,在PnP Power shell for SharePoint online中定义这样一个变量的等效方法是什么呢?

    谢谢

    0 回复  |  直到 3 年前
        1
  •  0
  •   Nikolay    3 年前

    在PnP中应该没有必要这样做。您可以使用普通的powershell列表来设置多用户选择器字段:

    $HRCollabs= @("[email protected]", "[email protected]")
    
    Set-PnPListItem -List $YourList -Identity $YourItem -Values @{"YourField" = $HRCollabs }
    
    
    推荐文章