Monday, January 30, 2012

BDCM: How to import through PowerShell

[What you have]:
You have a bunch of BDCM files.

[What you want]:
You want to import BDCM files via PowerShell Script.

[What you want to know]: 

[What you want to do]:
Run following in your PowerShell window:

sl {your path to BDCM files}

$MetadataStore = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType "Catalog" -ServiceContext {your url to CA}

$bdcmFiles = @(Get-ChildItem);
foreach ($bdcmFile in $bdcmFiles)

Import-SPBusinessDataCatalogModel -Path $bdcmFile.Name -Identity $MetadataStore -Force


[What you want to consider]:

BDCM: How to set permissions through the code?