Help with Powershell with assign metadata value in column

Hello,
I’ve created a PowerShell script to create some columns with managed metadata in a Sharepoint Site, this script doesn’t have any problem and the execution is correct but when I go to the Sharepoint Site / Library Settings / Columns, I can’t see default value in the columns, can you help me?
Script:

Many thanks.

David,
Welcome to the forum. :wave:t4:

Before we proceed - to post an image of your code is a very bad idea. That makes it impossible for us to copy your code and maybe try it.

Please go back, edit your existing post and fix this.

When you post code or sample data or console output please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance

1 Like

Hello Olaf
Many thanks for your suggestion, I’ve copy my code and I hope you can help me:
```
#Add a Managed Metadata column from “Country” term set in “EDUCO|Country” Group
Add-PnPTaxonomyField -DisplayName “DocType” -InternalName “DocType” -TermSetPath “EDUCO|Document Type” -List $ListName -Required -AddToDefaultView
Add-PnPTaxonomyField -DisplayName “Language” -InternalName “Language” -TermSetPath “EDUCO|Language” -List $ListName -Required -AddToDefaultView
Add-PnPTaxonomyField -DisplayName “Year” -InternalName “Year” -TermSetPath “EDUCO|Year” -List $ListName -Required -AddToDefaultView
Add-PnPTaxonomyField -DisplayName “Functional Area” -InternalName “Functional Area” -TermSetPath “EDUCO|Functional unit” -List $ListName -Required -AddToDefaultView
Add-PnPTaxonomyField -DisplayName “Process” -InternalName “Process” -TermSetPath “EDUCO|Process and other” -List $ListName -Required -AddToDefaultView
Add-PnPTaxonomyField -DisplayName “Project” -InternalName “Project” -TermSetPath “EDUCO|Projects” -List $ListName -Required -AddToDefaultView
Add-PnPTaxonomyField -DisplayName “Country” -InternalName “Country” -TermSetPath “EDUCO|Country” -List $ListName -Required -AddToDefaultView
Add-PnPTaxonomyField -DisplayName “DocVisibility” -InternalName “DocVisibility” -TermSetPath “EDUCO|Doc Visibility” -List $ListName -Required -AddToDefaultView

#Default value to column
#Set-PnPDefaultColumnValues -List $ListName -Field "Functional Area" -Value "EDUCO|Functional unit|General Management"
Set-PnPDefaultColumnValues -List $ListName -Field "Functional Area" -Value $URL.Functional
Set-PnPDefaultColumnValues -List $ListName -Field "Country" -Value $URL.Country
Set-PnPDefaultColumnValues -List $ListName -Field "Process" -Value $URL.Process
Set-PnPDefaultColumnValues -List $ListName -Field "Project" -Value $URL.Project
Set-PnPDefaultColumnValues -List $ListName -Field "DocVisibility" -Value "EDUCO|Doc Visibility|Public"