Powershell更新特定页面上ListView WebPart的工具栏类型. [英] Powershell to update toolbar type for listview webpart on particular page.

查看:73
本文介绍了Powershell更新特定页面上ListView WebPart的工具栏类型.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

目前,我们要处理的任务是具有listview Webpart且所有WebPart的工具栏类型都设置为none的页面,我们需要将其更新为Full工具栏类型.所以我厌倦了为Powershell工作以更新工具栏类型 特定页面上的listview webpart,但是我无法使用powershell更新listviewxml.

Currently we have at task where there are number of  pages where we have listview webpart and all the webpart has toolbar type set to none which we need to update it to Full toolbar type. So I tired working for Powershell to update toolbar type for listview webpart on particular page but I am not able to update the listviewxml using powershell.

感谢您的帮助.

$ web = Get-SPWeb"http://teams..com/Test" #url
        $ webpartmanager = $ web.GetLimitedWebPartManager("default.aspx",[System.Web.UI.WebControls.WebParts.PersonalizationScope] :: Shared)#获取Webpart管理器类

        for($ i = 0; $ i -lt $ webpartmanager.WebParts.Count; $ i ++)  
            {
                if($ webpartmanager.WebParts [$ i] .title -eq"Documents")  #列表标题
                    {  
                        $ wp = $ webpartmanager.WebParts [$ i]

$web= Get-SPWeb "http://teams..com/Test"  #url
       $webpartmanager = $web.GetLimitedWebPartManager("default.aspx", [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) #Get the webpart manager class

        for($i=0;$i -lt $webpartmanager.WebParts.Count;$i++)  
            {
                if($webpartmanager.WebParts[$i].title -eq "Documents")   #list title
                    {  
                        $wp = $webpartmanager.WebParts[$i]

                        $ wp.listviewxml ###在此特定xml中具有工具栏类型属性,您可以让我知道如何更新xml并将工具栏类型属性设置为完整工具栏.

                        $wp.listviewxml ### We have toolbar type property in this particular xml can you let me know how we can update the xml and set the toolbar type property to full toolbar.

                    }

                    }

           }

           }

推荐答案

阿莫尔-至少很难说.检查以下线程以寻求帮助:

Hi Amol- that's difficult to say the least. Check the following thread for some help:


这篇关于Powershell更新特定页面上ListView WebPart的工具栏类型.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆