Deploy WSP with SharePoint 2010 PowerShell .

The stsadm command was replaced by PowerShell cmdlets in 2010. To deploy on a Produciton, QA or DEV server you may probably need PowerShell scripts (with .ps1 suffix). However if you prefer GUI, you'll thank to Visual Studio 2010 as development and deployment is as simple as a few clicks.

You can use PowerShell to deploy on non-local servers and/or carry admin tasks. If the following message shows on the first line

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.

then you may grant yourself access to the farm. Run as Aministrator and run



Then



It will show shell admin accounts. You mast be in that group. PowerShell authorization is very different to Central Admin, where you perform all tasks using Application Pool's account. If you cannot add yourself to SPShellAdmin group, try to add machinename/user instead and always run as administrator from the SharePoint 2010 group in Start Menu.

Make sure no warning message comes when you run SharePoint PowerShell then you can create an XML file and a script file to deploy wsp solution files.

config.xml:



PowerShell script:


When the two files are prepared, at PowerShell prompt type
 

will invoke the script. All you need to modify is the config.xml file.

Script is modified from:
http://stsadm.blogspot.com/2010/06/deploying-sharepoint-2010-solution.html

posted on 2011-07-15 13:43  dz45693  阅读(7543)  评论(0编辑  收藏  举报

导航