通过PowerShell部署SharePoint 2010解决方案

这里是一些你编写 Powershell 脚本时常用的命令。

在SharePoint 2010中移除和添加一个解决方案包。

打开 Windows PowerShell窗口:

1. 在开始菜单中, 点所有程序。

2. 点击Microsoft SharePoint 2010 Products.

3. 点击SharePoint 2010 Management Shell

注意:你必须具有 配置数据库的SharePoint_Shell_Access角色,并且你应该是SharePoint Server 2010所在计算机的WSS_ADMIN_WPG 本地组的成员。

现在, 输入如下命令 ( 注意前两个命令需要的解决方案包必须已存在,你要做的事是回收它以便部署新的解决方案包)

Uninstall-SPSolution -identity {wsp文件的名字} -allwebapplications

remove-spsolution -identity {wsp文件的名字} -force

add-spsolution -literalpath C:\{文件的完整路径\wsp文件的名字}

install-spsolution -identity {wsp文件的名字} -webapplication http://{要部署到的 SharePoint 站点的URL地址} -GACDeployment -force

posted @ 2010-08-25 13:46  Sunmoonfire  阅读(240)  评论(0编辑  收藏  举报