本文介绍了使用CSOM更新脚本编辑器webpart的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想知道如何使用CSOM更新脚本编辑器webpart的内容。我在powershell中使用CSOM,我可以使用  $ webPartDefinition.WebPart.Properties.FieldValues.Content获取webpart的内容,但内容
更新没有运气。

I wanted to know how can i update the content of script editor webpart using CSOM. I am using CSOM in powershell and I am able to get the content of the webpart using $webPartDefinition.WebPart.Properties.FieldValues.Content but no luck with the content updation.




K Mohit

推荐答案

以下是供您参考的示例脚本(发布页面的更新脚本编辑器webpart)。

#Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

function Change-WebPart {
    #variables that needs to be set before starting the script
    #




这篇关于使用CSOM更新脚本编辑器webpart的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 06:34