7 thoughts on “Office 365 Advent Calendar – 06 Bulk-Uploading Files with Metadata to SharePoint Online”

  1. Excellent! Very nice and concise. It was what I was looking for. Two challenges… SharePoint doesn’t seem to like when there is no value even if the SP field is not mandatory. The bigger challenge I’m running into is setting the Enterprise Keywords column. I know this post is old but if you happen to see it and can write a response in less time it takes to drink a cup of coffee that would be great. If not, thanks much for posting this originally!!

    1. Hi Rob,
      found a solution for the Enterprise Keywords. You need to update the foreach($metadatacolumn…) loop as follows:

      foreach($metadatacolumn in $metadatacolumns) {
      if($metadatacolumn -eq “TaxKeyword”) {
      $values.Add($metadatacolumn, @($file.$metadatacolumn,$file.$metadatacolumn))
      } else {
      $values.Add($metadatacolumn, $file.$metadatacolumn)

      For the Enterprise Keywords (Field: TaxKeyword) the term (in the format “System|Keywords|MyTerm”) needs to be provided twice. Found this in the following article: https://www.thelazyadministrator.com/2018/08/20/manage-and-administer-sharepoint-using-sharepointpnp-powershell/
      Note that I’m only able to use a single term in my code above. There are way how it could work with multiple terms, but decided to provide this simple solution first.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.