Geeks With Blogs

About Me:
I am a Female SharePoint Developer (a platinum unicorn). I have been working with SharePoint since I attended the Portal University in 2005. I hold a BA in Computer Science from the University of Missouri - Kansas City. I love playing Rockband, organizing user group meetings, working with code, attending events as a speaker or organizer, and having bizarre conversations about geek things with cool people. If you have any comments or questions fill out the contact form and I will try my best to help.

The Guide of a MOSSLover Becky Isserman's Blog

I was playing around with some scripts today while I was working on an upgrade.  I didn’t want to individually write out the names of files in a batch file and I wanted to create a quick Powershell Script.  If you are using SharePoint 2010 you can use these lines of code in the Powershell Manager to deploy only .wsp files to your SharePoint 2010 Web Applications:

$dir = [directory]

$list = Get-ChildItem $dir | where {$_.extension -eq ".wsp"}

foreach($my_file in Get-ChildItem $list){Add-SPSolution -LiteralPath $my_file.FullName}

foreach($my_file in Get-ChildItem $list){Install-SPSolution -Identity $my_file.Name -AllWebApplications -GACDeployment}


Basically, you throw in the directory into a variable, then you throw the files into a variable in Powershell filtered by .wsp.  Then you loop through the files and add the solutions to the store, then loop through the files and deploy them to the web applications.  You can change the scripts accordingly.  I figured this would be something you all could use so enjoy!

Posted on Wednesday, August 18, 2010 1:31 PM MOSS | Back to top

Comments on this post: Deploying Multiple WSP Files Using Powershell

# re: Deploying Multiple WSP Files Using Powershell
Requesting Gravatar...
I want to deploy one wsp to multiple web application one bye one. Is this possiable by PowerShell?
Left by Dilip Nikam on Nov 02, 2010 10:56 AM

Your comment:
 (will show your gravatar)

Copyright © MOSSLover | Powered by: