The purpose of STSADM’s “copyappbincontent” command is:
stsadm –o copyappbincontent
Copies Web application–specific files, such as page resource (*.resx) files from their respective locations in the 12\CONFIG folder to the correct location in each Web application on the computer.
According to TechNet, there is no equivalent PowerShell cmd-let http://technet.microsoft.com/en-us/library/ff621081.aspxt:
However, there is a PowerShell cmd-let called Install-SPApplicationContent:
Install-SPApplicationContentCopies shared application data to existing Web application folders.
Now that sounds pretty similar.
I’ve tried this out – making a custom layouts.sitemap.xml file, and invoking Install-SPApplicationContent. It copies/merges the sitemap into the correct place under inetpub\wwwroot\wss\VirtualDirectories\*\_app_bin.
So, how dissimilar are they? I’ve heard it said that the PowerShell version won’t apply your changes to the whole farm, only the current server. But surely, that’s what stsadm does too?
Let’s use the rather fantastic open-source ILSpy replacement for Reflector to reflect over the code,
STSADM’s copyappbincontent decompiled
// Microsoft.SharePoint.StsAdmin.SPCopyAppBinContent public override void Run(StringDictionary keyValues) { SPServiceInstance sPServiceInstance = SPWebServiceInstance.LocalContent; if (sPServiceInstance != null && sPServiceInstance.Status == SPObjectStatus.Online) { SPWebService contentService = SPWebService.ContentService; contentService.ApplyApplicationContentToLocalServer(); } sPServiceInstance = SPWebServiceInstance.LocalAdministration; if (sPServiceInstance != null && sPServiceInstance.Status == SPObjectStatus.Online) { SPWebService administrationService = SPWebService.AdministrationService; administrationService.ApplyApplicationContentToLocalServer(); } }
Microsoft.SharePoint.PowerShell’s Install-SPApplicationContent decompiled
if (sPWebServiceInstance.Status == SPObjectStatus.Online) { SPWebService administrationService = SPWebService.AdministrationService; ServiceHelper.TryToControlService("W3SVC", false, out flag, out flag2); administrationService.ApplyApplicationContentToLocalServer(); } if (null != SPWebServiceInstance.LocalContent) { if (SPWebServiceInstance.LocalContent.Status == SPObjectStatus.Online) { ServiceHelper.TryToControlService("W3SVC", false, out flag3, out flag4); SPWebService contentService = SPWebService.ContentService; contentService.ApplyApplicationContentToLocalServer(); } }
Conclusion
So, there you have it. Like two completely dissimilar things… in a pod.
To be clear: you need to invoke either of these methods on each server in your farm to deploy content from the 14 hive to the IIS virtual directories.
Or have I missed something?