[英]Powershell PnP Sharepoint
上傳文件時如何上傳文件並更新元數據? 我想上傳一個文件(在 SharePoint 上,我有一個類似 deleteFromLocal 標志 = no 的列,所以當我上傳文件時,一旦文件上傳,它應該更改為是)。 有什么辦法嗎?
到目前為止的代碼:
Import-Module SharePointPnPPowerShellOnline
#Get Connection to the url , #Connect-PnPOnline $URL
Connect-PnPOnline "Some SharePoint Url" -UseWebLogin
$Files = Get-ChildItem "Local Folder Path which contains the files"
foreach($File in $Files){
$upload = Add-PnPFile -Folder "some folder inside Shared Documents in sharepoint" -Path $File.FullName
if($upload.UniqueId){
$successCounter += 1
$message = "Successfully Uploaded"
} else {
$failCount +=1
$message = "ERROR - Unable to Upload"
}
}
編輯:文件上傳成功,但如果可能,我想通過此腳本本身修改列/添加列,而不是手動添加(列 - 元數據像一個標志,它會告訴我是/否 - 文件是否成功上傳與否,以便將來在需要時我可以獲得該標志並執行必要的操作)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.