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

發佈了156 篇原創文章 · 獲贊 8 · 訪問量 41萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章