admin管理员组

文章数量:1296471

I have a script that reads an Excel document, and using the info from the excel document it adds a file to the sharepoint document library and fills the column information in the document library with the excel information in the row. Only problem is this script seems very fickle. it was working all morning but recently decided to randomly throw out "Error: The file XXXX has been modified by XXXXX on XXXXX." I initially use Get-PnPFile to check if the file already exists, and if it does I'' use Set-PnPListItem to update it. It seems fairly inconsistent as to when this error occurs. Can anyone help? thanks

I am running this script in a virtual machine btw

I have a script that reads an Excel document, and using the info from the excel document it adds a file to the sharepoint document library and fills the column information in the document library with the excel information in the row. Only problem is this script seems very fickle. it was working all morning but recently decided to randomly throw out "Error: The file XXXX has been modified by XXXXX on XXXXX." I initially use Get-PnPFile to check if the file already exists, and if it does I'' use Set-PnPListItem to update it. It seems fairly inconsistent as to when this error occurs. Can anyone help? thanks

I am running this script in a virtual machine btw

Share Improve this question edited Feb 14 at 20:47 Dharman 33.4k27 gold badges101 silver badges147 bronze badges asked Feb 11 at 20:24 DanielJDanielJ 1091 gold badge4 silver badges14 bronze badges 2
  • 1 This doesn't look like a powershell programming issue, at least there isn't enough information (minimal reproducible example) to answer from a code point of view. The Error: The file XXXX has been modified by XXXXX on XXXXX. isn't afaik a PowerShell error. Where do the XXXX stand for? (sample file name, is this the account that the script runs under? is it modified during the scripts execution?) what line of code failed? Please read: how to ask. – iRon Commented Feb 12 at 8:16
  • Can you provide some information about the SharePoint library settings? For example, whether check in/out is enabled? – Amy Jiang_MSFT Commented Feb 17 at 9:55
Add a comment  | 

1 Answer 1

Reset to default 0
  • If you are using Microsoft OneDrive or Google Drive or some other tool for real-time synchronization of files, pause the synchronization while doing this work.
  • If Microsoft Office updates are occurring while doing this work, wait for the updates to finish.
  • If you have granted someone access to the files you are working on, remove the access while doing this work.
  • (Optional) If you have shared the folders you are working on, remove the sharing while doing this work.

本文标签: