I think I found an answer but not in powershell. Content Migration object model says:
Content Migration object model:
The object model provides the most control over your data migration scenarios. Using the object model, you can migrate anything, from a Web site to an item in a list, or a single document in a library. You can choose whether to include information about security, versioning, user roles, and other metadata appropriate to the objects you are migrating. The content migration object model is implemented in the Microsoft.SharePoint.Deployment namespace.
So I followed this link. SPExportObject
and SPExport
does the trick of generating *.cmp
files.
SPExportObject eobj = new SPExportObject();
eobj.Id = guid;//guid of target page from Pages library, use UniqueId of SPListItem over pages library to get GUID
eobj.Type = SPDeploymentObjectType.File;
SPExportSettings settings = new SPExportSettings();
settings.SiteUrl = "http://rhwapp370a/sites/msbiportal/";
settings.FileLocation = @"c:\test";
settings.BaseFileName = "export";
settings.FileCompression = true;
settings.OverwriteExistingDataFile = true;
settings.ExportObjects.Add(eobj);
SPExport export = new SPExport(settings);
export.Run();
Above code created export.cmp file in c:\test folder and I have used it for import.
All my custom web parts and connection related to the target page came perfectly.