Jul 27 2017 08:04 AM
Hi
I am trying to add a file to a library using Add-PnPFile.
One of the columns in the content type of the file is called Business Unit and its a Taxonomy column.
So I used in the Add-PnPFile :- -Values @{Business_x0020_Unit=$businessUnit}
Where $businessUnit is "Navigation|Root|Term1|Term1a|Term1a1"
I get the error message - Add-PnPFile : The given guid does not exist in the term store
Anybody any Ideas ?
Regards
Nigel
Jul 27 2017 10:27 PM
Hi,
You need to use Guid value of terms and you can find the guid value from site setting -->site administration -->term srore management --> terms set-->terms -->Unique Identifier
Example:
add-pnpfile -path C:\test.csv -values @{jobname="33e7276f-f7ae-4629-9a72-9b5a4b573f38"}
Jul 28 2017 02:37 AM
The documentation says you can do this :-
Managed Metadata (single value with path to term): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE"}
I have added this to the PnP PowerShell list of issues.
Regards
Nigel
Jul 28 2017 02:42 AM
It looks as if Set-ListItem has been updated to handle Paths as well as GUIDs but Add-PnPFile has not.
@Wobba @ErwinVanHunen.
Regards
Nigel
Jul 28 2017 03:08 AM
Yes, your correct set-pnplistitem supports both path and guid but douctment only available for set-pnplistitem and not for add-pnpfile. and i guess managed metadata path supported recently.so it will updated soon to add-pnpfile.