如何使用 PowerShell 从 SharePoint 下载最新文件 [英] How to download newest file from SharePoint using PowerShell

查看:41
本文介绍了如何使用 PowerShell 从 SharePoint 下载最新文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇,我可以从 SharePoint 文档库下载文件吗?

I'm just curious, do I have any possibility to download the file from SharePoint document library?

问题是我在这个库中有 3-4 个文件,我需要获取具有最新修改日期的文件.

The problem is that I have like 3-4 files in this library and I need to get the file with the latest modification date.

提前致谢.

推荐答案

请参阅下面的链接,但不要使用目录的实际 SharePoint URL,而是使用 SharePoint 站点的文件资源管理器地址.

Refer to the link below, but instead of using the actual SharePoint URL for the directory use the File Explorer address for the SharePoint site.

Powershell 脚本:

Powershell Script:

$dir = "\\sharepoint.domain.com\site\Foo\SubFoo\SharedDocuments\Folder\"
$latest = Get-ChildItem -Path $dir | Sort-Object LastAccessTime -Descending | Select-Object -First 1
$latest.name

要获取资源管理器位置,请右键单击 SharePoint 中的文件链接(Firefox复制链接位置",IE属性").

To get the explorer location, right click on a file link in SharePoint, (Firefox 'Copy link location', IE 'Properties').

复制网址:http://sharepoint.domain.com/站点/Foo/SubFoo/SharedDocuments/Folder/

改成这个格式:\\sharepoint.domain.com\site\Foo\SubFoo\SharedDocuments\Folder\

验证链接是否有效:单击开始"-->运行"--> 粘贴更改后的链接并运行它.它应该打开 SharePoint 文件夹.

Verify the link works: Click 'Start' --> 'Run' --> paste the changed link and run it. It should open the SharePoint folder.

PowerShell 代码来自此站点.
也给他们一张支票:如何使用PowerShell脚本在目录中查找最新文件?

The PowerShell code came from this site.
Give them a check too: How to find newest file in directory using PowerShell script?

这篇关于如何使用 PowerShell 从 SharePoint 下载最新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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