惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
S
SegmentFault 最新的问题
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
C
Check Point Blog
M
MIT News - Artificial intelligence
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
U
Unit 42
D
Docker
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
H
Help Net Security
D
DataBreaches.Net
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
Cloudbric
Cloudbric
Blog — PlanetScale
Blog — PlanetScale
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
N
News | PayPal Newsroom
V2EX - 技术
V2EX - 技术
H
Heimdal Security Blog
S
Security @ Cisco Blogs
V
Visual Studio Blog
The Last Watchdog
The Last Watchdog
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Cyber Attacks, Cyber Crime and Cyber Security
Last Week in AI
Last Week in AI
爱范儿
爱范儿
博客园 - 聂微东
S
Securelist
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
CXSECURITY Database RSS Feed - CXSecurity.com
V
Vulnerabilities – Threatpost
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
O
OpenAI News
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - sumh

用Openxml获取本地文件的扩展信息 用PowerShell批量删除未部署的wsp包 用PowerShell批量收回wsp包 WSS3.0升级到Foundation 2010 PowerShell 操作bcs PowerShell搜索元数据 开发,部署,监视SharePoint 2010的沙盒解决方案 修改MOSS的RTF字段的上传图片功能 高权限的工作流 可重用声明性工作流 站点工作流 工作流事件 可插接式的工作流服务 sharepoint 2010 beta Workflow WF4的新功能 介绍WF4 用Aspx页面做流程表单的一些感想 创建网站集的内容类型 创建Infopath表单数据源的详细步骤图解
用PowerShell批量部署wsp包
sumh · 2011-07-26 · via 博客园 - sumh
 

提供wsp部署的参数:

$wsppath:wsp文件所在的路径,如“c:\”

$wspnames:路径下的所有wsp文件名用逗号隔开,如“sumhtestwsp.wsp,sumhtestwsp123.wsp,sumhtestwsp456.wsp,sumhtestwsp789.wsp”

$allwebapp:是否要全局部署,如“$True”,true是要全局部署$webId:$allwebapp为“$False”,那么就需要输入指定应用程序的Guid

方法:

function deployWSP([string] $wsppath,[string] $wspnames,[bool] $allwebapp,[Guid] $webId)

{

 $PSSnapinSharePoin = Get-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction silentlycontinue

 if( $PSSnapinSharePoin -eq $Null)

 {

  Add-PSSnapin Microsoft.SharePoint.PowerShell;

 }

 foreach($wspname in $wspnames.split(','))

 {

  $gspsolution = Get-SPSolution -Identity $wspname -ErrorAction silentlycontinue

  if($gspsolution -eq $null)

  {

   Add-SPSolution -LiteralPath $wsppath.Insert($wsppath.Length,$wspname)

  }

  if($allwebapp)

  {

   if(!$gspsolution.Deployed)

   {

    Install-SPSolution -Identity $wspname -GACDeployment -AllWebApplications

   }

  }

  else

  {

   if(!$gspsolution.Deployed)

   {

    Install-SPSolution -Identity $wspname -GACDeployment -WebApplication $webId

   }

  }

 }

}    

例如

deployWSP -wsppath "c:\" -wspnames "sumhtestwsp.wsp,sumhtestwsp123.wsp,sumhtestwsp456.wsp" -allwebapp $true