$webURL = "http://xxx/sites/wingtipcalculator"
$spSite = New-Object Microsoft.SharePoint.SPSite($webURL)
$spWeb = $spSite.OpenWeb()
$listTemplate = $spWeb.ListTemplates["Custom List"];
$spweb.Lists.Add("List4","Data information DTU",$listTemplate)
write-host "List added in the Web : " $spweb -foregroundcolor Yellow
$spList = $spWeb.Lists["List4"]
$spList.Fields.Add("Publication Date","DateTime",1)
$spList.Fields.Add("Headline","Text",1)
$spList.Fields.Add("LeadParagraph","Text",1)
$spList.Fields.Add("FullText","Text",1)
$spList.Fields.Add("ContactName","Text",1)
$spList.Fields.Add("ModifiedTest","DateTime",1)
$taxonomySite = Get-SPSite http://XXX:2010
$taxonomySession = Get-SPTaxonomySession -site $taxonomySite
$termStore = $taxonomySession.TermStores["Managed Metadata Service"]
write-host "Connection made with term store -"$termStore.Name
$taxonomySession = $spWeb.site;
$termStoreGroup = $termStore.Groups["XX"];
$termSet = $termStoreGroup.TermSets["General Business Taxonomy (v1.0)"];
$TaxonomyField = $spList.Fields.Add("TaxonomyFieldType", "Test1");
$taxonomyField.SspId = $termStore.Id;
$taxonomyField.TermSetId = $termSet.Id;
$spWeb.Dispose()
trying to use the above script but unable to cretae the required metadata column in list