使用Powershell获取所有文件 [英] Get all files using powershell

查看:109
本文介绍了使用Powershell获取所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Powershell获取SharePoint网站中所有文件的列表?

How to get the list of all files in SharePoint site using powershell ?

我尝试了以下代码,该代码从网站页面获取数据,但是有文件,这些文件不属于网站页面,如果在SharePoint Designer中打开,则会显示文件.

I have tried the below code, which gets data from site pages, but there are files, which are not part of site pages and if opened in SharePoint designer shows the files.

$sitepages = [Microsoft.Sharepoint.Utilities.SpUtility]::GetLocalizedString('$Resources:WikiLibDefaultTitle',"core",$web.UICulture.LCID) 

                $pages = $null 
                $pages = $web.Lists[$sitepages] 


谢谢


Thanks

推荐答案

[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
[System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
[System.Reflection.Assembly]::Load("Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
[System.Reflection.Assembly]::Load("System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

function Get-DocInventory([string]


siteUrl){


site =新对象Microsoft.SharePoint.SPSite
site = New-Object Microsoft.SharePoint.SPSite


这篇关于使用Powershell获取所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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