![](/img/trans.png)
[英]How can I setup default content type for a Document Library in SharePoint Online using PowerShell?
[英]How can I get the “Copy Link” from a document on SharePoint Online document library using Powershell
您需要使用Microsoft Graph API。 网上有示例和文档,但是它们处于Beta中,因此请记住该过程可能会更改。
您可以在Get
点站点上使用Get
并查看驱动器对象,然后可以使用Drive ID
连接到它们并查看文件的webURL
属性。
https://developer.microsoft.com/zh-CN/graph/docs/api-reference/beta/resources/drive
我最终动态地构建了链接。 因此,这是我最终为获取链接所做的事情:
这是一个例子
$ UniqueID =(Get-PnPListItem -id 231-列表预算).FieldValues.UniqueID
$ UniqueID = e1a1f20f-4b7d-4y16-x021-3469bde98088
以下是链接步骤:
最后,只需构建所有步骤即可动态构建链接。 https://mycompany.sharepoint.com/Site/subsite/_layouts/15/WopiFrame.aspx?sourcedoc={e1a1f20f-4b7d-4y16-x021-3469bde98088}&action=edit
最后,您将要更改的唯一ID是花括号之间的唯一ID。
除了Nick所说的以外,我们可以使用Graph API来实现此要求,尤其是“ createLink ”端点。
我们可以使用以下正文(或类似内容)发出POST请求
{
"type": "edit",
"scope": "organization"
}
并且请求URL可以是以下之一
- /v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/driveItem/createLink
- /v1.0/sites/{site-id}/drive/items/{drive-item-id}/createLink
- /v1.0/sites/{site-id}/drives/{drive-id}/items/{drive-item-id}/createLink
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.